Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:latest_receipt is not saved #3

Open
hayesmp opened this issue Feb 19, 2014 · 4 comments
Open

:latest_receipt is not saved #3

hayesmp opened this issue Feb 19, 2014 · 4 comments

Comments

@hayesmp
Copy link
Contributor

hayesmp commented Feb 19, 2014

I still can't sort out why it's not being saved.

@holgersindbaek
Copy link
Owner

@hayesmp Have you checked that the receipt gets checked and stored in line 18 of the Receipt module?

When checking the receipt on purchase and (if product is a subscription) when activating the app, we are checking the receipt against Apple's servers, to make sure it's a valid receipt. If the receipt is valid, we are storing it in NSUserDefaults. Have you checked that we are getting to this point in the code? Is there anything in the receipt object? Is it able to save the receipt object in NSUserDefaults?

@hayesmp
Copy link
Contributor Author

hayesmp commented Feb 21, 2014

I have had problems with NSUserDefaults in the past where I have saved to it, but there's a delay before I can retrieve data from it.

The receipts appear to be verifying, but I'm having trouble retrieving the :latest_receipt to get the expire date.

One of the bothersome things is that I have not been able to output the receipt from anywhere inside the gem.

@hayesmp
Copy link
Contributor Author

hayesmp commented Feb 21, 2014

If I try to output the receipt after the successful purchase I get a crash. I'll have to look at my old IAP code and see if I can figure out where the failure point is.

Also I noticed that I'm getting prompted to re-enter my test account password even when the app is in the background. This makes me suspect that the background process that's constantly retrying to verify the receipt is using bad data...?

@holgersindbaek
Copy link
Owner

Ok. I can't really help you with the crash, since you're not showing me any crash-logs. If the receipt you are trying to output, is saved as NSData, then I could suspect that it would crash, because it can't convert NSData to a string.

I'm quite sure it's not checking anything in the background. It's only checking receipts on startup and purchase. Sometimes Apple's servers are a bit slow to respond. So if you open your app and exit immediately, then that might be the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants