qonversion / react-native-sdk

React Native SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backend Error

EdDevs2503 opened this issue · comments

Description

Hi, I installed Qonversion SDK on react native and IOS working fine, but Android has problems. When I call the method purchase from the SDK it give me an error with the code BackendError. The documentation here say that I must read the property additionalMessage of QonversionError. I don't se anything at the SDK like that. But in the android native code it's possibly and when I get the additionalMessage can't understand it, check it: HTTP status code=422, error=failed to parse the backend response. I hope that any of you can help me whit this. Thanks

A curiosity is that the purchase method return this error but it do successfully the purchase, but the permission method checkPermissions return nothing. It buy the product but act like the user has no purchases.

React native info

System:
OS: macOS 11.4
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 263.23 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.3.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.15.1 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3
System Images: android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: ^0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Hi, @EdDevs2503
The fix for more useful additionalMessage already released for the native Android SDK and will be released for the RN SDK soon.
Now, as I can see, the purchase problem is related to Google Play. This the response we receive:
"message":"Google Play Android Developer API has not been used in project YOUR_PROJECT_NUMBER before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/overview?project=YOUR_PROJECT_NUMBER then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
Also, as you already created Google Play products, you possibly will face the issue that purchases still weren't work. In that case, you need to just update and save the product description (strange Google issue).

Hi, @EdDevs2503
The fix for more useful additionalMessage already released for the native Android SDK and will be released for the RN SDK soon.
Now, as I can see, the purchase problem is related to Google Play. This the response we receive:
"message":"Google Play Android Developer API has not been used in project YOUR_PROJECT_NUMBER before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/overview?project=YOUR_PROJECT_NUMBER then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
Also, as you already created Google Play products, you possibly will face the issue that purchases still weren't work. In that case, you need to just update and save the product description (strange Google issue).

Thanks for your answer. It was the solution, thanks!!