您是否可以在没有服务器端的情况下以codenameone实现自动续订

时间:2019-05-28 13:00:59

标签: java mysql codenameone

我遵循了自动续订应用程序订阅文档。但是,我正在构建的应用程序目前没有服务器端。我无法查看是否有可能完全不需要数据库即可创建应用

我尝试仅调用Purchase.subscribe方法,而没有将其保存到数据库中

public void start() {

    Form hi = new Form("Hello World");
    //create receiptes store 
    Purchase.getInAppPurchase().setReceiptStore(createReceieptsStore());
    //create a button to purchase the world
    Button buyWorld = new Button("Buy World");
    buyWorld.addActionListener(e -> {
        if (Purchase.getInAppPurchase().isSubscribed(SKU)) {
            Dialog.show("Cant Buy It", "You Own It", "OK", null);
        } else {
            Purchase.getInAppPurchase().subscribe(SKU);
        }
    });

    hi.addComponent(buyWorld);
    hi.show();
}

我遇到了与需要执行的收据存储获取和提交方法有关的错误

1 个答案:

答案 0 :(得分:1)

应该可以在没有服务器的情况下实现订阅,但是很容易在任何有根的Android设备上破解它。