Auto Renewable Subscription issue with different sandbox users on Same device - ios

I am using Auto Renewable Monthly Subscription in my application and successfully implemented workflow. I am testing application in development mode i.e with sandbox environment. I have added two Sandbox users in iTunes connect > User and Roles Section.
Query -
When user monthly subscribe service using first sandbox account and successfully subscribed product. then user Sign Out first sandbox account from device Settings > iTunes and App Store Section and then again login with second sandbox test user.
When user again open application then it show alert - "you are currently Subscribed to this" with option to manage and Ok, Rather than asking to perform purchase with new second sandbox user. Please guide me what should be the correct behaviour.
How can I add cancel subscription within app and test with sandbox environment.
How does auto renewable - renew subscription and validate subscription work?
Kindly Suggest , I will be very thankful for guide lines.

First of all,SandBox payment validity is 5 mins for monthly recurring payments. And for app inApp Payment details will save in appStoreReceiptURL this url, Apple will check based on Purchase_id(it will create in iTunes) and appStoreReceiptURL, If you want to use another Sandbox tester email You need to delete app and re install.then you will proceed to payment via SandBox.
2) There is no option to cancel Auto-renewable to sandbox payments.
3) Auto renewable will not work in Sandbox payments, it's for just testing purpose how inApp will work with out payment.

Related

How to Handle Canceled iOS In App Purchase Auto-Renewing Subscription

I'm wondering, if a user cancels a subscription and are trying to resubscribe am I supposed to present the management portal from within the App Store to this user and let them resubscribe from within the App Store or am I supposed to allow them to purchase a new subscription from within the App itself? It seems as if once a user has purchased the initial subscription from within the app itself Apple wants all other management to be done using the App Store.
I'm not exactly sure how this works and because I cannot access the 'Manage Subscriptions' portal for a sandbox App Store account I can't tell exactly how subscriptions are handled when they expire.
Thank you!
From the App Store subscription management page a user will be able to:
Change their auto-renew status
Upgrade or downgrade to a different subscription in the same group (e.g. change from a monthly to yearly subscription)
Resubscibe to an expired subscription
Paulw11’s comment is correct that you handle a re-subscribe exactly as a purchase in your app (the user won't receive a free trial if they had before). The purchase will go through as a normal subscription and it will be less confusing to your users.

Required to sign Paid Applications Agreement to enable initial IAP testing on iOS?

I'm developing a iOS app containing in-app purchases.
I'm having problems testing the app because it can't download IAP products from iTunes. Do I need to sign the Paid Applications Agreement even to perform initial (local) testing?
To test the purchase add one user / email ID which is not an apple ID under User and Groups >> Sandbox Account in iTunes account.
Refer below screenshot for the same
and If you are not able to get the IAP products from iTunes try this link and check wheather the store is working for you.
https://sandbox.itunes.apple.com/verifyReceipt?uo=8&at=11ld4k
if the link responsd with status code its working.
Resolved after signed the Apple Paid Applications contract.

Differentiating two Users for In-App Purchases in Application to Buy Non-Renewable Subscription by different users?

I am implementing In-App Purchases first time in my application and new to In-app purchases Store Kit.
I have few doubts regarding In-app purchases:
What happens if a user purchased a subscription and logged out from the application and another user logs in and trying to purchase the same?
Does iTunes allow the second user to use the First user's purchased product?
If it allows how can we handle the second user's subscription?
What details we will get post Successful/Failed transactions from itunes to save in my database?
For a non-renewing subscription then it is entirely up to you to track expiration and determine what content a user has access to and when.
For example, say your subscription gave access to "the word of the day". If the subscription was active for the month of January, then the user would receive access to new words each day in January. The user should continue to be able to see January's words even after the subscription expires, but no new words.
If they resubscribe in March then they would now get new words throughout March.
You need to track all of this on your server against the user account.
Non-renewable subscription IAPs act much like consumable IAPs. The "Restore purchases" Store Kit function does not restore non-renewable IAP items.
To answer your specific questions:
If a new user logs in to your account system in the app (but the same iTunes account is still active on the device) then a second purchase will succeed and you need to update the subscription start and end dates for the new active account on your server.
You also need to cater for the following:
- The original account logs back in; In this case the original subscription entitlements need to be available
- The original or second account log in to another device; Again, the accounts subscription entitlements need to be available.
No, since non-renewing subscriptions are not restorable, the second user cannot "use" the first user's subscription.
You handle each account in your system independently.
Information about the mechanics of the purchase process are described in the In App Purchase Programming Guide

iOS In-App Purchase Auto-Renewing Subscription Management

I am implementing auto-renewable subscriptions in iOS and want to be able to test the scenario where the user cancels the subscription but I am unable to do so because when I try to manage subscriptions with the sandbox account the app store wants me to associate a payment method with the sandbox account but in my experience once I do that the sandbox account is no longer valid.
Is it even possible to test cancellations or do I just blindly code for cancellations? I have search high and low and have not found anyone who has been able to manage subscriptions in a sandboxed environment.
I realized today that I was thinking about this all wrong and I can see why its not as necessary to be able to manage subscriptions. I was thinking that the 'Cancellation Date' field would reflect when a user cancel's (or really just opts out of auto-renewing) their subscription. But I was mistaken this field is only for the times when a user contacts Apple Support and requests to cancel early and receive some sort of a refund, and this is not something that is managed directly by a user.
Have you tried using a TestFlight build? You can do sandbox IAP testing via TestFlight with a "normal" iTunes account that has a payment method. I would assume that means you could try out canceling the subscription.

Testing Auto-renewing in-app purchase in sandbox environment

I have an app in which, content is uploaded on weekly basis and hence using Auto-renewing subscriptions is the best option. Once the user subscribes for a weekly subscription, he is charged on weekly basis until he opts out.
I researched on how to unsubscribe and I read there is no api call or no other way to implement this from the app. The user has to manually turn it off from iTunes & App Store. Is that true ?
Question: I am testing with a sandbox account so is there a way to Manage subscriptions i.e stop subscription to that particular app? I want to turn off the weekly subscription and then try again to turn it on from app. I could not turn it off from device. So is it because I am using sandbox account?
Please reply! Thanks in advance!

Resources