Skip to content

Commit

Permalink
Version 4.1.3
Browse files Browse the repository at this point in the history
* Add SetAttribute PurchaselyIos.cs

* 4.1.3 version

* fix missing declaration
  • Loading branch information
kherembourg authored Nov 13, 2023
1 parent e35dfac commit 633f4ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions Runtime/Platform/IOS/PurchaselyIos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ public void PresentSubscriptions()
_purchaselyPresentSubscriptions();
}

public void SetAttribute(int attribute, string value)
{
_purchaselySetAttribute(attribute, value);
}

public void SetUserAttribute(string key, string value)
{
_purchaselySetStringAttribute(key, value);
Expand Down Expand Up @@ -348,7 +353,7 @@ public bool IsAnonymous()
{
return _purchaselyIsAnonymous();
}

public void IsEligibleForIntroOffer(string planVendorId, Action<bool> onSuccess, Action<string> onError) {

var eligibilityCallback = new Action<bool>(isEligible =>
Expand All @@ -363,7 +368,7 @@ public void IsEligibleForIntroOffer(string planVendorId, Action<bool> onSuccess,

public void SignPromotionalOffer(string storeOfferId, string storeProductId, Action<PromotionalOfferSignature> onSuccess,
Action<string> onError) {

var signatureCallback = new Action<string, IntPtr>((json, pointer) =>
{
AsyncCallbackHelper.Instance.Queue(() =>
Expand Down Expand Up @@ -569,6 +574,9 @@ static extern void _purchaselySetDefaultPresentationResultHandler(
IosUtils.PresentationResultCallbackDelegate presentationResultCallback,
IntPtr presentationResultCallbackPtr);

[DllImport("__Internal")]
static extern void _purchaselySetAttribute(int attribute, string value);

[DllImport("__Internal")]
static extern void _purchaselySetStringAttribute(string key, string value);

Expand Down Expand Up @@ -615,14 +623,14 @@ static extern void _purchaselyShowContentForPresentationObject(IntPtr presentati
IosUtils.VoidCallbackDelegate closeCallback, IntPtr closeCallbackPtr,
IosUtils.PresentationResultCallbackDelegate presentationResultCallback,
IntPtr presentationResultCallbackPtr);

[DllImport("__Internal")]
static extern bool _purchaselyIsAnonymous();

[DllImport("__Internal")]
static extern void _purchaselyIsEligibleForIntroOffer(string planVendorId, IosUtils.BoolCallbackDelegate successCallback, IntPtr successCallbackPtr,
IosUtils.StringCallbackDelegate errorCallback, IntPtr errorCallbackPtr);

[DllImport("__Internal")]
static extern void _purchaselySignPromotionalOffer(string storeOfferId, string storeProductId, IosUtils.SignatureCallbackDelegate successCallback, IntPtr successCallbackPtr,
IosUtils.StringCallbackDelegate errorCallback, IntPtr errorCallbackPtr);
Expand All @@ -638,4 +646,4 @@ static extern void _purchaselySignPromotionalOffer(string storeOfferId, string s
}
}

#endif
#endif
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.purchasely.unity",
"version": "1.0.0",
"version": "4.1.3",
"displayName": "Purchasely",
"description": "Subscription optimization made easy",
"unity": "2019.4",
Expand All @@ -26,4 +26,4 @@
"url": "https://www.purchasely.com/"
},
"type": "library"
}
}

0 comments on commit 633f4ed

Please sign in to comment.