In-App Purchase fails to unlock content on some devices - ios

We have had users reporting that they have paid for our product via in-app purchase but we have failed to unlock the content. The common denominator between these reports is iOS 9 so far. It seems like the purchase with success method does not get called. The IAP seems to work and even says that the purchase has been restored successfully (Apple's own alert), yet it does not deliver the content (unlocks the app).
This is a very odd bug because it works perfectly fine on iOS 10, and there is no reason why it should't work on other older devices. At some point, we had a customer complain of the same issue with iOS 10 as well and we just can't produce the issue. I am using RMStore for my in app purchases but this has not started since we used this library. It has been happening even with standard IAP integration.
Does anyone knows or may have heard of what causes this issue?
Any tips would be great!

I have several apps on the App Store and I'm facing similar issues. For about 1% of the users, the success callback is not called after an in-app purchase. If the users restore their purchases later, the purchased features unlock properly, so the App Store processed the purchase properly, and this is likely a bug in the app. I could never find the issue as I could not reproduce it on any of my devices.
After I just read that you use RMStore, I checked the emails that my users sent me during the last two years about this issue and noticed that this occurs exclusively with apps that use RMStore. While the code of that library looks really clean, I assume that the bug is somewhere hidden in there.
As RMStore hasn't been updated since almost two years, I consider it deprecated and will remove it from my apps in the near future. I will update this answer if the issue persists after the removal.
Update after three months: After the removal of RMStore for the in-app purchase handling from one of my apps, the problems have apparently disappeared.

Related

Unity Codeless IAP IOS build rejected

I have a problem using Unity's codeless API in conjunction with IOS.
Apple keeps rejecting the build with the following message:
Guideline 2.1 - Performance - App Completeness
We found that your in-app purchase products exhibited one or more bugs
when reviewed on iPad running iOS 12.1 on Wi-Fi.
Specifically, no action takes place when we initiate the purchase.
Some notes:
I succesfully built and published the app on android.
The IOS version works with the uploaded build. I can make in app purchases when i run the app on my iphone.
I have filled in all the required legal/ financial information and have a valid contract for purchases as defined in the ios docs.
The build is set as "release" and "development build" is NOT checked.
After rejection by apple, all the in app purchases in the developer console are marked as requiring action.
Specifically it is now showing that the localizations are invalid. However no further information is given. I suspect this is just because the build is rejected?
So, has anyone had a similar problem? Having the app run fine when using the development build on a local phone, but still having it rejected because of the aforementioned reason?
In the end i requested i call with Apple to discuss the rejection of my IOS build(s).
It had been rejected 3/4 times with the same reason.
The reason: A problem on their part. They suspect they had a misconfigured environment on their side, which resulted in a not working build on Ipad.
I did not have to upload a new build, they reused the last rejected one and it was approved within hours of my call.
I suspect that the developers might have been confused, seeing that the app was entirely in dutch. This can seriously cause some confusing, because the representative on the phone had trouble locating some IAP functionality himself like the restore button.
So should you have the same problem:
If your app is in a non-english language, specificy where the reviewers have to click for In App Products, where the Restore button is and similar key parts of your app.
Request a call with Apple if you are sure that you did everything correctly. Talking on the phone with them really helps speed up the review process and clarify any misunderstandings.

iOS Switching from paid to free app, how does one know who previously purchased the app?

I have a paid app that was released on iOS 4. It hasn't been updated and I'm now reworking it to work with iOS 10. Since in app purchasing was not a thing, I made a free (lite) and paid version of the app. I would like to update the paid version to iOS 10 and change it from paid to free with ads and an in app purchase to remove ads.
I tried researching various methods and I have not found a fool proof way or evidence that one will work in all cases. The two most prevelant methods I found:
Use an existing UserDefaults key value to determine if they opened the old app and then grant them no ads in the new version.
I don't think this method will work, as if the app was uninstalled or the user redownloads it after the update they would not have that value.
I believe iOS 7 offered receipt checking. Use receipt checking to determine if the user has paid for the app and check if the date is before the new version date.
I'm not sure if this would work either. I saw in the documentation to verify locally. Would everything I need exist if the app was an iOS 4 app originally? Would this work for users who had the app through a promo code? What if they don't have an internet connection at the time they open the app? I had trouble finding sample code for this option to test.
How would I go about doing this? Are any of the methods above the only way or are there others?
Out of all the resources I found on this subject, checking the receipt seems to be your only feasible choice. If you have an account where you purchased your app, you can run the new version of the app via Xcode with that account and see if the receipt validation gives you the expected information. Though installing the app via Xcode may alter the receipt that the account has, you may want to check on that.
NSUserDefaults option could work if you were setting any value to NSUserDefaults on the iOS 4 version.

iOS Receipt validation failing for long-term users

With our latest release, we converted our app from paid to in-app subscription purchase. We promised our current users that we would grandfather them into the subscription because they already paid for the app. In our code, we look for a valid receipt with an original application version prior to our first subscription version. It all worked great in our tests.
When we released the new app, we started getting feedback from our long-term users that they were being asked to subscribe (they shouldn't even see the subscribe button). As we researched the issue, we noticed that all of these users purchased our app prior to the app being transferred to a new developer in September of 2014.
Recreating this issue is difficult - how do we simulate an app install in 2014? I may be able to login as one of the affected users, which would involve using their Apple credentials. I'm not very comfortable asking users to share their credentials.
Since I haven't been able to recreate it and our code is pretty simple, my best guess as to what is happening is that we aren't receiving a valid receipt for users that purchased prior to the app transfer in 2014.
So, I have a few questions:
Has anyone else experienced this?
If so, how have you resolved it?
How would you troubleshoot it?
FYI - I've filed an issue with Apple (3045378).
In speaking with Apple Developer Technical Support, we discovered a way to pull the NSLog messages off of the devices using the recently released Unified Logging feature. A couple of our users submit their logs, which clearly showed that they were getting valid receipts, but the originally purchased versions of those receipts are 4 and 2.8.
Given that our current version is 1.7.1, these are strange and non-typical numbers. However, the Original Application Version reported from the receipt is actually the CFBundleVersion (or Build), which can be a completely different string than the App Version reported in the App Store.
I assume that the developer prior to the app transfer was using a different build numbering system than the standard ... scheme.
I refined the version check within my code and re-submitted the app. It was released today, and, so far, all are being grandfathered correctly.

Debugging intermittent failures with Apple IAP

I'm working on an app with Swift 3, XCode 8.1, iOS 10.1.1. I'm testing my in-app purchases on my iPhone. About 30-40% of my purchase attempts are failing with SKError code 0: Cannot connect to iTunes Store. However, I can't figure out the pattern of the failures. IAPs that fail will frequently work if you just try again - same build, no changes, etc.
Things I've checked:
I've verified that the product identifiers are correct, and have successfully purchased each IAP multiple times. There does not appear to be any problem getting the list of available products.
I'm using a sandbox tester (gone through 6 of them at this point), having signed out of my regular account.
I'm on my iPhone, not on Simulator.
I've tried it under different network speeds using the Network Link Conditioner, with no change other than the success/failures happen faster or slower.
My device has plenty of space, and the IAP isn't downloading anything anyway.
Twitter isn't showing any complaints from other people about App Store issues.
This same behavior is happening on two different devices, both iPhone 6.
Each IAP is live and available.
Restoring purchases appears to work every time. I've seen some people on SO have success resetting their device when they can't get any IAP to work, but I'm hesitant to do that when my symptoms seem different.
Any suggestions on how to debug further?

IAP fails after release, but no in development stage

Here is the history of my app.
In v1.0 I didn't have IAP.
In v2.0 I had IAP code, and it worked while I was developing. When v2.0 was released, I checked and run a non-testing device (an iPhone under my itunesconnect user name, but does not have provision file installed, so I take it as a non-relevant device) and I got error message, which of course was set up by myself. The error is for situation that the app could not connect to Apple or could not find IAP for the app. The error shows up quickly right after clicking buy IAP. This is as expected since no product ID is available. It doesn't need wait payment queue at all.
Then I checked itunesconnect and found the IAP probably not linked to the app, so I updated to v2.1 and added the IAP to my app in itunesconnect (no real code change, at least no IAP-related code changed), and IAP works fine finally in development stage in my testing iPad. Now v2.1 came out, but I still have the same problem as v2.0, that means IAP encounters error, most likely no IAP product ID found. At the time I'm typing, v2.1 has been released for 2 hours, and I still have quick error --- the product ID problem, most likely.
[edit]
BTW, there was a glitch between v2.0 and v2.1. When I noticed the IAP was not linked to my app, I did something too quick so that I cannot remember exactly. Basically the IAP was hung over there, I could modify it or submit it. After talking to Apple, I was told I need reject my binary of v2.1 and resubmit v2.1 along with the IAP. I don't know if this is related, but anyway I can buy IAP in development stage with my sandbox testing iPad.
[edit]
Any idea? Thanks.
BTW, the app is set to English default, but with Chinese/Spanish localization.
[edit]
One more thing, don't know if it's related. All v1.0, v2.0, and v2.1 versions are deployed to iOS 6 or later. When I was developing v2.1, I was trying to back to iOS 5 (via adopting so deprecated methods or constants). My app could run on iOS 5, but IAP wouldn't work iOS 5. Since IAP doesn't work, there's no point for me to go compatible with iOS 5, so I removed all deprecated methods and constants and went back to original v2.0 version and resubmitted with linked IAP to become v2.1.
For those who cares, here is my app. You're welcome to try. long press first page would get you to options page where you can try buy IAP --- no worry, there is supposed to be a confirmation dialog where you can cancel, even if my IAP works.
https://itunes.apple.com/us/app/icalc24!/id566916783?mt=8
[edit]
One more edit:
OH yeah, it works now. I don't which step of the following make it work:
1, I delete my app and restart my iPhone again (and again, yes) and re-download
2, it's 4 hours now after v2.1 is approved.

Resources