Question

Problem with testflight purchase

  • 23 August 2021
  • 4 replies
  • 61 views

Badge

I have a problem with my app. As long as I installed the app to my iPhone with Xcode, everything was working (Apart from the fact that having configured the products from the Xcode file and not from the App Store, in the end the purchase failed). Now that I uploaded the app to testflight, when purchasing a product I can’t even see the iOS purchase popup. Could It be the fact that there is no longer the Xcode purchases configuration file and that the one on the App Store hasn’t been approved yet? I can I fix that? 


4 replies

Userlevel 2
Badge +6

Hey @Alessandro Bortoluzzi :wave: ,

 

I’m not exactly sure what might be causing this issue without debug logs. 

Could you send debug logs that reproduce this? You can enable debug logs by following this guide. After they're enabled you'll see logs like this in the console:
 

[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate


Please ensure the debug logs include the entire app life-cycle, including the messages printed during initialization of the SDK. The more information you include here, the better we'll be able to help.

 

Let me know if you have any questions!

Badge

@jazmine here are the logs:

2021-08-24 08:05:34.834471+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Debug logging enabled

2021-08-24 08:05:34.834558+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ SDK Version - 3.12.3

2021-08-24 08:05:34.834596+0200 Do[1567:1067737] [Purchases] - DEBUG: 👤 Initial App User ID - (null)

2021-08-24 08:05:35.393606+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

2021-08-24 08:05:35.571064+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PurchaserInfo cache is stale, updating from network in foreground.

2021-08-24 08:05:35.577160+0200 Do[1567:1067737] [Purchases] - DEBUG: 😻 PurchaserInfo updated from network.

2021-08-24 08:05:35.577213+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Offerings cache is stale, updating caches

2021-08-24 08:05:35.581340+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET /subscribers/$RCAnonymousID0X0P+0e24ac8a75e0148769c8a02fb6ed55c3b

2021-08-24 08:05:35.581400+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b

2021-08-24 08:05:35.584787+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b/offerings

 

2021-08-24 08:05:36.767062+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b/offerings 304

2021-08-24 08:05:36.776082+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b 304

2021-08-24 08:05:36.784101+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ Serial request done: GET /subscribers/$RCAnonymousID0X0P+0e24ac8a75e0148769c8a02fb6ed55c3b, 0 requests left in the queue

 

2021-08-24 08:07:04.676054+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Requesting products from the store with identifiers: {(

    advPublishing

)}

2021-08-24 08:07:04.727876+0200 Do[1567:1068451] [Purchases] - DEBUG: ℹ️ Products request finished.

2021-08-24 08:07:04.727949+0200 Do[1567:1068451] [Purchases] - DEBUG: 💰 Retrieved SKProducts:

2021-08-24 08:07:04.728001+0200 Do[1567:1068451] [Purchases] - DEBUG: 💰 advPublishing - <SKProduct: 0x2821b1df0>

2021-08-24 08:07:04.728043+0200 Do[1567:1068451] [Purchases] - DEBUG: ℹ️ 1 completion handlers waiting on products

2021-08-24 08:07:04.729296+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ makePurchase

2021-08-24 08:07:04.730579+0200 Do[1567:1067737] [Purchases] - DEBUG: 💰 Purchasing product - advPublishing

2021-08-24 08:07:04.731035+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: advPublishing (null) ((null)) (null) - 0

2021-08-24 08:07:09.128481+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

2021-08-24 08:07:10.364074+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: advPublishing 2 ((null)) (null) - 1

2021-08-24 08:07:10.364969+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/F29EC124-B8A5-403C-8AC2-77E0452633E0/StoreKit/sandboxReceipt

2021-08-24 08:07:10.365503+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: $RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b

2021-08-24 08:07:10.371268+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST /receipts

2021-08-24 08:07:10.371600+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts

2021-08-24 08:07:10.526788+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

2021-08-24 08:07:11.365856+0200 Do[1567:1068479] [Purchases] - DEBUG: ℹ️ API request completed with status: POST /v1/receipts 304

2021-08-24 08:07:11.366996+0200 Do[1567:1068479] [Purchases] - ERROR: 😿‼️ The receipt is not valid.

2021-08-24 08:07:11.367592+0200 Do[1567:1068479] [Purchases] - DEBUG: ℹ️ Serial request done: POST /receipts, 0 requests left in the queue

The receipt is not valid.

Purchase failed

2021-08-24 08:07:11.371725+0200 Do[1567:1067737] [Purchases] - DEBUG: 💰 Finishing transaction advPublishing 2 ((null))

2021-08-24 08:07:11.416829+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PaymentQueue removedTransaction: advPublishing 2 ((null) (null)) (null) - 1

Badge

Hey @Alessandro Bortoluzzi :wave: ,

 

I’m not exactly sure what might be causing this issue without debug logs. 

Could you send debug logs that reproduce this? You can enable debug logs by following this guide. After they're enabled you'll see logs like this in the console:
 

[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate


Please ensure the debug logs include the entire app life-cycle, including the messages printed during initialization of the SDK. The more information you include here, the better we'll be able to help.

 

Let me know if you have any questions!

 

@jazmine here are the logs:

2021-08-24 08:05:34.834471+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Debug logging enabled

2021-08-24 08:05:34.834558+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ SDK Version - 3.12.3

2021-08-24 08:05:34.834596+0200 Do[1567:1067737] [Purchases] - DEBUG: 👤 Initial App User ID - (null)

2021-08-24 08:05:35.393606+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

2021-08-24 08:05:35.571064+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PurchaserInfo cache is stale, updating from network in foreground.

2021-08-24 08:05:35.577160+0200 Do[1567:1067737] [Purchases] - DEBUG: 😻 PurchaserInfo updated from network.

2021-08-24 08:05:35.577213+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Offerings cache is stale, updating caches

2021-08-24 08:05:35.581340+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET /subscribers/$RCAnonymousID0X0P+0e24ac8a75e0148769c8a02fb6ed55c3b

2021-08-24 08:05:35.581400+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b

2021-08-24 08:05:35.584787+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b/offerings

 

2021-08-24 08:05:36.767062+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b/offerings 304

2021-08-24 08:05:36.776082+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/$RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b 304

2021-08-24 08:05:36.784101+0200 Do[1567:1067769] [Purchases] - DEBUG: ℹ️ Serial request done: GET /subscribers/$RCAnonymousID0X0P+0e24ac8a75e0148769c8a02fb6ed55c3b, 0 requests left in the queue

 

2021-08-24 08:07:04.676054+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Requesting products from the store with identifiers: {(

    advPublishing

)}

2021-08-24 08:07:04.727876+0200 Do[1567:1068451] [Purchases] - DEBUG: ℹ️ Products request finished.

2021-08-24 08:07:04.727949+0200 Do[1567:1068451] [Purchases] - DEBUG: 💰 Retrieved SKProducts: 

2021-08-24 08:07:04.728001+0200 Do[1567:1068451] [Purchases] - DEBUG: 💰 advPublishing - <SKProduct: 0x2821b1df0>

2021-08-24 08:07:04.728043+0200 Do[1567:1068451] [Purchases] - DEBUG: ℹ️ 1 completion handlers waiting on products

2021-08-24 08:07:04.729296+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ makePurchase

2021-08-24 08:07:04.730579+0200 Do[1567:1067737] [Purchases] - DEBUG: 💰 Purchasing product - advPublishing

2021-08-24 08:07:04.731035+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: advPublishing (null) ((null)) (null) - 0

2021-08-24 08:07:09.128481+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

2021-08-24 08:07:10.364074+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: advPublishing 2 ((null)) (null) - 1

2021-08-24 08:07:10.364969+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Loaded receipt from url file:///private/var/mobile/Containers/Data/Application/F29EC124-B8A5-403C-8AC2-77E0452633E0/StoreKit/sandboxReceipt

2021-08-24 08:07:10.365503+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ Found 0 unsynced attributes for App User ID: $RCAnonymousID:e24ac8a75e0148769c8a02fb6ed55c3b

2021-08-24 08:07:10.371268+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request POST /receipts

2021-08-24 08:07:10.371600+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ API request started: POST /v1/receipts

2021-08-24 08:07:10.526788+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive

2021-08-24 08:07:11.365856+0200 Do[1567:1068479] [Purchases] - DEBUG: ℹ️ API request completed with status: POST /v1/receipts 304

2021-08-24 08:07:11.366996+0200 Do[1567:1068479] [Purchases] - ERROR: 😿‼️ The receipt is not valid.

2021-08-24 08:07:11.367592+0200 Do[1567:1068479] [Purchases] - DEBUG: ℹ️ Serial request done: POST /receipts, 0 requests left in the queue

The receipt is not valid.

Purchase failed

2021-08-24 08:07:11.371725+0200 Do[1567:1067737] [Purchases] - DEBUG: 💰 Finishing transaction advPublishing 2 ((null))

2021-08-24 08:07:11.416829+0200 Do[1567:1067737] [Purchases] - DEBUG: ℹ️ PaymentQueue removedTransaction: advPublishing 2 ((null) (null)) (null) - 1

 

Is it possible that I have to upload the app to the App Store as private and wait apple to allow the app and the in app purchases so that it can work on TestFlight?

Userlevel 2
Badge +6

Hey @Alessandro Bortoluzzi :wave: ,

Thanks for providing those logs! I was able to locate the following error. 

2021-08-24 08:07:11.366996+0200 Do[1567:1068479] [Purchases] - ERROR: 😿‼️ The receipt is not valid.

We have the following documentation on this error in our docs on Error Handling

This error indicates an error with configuration and usually occurs in the sandbox environment.

If testing with StoreKit Configuration Files:

Some other places to check:

Reply