Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: android build error with React Native 0.76 (#2872)
When using React Native 0.76 the Android build fails with an error: ``` java/com/dooboolab/RNIap/PromiseUtlis.kt:40:21 Type mismatch: inferred type is String? but String was expected ``` The issue seems to be caused by the fact that in RN 0.76 the Promise class was rewritten from Java to Kotlin and the code parameter of the reject method is a non-nullable String now: facebook/react-native@de73e44#diff-74cbd5a9d82e4c21dbc37dd72a92e31542e574dc6425d2454c3ce53e71e08bbeR31 but in react-native-iap it is called with a nullable string: https://github.com/hyochan/react-native-iap/blob/12.15.6/android/src/main/java/com/dooboolab/rniap/PromiseUtlis.kt#L40. This change updates that call to use an empty string "" for code if for some reason it's null. Fixes #2871
- Loading branch information