app is asking for AppleID when being run
Asked Answered
C

3

5

I am updating my iOS app with the Apple suggested transaction VerificationController code to verify in-app purchases due to the recent "hack" published that allowed people to purchase in-ap purchases without paying due to spoofed receipts from spoofed Apple servers.

I have everything integrated, and am now testing. I have run the app several times and the verification stuff has run several times.

I want to test everything about purchasing including starting with a fresh brand new app and AppleID. So I deleted the app completely off my testing device. I created a brand new "test user" AppleID in iTunes Connect. I went to the Settings app on my test device, went to Store, and changed the default AppleID for the device to this newly created AppleID.

I re-run the app from Xcode with the debugger, which re-installs the App onto the testing device and runs it fresh.

The problem is that almost immediately on launch, the testing device puts up the AppleID password Alert-type view and asks for the password for the old AppleID that I originally used to test everything including the original in-app purchase and the verification for it. It does not ask for the password for the new device AppleID as set in the Settings app under store.

When I run it as a new app, the verification code does not run and no code from any of my routines that do anything with the Apple StoreKit stuff is run except for a solitary

[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

(observer is my delegate object for the StoreKit stuff and is created but no routines in it run except init and init does nothing except set a static variable for itself to create a singleton type class)

For checking purposes, I also added in

NSLog(@"in App Delegate, payment queue transactions are %@", [[SKPaymentQueue defaultQueue] transactions]);

which shows no old transactions hanging around.

I have no clue on why it has started to ask for my AppleID of the original test user when the App is newly installed, the AppleID for the store for the device is different, and I can identify no code being run that accesses the StoreKit (except as mentioned above).

ANy insight into this would be appreciated.

ETA: Touching CANCEL in the password dialog does not cause any extra code to run in the app and does not prevent the app from running.

If I then go into the in-app purchase screen (where the app queries the store for available in-app purchases), it asks for the password again in the same way, on the OLD AppleID. I can cancel and nothing seems to happen. If I actually touch "restore purchases" button in my app, it then asks for the password on the new AppleID as set up in the Store settings. I have not gone past this point as I want to understand what is going on and don't want to mess things up by completing/attempting the restore or purchase under the new AppleID.

Thanks

Courage answered 26/7, 2012 at 0:20 Comment(2)
Have you solved it somehow ?Penitentiary
@bluesm I never did solve the problem and no longer really use that device I was having the issues with. Sorry. I may eventually try and come back to it as I still have that device in a drawer...Courage
G
7

I had exactly the same problem and struggled for hours to solve it.

As previously mentioned, StoreKit works system-wide and the system keeps asking for login for any transaction for which

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

has not been called. I was using RMStore, looked at the source code I found this suspect lines:

if (error.code != RMStoreErrorCodeUnableToCompleteVerification) { 
    // If we were unable to complete the verification we want StoreKit to keep reminding us of the transaction
    [queue finishTransaction:transaction];
}

This is probably what happened:

  • I first purchased the product with my test Apple ID
  • I deleted the product for test purposes
  • I tried to purchase it again. At this point I entered wrong credential and RMStore did not call [[SKPaymentQueue defaultQueue] finishTransaction:.
  • The app started asking for login at every startup.

I tried to login with a different test account but still the same alert asking to login with the old Apple ID. I also deleted the Apple ID on iTunes Connect but this did not help.

Finally I managed to solve by Restoring (not Purchasing) the product with the same account. I don't know if there is another way to solve this issue (i.e. to reset the StoreKit queue). Anyway always remember to call finishTransaction in your code.

Greasepaint answered 12/7, 2014 at 9:54 Comment(1)
Thank you! I just logged in as my test user, hit my "restore" button. Then quit and restarted and the login didn't happen. The timing of the login window was so weird. Even debugging line-by-line it consistently happened at something completely unrelated to StoreKit.Charcuterie
H
2

StoreKit.framework works system-wide, so the Apple ID that gets displayed doesn't have anything to do with your app, and reinstalling the app will not have any influence.

However, you can log out from the iTunes Store / App Store:

  1. Tap Settings → iTunes & App Stores
  2. Tap the Apple ID signed in (button at the top)
  3. Tap "Sign Out"

When you then use your app again, StoreKit should prompt for both email and password.

Halfhearted answered 11/4, 2013 at 16:16 Comment(4)
I don't know if you saw the comments that the AppleID is not related to the one stored in settings ("the AppleID for the store for the device is different")Courage
It's almost as if iOS has stored information somewhere saying "this app is requesting previous purchase information" and can't help but asking for it on subsequent loads. Only deleting the app got rid of it for me.Huang
@Courage Ah, sorry, didn't understand you correctly there. Not sure what's going on then. :(Halfhearted
@AndreasLey no harm no foul ;). The device I had this issue with is no longer my main device, though I have not worked on this app since due to other paying gigs, so I am not sure where I stand on this issue at the moment. I'll be back on it shortly unless people come out of the woodwork with paying work...Courage
T
-1

Steps to Fix:

  1. Starting at the App Store, pull up the multi-task bar and tap the Settings app.
  2. Scroll down and tap 'General'.
  3. Scroll down and tap 'Date & Time'.
  4. If the 'Set Automatically' switch is ON, turn it OFF.
  5. Tap 'Set Date & Time'.
  6. Tap the field that says "[day of the week], [month][day], 2013".
  7. Adjust the year wheel to say "2012" and back out of the Date & Time section.
  8. Multi-task back to the App Store and attempt to download the app again.
  9. Tap 'Cancel' on the "Cannot connect…" modal.
  10. Return to the native Settings > General > Date & Time > Set Date & Time.
  11. Go back to the month, date, year wheels and change the year to "2030".
  12. Back out to the home screen and launch the App Store.
  13. A "Cannot connect to the Store" modal should appear right away.
  14. Tap 'OK' and then multi-task back to Settings.
  15. Return all the way back to the month, date, year wheels again and change the year back to "2013.
  16. Multi-task back to the App Store and attempt to download the app again.
Tedric answered 14/4, 2013 at 22:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.