Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

iOS in-app subscription expire date
Started by ronald14 Oct 01 2018 07:52 AM

41 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

I want to use the iOS subscription in-app purchase. When I do a purchase. I receive a transaction via the transaction listener. This gives me some information like: state, identifier , productIdentifier and more. 

 

I miss lots of fields defined by apple, see:

 

https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1

 

Especially I miss the 'Subscription Expiration Date'

 

When I look at the receipt. I see a hex string like this: '<7b0a0922 7369676e 61747572 6522203d 20224133 346c4a78 516d6e33 48376f72 ....'

 

Is there a way to get the missing fields? 

 

Ronald



[TOPIC: post.html]
#2

xnailbender

[GLOBAL: userInfoPane.html]
xnailbender
  • Contributor

  • 357 posts
  • Corona SDK

Ronald,

 

Awhile ago, I tried to get IAP Subscriptions to work, I also ran into a dead end.

 

I hope Rob can clarify if Subscriptions are supported by Corona and if not, if they ever will be.  I believe Apple is trying to get developers to steer in this direction.

 

Nail



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,970 posts
  • Corona Staff

I'll ask



[TOPIC: post.html]
#4

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

Thank you Rob, 

 

I really hope a solution can made to get missing fields.

 

Ronald



[TOPIC: post.html]
#5

Kevin H

[GLOBAL: userInfoPane.html]
Kevin H
  • Contributor

  • 130 posts
  • Corona SDK

I've been putting together iOS IAP subscription for a client, the subscription receipt is coming through fine, and the validation URL provides all relevant info on subscription status when passed the receipt. Kind of messy and multi stepped, but definitely possible from within Corona.



[TOPIC: post.html]
#6

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

Thank you. I will try this validation URL method.

 

Ronald



[TOPIC: post.html]
#7

Kevin H

[GLOBAL: userInfoPane.html]
Kevin H
  • Contributor

  • 130 posts
  • Corona SDK

I used this very awesome script created by Corona user Satheesh to pass up the receipt and return the validation info: https://github.com/SatheeshJM/Auto-Renewable-In-App-Purchase-Validation-using-Corona-SDK/blob/master/validate.lua



[TOPIC: post.html]
#8

borderleap

[GLOBAL: userInfoPane.html]
borderleap
  • Contributor

  • 389 posts
  • Corona SDK

Hey Kevin have you used that script lately?  Looks to not have been updated in about 7 years... just wanted to make sure it works before attempting to use it.



[TOPIC: post.html]
#9

Kevin H

[GLOBAL: userInfoPane.html]
Kevin H
  • Contributor

  • 130 posts
  • Corona SDK

Using it now :)



[TOPIC: post.html]
#10

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,970 posts
  • Corona Staff

We have created a new IAP plugin for Apple OS's (iOS, tvOS, macOS) that should be a drop-in for store.* but it adds some new API's to help with receipt management which could help with subscriptions.

 

Reply here if you want to test and I'll email you instructions.

 

Thanks

Rob



[TOPIC: post.html]
#11

Kevin H

[GLOBAL: userInfoPane.html]
Kevin H
  • Contributor

  • 130 posts
  • Corona SDK

I'd be happy to test it out!



[TOPIC: post.html]
#12

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

Thank you Rob,

 

I would like to test this. Can you send me the instructions?

 

Ronald



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,970 posts
  • Corona Staff

Emails sent.



[TOPIC: post.html]
#14

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 30 posts
  • Corona SDK

I am interested to see what is involved here. Can this be tested via just the Corona simulator ?



[TOPIC: post.html]
#15

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,970 posts
  • Corona Staff

@IBMHurskley1964, I'm not finding the email you're using for the forums in our developer database. I need an email address that you're logged into Corona with.  Please email me at devrel AT coronalabs DOT com with your logged in email.

 

Rob



[TOPIC: post.html]
#16

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 30 posts
  • Corona SDK

Maybe new change not updated yet.. Will email you . thanks



[TOPIC: post.html]
#17

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 850 posts
  • Corona SDK

I'll test it also.



[TOPIC: post.html]
#18

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 30 posts
  • Corona SDK

@IBMHurskley1964, I'm not finding the email you're using for the forums in our developer database. I need an email address that you're logged into Corona with.  Please email me at devrel AT coronalabs DOT com with your logged in email.

 

Rob

Looks like I have the links now and all emails working.  I am now realising I am missing some basic knowledge on how I would test this. I assume this would be via Apple 'TestFlight'. Any pointers would be appreciated as testing here thus far is fairly straight forward without any access to Store prior to publishing... UPDATE... 

I have found what I need I think here... https://developer.apple.com/library/archive/technotes/tn2259/_index.html



[TOPIC: post.html]
#19

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

I just implemented this new iap api. I can now easily see the required 'expires_date' of my subscription. 

 

I have one note!

When I buy a subscription and request the receipt, with store.receiptDecrypted(). I see in the recept's field 'in_app' the complete history of all the subscriptions i bought in the past. In my case I see 60 entries (in the sanbox environment). The last entry is the one I need. I kind of expected just 1 entry in 'in_app' field.

 

But when I do a restore, I get all 60 transaction in restore state. All these 60 transaction again have 60 entries in the 'in_app' field, if I request the receipt. This seems a bit too much to me. But good usable. I just need the last entry in 'in_app' from the last transaction.

 

is this intended behavior?

 

I kind of remember from many years ago on x-code. I also saw much redundant data when working with receipts and restores. But I am not sure anymore.



[TOPIC: post.html]
#20

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

Looks like I have the links now and all emails working.  I am now realising I am missing some basic knowledge on how I would test this. I assume this would be via Apple 'TestFlight'. Any pointers would be appreciated as testing here thus far is fairly straight forward without any access to Store prior to publishing... UPDATE... 

I have found what I need I think here... https://developer.apple.com/library/archive/technotes/tn2259/_index.html

No, not via TestFlight. Just build and app and copy to iOS device with 'Developer' profile (not a wildcard profile). When developer profile is used the iap sandbox environment is used.

 

Ronald


  • IBMHursley1964 likes this

[TOPIC: post.html]
#21

IBMHursley1964

[GLOBAL: userInfoPane.html]
IBMHursley1964
  • Enthusiast

  • 30 posts
  • Corona SDK

Seems easier than I expected from all the documentation.  Thanks .... I assume I have to set up my consumable product types somewhere  

https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Products.html#//apple_ref/doc/uid/TP40008267-CH2-SW2

 

 

Thanks all. Stepping out of conversation for a long while and  just observation...  leaving further discussion to the experienced,



[TOPIC: post.html]
#22

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,970 posts
  • Corona Staff

Ronald, are you calling the finishTransiaction() API?



[TOPIC: post.html]
#23

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

Ronald, are you calling the finishTransiaction() API?

Yes, I do during purchase and restore

 

When I do a recover, in sanbox mode, I keep getting all transactions from the past.

 

Ronald



[TOPIC: post.html]
#24

ronald14

[GLOBAL: userInfoPane.html]
ronald14
  • Observer

  • 16 posts
  • Corona SDK

Rob,

 

Apple rejects my binary since I use this API. They claim I need to use production for recept verification. The give me this hint:

 

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead

 

Is this new corona SDK ready for production? When it does verify the receipt does it try production first en then sandbox, like apple suggests?

 

Ronald



[TOPIC: post.html]
#25

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,970 posts
  • Corona Staff

Hi Ronald. You're going to have to help me out a bit. What API are you using? Are you referring to the whole store.* API family?

 

How are you handling receipt validation?

 

Receipt validation is your responsibility. Our store.* API's just return data to you.

 

Are you using the test plugin that I emailed you about? We've not gotten any feedback from you about it. If you're using this plugin that we are asking you to help test, I can't say if it's production ready or not. It's why we solicited feedback. If this is the case, please reply via the email that I sent. 

 

Rob




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]