- this binding is based on: https://github.com/thisisthekap/Xamarin.RevenueCat.Android
- it is created for .NET MAUI and targeted to
.NET 8
- it contains bindings for RevenueCat Android library
The versioning scheme of Maui.RevenueCat.Android
is derived from the versioning of revenuecat/purchases-android
.
revenuecat/purchases-android | Maui.RevenueCat.Android | Note |
---|---|---|
3.4.1 | 3.4.1.0 | First version of bindings for 3.4.1 |
3.4.1 | 3.4.1.17 | Bindings for 3.4.1 containing 17 fixes |
RevenueCat Android library is writtein in Kotlin
. You can find more about Kotlin binding here.
- To start create a project
Android Java library binding
- Then files of the the library have to be downloaded.
- For native libraries you can use Google maven repo.
- For downloading this library I have used mvnrepository.com to download the RevenueCat v7.2.4 android library.
- At the time of creating this binding
v7.3.3
was out but it wasn't compatible with latestXamarin.Android.Google.BillingClient
library
- Click files->View all: You have to download there files:
.aar
that contains the compiled library and-sources.jar
that is used in binding process for documenting the library.
- After download create in your project
Jars
folder and put there both files. For- for
.aar
setBuild Action
to:AndroidLibrary
- for
-sources.jar
setBuild Action
to:JavaSourceJar
based on this docs
- for
- Then you have to add all necessary dependencies. Dependencies of the library are showed on mvnrepository site. Your binding library should contain all these dependencies (ideally in same
version
but until those libraries are compatible, versions are not important).- I have found and added
PackageReference
for allXamarin/Maui
alternatives of these libraries ⚠️ When I wanted to use newer RevenueCatv7.3.3
with requirement ofBillingClient v6.1.0
while the newest Xamarin library was stuck atv6.0.1
it caused build errors after inserting this project to the main MAUI app. Rule of thumb is that usually libraries are back compatible but not forward compatible. So when it requires newer version it could be a problem but when you have newer version of the package it could be okay(depends if some breaking changes were introduced).
- I have found and added
⚠️ Even after finding all mentioned libraries I had some warnings regarding someamazon
method calls and build errorandroidx.collection.ArrayMapKt is defined multiple times
- the amazon problem was fixed by including package
Eddys.Amazon.AppStoreSdk.Binding
- and the compilation error by including
Xamarin.AndroidX.Fragment.Ktx
.- I found this in the source: purchases-android-main\purchases-android-main\api-tester\build.gradle at the end and it is present also in gradle\libs.versions.toml
- the amazon problem was fixed by including package
- After providing all necessary libraries you have to adjust
Metadata.xml
to get rid of compilation errors. - docs ⚠️ At the end there are still 2 important warnings left withkotlin.jvm.functions.Function1
andkotlin.jvm.internal.IntCompanionObject
but even with then the binding works correctly- I hope this helped and enjoy the binding ❤️
This repository is licensed with the MIT license.