in app purchase - android In app billing strange execution -


i working on in app billing of android..i follow tutorial of android , testing test app.(android.test.purchased) create app on google console sign apk , upload google console copy public key , paste code , sign apk again , install on phone tried buy test purchased id display me purchased successful in log value display purchaseddata , datasignature , got datasignature null (empty)

the fun part in handleactivityresult method there 1 if condition checks weather datasignature or purchaseddata null or not , in code not execute if skips ? how possible?

here pur log in logcat cannot see "in bug null value"

 if (purchasedata == null || datasignature == null) {             logerror("bug: either purchasedata or datasignature null.");             log.e("inapp", "in bug null value");             logdebug("extras: " + data.getextras().tostring());             result = new iabresult(iabhelper_unknown_error, "iab returned null purchasedata or datasignature");             if (mpurchaselistener != null) mpurchaselistener.oniabpurchasefinished(result, null);             return true;         } 

i had problem myself. after while found did wrong. calling wrong method on iabhelper.

if call mhelper.launchpurchaseflow(...) sku registered subscription on google developer console result in error: iab returned null purchasedata or datasignature (response -1008:unknown error).

if have sku registered subscription have use method: mhelper.launchsubscriptionpurchaseflow(...) instead.

hope helps.


Comments