Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling logPurchase with invalid currency causes native crash. #570

Open
nixolas1 opened this issue Oct 21, 2024 · 0 comments
Open

Calling logPurchase with invalid currency causes native crash. #570

nixolas1 opened this issue Oct 21, 2024 · 0 comments

Comments

@nixolas1
Copy link

🐛 Bug Report

Calling AppEventsLogger.logPurchase with invalid currency causes native app crash on Android.
AppEventsLogger.logPurchase(10.0, "FAKE_CURRENCY")

java.lang.IllegalArgumentException: The input currency code is not 3-letter alphabetic code.
    at android.icu.util.Currency.getInstance(Currency.java:289)
    at java.util.Currency.getInstance(Currency.java:278)
    at com.facebook.reactnative.androidsdk.FBAppEventsLoggerModule.logPurchase(FBAppEventsLoggerModule.java:191)

To Reproduce

On android:

const price = 10
const currency = undefined;
AppEventsLogger.logPurchase(price, currency ?? "NOT_SET");

(app closes)

Expected Behavior

Function throws error, but only in JS space, so a try/catch stops the error from crashing the app.
Having a tracking function crash the entire app is not so good.

Environment

Expo 51
"react-native-fbsdk-next": "^13.1.3"

SDKs:
Android SDK:
API Levels:
- "31"
- "33"
- "34"
Build Tools:
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
- 35.0.0
System Images:
- android-30 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2412.12266719
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac

npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.5
wanted: 0.74.5
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant