Detect a cancellation of the auto-renewable subscription.

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Jellobus
Posts: 210
Joined: Tue Dec 10, 2013 2:53 pm

Detect a cancellation of the auto-renewable subscription.

Post by Jellobus » Fri Mar 31, 2017 8:11 pm

Hi All,

I have been searching how to implement auto-renewable subscription in iOS. Purchasing auto renewal subscription is quiet similar to other in-app purchase.

But the challenge was to detect cancellation of subscription made by user. so I asked one of staffs in livecode and she told me that..
Unfortunately, in order to "get a transaction receipt for an in-app-purchase" we need to use a property which is not implemented in LiveCode yet.
As a workaround, it was suggested to use "mobileStoreRestorePurchases" in the openstack handler. and this should detect cancellation of the subscription. but my concern is, "Apple recommend not to restore purchase often since it prompts for the user’s AppStore credentials, which interrupts the flow of your app."

Thus, my idea is using "mobileStoreRestorePurchases " just once per a month by counting days since the date of purchase. so I don't need to use "mobileStoreRestorePurchases" often as apple recommended.

But here is my question, I found that Android devices never asking user's password or id when the items restored. What about iPhone and iPad? will they actually asking anything if the command "mobileStoreRestorePurchases" sent? I couldn't test this because I had problem with setting up testflight. Please let me know if anyone has idea about this.

Thanks a million in advance!

Louis

LiveCode_Panos
Posts: 306
Joined: Fri Feb 06, 2015 4:03 pm

Re: Detect a cancellation of the auto-renewable subscription

Post by LiveCode_Panos » Fri Mar 31, 2017 8:25 pm

Hi Louis,

If I remember correctly, yes the user will be asked for their AppStore login credentials when "mobileStoreRestorePurchases" is called. This is the reason Apple does not recommend using this function too often, because it "interrupts the flow of your app"

The enhancement report about the unimplemented property (which is needed in order to perform receipt validation) is this one:

http://quality.livecode.com/show_bug.cgi?id=19507

Best,
Panos
--

Jellobus
Posts: 210
Joined: Tue Dec 10, 2013 2:53 pm

Re: Detect a cancellation of the auto-renewable subscription

Post by Jellobus » Fri Mar 31, 2017 9:30 pm

Hi Panos,

I discovered this

https://developer.apple.com/library/con ... otely.html

I tried this code for testing in the desktop

Code: Select all

on checkSubscription
  put url "https://buy.itunes.apple.com/verifyReceipt" into tResult
  answer tResult
end checkSubscription
This code returns "status: 21000", if I test it on my computer. The returned number indicates the status of subscription. Can it be a solution for this matter?

Cheers,

Louis
Attachments
status code.png

LiveCode_Panos
Posts: 306
Joined: Fri Feb 06, 2015 4:03 pm

Re: Detect a cancellation of the auto-renewable subscription

Post by LiveCode_Panos » Sat Apr 01, 2017 9:31 pm

Hi Louis,

The url "https://buy.itunes.apple.com/verifyReceipt" has to be used in combination with the actual receipt data, which currently cannot be obtained by LiveCode. This will be possible when the enhancement http://quality.livecode.com/show_bug.cgi?id=19507 is implemented. I suggest you add your email to the cc list of this enhancement request, so as you get notified when its status changes.

Best,
Panos
--

Jellobus
Posts: 210
Joined: Tue Dec 10, 2013 2:53 pm

Re: Detect a cancellation of the auto-renewable subscription

Post by Jellobus » Sun Apr 02, 2017 3:43 am

That's fantastic! Thanks a lot for your help!

Post Reply

Return to “iOS Deployment”