Apple IAP store event nil

Hi,

I’m having a problem with the Apple IAP using the store library.

I have setup (2) purchase options that are consumable. When I go to test the purchase using a test account listed in my iTunes account, the call goes out to Apple to make the purchase and comes back calling the storeTransaction call. In the return call the event parameter keeps coming back as nil, there is no information being passed back. The last app I published was about 6 months or so ago using this same code but for some reason with the newest build no info is passed. I am using storyboard and don’t know what could be causing the issue.

Both consumable products are listed in my app listing and the id is being passed to the apple purchase call.

Thanks for any help!!

Any messages in your console log?

Unfortunately nothing

I am displaying alert messages in the store callback function so I know it is being fired off after the attempt to make a purchase.

If I cancel the payment the storetransaction function is called with a nil event parameter value.

At a loss as to why there is no information being sent back in the listener for the store purchase attempt.

Can you put this at the top of your transaction listener?

print( json.prettify( event ) )

You will need to have required the json module earlier. And then post what’s going on in the console log (of the device).

Rob

Hi Rob,

The printout of the json is the following:

{ “name” : “storeTransaction”, “transaction” : “<type ‘userdata’ is not supported by JSON.>”  }

Do I have some setting wrong?

Thanks for all your help!

Shawn

No. The data being returned is a block of C memory and not a Lua table, so we can’t easily dump it with one line. event.transaction isn’t nil, so you’re probably going to have to print out the values by hand.

Try looking at this and printing out all these values:

https://docs.coronalabs.com/api/library/store/event/storeTransaction/transaction.html

and all these values:

https://docs.coronalabs.com/api/library/store/event/storeTransaction/index.html

We have to know what’s going on.

Any messages in your console log?

Unfortunately nothing

I am displaying alert messages in the store callback function so I know it is being fired off after the attempt to make a purchase.

If I cancel the payment the storetransaction function is called with a nil event parameter value.

At a loss as to why there is no information being sent back in the listener for the store purchase attempt.

Can you put this at the top of your transaction listener?

print( json.prettify( event ) )

You will need to have required the json module earlier. And then post what’s going on in the console log (of the device).

Rob

Hi Rob,

The printout of the json is the following:

{ “name” : “storeTransaction”, “transaction” : “<type ‘userdata’ is not supported by JSON.>”  }

Do I have some setting wrong?

Thanks for all your help!

Shawn

No. The data being returned is a block of C memory and not a Lua table, so we can’t easily dump it with one line. event.transaction isn’t nil, so you’re probably going to have to print out the values by hand.

Try looking at this and printing out all these values:

https://docs.coronalabs.com/api/library/store/event/storeTransaction/transaction.html

and all these values:

https://docs.coronalabs.com/api/library/store/event/storeTransaction/index.html

We have to know what’s going on.