tikhop / TPInAppReceipt

Reading and Validating In App Purchase Receipt Locally.
MIT License
631 stars 93 forks source link

Is it expected to see 'Sign in with Apple ID' alert dialog while using TPInAppReceipt? #78

Closed dev893 closed 3 years ago

dev893 commented 3 years ago

Hello,

Thank you for this library. I encountered something strange that I have never encountered before, not in my regular iOS use. I am trying to understand if this is expected behavior.

In devices & simulators where Apple ID is already signed in & enabled, I am seeing the 'Sign in with Apple ID' alert dialog popping up after my app executes the following code.

    if let receipt = try? InAppReceipt.localReceipt() {
        ....
    } else {
        InAppReceipt.refresh { (error) in
            if let err = error {
                ...
            } else {
                if let receipt = try? InAppReceipt.localReceipt() {
                    ...
                }
            }
        }
    }

Is this normal? I wasn't sure if this is something that only happens in debug build or if this is something that will also be going to happen after the app is published to the app store.

It was strange to see this because the device is already signed in with Apple ID. I am a bit wary as if this happens even after the app gets downloaded from Appstore, some of the users will think that the app is making a phishing attempt.

tikhop commented 3 years ago

Hi @dev299,

As I know, refreshing in-app receipt triggers sign-in alert. When you are running your app in sandbox mode (debug) for the first time you won't have in app receipt until you either refresh a local receipt or make a purchase. However, when you download the app from AppStore, receipt will be there.

dev893 commented 3 years ago

I see. Thank you.