InApp Purchase RESTORE_TRANSACTIONS, I am not able to figure the code out

后端 未结 3 1510
孤独总比滥情好
孤独总比滥情好 2021-01-17 15:14

I am adding a in app purchase in my coding, it\'s working well while purchase but gives error and application closes when I try to add Restore_Transaction code when applicat

3条回答
  •  长发绾君心
    2021-01-17 15:57

    Follow this:

        confirmTransaction(new String[] { latestPurchase.notificationId });
    

    here and do this:

    protected static void confirmTransaction(String[] notifyIds) {
            if (amIDead()) {
                return;
            }
            // there isn't a notifyid then this was the restore transaction call and this should be skipped 
            if (notifyIds[0] != null){
            Log.i(TAG, "confirmTransaction()");
            Bundle request = makeRequestBundle("CONFIRM_NOTIFICATIONS");
                 ......
                 ......
    }
    

    Works like a charm form me.. Thanks Guys...

提交回复
热议问题