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

feat: use In App Billing v6 #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

hansemannn
Copy link
Owner

@hansemannn hansemannn commented Aug 26, 2023

Breaking Changes

  • The purchase method now uses an object, not String.
- purchase(productId);
+ purchase({ identifier: productId });
  • The launchPriceChangeConfirmationFlow method has been removed, because it was removed from the In App Billing SDK v6. Please use the new properties oldPurchaseToken, subscriptionReplacementMode and originalExternalTransactionId in purchase() instead!

Download: ti.iap-android-4.0.0.zip

If you use this version, please leave a comment below to let me know if all works!

@cmtanko
Copy link

cmtanko commented Jun 4, 2024

Hey @hansemannn I'm trying the version 4.0.0

with update in the purchase method, I'm getting following error for my valid productId
IAP.purchase({identifier: selectedProduct}); // where selectedProduct is a productId:String

IAP purchase error: Error: Unable to convert null at eval (eval at Module._compile (/app.js:727:10), <anonymous>:41:19) at new Promise (<anonymous>) at purchase (eval at Module._compile (/app.js:727:10), <anonymous>:30:10) at Object.exports.purchase (eval at Module._compile (/app.js:727:10), <anonymous>:208:9) at Object.exports.purchase (eval at Module._compile (/app.js:727:10), <anonymous>:69:21) at eval (eval at Module._compile (/app.js:727:10), <anonymous>:916:27) at Titanium.eval (eval at Module._compile (/app.js:727:10), <anonymous>:657:7) { nativeStack: '' + ' org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:439)' + ' org.appcelerator.kroll.KrollDict.getInt(KrollDict.java:162)' + ' ti.iap.TitaniumInAppPurchaseModule.purchase(TitaniumInAppPurchaseModule.kt:183)' + ' org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)' + ' org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:55)' + ' org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:41)' + ' ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:142)' + ' android.os.Handler.handleCallback(Handler.java:942)' + ' android.os.Handler.dispatchMessage(Handler.java:99)' + ' android.os.Looper.loopOnce(Looper.java:226)' + '' }

@hansemannn
Copy link
Owner Author

The branch is still work in progress, so you might want to look into the code for details. We migrated to RevenueCat a while ago, so there is no direct impact on us here right now. Sorry for that!

@cmtanko
Copy link

cmtanko commented Jun 5, 2024

When you say we migrated to RevenueCat, does that mean ti.iap wont be maintained anymore ?

@hansemannn
Copy link
Owner Author

It will be, but not alone from me - that's why it's open source :-)

@cmtanko
Copy link

cmtanko commented Jun 5, 2024

I'm not an Android dev so have very less knowledge on it, can you clear this one.

It works if I replace
val subscriptionReplacementMode = params.getInt("subscriptionReplacementMode")
with
val subscriptionReplacementMode: Int? = null

and since subscriptionReplacementMode is optional it should have worked with the previous code as well, right ?

@cmtanko
Copy link

cmtanko commented Jun 5, 2024

ahh maybe because null is not an integer, that's why ?

@hansemannn
Copy link
Owner Author

It should default to null without issues. But let me check ;)

@hansemannn
Copy link
Owner Author

@cmtanko Done

@martinrademacher
Copy link

Is there a compiled version of the module including the last changes available for download and testing?

Thanks

@hansemannn
Copy link
Owner Author

@martinrademacher You can build it from this PR :)

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

Successfully merging this pull request may close these issues.

None yet

3 participants