-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Store login popup appearing all the time! #307
Comments
@funkenstrahlen I am facing the same issue. Were you able to find a fix for this one yet ? |
I could not find out the source of the issue. It looks like it does refresh the receipt from the App Store. However after looking at the code this should not happen because the receipt is already stored on disk. I will try to find out more via debugging. |
I had the same issue, its an issue of sandbox I think because once in production it doesn't happen. just make sure you are verifying in production and not in sandbox. |
@SirComet Thank you for your answer! How can I be sure this does not happen in production too? There seems to be no way to test this via Testflight because this will use the Sandbox backend too. I really do not want to release my app as long as I can not be sure this works correctly because it is extremely annoying for the users. |
I read about a way to test this but have not confirmed yet:
|
I did some debugging on this. Subscription verification runs with the commands listed above perfectly fine and seems to have nothing to do with the login popup. I found a suggestion that I have an unfinished transaction. However I can not see any transaction being passed to me in applicationDidBecomeActive. I also am sure to finish all transactions correctly. Any further ideas? |
Thank @funkenstrahlen |
The request for password I see is for my actuall AppleID but in the sandbox environment. The weird thing is: This seems to happen very randomly. Sometimes it takes 20s after I launch the app until the popup occurs. All of my code that has something to do with subscriptions is finished already (verified through logging). I feel like my code has NOTHING to do with this popup. I did not have this issue before working with IAP. However even installing an old version from TestFlight which does not have any IAP in it does bring up the popup now. I am really out of ideas why this does happen. |
Same problem here, I hoped this has something todo with the sandbox environment and submitted the app anyway but Apple rejected it because of "Unable to access app due to 'Sign In to iTune Store' prompt". When I remove all my IAP code it stops appearing. Happy for any help and suggestions. |
@funkenstrahlen thank you for the report and apologies for the late reply. Yes, the login popup is something that I have previously seen myself and I suspect it is to do with unfinished transactions. I have even seen it appearing randomly while using other apps, likely because once a purchase is started, it can continue even if the app is backgrounded or killed. Like everyone else, I don't have clear reproduction steps and I haven't found a reliable way of testing this in sandbox / production. I'll try to spend a bit of time on this and see if I can be of any help. |
Interesting. This did not have the same effect for me.
This was also my initial thought and is also suggested on many forum threads. However how can I debug this? All approaches to find out what's going on did not help: I added logging to my code in App Delegate that does check for new unfinished transactions. It does reliably get called when the subscription does auto renew and it finishes the transaction. I can confirm it finished because it does not appear in the queue again. I also can confirm the popup is not related to an unfinished transaction that is hanging in the queue because of messing around with iTunes Connect sandbox users. I see this error also on test devices that only have seen the app version I released via Test Flight. On these devices I only use the main device Apple ID to test the IAP. On these devices the popup does also appear very often. Very weird: Even after removing the app from my devices I still sometimes see the popup requesting a login?! This really confuses me. Previously I talked about this approach to test in production:
This does only work if the app is not released on the App Store yet. As I am working on an app update to include subscriptions this does not work for me. |
I discovered a bug in |
This issue may be related to #288. |
This is the code I execute in App Delegate when my app is launched: static func completeIAPTransactions() {
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in
var isVerifySubscriptionRequired = false
for purchase in purchases {
if purchase.needsFinishTransaction {
SwiftyStoreKit.finishTransaction(purchase.transaction)
}
switch purchase.transaction.transactionState {
case .purchased, .restored, .failed: isVerifySubscriptionRequired = true
default: break
}
}
if isVerifySubscriptionRequired {
verify(.premiumOneYear)
}
}
} As I use I basically finish all transactions that require it. Because checking subscription status is done independantly on the receipt. |
@funkenstrahlen Do your popups look like this? I have seen them randomly appearing outside the app. |
I run via TestFlight. The popup looks like this for me (explicitly referring to the sandbox environment). I also see the popup in your second screenshot but this only happens when I logout of my regular Apple ID in iOS settings App Store and use a special sandbox testing account. When running in TestFlight I do not see the seconds kind of popup. I also do not feel like the "login in settings" popup is related to the issue. |
@funkenstrahlen To diagnose your problem, I would try to determine if the login popup is triggered by Could you try the following scenarios in AppDelegate and report in which cases the popup appears?
|
@bizz84 I already did have this idea and tried to investigate exactly like this. I learned that even if I do not call anything the popup still appears. See #307 (comment) Does it help if I also test for the two other cases you mentioned? |
@funkenstrahlen If you don't call anything and still get a popup then I can only think somehow there is some internal state set by StoreKit at the system level for your app. Nasty issue this is. It would really help if we could get consistent reproduction steps. Maybe I'll try to test a few scenarios, write down steps and take screenshots. |
@bizz84 Yes this is really a difficult issue because it is so hard to debug. I am currently running a version of my app on my device directly from the App Store. This version does not contain any IAP code (this is the old version). I do not get the popup at every app launch now. It still does appear from time to time though. It even does popup 10 times repeating then! So weird :O |
@funkenstrahlen I also noticed the login popup outside the app even though all the transactions are finished. After some research, I found this: I think what is happening is that auto-renewable subscriptions add new transactions to the queue when they get renewed. This can be particularly annoying in sandbox mode as the durations are compressed:
So it could be that StoreKit adds new transactions and these trigger the popup at random times. This theory is also confirmed as sometimes I get new transactions in A few things to test:
|
@bizz84 You are right. I am aware that auto-renewable subscriptions do automatically renew 6 times in the sandbox environment. I did confirm with logging that the auto-renew process is registered as a new transaction in my app and gets finished successfully. This is why I know I can process new transactions in App Delegate successfully when they actually appear in the queue. I understand your idea that this can cause the popup to appear even when the app is not running. However I also see this popup after all 6 renew transactions are finished and my app goes back to invalid subscription purchase state because the user is no longer premium.
This is actually an interesting question. Let's see if we can find out. |
@funkenstrahlen I've been doing some testing with a weekly subscription on sandbox. Test 1When purchasing a subscription, I got this message: After the purchase, I've been able to verify that every three minutes I get a new item in the receipt. Test 2I purchased a subscription, and logged out of my sandbox account in Settings.
So it looks like signing out stops the subscriptions from renewing (maybe this is what the message about cancelling a subscription in Settings means). Still, no answer to the random login popups. |
As far as I know this is how it is supposed to be?
I do not think this is correct. Signing out should have no effect on subscription renewal. However as long as your are signed out you will not get transaction updates in the app of course. When you log back in you should see multiple auto renewals then. The message about subscription cancelation in Settings is not working in sandbox mode. This message is intended to production use because you can get to your manage subscriptions page from iOS Settings. This is only available for real Apple IDs. Sandbox subscriptions can not be cancelled manually. This is why they stop renewing automatically after 6 renewals. |
Hi, just want to chip in, we've been observing incessant login popup for consumable iap, not subscription. It's been quite a nightmare for our Beta tester as the popup shows 10-20 times a day |
Hello there, however I use the non-consumable iap, it also does popup. And for my experience, it can be reproduce through TestFlight:
|
I have just got into this situation as well. I'll try to explain my use case: I am just implementing subscriptions. After creating a subscription on iTunes connect and testing it with my real account in the app, the popup starts appearing. Even if I remove all the code related to SwiftyStore Kit, the popup is showing all the time. I'm really frustrated. |
What about the possibility this is no issue in this framework but actually a bug from Apple? |
same issue here. Noticed that:
The "second" print never gets printed. |
My guess is that the callback only gets called when there is actually a purchase in the queue. Just take a look at the source code. It’s all here. We can discuss of course if this is a good expected behaviour of this callback or not. But this should be the topic of another thread maybe? What do you think? |
I have one user on test flight beta who reported the login popups are fixed since he upgrade to 11.3 beta. I could not test this myself yet though. |
I'm continuously getting the login popup (sandbox). |
Now you have reached the same dead end as everybody else in this thread. |
Hi. Wondering if anyone has resolved this issue?! |
Sadly, no. However it will go away when user download your app from App Store. |
Is this 100%? That means it only doesn't work on TestFlight? |
Sence I published my app to Appstore, it has been 7 days, all good now....... |
One more question: do you receive a lag between sign in and the pop up that says purchase? |
sometimes? I don't think so. |
I've been dealing with the exact same issues for auto-renewables as everyone else in this thread. Hopefully 11.3 becoming widely available will put this to rest for future IAP implementers. |
I have the same issue. I suspect it is because iOS is automatically checking the the app receipt. When you do an in-app purchase another receipt is added and because of the testing, some or all, of these are signed with your test user id. iOS automatically checks and potentially updates this chain of receipts linked to your app and it needs you to log in so that in can validate the signature on the receipts. But because of the sandbox environment you are somehow not properly logged in, or at least it kicks users out quickly. I have not found a solution for this |
I confirm that the bug is fixed on iOS 11.3 (Beta). Careful though; I had to:
just to test it. That's about 15GB of downloads and several hours of idling |
Thank you for testing this an letting us know! I really think we can hopefully mark this issue as closed as soon as iOS 11.3 is released. |
I can confirm this is fixed in iOS 11.3. |
What about old iPhone models? (( |
I have the same problem with annoying requesting password. iOS 11.4.1 |
I have the same problem with annoying requesting password. iOS 11.4.1 |
Same issue. Started with iOS 12... |
+1 here. |
+1 same issue. Worked fine until iOS 12. |
When I call this:
It first asks me to enter password and then after purchase is complete it shows "Sign-In Required alert". Purchase is OK even if I tap cancel on second alert. I am testing with sandbox user on iOS 12. I have tried purchasing product in another app that doesn't use this library but native StoreKit implementation, behavior is the same. It seems Apple messed something on iOS 12, at lease on sandbox. Edit: I've done some tests Test 1: iOS 10.3.3, sandbox user, iphone 5, SwiftyStoreKit Test 2: iOS 12.0.1, sandbox user, iphone 7, SwiftyStoreKit Test 3: iOS 12.0.1, sandbox user, iphone X, SwiftyStoreKit Test 4: iOS 12.0.1, sandbox user, iphone 7, StoreKit Conclusion: Test 3 is interesting bcs I thought this was related to iOS 12, but it seems it is also related to some other factor. The difference is that I am using iphone 7 privately and it is tied to my icloud account, also I am using it with my normal itunes account for purchases. I hope this only happens on sandbox environment. |
@DanijelHuis: Try to remove your app from your iPhone 7 and Log Out from both of your normal and sandbox accounts in Settings. |
Hello, |
This answer helped me: https://stackoverflow.com/questions/51820800/receipt-validation-before-showing-iap-page |
OS: macOS 10.15.5 I am getting this each time when I called verifyReceipt method. |
Platform
In app purchase type
Environment
Version
0.11.0
Related issues
Report
Issue summary
I call
verifyReceipt
andverifySubscription
inapplicationDidFinishLaunchingWithOptions
to verify that the user is still a valid subscriber of my premium service.Right now in Test Flight beta testing I see the App Store login alert popping up every time I open the app. This is very annoying.
Is there a better best practise way to verify subscription status? I know Apple recommends doing this via my own server, but I do not want to go this way.
What did you expect to happen
No popup to sign in. Verification runs in the background.
What happened instead
Right now in Test Flight beta testing I see the App Store login alert popping up every time I open the app.
The text was updated successfully, but these errors were encountered: