0

I am currently developing an in-app purchasing in Ionic 2 and each time the app is run I check if a user is subscribed. For Android I use restorePurchases function. For iOS I am trying to use getReceipt() function. What I get is a long Base64 receipt string. My question is, how am I supposed to check if a subscription exists using that string?

Thank you in advance.

CannotCode
  • 125
  • 1
  • 2
  • 10
  • 1
    I suggest you make your question specific, single and unique. Are you after a sample Receipt (which I doubt to be useful) or you want to know why you are getting this error? – n00b Nov 30 '17 at 23:39

1 Answers1

0

I am answering the implicit question of why this error could occur: Many things can go wrong causing this error, which most of them has nothing to do with your code actually. just your setup. for this to work in a test device

  1. You should be logged in that device using a iTunes Connect sandbox account.
  2. You should be logged in your Mac using sandbox account. (not sure why, but I read somewhere you have to, and I do it!)
  3. The Bundle ID everywhere should match. that is in your iTunes Connect, your ionic app's Config.xml
  4. should not have production version of the app on your device

hope others provide better answering explaining why this is so difficult to get to work!

n00b
  • 1,832
  • 14
  • 25
  • Thank you so much for your response. Unfortunately, I cannot do any of that as I do not really have a constant access to any iOS device that I could manipulate the way I want. Is there any way that you could at least show me how the returned receipt object usually looks like and how one can access its data, so I at least could code it blindly and test later the effect in beta testing? That is the only option I have right now. Thank you once more – CannotCode Dec 01 '17 at 07:32