function sponsorpay.requestNewCoins(resultListener, currencyName) won’t fire result listener making the whole plugin USELESS!
Corona version: 2013.1257 (2013.11.7)
Platforms affected: iOS, Android
With the option: sponsorpay.setShowMBERewardNotification( true ) the popup will show with the valid delta of coins but the listener still won’t be fired BTW. this function crashed app on Android.
This code will never fire the resultListener(event) function
function \_M.getCoinsDelta( \_listener) print("TRY TO GET COINS DELTA") local function resultListener(event) if event.success then local coins = tonumber(vcsTransaction.deltaOfCoins) print("SUCCES DELTA: ", coins) \_listener(coins) else print( "can't retrieve coins delta" ) \_listener(false) end end if Connection.test() then sponsorpay.requestNewCoins(resultListener, currencyName) end end
Hi there!,
we’re currently looking at the other post open in the forum (http://forums.coronalabs.com/topic/41859-android-app-crash-on-sponsorpaysetshowmberewardnotification-false-call/#entry217722).
Regarding this one, can you try with
tonumber(event.vcsTransaction.deltaOfCoins)
instead of
tonumber(vcsTransaction.deltaOfCoins)
Cheers,
David
Hi David,
Thanks for your help. It turned out that source of the problem was me trying to use the plugin immediately after calling sponsorpay.start( appId, userId, securityToken ). Using timer.performWithDelay() fixed all the issues.
I mark this as resolved.
Hi there!,
we’re currently looking at the other post open in the forum (http://forums.coronalabs.com/topic/41859-android-app-crash-on-sponsorpaysetshowmberewardnotification-false-call/#entry217722).
Regarding this one, can you try with
tonumber(event.vcsTransaction.deltaOfCoins)
instead of
tonumber(vcsTransaction.deltaOfCoins)
Cheers,
David
Hi David,
Thanks for your help. It turned out that source of the problem was me trying to use the plugin immediately after calling sponsorpay.start( appId, userId, securityToken ). Using timer.performWithDelay() fixed all the issues.
I mark this as resolved.