bizz84 / SwiftyStoreKit

Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺
MIT License
6.58k stars 795 forks source link

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

Open natacodes opened 6 years ago

natacodes commented 6 years ago

Platform

In app purchase type

Environment

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?

julius94 commented 6 years ago

+1

ArtappsLaurens commented 6 years ago

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.

FlashTang commented 5 years ago

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 ?

screenworker commented 5 years ago

+1

ozanyukruk commented 3 years ago

is there any solution to this issue?