qonversion / react-native-sdk Goto Github PK
View Code? Open in Web Editor NEWReact Native SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations
React Native SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations
Hello
We started having app crashes in dev mode after updating to 6.2.0 from 4.4.2 (haven't tested release mode yet).
There seems to be some kind of module conflict related to react-native-appmetrica
(natively based on YandexMobileMetrica
on iOS and com.yandex.android:mobmetricalib
on Android. And also patched with additional functionality to support certain native methods). Commenting out certain code blocks in js code prevents crashes. Specifically, on Android these would be AppMetrica.reportEvent
and AppMetrica.reportUserProfile
, on iOS - AppMetrica.requestAppMetricaDeviceID
.
iOS crash stacktrace leads to [YMMYandexMetrica requestAppMetricaDeviceIDWithCompletionQueue:nil completionBlock:completionBlock];
in native code.
Haven't been able to pinpoint the exact stacktrace on android.
Also, no crashes on qonversion 5.0.0.
I tried reverting the upgrade and crashes disappear. Upgraded again, cleaned all the caches and crashes resume. Checked that multiple times and concluded that qonversion could be the main source of an issue.
Is it possible to add price-related fields like price
, instroductoryPrice
, currencyCode
, currencySymbol
so we don't have to dig into skProduct
& skuDetail
.
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch [email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-qonversion/ios/.DS_Store b/node_modules/react-native-qonversion/ios/.DS_Store
new file mode 100644
index 0000000..96a379e
Binary files /dev/null and b/node_modules/react-native-qonversion/ios/.DS_Store differ
diff --git a/node_modules/react-native-qonversion/react-native-qonversion.podspec b/node_modules/react-native-qonversion/react-native-qonversion.podspec
index 8f84e00..1e32170 100644
--- a/node_modules/react-native-qonversion/react-native-qonversion.podspec
+++ b/node_modules/react-native-qonversion/react-native-qonversion.podspec
@@ -21,6 +21,6 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,swift}"
s.requires_arc = true
- s.dependency "React"
+ s.dependency "React-Core"
s.dependency "QonversionSandwich", "0.2.0"
end
This issue body was partially generated by patch-package.
Hi
Thanks for the library -- we're using it in production and it's great.
We're stuck at the moment: React Native Qonversion is giving us ios build errors for x86_64 architecture when using use_frameworks!
in our podfile, blocking an upgrade of React Native Firebase, one of our core dependencies.
The errors are:
Link react_native_qonversion (x86_64) 0.1 seconds
...
Undefined symbols for architecture x86_64:
"_OBJC_METACLASS_$_RCTEventEmitter", referenced from:
_OBJC_METACLASS_$_RNAutomations in RNAutomations.o
_OBJC_METACLASS_$_RNQonversion in RNQonversion.o
"_OBJC_CLASS_$_RCTEventEmitter", referenced from:
_OBJC_CLASS_$_RNAutomations in RNAutomations.o
_OBJC_CLASS_$_RNQonversion in RNQonversion.o
"_RCTRegisterModule", referenced from:
+[RNAutomations load] in RNAutomations.o
+[RNQonversion load] in RNQonversion.o
ld: symbol(s) not found for architecture x86_64
I tried fixing by adding this to our podfile, but it didn't work:
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.eql?('RNQonversion')
def pod.build_type
Pod::BuildType.static_library
end
end
end
end
Could you help? Or guide us to a solution / let us know how to help fix? We're keen to get this fixed soon.
I'm on:
react-native-qonversion 3.5.0
react-native 0.69.5
M1 Macbook
Platform : IOS
react-native-qonversion : "^6.2.0"
react-native : "0.70.6"
I have a function to subscribe
const subscribe = async () => {
dispatch(SET_LOADING(true));
try {
const selected = products?.find(
prod => prod.qonversionID === (selectedId === 1 ? 'monthly' : Platform.OS === 'ios' ? 'yearly' : 'sixmonths'),
);
if (selected) {
const entitlements: Map<string, Entitlement> =
Platform.OS === 'ios'
? await Qonversion.getSharedInstance().purchaseProduct(selected)
: await Qonversion.getSharedInstance().purchase(selected.qonversionID);
if (entitlements.keys()) {
for (const [key, value] of entitlements.entries()) {
reactotron.log?.('key', key);
reactotron.log?.('value', value);
}
}
reactotron.log?.('entitlements', entitlements);
}
} catch (e: any) {
if (e.userCanceled) {
// Purchase canceled by the user
reactotron.log?.('Purchase canceled by the user');
}
reactotron.log?.('error in subscribe', e);
}
dispatch(SET_LOADING(false));
};
and when i log returned entitlements i got this :
this is my entitlement:
and the docs says that Entitlement object is like this :
But if we look into Entitlement class in react-native-conversion package:
i need other information as docs says. Like transaction id or purchaseToken (for android) of purchase.
whats the point in here ? am i missing something ?
Installing this in a new react native project throws this error.
Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.1" from [email protected]
npm ERR! node_modules/react-native-qonversion
npm ERR! react-native-qonversion@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I'm trying to install this library so that we can use it in Observer mode alongside IAPHub.
Launching the app on Android will cause a crash without any error messages being sent.
Luckily I was able to track down the issue with sentry.
NoSuchMethodError: No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie; or its super classes (declaration of 'okhttp3.Cookie' appears in /data/app/com.gamerzclass.gamerzclassmembers-NXTfYo4m0itGOWA7suy2CA==/base.apk!classes4.dex)
It appears that I some part of this library is trying to use a method from https://square.github.io/okhttp/ - I'm just confused as to why this dependency is not either automatically installed or mentioned as a requirement in the getting started articles.
I have scheduled a technical support call with Qonversion tomorrow to address concerns unrelated to this issue. I do however intend to refer to this issue during the call to clear things up.
Please add above feature
Using react native are we able to display product (subscriptions).
Using react native are we able to purchase in app (in app purchases)
following the documentation I did not see any codes on how to do this. Only saw code for setup with react native but nothing to do the two task above, only swift and obj c.
Do you have plans to provide code to do this in react native and as well as a full working example for use review
We are trying out your platform but already run in some issues...
Hello, and happy new year ๐ฅณ ! I am not really sure if this is an issue but here it is.
When running the command npx react-native link react-native-qonversion
from https://documentation.qonversion.io/docs/react-native-sdk, I get the following warning:
$ npx react-native link react-native-qonversion
warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release.
Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Linking "react-native-qonversion" iOS dependency
info iOS module "react-native-qonversion" has been successfully linked
info Linking "react-native-qonversion" Android dependency
info Android module "react-native-qonversion" has been successfully linked
Is this something to look out for ?
Thank you.
Since updating 3.4 -> 3.6, I'm getting empty products back in iOS in production, with the correct IDs but empty details, for example:
{
"currencyCode": undefined,
"duration": undefined,
"offeringId": undefined,
"prettyIntroductoryPrice": undefined,
"prettyPrice": "",
"price": undefined,
"qonversionID": "unlock_themes",
"skProduct": null,
"skuDetails": null,
"storeDescription": undefined,
"storeID": "unlock_themes",
"storeTitle": undefined,
"trialDuration": "NOT_AVAILABLE",
"type": "ONE_TIME"
}
Any ideas on this? Is there extra steps needed since the update that aren't documented?
I would send this as a support ticket on the Qonversion website, but the chat feature isn't working.
I intend on using consumable purchases to give user access to a digital product, I can see brief mentions of consumable products but am quite unclear on how this works.
Does Qonversion have the ability to mark purchases as consumed (e.g. https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/finishing_a_transaction) and whatever equivilent for Android?
Hello,
We have an expo app and we just migrated to expo 46 which is shipped with react native 0.69.3.
When we try to build the app we get this error :
In the documentation you say to install the package and run react-native link react-native-qonversion
But the link
command does exist anymore in react native 0.69.X. I dont know if the build error is related or not.
Here is a link to a minimal reproductible demo
Run commands:
yarn
cd android
./gradlew assembleRelease
=> Error. if you delete the qonversion package and try to build again you will see that the build is successful.
Thanks for your help.
Hi There,
I am facing [Error: UNKNOWN_ERROR] when trying to fetch the products.
Any insights on how to debug or to get more meaningful output?
try {
const offerings = await Qonversion.offerings();
console.log('offerings', offerings)
if (offerings
&& offerings.main != null
&& offerings.main.products.length > 0) {
// Display products for sale
console.log('offerings', offerings)
}
} catch (e) {
console.error(e)
}
react-native info
System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 397.40 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.5/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.15.5/bin/npm
Watchman: 2021.08.30.00 - /usr/local/bin/watchman
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.3
System Images: android-29 | Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_282 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
"react-native-qonversion": "^3.1.1",
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.
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
Greetings!
Are you working on implementing resetUser
method in RN SDK?
Or I can implement it and create a PR?
Hello! Setting up a new iOS application I am seeing that skProduct is always null
Request:
const products = await Qonversion.getSharedInstance().products()
Response:
[
{
"qonversionID": "workout_annual",
"storeID": "workout_annual",
"type": "DIRECT_SUBSCRIPTION",
"duration": "ANNUAL",
"skuDetails": null,
"skProduct": null,
"prettyPrice": "",
"trialDuration": "UNKNOWN"
},
{
"qonversionID": "workout",
"storeID": "workout",
"type": "ONE_TIME",
"skuDetails": null,
"skProduct": null,
"prettyPrice": "",
"trialDuration": "UNKNOWN"
},
{
"qonversionID": "workout_monthly",
"storeID": "workout_monthly",
"type": "DIRECT_SUBSCRIPTION",
"duration": "MONTHLY",
"skuDetails": null,
"skProduct": null,
"prettyPrice": "",
"trialDuration": "UNKNOWN"
}
]
Based on qonversion/qonversion-ios-sdk#101 I can validate the following:
Your in-app purchases are not configured correctly on the App Store Connect. Check the first point of this section.
I believe they are, here they are
Your app bundle ID does not match the bundle ID from App Store Connect where purchases were created.
It does:
You are using .storekit file which is configured with other IDs than you are trying to use.
We are not using a storekit file.
Hello. We're using react-native-qonversion 4.4.2
We're calling Qonversion.getSharedInstance().syncHistoricalData()
after module initialization. For some reason, it causes an apple login prompt to appear on a simulator, as well as on some real devices (App is downloaded from Testflight. One device so far). Cancelling this prompt results in Qonversion.getSharedInstance().checkEntitlements()
failing with error (checkEntitlements
is called later, after Qonversion module init and syncHistoricalData
). Devices obviously have a logged in Apple ID user.
Example error from xCode logs after login prompt is dismissed:
โ Historical data sync failed: The operation couldnโt be completed. (SKErrorDomain error 2.)
Is this expected behaviour? Would this prompt appear when the app is in production?
Hi guys,
I'm using version 3.3.2 of the package.
Since Tuesday I cant build on android because of the following error:
I did not change anything in my project, and I'm not using version 0.71.0-rc.0 of react native.
Any idea why this popped out of nowhere ?
Version of react native in my node_modules:
Version of react-native-qonversion in my node_modules:
Thanks for your help :)
When I call "qonversion.purchase" for an expired subscription it returns permissions, but not initialize a new purchase. How to subscribe to the same product again?
const products = await qonversion.purchase("app.week");
data returned:
{
permissionID:'app.week'
productID:'app.week'
expirationDate:1621442782000
isActive:false
renewState:2
startedDate:1621424788000
}
I'm unable to make a purchase, when calling await Qonversion.purchase('monthly')
, I get the following error:
[Error: Failure to retrieve SkuDetails for the in-app product ID]
The product exists in Google Play and IS active.
I'm completely clueless on what I should do next.
Hi, I was wondering if there are any plans to add typescript support? The current index.js throws a bunch of errors in my IDE because it contains type annotations in a .js file. I put a definition file together to avoid some runtime type errors - the gist is here. I can submit a proper pull request, but have never written a definition file before so it probably shouldn't be taken at face value.
Other than that am enjoying how smooth the integration is going!
Any update to support RN 0.67+
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/user/Desktop/testapp (v0.67.3) - (v1)/testapp/node_modules/react-native-qonversion/android/build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-qonversion'.
> Plugin with id 'maven' not found.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-qonversion'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
App is crashing on some device .
java.lang.SecurityException
Stack Trace:
java.lang.SecurityException:
at android.os.Parcel.createExceptionOrNull (Parcel.java:2441)
at android.os.Parcel.createException (Parcel.java:2425)
at android.os.Parcel.readException (Parcel.java:2408)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query (ContentProviderNative.java:481)
at android.content.ContentResolver.query (ContentResolver.java:1237)
at android.content.ContentResolver.query (ContentResolver.java:1162)
at android.content.ContentResolver.query (ContentResolver.java:1118)
at com.qonversion.android.sdk.FacebookAttribution.getAttributionId (FacebookAttribution.java:10)
at com.qonversion.android.sdk.QUserPropertiesManager.sendFacebookAttribution (QUserPropertiesManager.java:45)
at com.qonversion.android.sdk.Qonversion.launch (Qonversion.java:97)
at com.reactlibrary.QonversionModule.launchWithKey (QonversionModule.java:108)
at java.lang.reflect.Method.invoke (Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run (Native Method)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce (Looper.java:233)
at android.os.Looper.loop (Looper.java:344)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:226)
at java.lang.Thread.run (Thread.java:920)
Device : OnePlus OnePlus9R
I have made a real purchase with Card , and i was successfully using My Premium features within the app Permission Object having Active flag to true
, but when i refund the order from OrderManagement Page Google Play Console and then again i purchased the premium feature amount was deducted and got successful purchase message but Permission Active flag was set to false
, what may be the issue?
Qonversion SDK : ^3.1.1
React Native : 0.63.4
ps: I have checked the Revoke Entitlement checkbox while refunding the order
Hi,
I've received this message from an app reviewer saying that IAP purchase resulted in an error prompt showing up with this error message No matching receipt found
Personally I have been unable to reproduce this issue and I was wondering if anyone has seen this before. If so, how do we resolve this issue?
Hi , Thanks for the wonderful service you guys provide . I have a question about how to handle pending /Deferred payment with Play store because there is no react-native example in the docs of qonversion?
I make an apple in-app purchase with Qonversion.purchase
method but not show a pay modal, just return a Permission object. But never pay and the subscription status keeps the same. Not display an error o warn only don't work.
I have a public version of my app in the app store with 2.0.2, I try rollback and wait for your answer.
I use React native with Hermes build option (works perfectly in the previous version)
All test make in the physical device iPhone 6 Plus
Xcode: Version 12.3 (12C33)
"react": "17.0.1",
"react-native": "0.64.0-rc.2",
"react-native-qonversion": "2.3.0",
I need to test but not able to do:
TypeError: _reactNativeQonversion.default.setDebugMode is not a function. (In '_reactNativeQonversion.default.setDebugMode()', '_reactNativeQonversion.default.setDebugMode' is undefined)
Hello can you guys provide what Data Types
you're collecting? This is actually required in the new Data Safety App Content. I don't know which data type should i check on.
My app is purely offline so i don't collect data on my own, users just need internet connection to buy subscription and for the admob adverisement
I receive an "Action Required: Your app is not compliant with Google Play Policies" from google and i think you're one of the culprit, hehe sorry for the word
Revenue Cat provided a doc already regarding this and i hope Qonversion can do this as soon as possible.
Sorry, I know this isn't related to the library but just want to open this to the public and inform other devs as well. Thank you!
https://docs.revenuecat.com/docs/google-plays-data-safety
Since outage on your plateform (01/16/2023) it seems that offering can't be fetched and produce a crash (at least on iOS)
I'm not able to catch this crash
dispatch(setOffers({}))
Qonversion.offerings()
.then((shop) => {
if (shop) {
dispatch(setOffers(shop))
}
})
.catch(error => console.error(error))
// Qonversion.restore().catch is returning an internal server error as expected
This always produces a crash with this trace (i'm not familiar with Xcode debugger)
Do you think that using this is a good workaround for now ?
await axios.get('https://api.qonversion.io/')
.catch(e => {
//
if (e.message.includes('502') || e.message.includes('503')) {
isQonversionAvailable = false
}
})
I'm initializing SDK as in the docs
const config = new QonversionConfigBuilder(
'xxxxxx...',
LaunchMode.SUBSCRIPTION_MANAGEMENT
)
.setEntitlementsCacheLifetime(EntitlementsCacheLifetime.YEAR)
.build()
Q.initialize(config)
const Qonversion = Q.getSharedInstance()
export { Qonversion }
RN 0.70.5
Qonversion SDK 4.0.1
Thank you
Hello I got error when npx react-native run-android
Can you help me please ?
Version: "react-native-qonversion": "^3.3.1",
Device: Macbook Pro M1 (12.0.1)
FAILURE: Build failed with an exception.
Where:
Build file '/Users/huseyintamer/Desktop/Hiface/LeanHiface/node_modules/react-native-qonversion/android/build.gradle' line: 82
What went wrong:
A problem occurred configuring project ':react-native-qonversion'.
Configuration with name 'compile' not found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.