IAP store.init callback event Not Working

Hi,

I’m implementing a game with IAP. (Apple). I managed to creating products and the user test account.

Currently the products are loaded and the test account on iTunes seems to work well as when I invoke the store.Purchase method, iTunes ask me for credentials and agreeing on the item purchase.

But despite I validated the purchase on iTunes popup, the callback event is never executed, so the application can not validated if purchase was successful or not.

The is my code in main.lua

local store = require( “store” )

function transactionCallback(event)

    local transaction = event.transaction

    local showMsgID = “”

    print("transaction state "…transaction.state)

    print("transaction error type "…transaction.errorType)

    print("transaction error "…transaction.errorString)

    status = transaction.state

    if ( transaction.state == “purchased” ) then

        print("transaction "…transaction.productIdentifier)

    elseif ( transaction.state == “restored” ) then

    elseif(transaction.state == “refund”) then

    elseif ( transaction.state == “cancelled” ) then

    elseif ( transaction.state == “failed” ) then

    else

    end

    store.finishTransaction( transaction )

end

print(“init store”)

store.init(“apple”, transactionCallBack)

store.purchase({“com.xxx.xxxx.xxxx.xxxx”}) --<-- here comes the right product id

However, this is the result on the log:

Feb 25 06:15:48 iPhone MyGame[6371] <Warning>: init store

Feb 25 06:15:48 iPhone gamed[6202] <Warning>: 06:15:48.382444 NSLog: Application(com.xxx.xxxx.xxxx.xxxx) is not allowed to run in production

Feb 25 06:15:49 iPhone locationd[64] <Notice>: Gesture EnabledForTopCLient: 1, EnabledInDaemonSettings: 1

Feb 25 06:15:49 iPhone itunescloudd[6117] <Notice>: (Note ) MC: User has completed cloud configuration. Not showing UI again.

Feb 25 06:15:49 iPhone itunescloudd[6117] <Warning>: Updating media purchase history for initial load…

Feb 25 06:15:50 iPhone locationd[64] <Notice>: Gesture EnabledForTopCLient: 1, EnabledInDaemonSettings: 1

Feb 25 06:15:51 iPhone itunescloudd[6117] <Warning>: ============================== releasing power assertion: <CloudServerPowerAssertion: 0x14603100>

Feb 25 06:15:58 iPhone itunesstored[6119] <Warning>: Could not load library [21]

Feb 25 06:15:59 iPhone itunescloudd[6117] <Notice>: (Note ) MC: User has completed cloud configuration. Not showing UI again.

Feb 25 06:15:59 iPhone itunescloudd[6117] <Warning>: Updating media purchase history for initial load…

Feb 25 06:15:59 iPhone itunescloudd[6117] <Warning>: Updating media purchase history for initial load…

Feb 25 06:16:03 iPhone itunescloudd[6117] <Warning>: ============================== releasing power assertion: <CloudServerPowerAssertion: 0x14653df0>

Feb 25 06:16:03 iPhone itunescloudd[6117] <Warning>: ============================== releasing power assertion: <CloudServerPowerAssertion: 0x147c8c50>

As you can see only the “init store” message is printed. Despite I entered my test user credentials and agreed on all iTunes pop up windows the prints in the transaction event are not shown, thereby, callback is not executed

I appreciated any guidance on this.

Olman

PS:

Just a curiosity. When I start the app from the console I got this warning:

Corona SDK Warning

You will not be able to publish this app to the store because it uses a restricted library (store). Please upgrade to unlock it.

However, I have the basic account, so IAP is available.

Hi @oquesada,

Are you certain that you’re logged in to the Simulator using your Basic subscription account? I checked our records and it appears that this account (which you’re posting from) is different from the one that has a Basic subscription.

Thanks,

Brent

Hi Brent

I subscribed to the Basic account on 14Feb 2015. A few days before I changed my email. because of that I had to unregister the Corona simulator on my Mac and register again with the new email.

I just checked my account info in Corona website and it says: 

Corona SubscriptionUpgrade Corona SDK Basic

This role will expire on 14 Feb 2016 - 18:17

I have the purchase email. Should i sent that email to somebody there? Coul that email change the cause of the issue?

Hi @oquesada,

This matches what I see in your records. I have actually just de-authorized all of the computers in your account, so please “Deauthorize and Quit” from your Corona Simulator, then restart the Simulator and log in under your latest credentials (the one with the Basic subscription). Let me know if that solves the issue.

Thanks,

Brent

Thanks Brent.

Your suggestion worked to remove the Corona SDk warning.

I just checked I was passing callback method to store.init wrongly

That method is declared function transactionCallback (event) but I was using transactionCall B ack in the store.init().

I just made a quick run and I got the transactionCallback fired on init. I suppose it happens for all purchases I executed without calling

store.finishTransaction( transaction )

Is there any way to achieve a fresh start of the IAP in order to validate everything is OK?

thanks

Hi @oquesada,

Are you certain that you’re logged in to the Simulator using your Basic subscription account? I checked our records and it appears that this account (which you’re posting from) is different from the one that has a Basic subscription.

Thanks,

Brent

Hi Brent

I subscribed to the Basic account on 14Feb 2015. A few days before I changed my email. because of that I had to unregister the Corona simulator on my Mac and register again with the new email.

I just checked my account info in Corona website and it says: 

Corona SubscriptionUpgrade Corona SDK Basic

This role will expire on 14 Feb 2016 - 18:17

I have the purchase email. Should i sent that email to somebody there? Coul that email change the cause of the issue?

Hi @oquesada,

This matches what I see in your records. I have actually just de-authorized all of the computers in your account, so please “Deauthorize and Quit” from your Corona Simulator, then restart the Simulator and log in under your latest credentials (the one with the Basic subscription). Let me know if that solves the issue.

Thanks,

Brent

Thanks Brent.

Your suggestion worked to remove the Corona SDk warning.

I just checked I was passing callback method to store.init wrongly

That method is declared function transactionCallback (event) but I was using transactionCall B ack in the store.init().

I just made a quick run and I got the transactionCallback fired on init. I suppose it happens for all purchases I executed without calling

store.finishTransaction( transaction )

Is there any way to achieve a fresh start of the IAP in order to validate everything is OK?

thanks