qonversion / unity-sdk Goto Github PK
View Code? Open in Web Editor NEWUnity SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations
Unity SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations
In our app we offer only consumable purchases.
At the start of the app once the purchases/products are loaded we call Qonversion.GetSharedInstance().CheckEntitlements()
since this is what is in the documentation:
You need to call the checkEntitlements() method at the start of your app to check if a user has the required entitlement. This method will check the user's receipt and return current entitlements.
This returns already consumed purchases and their entitlements.
Note that I did not verify the boolean value of IsActive
of the returned entitlement.
As far as I know consumable purchase support is still in progress, correct?
@SpertsyanKM tagging you here since you were able to help me before, apologies if this is someone elses territory.
Steps to reproduce:
Result:
Currently I was unable to find a way to manually acknowledge/consume a purchase via API.
Since out of app purchases can happen on Android(preregistration, deferred) this should work out of the box...
Hey. I am new to Quonversion. I have tried to import the SDK following this guide (except multidex step) and then tried to build the project but I have got this error. I already had a Unity IAP implemented so I also excluded the billingclient
dependency.
Unity: 2021.2.10f1
Qonversion: 7.0.0
Here are some logs:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'. Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'. Failed to transform moshi-1.14.0.jar (com.squareup.moshi:moshi:1.14.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.environment=standard-jvm, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}. Execution failed for JetifyTransform: /Users/daniel/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.14.0/df173a3bfa0bd9e0cd2a8fc14b24fc336dca0de0/moshi-1.14.0.jar. > Failed to transform '/Users/daniel/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.14.0/df173a3bfa0bd9e0cd2a8fc14b24fc336dca0de0/moshi-1.14.0.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 60. (Run with --stacktrace for more details.)
The Qonversion monobehaviour's getFinalInstance will create multiple gameobjects over the course of its lifetime.
As seen below - it doesnt respect the null check of the instance.
The above might be a solution to this issue. However, I can't tell if theres a good reason this is a monobehaviour? The object is never destroyed, and every public method is static anyways, and it doesnt seem as if any gameobject related functionality is used.
I wrote you guys about 10 days ago about this issue. Regarding gradle builds failing, specifically about cloud builds failing (as well as android studio exports) at this line here :
8353: [Unity] boolean result = Qonversion.handleNotification(notificationInfo); 8354: [Unity] class file for com.google.firebase.messaging.RemoteMessage not found
Now - i have solved this issue by going into your android Qonversion project and locating the specific version of com.google.firebase.messaging that you guys are using - and added that as a dependency in our custom gradle file. It seems to me, as if that dependency is not properly propagated out to the unity sdk. I feel like this should have been something you guys could have tested.
Also - i would recommend that you go in and update the version you point to in your installation guide on your documentation page, as that one has failing iOS cloud builds also. (The one specified as the Git url approach)
I hope this can be resolved soon. I dont know much about android, but i feel like the android issue could potentially live in the QonversionDependencies.xml file.
For anyone else having this issue - you can in you mainTemplate.gradle add the following line as a workaround until this is fixed (this is for the 3.4.1 release):
Hello, I got these errors when I built my project on Xcode. I imported the SDK via Git and I'm using Xcode 13.0.
com.qonversion.unity/Runtime/iOS/Plugins/Common/UtilityBridge.m:68:31: Definition of 'QNPermission' must be imported from module 'Qonversion.QNPermission' before it is required
com.qonversion.unity/Runtime/iOS/Plugins/Common/UtilityBridge.m:89:43: Definition of 'QNProduct' must be imported from module 'Qonversion.QNProduct' before it is required
com.qonversion.unity/Runtime/iOS/Plugins/Common/UtilityBridge.m:68:31: Definition of 'QNPermission' must be imported from module 'Qonversion.QNPermission' before it is required
com.qonversion.unity/Runtime/iOS/Plugins/Common/UtilityBridge.m:89:43: Definition of 'QNProduct' must be imported from module 'Qonversion.QNProduct' before it is required
Hello! I have problem with getting purchase was cancelled callback. Seems like it was missed in the Unity SDK and Unity documentation, however Unity is cross-platform engine with iOS support too.
Can you please add this feature or tell me where I can find it if exists.
#region StartBuying()
public void StartBuying( PurchasePack<IapPack> purchasePack, Action<string, PurchaseFinishStatus, string> purchaseFinishCallback )
{
var purchaseModel = purchasePack.StoreProduct.ToPurchaseModel();
Qonversion.GetSharedInstance().Purchase( purchaseModel, ( entitlements, error, isCancelled ) =>
{
var purchaseFinishStatus = isCancelled ? PurchaseFinishStatus.Cancelled
: error == null ? PurchaseFinishStatus.Success
: error.Code == QErrorCode.PurchasePending ? PurchaseFinishStatus.Pending
: PurchaseFinishStatus.Failed;
Log.Info( $"PurchaseManager - purchase of pack({purchasePack.IapPack.Id}) finished. Status({purchaseFinishStatus}) WasCancelled({isCancelled}) Error({error})" );
if( entitlements is { Count: > 0 } )
{
foreach( var entitlement in entitlements )
{
Log.Info( $"PCEntitlements -> Id: {entitlement.Key} Transactions:{string.Join(";", entitlement.Value.Transactions.Select(x=>x.TransactionId))}" );
}
}
var transactionId = entitlements == null || entitlements.Count <= 0 ? string.Empty : entitlements.FirstOrDefault(x=>x.Value.ProductId == purchaseModel.ProductId).Value?.Transactions[0].TransactionId;
Log.Info( $"PurchaseComplete for {purchaseModel.ProductId} with transactionId: {transactionId}" );
Log.Assert( purchaseFinishStatus != PurchaseFinishStatus.Success || !string.IsNullOrEmpty( transactionId ), "Cannot have successful purchase with no transactionId" );
purchaseFinishCallback?.Invoke( purchasePack.StoreProduct.StoreId, purchaseFinishStatus, transactionId );
if( purchaseFinishStatus == PurchaseFinishStatus.Success ) rewardPurchase?.Invoke( purchasePack, transactionId );
} );
}
#endregion StartBuying()
This is our purchasing code, that worked fine two months ago, last confirmed case was 22nd of May.
Testing with Test Card on Android:
Successful purchase is returning empty entitlements dictionary...
Pending purchases do not get success callback
We get normal confirmation emails from GooglePlay for these test purchases with valid transaction IDs, but the entitlements are empty...
This is happening with release 7.4.0 && 8.0.0, Unity version 2022.3.22f1
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.