react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

requestSubscription withOffer alert message: Unable to Purchase

Open caoyongfeng0214 opened this issue 7 months ago • 14 comments

Description

if not use withOffer, it work.

if used withOffer, the purchase process was unsuccessful.

On TestFlight, When the requestSubscription is called, the product information will pop up, and the user name and password will also be requested.

Alert message ' Unable to Purchase, Contact the developer for more infomation ' after submit password.

Here's my code:

let productId = 'xxxx';

// https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/generating_a_promotional_offer_signature_on_the_server?language=objc
let withOffer = await http.post('https://xxx/signature-with-offer', { ... });

requestSubscription({
    sku: productId,
    appAccountToken: 'a-uuid',
    withOffer: withOffer
})

Environment:

  • react-native-iap: 12.11.0
  • react-native: 0.72.6
  • Platforms (iOS):

caoyongfeng0214 avatar Nov 26 '23 19:11 caoyongfeng0214

The correct method is to obtain the offerToken through getSubscriptions and submit the subscription through the requestSubscription method.

isnolan avatar Nov 30 '23 01:11 isnolan

The correct method is to obtain the offerToken through getSubscriptions and submit the subscription through the requestSubscription method.

offerToken only exists on android platform, and I'm using ios.

caoyongfeng0214 avatar Dec 01 '23 08:12 caoyongfeng0214

@caoyongfeng0214 @yhostc I'm getting one issue where everything works fine in test flight version when I click on Subscribe button and it calls requestSubscription method of react-native-iap package, but in release version it is showing like this: Screenshot 2023-12-01 at 19 12 25

What would be the issue?

premj-ekah avatar Dec 01 '23 13:12 premj-ekah

@caoyongfeng0214 @yhostc I'm getting one issue where everything works fine in test flight version when I click on Subscribe button and it calls requestSubscription method of react-native-iap package, but in release version it is showing like this: Screenshot 2023-12-01 at 19 12 25

What would be the issue?

Do you also used withOffer?

caoyongfeng0214 avatar Dec 01 '23 15:12 caoyongfeng0214

No

premj-ekah avatar Dec 01 '23 15:12 premj-ekah

Issue is resolved I updated the library to 12.10.0 and it's working fine now. Thanks!

premj-ekah avatar Dec 08 '23 05:12 premj-ekah

The correct method is to obtain the offerToken through getSubscriptions and submit the subscription through the requestSubscription method.

offerToken only exists on android platform, and I'm using ios.

The correct method is to obtain the offerToken through getSubscriptions and submit the subscription through the requestSubscription method.

offerToken only exists on android platform, and I'm using ios.

Have you resolved this issue? I also cannot find the offer code from the subscriptions object.

PasinduWeerakoon avatar Feb 07 '24 13:02 PasinduWeerakoon

I'm getting the same issue, is there any solution, or is anyone able to get a workaround? @caoyongfeng0214

itsaliraxa avatar Mar 14 '24 18:03 itsaliraxa

@itsaliraxa have you tried with 12.10.0 version?

premj-ekah avatar Mar 15 '24 04:03 premj-ekah

no, I'm using the latest version v12.13.0.

On Fri, Mar 15, 2024 at 9:32 AM premj-ekah @.***> wrote:

@itsaliraxa https://github.com/itsaliraxa have you tried with 12.10.0 version?

— Reply to this email directly, view it on GitHub https://github.com/dooboolab-community/react-native-iap/issues/2628#issuecomment-1998919175, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4XC7STSDPSY77RVOCGDF4TYYJ2WVAVCNFSM6AAAAAA73BUWYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYHEYTSMJXGU . You are receiving this because you were mentioned.Message ID: @.***>

itsaliraxa avatar Mar 15 '24 16:03 itsaliraxa

@premj-ekah I've tried with v12.10.0, but got the same error. Please see the full details below

React-native: 0.71.11 react-native-iap: 12.10.0,

screenshots IMG_1355 IMG_1356 IMG_1357

error detail: { "message": "[E_UNKNOWN]: An unknown error occurred", "error": { "code": "E_UNKNOWN", "message": "An unknown error occurred", "userInfo": { "NSLocalizedFailureReason": "The server encountered an error", "AMSURL": "http://localhost:55939/WebObjects/MZBuy.woa/wa/inAppBuy", "AMSStatusCode": 200, "AMSServerErrorCode": 3903, "AMSServerPayload": { "dialog": { "m-allowed": false, "explanation": "Contact the developer for more information.\n\n[Environment: Xcode]", "okButtonString": "OK", "initialCheckboxValue": true, "defaultButton": "ok", "message": "Unable to Purchase" }, "jingleAction": "inAppBuy", "dsid": "17322632127", "failureType": "3903", "jingleDocType": "inAppSuccess", "pings": [], "cancel-purchase-batch": true }, "NSLocalizedDescription": "Server Error" } } } } } } }

itsaliraxa avatar Mar 17 '24 14:03 itsaliraxa

Hi @itsaliraxa, seems like something is missing when setting up for in app purchase in app store.

premj-ekah avatar Mar 17 '24 15:03 premj-ekah

Hi @itsaliraxa, seems like something is missing when setting up for in app purchase in app store.

How I can identify it? because when I am going to subscribe without an offer it works fine but if I use withOffer then getting this error.

itsaliraxa avatar Mar 17 '24 15:03 itsaliraxa

How I can identify it? because when I am going to subscribe without an offer it works fine but if I use withOffer then getting this error.

On Sun, Mar 17, 2024 at 8:05 PM premj-ekah @.***> wrote:

Hi @itsaliraxa https://github.com/itsaliraxa, seems like something is missing when setting up for in app purchase in app store.

— Reply to this email directly, view it on GitHub https://github.com/dooboolab-community/react-native-iap/issues/2628#issuecomment-2002501975, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4XC7SR6DJPCJF4USEZHRO3YYWWMVAVCNFSM6AAAAAA73BUWYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGUYDCOJXGU . You are receiving this because you were mentioned.Message ID: @.***>

itsaliraxa avatar Mar 18 '24 15:03 itsaliraxa