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); } }
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"); } }
// 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"); } }
public static void onHandleURLMessage(string _url) { EngagementAgent.Logging("OnHandleURL: " + _url); if (HandleURL != null) { HandleURL(_url); } else { EngagementAgent.Logging("WARNING: unitialized HandleURL"); } }
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 }