AppsFlyerSDK / appsflyer-react-native-plugin

AppsFlyer plugin for React Native
MIT License
276 stars 197 forks source link

validateAndLogInAppPurchase not working on iOS #229

Closed jwebcat closed 3 years ago

jwebcat commented 3 years ago

Report

Plugin Version

6.1.20

On what Platform are you having the issue?

ios

What did you do?

installed latest version of the plugin

What did you expect to happen?

validateAndLogInAppPurchase to be called successfully on iOS

What happened instead?

validateAndLogInAppPurchase fails on iOS with this error message. Working as expected on Android.

code: "E(null)0"
domain: "RCTErrorDomain"
message: "Unknown error from a native module"

Please provide any other relevant information.

I am calling appsFlyer.setUseReceiptValidationSandbox(true); on iOS, as recommended in the docs. I have tried calling it both before appsFlyer.initSdk method and before calling appsFlyer.validateAndLogInAppPurchase (separately) and it still doesn't work. Also I tried it without calling appsFlyer.setUseReceiptValidationSandbox and it yields the same result.

ReactNative version is 0.63.3

pazlavi commented 3 years ago

hey, Can you please let us know what is the error code you got from the native when you run the app from Xcode? Search the logs block that starts with [Validate] Response Info. Don't forget the enable the debug logs when you initialize the SDK isDebug: false 21007

jwebcat commented 3 years ago

@pazlavi For sure, thanks for the quick reply. I will get back to you shortly with that error code.

jwebcat commented 3 years ago

@pazlavi this the output in the logs when that error occurs:

[DEBUG] AppsFlyer: 
[Validate] Dictionary:{
    environment = Sandbox;
    status = 21004;
}
[Validate] Response Info:{
    data = {length = 40, bytes = 0x7b22656e ... };
    dataStr = "{\"environment\":\"Sandbox\",\"status\":21004}";
    statusCode = 200;
    taskIdentifier = 10;
}
[Validate] Error: (null)
jwebcat commented 3 years ago

@pazlavi Does the plugin not support validating Apple Sandbox receipts? I assumed it does, as we have this method available appsFlyer.setUseReceiptValidationSandbox(true) but I figured I would call it out just in case.

pazlavi commented 3 years ago

@jwebcat the plugin supports validating Apple Sandbox receipts. This error is not SDK-related, it comes from Apple. I'll explain what this error means in your support ticket.