예제 #1
0
        public static void onDataPushMessage(string _serialized)
        {
            Dictionary <string, object> dict = (Dictionary <string, object>)MiniJSON.Json.Deserialize(_serialized);
            string category = null;
            string body     = null;
            bool   isBase64 = (bool)dict ["isBase64"];

            if (dict["category"] != null)
            {
                category = WWW.UnEscapeURL(dict["category"].ToString(), System.Text.Encoding.UTF8);
            }

            EngagementAgent.Logging("DataPushReceived, category: " + category + ", isBase64:" + isBase64);

            if (isBase64 == false)
            {
                body = WWW.UnEscapeURL(dict["body"].ToString(), System.Text.Encoding.UTF8);
                onDataPushString(category, body);
            }
            else
            {
                body = dict ["body"].ToString();
                byte[] data = Convert.FromBase64String(body);
                onDataPushBase64(category, data, body);
            }
        }
예제 #2
0
 public static void onDataPushBase64(string _category, byte [] _data, string _body)
 {
     EngagementAgent.Logging("onDataPushBase64, category:" + _category);
     if (Base64DataPushReceived != null)
     {
         Base64DataPushReceived(_category, _data, _body);
     }
     else
     {
         EngagementAgent.Logging("WARNING: unitialized Base64DataPushReceived");
     }
 }
예제 #3
0
        // Delegates from Native

        public static void onDataPushString(string _category, string _body)
        {
            EngagementAgent.Logging("onDataPushString, category:" + _category);
            if (StringDataPushReceived != null)
            {
                StringDataPushReceived(_category, _body);
            }
            else
            {
                EngagementAgent.Logging("WARNING: unitialized StringDataPushReceived");
            }
        }
예제 #4
0
 public static void onHandleURLMessage(string _url)
 {
     EngagementAgent.Logging("OnHandleURL: " + _url);
     if (HandleURL != null)
     {
         HandleURL(_url);
     }
     else
     {
         EngagementAgent.Logging("WARNING: unitialized HandleURL");
     }
 }
예제 #5
0
        public static void Initialize( )
        {
            EngagementAgent.Logging("Initializing Reach");

            if (EngagementConfiguration.ENABLE_REACH == false)
            {
                Debug.LogError("Reach must be enabled in configuration first");
                return;
            }

            if (EngagementAgent.hasBeenInitialized == false)
            {
                Debug.LogError("Agent must be initialized before initializing Reach");
                return;
            }
#if UNITY_WSA && !UNITY_EDITOR
#else
            EngagementWrapper.initializeReach();
#endif
        }