delete Auto-Renewable subscription when user delete account - ios

I'm coding a mobile app (React Native) and using library react-native-iap to handle In-App Purchase logic for IOS device.
My question is: How to stop renew and delete current subscription when user delete their account?
I'm using Sandbox Tester on AppStoreConnect for In-App Purchase testing.

Related

How to complete in app purchase(subscription) for my flutter app

I set up platform in RevenueCat for Subscription and successfully connected with my app. I set up In app purchase in App Store connect. I have a question: Do I have to first submit for review in app purchase, and when App Store approve it , then I can test in sandbox if my implementation of subscription working? I don't understand the order of the steps to be able successfully launch my app with subscription in App Store.
Or I can test my subscription implementation before submitting in app purchase ? And once all working then I submit in app purchase for review?

app user vs itunes user in In app purchases in ios

For in-app purchases in iOS is there any limit on number of subscriptions(in same group for same app) that can be made from a single itunes account? If there is more than one subscription how to distinguish them on server side?

How to check iOS app is paid when updating new app version with in-app purchase?

I have my paid app in App Store now I change it to a free app with in-app purchase in new version. (Auto-Renewable Subscriptions)
I want to give free for the user's who purchased the previous version.
I have some questions here:
1) How to check app purchased or not in code (Swift) ? I tried use SKPaymentTransactionObserver but I can't check history purchases.
2) How to test update from paid app (App downloaded from Store) to new version app (With Auto-Renewable Subscriptions by Sandbox account) ?
Apple will not issue any commands to the SKPaymentObserver unless you are making an in-app purchase. It has nothing to do with the original purchase of the app.
You can determine the original purchase date of the application by validating the iTunes Receipt with Apple and reading the original_application_version field. This would tell you if the user bought your app while it was a paid application. Apple has a guide for reading the AppStore receipt here.

Steps for Testflight to test an in app purchase on IOS?

I cannot work out nor find up-to-date documentation that shows how to test in-app purchases on IOS using Testflight.
As far as I understand the use of Testflight negates the need for sandbox users. Testers can use their normal iTunes account details - correct?
I have enabled In-App Purchases for the app in the Developer Console.
I have uploaded In-App Purchases to iTunes Connect via Application Loader
The IAP are showing status 'Ready to submit'
The app itself is showing as 'prepare for submission' - it is way off submission yet, I'm just trying to test functionality.
The ID's of the IAP match those in the app code.
Is there anything else I need to do in iTunes Connect to get them working in Testflight builds?

How to test In App Purchases through Apple TestFlight?

I uploaded my first app to iTunes Connect (iOS 8, iPhone) and it's now available through Apple TestFlight for internal and external testers.
I created a Non-Consumable in app purchase for it and would like to test it. How can I add it to my beta app?
I'm getting this message in iTunes Connect:
Your first In-App Purchase must be submitted with a new app version. Select it from the In-App Purchase section in Version Details
and click Submit.
You do not currently have a iOS Paid Apps contract in effect. If this In-App Purchase was submitted with your app, then your app will
not be available on the App Store until your contract goes into
effect. Legal, Admin, and Finance users can go to the Agreements, Tax,
and Banking module in iTunes Connect to view your contract status.
TestFlight users don't require a sandbox account, but they will test against an automatically created sandbox account.
Sandbox Accounts
The moment a tester opens your application, a sandbox
account is created for them. This means it's no longer necessary to
create test accounts in iTunes Connect. Testing In-App Purchases was
never easier.
Source
Note that your TestFlight user is a legitimate App Store user. That user will be purchasing, restoring, etc. from the IAP in the Sandbox as opposed to the real IAP.
On iTunes Connect, the IAP can be "Approved" or "Ready to Submit" (or any other status, I think).
English
Testers - TestFlight - Apple Developer
Each build is available to test for up to 90 days, starting from the
day the developer uploads their build. You can see how many days you
have left for testing in the app’s details page in TestFlight.
TestFlight will notify you each time a new build is available and will
include instructions on what you need to test.
All in-app purchases are free during the testing period.
中文
测试员 - TestFlight - Apple Developer
从开发者上传的那一天起,每个构建版本可被测试长达 90 天。您可以在 TestFlight 的 app 详细信息页面上查看可供测试的剩余天数。
在测试期间,所有 App 内购买项目都是免费的.
you can test in-app purchase with test account.
go to itunes connect -> Users and Roles --> Sandbox Testers
then create an account for testing your in app purchase.
when test in app purchase try to logout from app store which uses your real account. then it will ask for itunes account while in testing in app purchase then enter your test account credentials.
Testing IAP is going to require a test user that you create under iTunes connect. Plus code in you app to implement IAP. Then to test it you "purchase" the item from within the app, under the sandbox, using that user id.
As far as I know TestFlight is no different than testing the IAP on your device by building directly to your device.
I'm assuming that you didn't just add the IAP bundle id and expect it to do something.
If you have not added code to support IAP, that answer is non-trivial within the scope of a SE answer. Google IAP tutorial. There are lots of good ones out there.

Resources