Unity IAP not working in Apple Testflight - ios

Having issues for the past days trying to make the IAP work on TestFlight for my 1st game app.
IAP works fine in Unity Editor (fake store) and also on Google Play (internal test track).
I don't receive any product prices from the apple store and the buy buttons have no effect (no callbacks on ProcessPurchase or OnPurchaseFailed since I show popup windows for both scenarios).
Below is the status of my app and IAP :
From other similar threads everything should be ok and working as TestFlight doesn't require the IAPs to be submitted nor it requires for sandbox users to be manually created.
Any hints on what to further test or how could I check logs/warnings/errors are much appreciated, thanks.
Tools used : Unity 2019.3.0 (IAP 2.0.6) and XCode 11.3.1
Update 1: OnInitializeFailed() is called with NoProductsAvailable err

The reason why the initialization failed with NoProductsAvailable was because I didn't have an active agreement for paid apps, although it is testflight and there are no real money involved, you still need to have this setup.
Here is how it should look like :
Once this was solved the IAPs worked fine.

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.

In-App Purchase fails to unlock content on some devices

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.

When publishing an Apple app, can a third party get access before published?

I am publishing my first iOS app to the App Store. However, the company that hired us wants to see the app work before we publish. Is there a way under the $99 developers plan to allow them to see the app work on a real iPhone?
For completeness there is another way. Although I've used TestFlight very happily for years, it can prove to be too complicated for some testers!
If your app has been approved by Apple (but you've set release date in the future), you can give people promo codes (which you can get from iTunesConnect) and they can download the unreleased app. This is great for getting your app to reviewers.
From iOS Developer Library:
Promo codes apply to a specific app version, so when users redeem
promo codes for a version of an app that hasn't been released yet,
they download the prerelease version.
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/ProvidingPromoCodes.html
Obviously in your case, you probably want to get your client's approval before even submitting to Apple, therefore #Anil's answer is better for you.
This is possible through multiple platforms.
iOS 8
As mentioned above, refer to the following link:
http://blog.thebetafamily.com/2014/09/10/testflight-beta-testing-ios-8/
iOS 7 and below
Test Flight - https://www.testflightapp.com (Acquired by Apple and available on iOS8 as described above)
Hockey App - http://hockeyapp.net
Test Flight is free and simple to use. All you need to do is upload the certificate and it'll take care of the rest. Test Flight used to support other OS like Android. But after the acquisition, I think it only supports iOS.
Hockey App is also simple. But only supports certain numbers of builds or projects for the free version. Hockey App provides direct update during the app launch if a new build has been uploaded.

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.

In-app payment still says it's in sandbox mode

I built a in-app payment for one of my iPhone apps. It worked in sandbox mode.
I submitted my app to the app store and it got accepted. I even submit my in app payment. It got accepted and it's status is 'ready for sale'.
However, when I go get my app in the app store, it still says it's in sandbox?
Is there something in MKStoreKit that you have to transfer environments, or does it take some time for it to change?
I currently pulled it from the store because of it. Please help! Thanks.
Hmmm. Are you using your Test User ID or a real Apple ID?
When this happens, it's usually because you previously used the same device for testing IAP in sandbox mode. To fix, just go into "Settings", then go to "Store", then log out and back in again. That should clear that up, assuming that you are actually using the archived app that you downloaded from iTunes, rather than your dev copy.
Re-released my app today so I could get it and see if the in app payment would work. Surprisingly, it worked and it wasn't in sandbox mode! So I guess it just takes time for apple's servers to make the change.
If anyone else had this problem, don't fret like I did! Just wait and be patient. Hold for developer release and wait around 24 hours and you should be good!
Here's the real solution (edit):
Set your availability date to the future so it will be removed from the app store
Set your availability date to the day it is so it will re appear

Resources