From de293abd0cff56857d546a3fc126b45dc6241521 Mon Sep 17 00:00:00 2001 From: nur nachman Date: Thu, 4 Jul 2024 15:56:18 +0300 Subject: [PATCH] RC 5.1.3: - removes obsolete #UNITY_PURCHASING directive from APIs and fixes access to Singular APIs for In App Purchasing. - adds unity purchasing library of the minimum required version as a dependency of the Singular plugin. - exposes 2 new APIs: revenue/custome revenue with attributes. - upgrades underlying Singular native iOS SDK version to 12.4.4 (latest). - upgrades underlying Singular native Android SDK version to 12.5.6 (latest). - upgrades android bridge version to 6.7.4 (latest). - finetunes .meta files for iOS build target. - cleanup and style. - bumps plugin version numbers. --- SingularSDK/Editor/Dependencies.xml | 4 +- .../Plugins/Android/SingularUnityBridge.jar | Bin 14654 -> 15546 bytes .../Plugins/iOS/SingularAppDelegate.m.meta | 16 ++- .../Plugins/iOS/SingularStateWrapper.h.meta | 2 + .../Plugins/iOS/SingularStateWrapper.m.meta | 16 ++- .../iOS/SingularSwizzledAppController.m.meta | 16 ++- .../Plugins/iOS/SingularUnityWrapper.mm | 33 +++++- .../Plugins/iOS/SingularUnityWrapper.mm.meta | 16 ++- SingularSDK/Runtime/SingularSDK.asmdef | 5 +- SingularSDK/Runtime/SingularSDK.cs | 111 ++++++++++++++---- package.json | 5 +- 11 files changed, 188 insertions(+), 36 deletions(-) diff --git a/SingularSDK/Editor/Dependencies.xml b/SingularSDK/Editor/Dependencies.xml index bc92f23..d162655 100644 --- a/SingularSDK/Editor/Dependencies.xml +++ b/SingularSDK/Editor/Dependencies.xml @@ -1,6 +1,6 @@ - + https://maven.singular.net @@ -10,7 +10,7 @@ - + diff --git a/SingularSDK/Plugins/Android/SingularUnityBridge.jar b/SingularSDK/Plugins/Android/SingularUnityBridge.jar index 6f131be018b0291aedb7b7f92d0c68a92d13dec1..df71aaab5f383ad6c397f48a059b64c505b089de 100644 GIT binary patch delta 10547 zcmZ9SWmsHG)2<0FLvS4=xVw9h;O_431lI|g;0%MiySux)dxAT`UBZ{W-|IW)yl4IG zURBl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WZ+z3_cmyx^#Gg z=IO(AZ1t0Z{INhR-svm;tev6eG*B->)Q_~uMN3-3U{3z5lWKr2fA9XM-lN(NN3*q` z#>C%x+R!bt`5UB4)7lp)f`4w^wFFiqeGQ!_@7@s_vMM(+IqFmC++Pc3u24Vi{@fhV za95kDzE}ys;Z#CtAB4uqSlDmDd(ZOE4d}&o zVwE|@Y^^3SM<7mZK_^Og^yU5ZEXl9>5UH{D_|;wY3rq#N$gP-I@Z=>XNmlJ^g7MfW zQ?N-3EMKA89c;)%-!l$Y_)J6cRk6m#3ZQ^WohI<6cPnEokd;A(I-ZhQFXv^PP0!5T5f;$)^F{la-nY@abA(eXK*!hT>9|9<5JfBtiUtnzxn9l^ptVBzT@ z9B(inHvIUc|2cT)fdTwc|L?N}_gBdW`OSw9|Ifq~pWg=l@9+&0#BT-oH$8`3^P7|Y z8<+m!>Hlp-AM>vjwm*0s04e`~Px_abUj4zNdw<9Z?|-c~g$)BS!Q=P?S}92X4N?D( zN&xS#>cd~(;s0V(NR9v=Tmiw~m+X)O0dmrRg+ZkMe_PL#|56!H0saZ&e+HlHzqTbs_gBdZNfIJQRN(#_-2Vsm5G2I_ diff --git a/SingularSDK/Plugins/iOS/SingularAppDelegate.m.meta b/SingularSDK/Plugins/iOS/SingularAppDelegate.m.meta index 3e567b8..9a68c0d 100644 --- a/SingularSDK/Plugins/iOS/SingularAppDelegate.m.meta +++ b/SingularSDK/Plugins/iOS/SingularAppDelegate.m.meta @@ -11,6 +11,20 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 - first: Any: second: @@ -30,7 +44,7 @@ PluginImporter: - first: tvOS: tvOS second: - enabled: 1 + enabled: 0 settings: {} userData: assetBundleName: diff --git a/SingularSDK/Plugins/iOS/SingularStateWrapper.h.meta b/SingularSDK/Plugins/iOS/SingularStateWrapper.h.meta index 1e4d861..f8d7b86 100644 --- a/SingularSDK/Plugins/iOS/SingularStateWrapper.h.meta +++ b/SingularSDK/Plugins/iOS/SingularStateWrapper.h.meta @@ -20,9 +20,11 @@ PluginImporter: Exclude Editor: 1 Exclude Linux64: 1 Exclude OSXUniversal: 1 + Exclude WebGL: 1 Exclude Win: 1 Exclude Win64: 1 Exclude iOS: 0 + Exclude tvOS: 1 - first: Android: Android second: diff --git a/SingularSDK/Plugins/iOS/SingularStateWrapper.m.meta b/SingularSDK/Plugins/iOS/SingularStateWrapper.m.meta index ca51dfb..510e9b2 100644 --- a/SingularSDK/Plugins/iOS/SingularStateWrapper.m.meta +++ b/SingularSDK/Plugins/iOS/SingularStateWrapper.m.meta @@ -11,6 +11,20 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 - first: Any: second: @@ -30,7 +44,7 @@ PluginImporter: - first: tvOS: tvOS second: - enabled: 1 + enabled: 0 settings: {} userData: assetBundleName: diff --git a/SingularSDK/Plugins/iOS/SingularSwizzledAppController.m.meta b/SingularSDK/Plugins/iOS/SingularSwizzledAppController.m.meta index 71a1523..71ec8e7 100644 --- a/SingularSDK/Plugins/iOS/SingularSwizzledAppController.m.meta +++ b/SingularSDK/Plugins/iOS/SingularSwizzledAppController.m.meta @@ -11,6 +11,20 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 - first: Any: second: @@ -30,7 +44,7 @@ PluginImporter: - first: tvOS: tvOS second: - enabled: 1 + enabled: 0 settings: {} userData: assetBundleName: diff --git a/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm b/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm index 216bb64..d5e8339 100644 --- a/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm +++ b/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm @@ -404,22 +404,45 @@ int SetDeferredDeepLinkTimeout_(int duration){ } // Revenue methods - void Revenue_(const char* currency, double amount){ + void Revenue_(const char* currency, double amount) { [Singular revenue:[NSString stringWithUTF8String:currency] amount:amount]; } - void CustomRevenue_(const char* eventName, const char* currency, double amount){ + void CustomRevenue_(const char* eventName, const char* currency, double amount) { [Singular customRevenue:[NSString stringWithUTF8String:eventName] currency:[NSString stringWithUTF8String:currency] amount:amount]; } - void RevenueWithAllParams_(const char* currency, double amount, const char* productSKU, const char* productName, const char* productCategory, int productQuantity, double productPrice){ + void RevenueWithAllParams_(const char* currency, double amount, const char* productSKU, const char* productName, const char* productCategory, int productQuantity, double productPrice) { [Singular revenue:[NSString stringWithUTF8String:currency] amount:amount productSKU:[NSString stringWithUTF8String:productSKU] productName:[NSString stringWithUTF8String:productName] productCategory:[NSString stringWithUTF8String:productCategory] productQuantity:productQuantity productPrice:productPrice]; } - void CustomRevenueWithAllParams_(const char* eventName, const char* currency, double amount, const char* productSKU, const char* productName, const char* productCategory, int productQuantity, double productPrice){ + void CustomRevenueWithAllParams_(const char* eventName, const char* currency, double amount, const char* productSKU, const char* productName, const char* productCategory, int productQuantity, double productPrice) { [Singular customRevenue:[NSString stringWithUTF8String:eventName] currency:[NSString stringWithUTF8String:currency] amount:amount productSKU:[NSString stringWithUTF8String:productSKU] productName:[NSString stringWithUTF8String:productName] productCategory:[NSString stringWithUTF8String:productCategory] productQuantity:productQuantity productPrice:productPrice]; } - + + void RevenueWithAttributes_(const char* currency, double amount, const char* attributesAsJson) { + NSError *error; + NSDictionary* attributesDictionary = [NSJSONSerialization JSONObjectWithData:[[NSString stringWithUTF8String:attributesAsJson] + dataUsingEncoding:NSUTF8StringEncoding] options:0 error:&error]; + if (!error) { + [Singular revenue:[NSString stringWithUTF8String:currency] + amount:amount + withAttributes:attributesDictionary]; + } + } + + void CustomRevenueWithAttributes_(const char* eventName, const char* currency, double amount, const char* attributesAsJson) { + NSError *error; + NSDictionary* attributesDictionary = [NSJSONSerialization JSONObjectWithData:[[NSString stringWithUTF8String:attributesAsJson] + dataUsingEncoding:NSUTF8StringEncoding] options:0 error:&error]; + if (!error) { + [Singular customRevenue:[NSString stringWithUTF8String:eventName] + currency:[NSString stringWithUTF8String:currency] + amount:amount + withAttributes:attributesDictionary]; + } + } + // Custom user id void SetCustomUserId_(const char* customUserId){ [Singular setCustomUserId:[NSString stringWithUTF8String:customUserId]]; diff --git a/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm.meta b/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm.meta index da62e61..6257585 100644 --- a/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm.meta +++ b/SingularSDK/Plugins/iOS/SingularUnityWrapper.mm.meta @@ -11,6 +11,20 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 1 - first: Any: second: @@ -30,7 +44,7 @@ PluginImporter: - first: tvOS: tvOS second: - enabled: 1 + enabled: 0 settings: {} userData: assetBundleName: diff --git a/SingularSDK/Runtime/SingularSDK.asmdef b/SingularSDK/Runtime/SingularSDK.asmdef index 1b0d872..a0769b4 100644 --- a/SingularSDK/Runtime/SingularSDK.asmdef +++ b/SingularSDK/Runtime/SingularSDK.asmdef @@ -1,6 +1,9 @@ { "name": "SingularSDK", - "references": [], + "rootNamespace": "", + "references": [ + "UnityEngine.Purchasing" + ], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, diff --git a/SingularSDK/Runtime/SingularSDK.cs b/SingularSDK/Runtime/SingularSDK.cs index 7ded107..94bb734 100644 --- a/SingularSDK/Runtime/SingularSDK.cs +++ b/SingularSDK/Runtime/SingularSDK.cs @@ -3,11 +3,10 @@ using System.Collections.Generic; using System.Globalization; using System.Runtime.InteropServices; +using System.Text.RegularExpressions; using Newtonsoft.Json; using UnityEngine; -#if UNITY_5_3_OR_NEWER && UNITY_PURCHASING using UnityEngine.Purchasing; -#endif namespace Singular { @@ -26,7 +25,7 @@ public class SingularSDK : MonoBehaviour private static bool Initialized = false; private const string UNITY_WRAPPER_NAME = "Unity"; - private const string UNITY_VERSION = "5.1.1"; + private const string UNITY_VERSION = "5.1.3"; // ios-only: [Obsolete] @@ -150,8 +149,7 @@ public static void InitializeSingularSDK() #endif Initialized = true; } - - + public static void createReferrerShortLink(string baseLink, string referrerName, string referrerId, Dictionary passthroughParams, ShortLinkCallback completionHandler) { @@ -236,8 +234,8 @@ private static void InitAndroidJavaClasses() { private static AndroidJavaObject JavaArrayFromCS(string[] values) { AndroidJavaClass arrayClass = new AndroidJavaClass("java.lang.reflect.Array"); - AndroidJavaObject arrayObject = - arrayClass.CallStatic("newInstance", new AndroidJavaClass("java.lang.String"), values.Length); + AndroidJavaObject arrayObject = arrayClass.CallStatic("newInstance", new AndroidJavaClass("java.lang.String"), values.Length); + for (int i = 0; i < values.Length; ++i) { arrayClass.CallStatic("set", arrayObject, i, new AndroidJavaObject("java.lang.String", values[i])); } @@ -320,7 +318,15 @@ private enum NSType private static extern void CustomRevenue_(string eventName, string currency, double amount); [DllImport("__Internal")] - private static extern void RevenueWithAllParams_(string currency, double amount, string productSKU, string productName, string productCategory, int productQuantity, double productPrice);[DllImport("__Internal")] private static extern void CustomRevenueWithAllParams_(string eventName, string currency, double amount, string productSKU, string productName, string productCategory, int productQuantity, double productPrice); + private static extern void RevenueWithAllParams_(string currency, double amount, string productSKU, string productName, string productCategory, int productQuantity, double productPrice); + [DllImport("__Internal")] + private static extern void CustomRevenueWithAllParams_(string eventName, string currency, double amount, string productSKU, string productName, string productCategory, int productQuantity, double productPrice); + + [DllImport("__Internal")] + private static extern void RevenueWithAttributes_(string currency, double amount, string attributesJson); + + [DllImport("__Internal")] + private static extern void CustomRevenueWithAttributes_(string eventName, string currency, double amount, string attributesJson); // Auxiliary functions; [DllImport("__Internal")] @@ -719,9 +725,7 @@ public static void Event(Dictionary args, string name) Free_NSDictionary(); Free_NSMasterArray(); #elif UNITY_ANDROID - AndroidJavaObject json = - new AndroidJavaObject("org.json.JSONObject", JsonConvert.SerializeObject(args, Formatting.None)); - + AndroidJavaObject json = new AndroidJavaObject("org.json.JSONObject", JsonConvert.SerializeObject(args, Formatting.None)); if (singular != null) { status = singular.CallStatic("eventJSON", name, json); } @@ -1136,9 +1140,9 @@ private void SingularSdidReceived(string result) } #endregion // end sdid - -#if UNITY_5_3_OR_NEWER && UNITY_PURCHASING +#region IAP + public static void InAppPurchase(IEnumerable products, Dictionary attributes, bool isRestored = false) { InAppPurchase("__iap__", products, attributes, isRestored); @@ -1285,7 +1289,13 @@ private static Dictionary BuildAndroidPurchaseAttributes(Product } #endif -#endif + #endregion // end region IAP + + #region Revenue + + private const string androidNativeMethodName_Revenue = "revenue"; + private const string androidNativeMethodName_CustomRevenue = "customRevenue"; + public static void Revenue(string currency, double amount) { if (Application.isEditor) @@ -1296,7 +1306,8 @@ public static void Revenue(string currency, double amount) Revenue_(currency, amount); #elif UNITY_ANDROID if (singular != null) { - singular.CallStatic("revenue", currency, amount); + singular.CallStatic(androidNativeMethodName_Revenue, + currency, amount); } #endif } @@ -1311,7 +1322,8 @@ public static void CustomRevenue(string eventName, string currency, double amoun CustomRevenue_(eventName, currency, amount); #elif UNITY_ANDROID if (singular != null) { - singular.CallStatic("customRevenue", eventName, currency, amount); + singular.CallStatic(androidNativeMethodName_CustomRevenue, + eventName, currency, amount); } #endif } @@ -1324,7 +1336,8 @@ public static void Revenue(string currency, double amount, string receipt, strin } #if UNITY_ANDROID if (singular != null) { - singular.CallStatic("revenue", currency, amount, receipt, signature); + singular.CallStatic(androidNativeMethodName_Revenue, + currency, amount, receipt, signature); } #endif } @@ -1338,7 +1351,8 @@ public static void CustomRevenue(string eventName, string currency, double amoun } #if UNITY_ANDROID if (singular != null) { - singular.CallStatic("customRevenue", eventName, currency, amount, receipt, signature); + singular.CallStatic(androidNativeMethodName_CustomRevenue, + eventName, currency, amount, receipt, signature); } #endif } @@ -1353,10 +1367,10 @@ public static void Revenue(string currency, double amount, string productSKU, st #if UNITY_IOS RevenueWithAllParams_(currency, amount, productSKU, productName, productCategory, productQuantity, productPrice); - #elif UNITY_ANDROID if (singular != null) { - singular.CallStatic("revenue", currency, amount, productSKU, productName, productCategory, productQuantity, productPrice); + singular.CallStatic(androidNativeMethodName_Revenue, + currency, amount, productSKU, productName, productCategory, productQuantity, productPrice); } #endif } @@ -1370,13 +1384,66 @@ public static void CustomRevenue(string eventName, string currency, double amoun } #if UNITY_IOS CustomRevenueWithAllParams_(eventName, currency, amount, productSKU, productName, productCategory, productQuantity, productPrice); - #elif UNITY_ANDROID if (singular != null) { - singular.CallStatic("customRevenue", eventName, currency, amount, productSKU, productName, productCategory, productQuantity, productPrice); + singular.CallStatic(androidNativeMethodName_CustomRevenue, + eventName, currency, amount, productSKU, productName, productCategory, productQuantity, productPrice); } #endif } + + public static void Revenue(string currency, double amount, Dictionary attributes) + { + if (Application.isEditor) + { + return; + } + + try + { + string attributesAsJsonString = JsonConvert.SerializeObject(attributes); + #if UNITY_IOS + RevenueWithAttributes_(currency, amount, attributesAsJsonString); + #elif UNITY_ANDROID + if (jniSingularUnityBridge != null) + { + jniSingularUnityBridge.CallStatic("revenueWithAttributes", currency, amount.ToString(), attributesAsJsonString); + } + #endif + } + catch (Exception) + { + + } + + } + + public static void CustomRevenue(string eventName, string currency, double amount, Dictionary attributes) + { + if (Application.isEditor) + { + return; + } + + try + { + string attributesAsJsonString = JsonConvert.SerializeObject(attributes); + #if UNITY_IOS + CustomRevenueWithAttributes_(eventName, currency, amount, attributesAsJsonString); + #elif UNITY_ANDROID + if (jniSingularUnityBridge != null) + { + jniSingularUnityBridge.CallStatic("customRevenueWithAttributes", eventName, currency, amount.ToString(), attributesAsJsonString); + } + #endif + } + catch (Exception) + { + + } + } + + #endregion // end region Revenue public static void RegisterTokenForUninstall(String token) { diff --git a/package.json b/package.json index de96175..df705a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "singular-unity-package", - "version": "5.1.1", + "version": "5.1.3", "displayName": "Singular", "description": "Singular Unity Package", "type": "library", @@ -12,6 +12,7 @@ }, "unity": "2019.4", "dependencies": { - "com.unity.nuget.newtonsoft-json": "3.2.1" + "com.unity.nuget.newtonsoft-json": "3.2.1", + "com.unity.purchasing": "2.0.6" } } \ No newline at end of file