28

I integrate In-App purchase in my App, its working fine for purchase and restoring items. But one issue are there,

When I purchase the item using test1@gmail.com, its successfully purchase the item also restore working fine.

Now, I uninstalled apps from my device, also clear credential from iTunes & App Store. and again installed.

When I click on the restore button, then there are two Popup is display : one with test1@gmail.com , and Second one is Exiting or Create user.

Whenever I come from background to foreground, the Sign-In popup is display every time.

NOTE : I HAVE ALSO Call finishTransaction method. But its not work for me.

No One method is Called when Sign-In PopUp display.

enter image description here

How could I resolve this?

Hash
  • 4,647
  • 5
  • 21
  • 39
Kirit Modi
  • 23,155
  • 15
  • 89
  • 112
  • Do you implemented auto-renewal subscription in app? – Sagar Thummar Apr 03 '17 at 07:48
  • Well the user needs to be logged in, in order to make an In App Purchase. This is a system dialog displayed by the OS and has nothing to do with your app, neither does it provide any callbacks to your code via a delegate. – Lefteris Apr 06 '17 at 07:03
  • @Lefteris but user doesn't want purchase or restore at the time. although the popup display continuously. – Kirit Modi Apr 06 '17 at 07:10
  • 1
    Well you are obviously initializing something from StoreKit that triggers that. You might not call a method, but even doing the initialization of something from StoreKit, will trigger that – Lefteris Apr 06 '17 at 07:12
  • @Lefteris , if user want to purchase the item with other Apple ID. then I initialize, at that time have two popup. one popup with with email id, I have already purchase with this emailID. and other popup with new Sign-In. After cancel Both although one pop up of EmailID with sign-In is continuously . – Kirit Modi Apr 06 '17 at 07:17
  • I am getting the same behaviour for months now. I am even considering of removing my own beta application from my device. I don't even want to imagine what my users think of that. I want them to test an application and the system is giving multiple pop-ups every hour. Even when my app is in the background. – zirinisp Oct 23 '17 at 09:23
  • You all have to understand, that the app behaves differently while in Sandbox mode. It won't ask the user so many times to sign in when the app is live. I found a great article by someone that pointed out to this thing, but I can't find that article to reference here. There is even someone on this thread saying that after his app got approved and he put it for sale, the annoying popups stopped: https://github.com/bizz84/SwiftyStoreKit/issues/307 – Starsky Feb 17 '19 at 18:31

3 Answers3

1

As far as I know, this happens in two cases.

  1. There is a pending transaction. If some purchase transaction haven't finished yet, iOS will try to proceed that transaction automatically.

  2. Some of auto-renewable subscription should be renewed. iOS also automatically start a purchase transaction for auto-renewable transaction, if auto-renew setting is on and subscription is expired.

This is triggered when transaction observer is added to payment queue

[[SKPaymentQueue defaultQueue] addTransactionObserver: yourTransactionObserver];

In any case of them, you can put break point in your transaction observer

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

and grasp which transaction is processing.

Basically, SKPaymentQueue has no function to cancel ongoing transaction by the app, so you owe to proceed that transaction.

taka
  • 1,407
  • 5
  • 7
0

As you mentioned , 'Now, I uninstalled apps from my device, also clear credential from iTunes & App Store. and again installed.', you need to login with apple account in itunes on device to remove this pop up.

Tejas Chauhan
  • 29
  • 1
  • 7
-1

This happens sometime in sandbox environment not always. Once your app is live and in app purchases are approved by Apple, everything will work fine automatically.

However, your in-app purchase code flow should be correct. iOS automatically ask for login options if you have not logged in yet, otherwise it will show popup for entering password only and username/email will be auto filled.

Rajender Kumar
  • 1,377
  • 19
  • 32