Apple IAP Plugin vs store.init("apple")

We have been using 

store.init("apple", callBack)

for IAP for a really long time. We also see that there is a newer Apple IAP plugin that has come out:

https://docs.coronalabs.com/plugin/apple-iap/

We did some testing with the new plugin, and it seems to work fine, except that the receipt format appears to be different and our receipt validation is failing. So we are trying to understand whether or not we should be migrating to the new Apple IAP plugin, given that the new plugin’s market place listing is full of warnings…

  • What exactly is the difference between the Apple IAP plugin vs the stock store.init()? In other words, what benefits can/should I expect if I were to do the work to migrate? 
  • What exactly is the difference in the receipt data that we receive? 

The reason we are considering this is, lately, we’ve been noticing a lot more incidences of our app crashing out of the purchase flow on iOS (within our test environment). So, we want to see if migrating to the new Apple IAP plugin is a good idea. 

thx.

Apple changed the receipt format. If you’re validating receipts, you will need to use the new plugin. There shouldn’t be much difference other than being able to handle the new receipt format.

Rob

@RobMiracle

So, other than the change in the receipt format, are there any other changes/enhancements with the new Apple IAP? 

We are actually having a really difficult time with the new receipt format. We haven’t been able to find much documentation or existing LUA code that can help us process it. The previous store.init() call returned us a receipt format that we have been processing (and continue to process) successfully.

So, unless the new Apple IAP plugin offers some additional benefit, we are inclined to not make the move. 

The problem is Apple changed the receipt format. Most people checking the receipts are having trouble using the store.init() based IAP support. If you’re working, there isn’t a reason to change.

Rob

@Rob

I’m working on new receipt format and using new Apple plugin for receipt validation. Here is plugin page.
https://docs.coronalabs.com/plugin/apple-iap/index.html

I think I could find a severe bug on device. Whenever I check canMakePurchases(https://docs.coronalabs.com/plugin/apple-iap/canMakePurchases.html), app just freeze.

I tested it on iPhone 7plus. Allow/Don’t Allow settings in Content & Privacy Restrictions does not effect this. May be in first some tries, it don’t freeze. It worked for me for some initial testing but after couple of tries, it never worked.

Please find the attached project that uses only plugin and small code that would be frozen after “Subscribe” button press.

Usman

 

@Rob I was mistaken. It seems like with iOS13 and the latest Corona Daily Build, we are having receipt issues. So, we do need to migrate to the new plugin… We are having the issue that Usman is describing when using the new plugin.

I pinged Engineering.

Rob

Plugin is using very same code as core does. Differences are minimal. It is quite hard for me to explain differences in behaviour. Make sure something is going on on the screen.

Only functional difference is that plugin has tools to work with receipts, decode and verify them locally.
I will try to investigate what is causing issues.

The reason we are considering this is, lately, we’ve been noticing a lot more incidences of our app crashing out of the purchase flow on iOS (within our test environment). So, we want to see if migrating to the new Apple IAP plugin is a good idea. 

Is it a good idea to use the new one? Any news yet?

So, benefits of new plugin, is that you can use it to verify and decode receipts on the device. Receipts contain subscription information. There is no other difference with the IAP which is built in. Unfortunatelly, it seems that plugin has very long lag issues as well, like you make a purchase, and reply comes after very long time. I don’t know what is the cause of this behaviour unfortunatelly.

Based on the idea “that plugin has very long lag issues…” I’m thinking that the new plugin is not quite ready yet. Is there a target date for when it will be ready for production?

I couldn’t reproduce lag issue myself. I have suspicion it was caused by sandbox environment.

OK, so we think it’s basically good to go then. Thanks! The plugin page said it’s “experimental” and that scared me off a bit. I’ll start digging in to it. 

Just to confirm, the table returned from store.receiptDecrypted() is not all parsed out for us like the table event.transaction, correct? That is, I’ll have to learn how to parse out the receipt to find the subscription info - like subscriptionExpirationDate, correct?

Yes. That’s right. It follows Apple documentation for receipts contents, but it’s rather irregular. If you want to share your experience with using it, I’ll be grateful

Also, if it is decrrypted it is also verified by digital signature.