Exemplo n.º 1
0
        /* ===================================================================
         * Helper Methods
         * =================================================================== */
                 #if UNITY_ANDROID
        internal static Dictionary <string, string> dictFromVisitorIdentifier(AndroidJavaObject visitorId)
        {
            if (visitorId == null)
            {
                return(null);
            }
            Dictionary <string, string> dict = new Dictionary <string, string> ();

            dict.Add("idOrigin", visitorId.Call <string>("getIdOrigin"));
            dict.Add("idType", visitorId.Call <string>("getIdType"));
            dict.Add("identifier", visitorId.Call <string>("getId"));
            dict.Add("authenticationState", ACPIdentity.stringFromAuthState(visitorId.Call <AndroidJavaObject>("getAuthenticationState")));
            return(dict);
        }
Exemplo n.º 2
0
        void call(AndroidJavaObject visitorIds)
        {
            if (visitorIds == null)
            {
                redirectedDelegate("");
                return;
            }

            int           length     = visitorIds.Call <int>("size");
            List <string> visIdsList = new List <string>();

            for (int i = 0; i < length; i++)
            {
                AndroidJavaObject           visitorId     = visitorIds.Call <AndroidJavaObject>("get", i);
                Dictionary <string, string> vistiorIdDict = ACPIdentity.dictFromVisitorIdentifier(visitorId);
                visIdsList.Add(ACPHelpers.JsonStringFromStringDictionary(vistiorIdDict));
            }
            string result = string.Join(",", visIdsList.ToArray());

            redirectedDelegate(result);
        }