예제 #1
0
 public static void LifecycleStart(Dictionary <string, string> additionalContextData)
 {
     if (additionalContextData == null)
     {
         Debug.Log("Unable to perform LifecycleStart, context data is null");
         return;
     }
                 #if UNITY_ANDROID && !UNITY_EDITOR
     AndroidJavaObject contextData = ACPHelpers.GetStringHashMapFromDictionary(additionalContextData);
     if (contextData == null)
     {
         Debug.Log("Unable to perform LifecycleStart, invalid context data");
         return;
     }
     mobileCore.CallStatic("lifecycleStart", contextData);
                 #elif UNITY_IPHONE && !UNITY_EDITOR
     string jsonContextData = ACPHelpers.JsonStringFromStringDictionary(additionalContextData);
     if (jsonContextData == null)
     {
         Debug.Log("Unable to perform LifecycleStart, invalid context data");
         return;
     }
     acp_LifecycleStart(jsonContextData);
                 #endif
 }
예제 #2
0
        public static void SyncIdentifiers(Dictionary <string, string> ids, ACPAuthenticationState authenticationState)
        {
            if (ids == null)
            {
                Debug.Log("Unable to perform SyncIdentifiers, ids are null");
                return;
            }

                        #if UNITY_ANDROID && !UNITY_EDITOR
            using (var authStateClass = new AndroidJavaClass("com.adobe.marketing.mobile.VisitorID$AuthenticationState"))
            {
                var authStateObj        = authStateClass.GetStatic <AndroidJavaObject>(authenticationState.ToString());
                AndroidJavaObject idMap = ACPHelpers.GetStringHashMapFromDictionary(ids);
                identity.CallStatic("syncIdentifiers", idMap, authStateObj);
            }
                        #elif UNITY_IPHONE && !UNITY_EDITOR
            string idsDict = ACPHelpers.JsonStringFromStringDictionary(ids);
            if (idsDict == null)
            {
                Debug.Log("Unable to perform SyncIdentifiers, ids are invalid");
                return;
            }
            acp_SyncIdentifiersWithAuthState(idsDict, (int)authenticationState);
                        #endif
        }
예제 #3
0
 public static void TrackAction(string name, Dictionary <string, string> contextDataDict)
 {
     if (name == null || contextDataDict == null)
     {
         Debug.Log("Unable to perform track action, invalid input");
         return;
     }
                 #if UNITY_ANDROID && !UNITY_EDITOR
     AndroidJavaObject contextData = ACPHelpers.GetStringHashMapFromDictionary(contextDataDict);
     mobileCore.CallStatic("trackAction", name, contextData);
                 #elif UNITY_IPHONE && !UNITY_EDITOR
     string cData = ACPHelpers.JsonStringFromStringDictionary(contextDataDict);
     if (cData == null)
     {
         Debug.Log("Unable to perform track action, contextDataDict is invalid");
         return;
     }
     acp_TrackAction(name, cData);
                 #endif
 }
예제 #4
0
        public static void SyncIdentifiers(Dictionary <string, string> ids)
        {
            if (ids == null)
            {
                Debug.Log("Unable to perform SyncIdentifiers, ids are null");
                return;
            }

                        #if UNITY_ANDROID && !UNITY_EDITOR
            AndroidJavaObject idMap = ACPHelpers.GetStringHashMapFromDictionary(ids);
            identity.CallStatic("syncIdentifiers", idMap);
                        #elif UNITY_IPHONE && !UNITY_EDITOR
            string idsDict = ACPHelpers.JsonStringFromStringDictionary(ids);
            if (idsDict == null)
            {
                Debug.Log("Unable to perform SyncIdentifiers, ids are invalid");
                return;
            }
            acp_SyncIdentifiers(idsDict);
                        #endif
        }