SwiftyStoreKit icon indicating copy to clipboard operation
SwiftyStoreKit copied to clipboard

How to avoid "Sign in to iTunes" popup on every app launch

Open natacodes opened this issue 5 years ago • 5 comments

Platform

  • [x] iOS

In app purchase type

  • [x] Non-consumable
  • [x] Auto-Renewable Subscription

Environment

  • [x] Sandbox

Version

0.13.3

Report

Issue summary

I'm only allowing users to access the app after they buy a subscription. To make sure that the auto-renewable subscription is still active I call SwiftyStoreKit.verifyReceipt and SwiftyStoreKit.verifySubscriptions to receive all the receipts and check the expiration date every time the app is launched. Calling those methods causes "Sign In To iTunes Store" pop-up appear every time.

Is there a good way to avoid those popups while still being able to verify that the subscription is still active on each app launch?

One possible solution would be for me to keep the receipts on my own backend and verify them first instead of going straight to iTunes Store. Is that what everyone is doing?

natacodes avatar Oct 06 '18 23:10 natacodes

+1

julius94 avatar Oct 15 '18 05:10 julius94

Have you tried setting forceRefresh to false? This will use the local receipt if available. As soon as a user completes a purchase or restores purchases, StoreKit creates and stores the receipt locally as a file. You can use this receipt and verify it without having the user sign in.

ArtappsLaurens avatar Oct 15 '18 21:10 ArtappsLaurens

Seems local receipt file not update after purchase or restore , Purchase Success: com.test123.test and then next launch verifyPuerchase : The user has never purchased com.test123.test This is strange , not every time print "The user has never purchased" , but almost 90% print "The user has never purchased" Any idea ?

FlashTang avatar Dec 09 '18 09:12 FlashTang

+1

screenworker avatar Feb 17 '19 13:02 screenworker

is there any solution to this issue?

ozanyukruk avatar Dec 30 '20 08:12 ozanyukruk