Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My ios application is always asking me to Sign In to iTunes Store

I'm developing an ios Application with IAP feature. It works well. But I encountered a strange issue today. It always show me a message to ask me to "Sign In to iTunes Store" for some reasons. Here is the screenshot:

It always shows this every time when I start the application or resume from background. It even still shows this after I delete and reinstall the application. When I setup breakpoints in my source code. There is no any transaction,payment delegate callbacks. Can anybody tell me what the reason is ? Could it be the problem of Apple IAP Sandbox? (I run the same application in other devices without any problem. I can purchase, restore in Sandbox.)

enter image description here

like image 993
Bagusflyer Avatar asked Apr 16 '14 03:04

Bagusflyer


People also ask

Why does the App Store keep telling me to sign into iTunes?

Answer: A: A request for another Apple ID password is often caused by updates to apps/purchases that were made when using the other ID. Those purchases are tied to the other ID and can't be transferred. One option is to delete the apps/purchases made by the other ID and download them using the new ID if desired.


1 Answers

I've had this problem too a couple of times, it turned out I was stopping processing of transactions before calling finishTransaction on all queued transactions. I was forgetting to finish failed transactions in the particular case.

So, you could try letting your application run once and call finishTransaction for each and every one in your observer delegate like this:

-(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions 
{
   foreach(SKPaymentTransaction *tr in transactions) [queue finishTransaction:tr];
}

i.e. finish every transaction irrespective of transaction state. After the test run revert to your original handling code.

Hope this helps.

like image 75
mpramat Avatar answered Nov 14 '22 00:11

mpramat