Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Apple IAP Plugin vs store.init("apple")
Started by akao Nov 13 2019 12:01 PM

14 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

akao

[GLOBAL: userInfoPane.html]
akao
  • Contributor

  • 372 posts
  • Corona SDK

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.

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,394 posts
  • Enterprise

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



[TOPIC: post.html]
#3

akao

[GLOBAL: userInfoPane.html]
akao
  • Contributor

  • 372 posts
  • Corona SDK

@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. 



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,394 posts
  • Enterprise

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



[TOPIC: post.html]
#5

usmanmughal.uog

[GLOBAL: userInfoPane.html]
usmanmughal.uog
  • Enthusiast

  • 67 posts
  • Corona SDK

@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


 

Attached Files



[TOPIC: post.html]
#6

akao

[GLOBAL: userInfoPane.html]
akao
  • Contributor

  • 372 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,394 posts
  • Enterprise

I pinged Engineering.

 

Rob



[TOPIC: post.html]
#8

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

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.



[TOPIC: post.html]
#9

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 918 posts
  • Corona SDK

...

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?



[TOPIC: post.html]
#10

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

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.



[TOPIC: post.html]
#11

dan56

[GLOBAL: userInfoPane.html]
dan56
  • Enthusiast

  • 45 posts
  • Corona SDK

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?



[TOPIC: post.html]
#12

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

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

[TOPIC: post.html]
#13

dan56

[GLOBAL: userInfoPane.html]
dan56
  • Enthusiast

  • 45 posts
  • Corona SDK

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?



[TOPIC: post.html]
#14

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

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

[TOPIC: post.html]
#15

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

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


[topic_controls]
[/topic_controls]