Closed befirst closed 3 years ago
Hey @befirst , this is already implemented in the plugin available in the ProPlugins NPM registry.
All future work of this plugin will be available exclusively as part of ProPlugins initiative. So if you want to get the latest updates/fixes/features make sure you subscribe to the service. You get all my plugins plus many of the most used and high quality plugins for a small monthly subscription fee.
Hi @PeterStaev. I am writing here because I can't get access to the private repo in GitLab for the paid version.
I have this issue when trying to get a list of products with the paid version of this plugin:
Cannot read property 'querySkuDetailsAsync' of undefined
I have tns version 6.5.0, tns android 6.4.1, plugin version 6.0.0
I tried to update to tns version 7.0.10, and updated tns android to 6.5.3. it doesn't work anyway, the same error.
I tried downgrading the plugin version to 5.0.0, the same. Also after installing the plugin everytime I see a warning that this plugin works with tns anroid version 7, but the last one that is written in official github is 6.5.3
@befirst in the future please open a new issue for your problem, because this has nothing to do with billing lib 2+
Seems your project is not correctly migrated. The latest version of the plugin supports NS 7+. tns-android
is depreciated and you should use @nativescript/android
instead. Please migrate your project by following https://nativescript.org/blog/nativescript-7-announcement/ and then try again.
Got it, thank you, will try!
Hi again @PeterStaev ! I've tried to update nativescript to the 7th version. I've spent 3days for it. And I haven't success with it, because a lot of libraries that I use doesn't support NS 7+. And all my layouts are broken because of upgrading. Is it possible to install some version of the paid plugin with BillingLibrary 2.0 and with supporting of NS 6?
Hey @befirst , you can use version 4.1 which uses billing lib 2.0 and is NS 6 compatible. But note Billing lib 2 is scheduled to be deprecated sometime next year:
Thank you @PeterStaev ! So is it possible to get the third version of the library with NS 6 compatibility? Maybe there is some page where I can get such information just to not ask you about all my problems? But anyway I am changing the purchasing approach because of Warning: AIDL is now deprecated and will be removed in a future release. To implement billing-related features, use the Google Play Billing Library.
As I understand it's enough to just change the version of the billing library in the Gradle file just to get the new version?
Like that:
dependencies {
def billing_version = "3.0.0"
implementation 'com.android.billingclient:billing:$billing_version'
}
@PeterStaev I got the same error anyway(
JS: Error getting product details: TypeError: Cannot read property 'querySkuDetailsAsync' of undefined
No, you cannot change the billing library like that, because it comes with breaking changes. The library version is hardcoded in the plugin so that it ensures the plugin works as expected with it. Billing Library 2.x comes with verson 4.1 or lower. Billing Lib 3.x is with 5+ which is only compatible with NS 7.
As for the error - you probably are not using the plugin as described in the readme. Make sure you call init()
as described in the readme and as it is in the samples and also make sure you wait the promise that is returned by init
to be resolved before calling any other billing related logic.
Thank you @PeterStaev I will check! Btw 2.1.1 version works fine with my project. But anyway I will check the behavior.
Looks like after 2.1.1 the init()
call can't finish properly, I don't see any logs that I put in then
and in catch
.
Also, previously it was in the constructor of my service. But pulling out it from there helped to initialize. Interesting...
@PeterStaev thank you very much for your help! Right now it's working, I don't know what I would do without your help!
Glad it is working! 2.x was using still the AIDL so probably that's why it is a diff behavior. 3+ uses the Billing Libs.
https://developer.android.com/google/play/billing/migrate:
https://developer.android.com/google/play/billing/integrate