diff --git a/Runtime/Platform/IOS/PurchaselyIos.cs b/Runtime/Platform/IOS/PurchaselyIos.cs index 8475951..93bc54a 100644 --- a/Runtime/Platform/IOS/PurchaselyIos.cs +++ b/Runtime/Platform/IOS/PurchaselyIos.cs @@ -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); @@ -348,7 +353,7 @@ public bool IsAnonymous() { return _purchaselyIsAnonymous(); } - + public void IsEligibleForIntroOffer(string planVendorId, Action onSuccess, Action onError) { var eligibilityCallback = new Action(isEligible => @@ -363,7 +368,7 @@ public void IsEligibleForIntroOffer(string planVendorId, Action onSuccess, public void SignPromotionalOffer(string storeOfferId, string storeProductId, Action onSuccess, Action onError) { - + var signatureCallback = new Action((json, pointer) => { AsyncCallbackHelper.Instance.Queue(() => @@ -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); @@ -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); @@ -638,4 +646,4 @@ static extern void _purchaselySignPromotionalOffer(string storeOfferId, string s } } -#endif \ No newline at end of file +#endif diff --git a/package.json b/package.json index e014463..34b8a7e 100644 --- a/package.json +++ b/package.json @@ -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", @@ -26,4 +26,4 @@ "url": "https://www.purchasely.com/" }, "type": "library" -} \ No newline at end of file +}