Exemple #1
0
            public void Send(bool showsOverlayImmediately)
            {
#if UNITY_IPHONE || UNITY_ANDROID
                if (Application.isEditor)
                {
                    Debug.Log("PlayHaven: metadata request (" + mPlacement + ")");
                    PlayHavenManager manager = PlayHavenManager.instance;
                    if (manager != null)
                    {
                        // mimic a payload for in-editor integration validation

                        Hashtable notification = new Hashtable();
                        notification["type"]  = "badge";
                        notification["value"] = "1";

                        Hashtable data = new Hashtable();
                        data["notification"] = notification;

                        Hashtable result = new Hashtable();
                        result["data"]    = data;
                        result["hash"]    = hashCode;                                           // not part of a real result; for in-editor only
                        result["name"]    = "success";                                          // not part of a real result; for in-editor only
                        result["content"] = mPlacement;

                        string jsonResult = JsonMapper.ToJson(result);
                        manager.HandleNativeEvent(jsonResult);
                    }
                }
                else
                {
                    if (Debug.isDebugBuild)
                    {
                        Debug.Log(string.Format("PlayHaven: metadata request (id={0}, placement={1})", hashCode, mPlacement));
                    }
                                        #if UNITY_IPHONE
                    _PlayHavenMetadataRequest(hashCode, PlayHavenBinding.token, PlayHavenBinding.secret, mPlacement);
                                        #elif UNITY_ANDROID
                    if (PlayHavenManager.IsAndroidSupported)
                    {
                        PlayHavenBinding.obj_PlayHavenFacade.Call("metaDataRequest", hashCode, mPlacement);
                    }
                                        #endif
                }
#endif
            }
Exemple #2
0
            public void Send(bool showsOverlayImmediately)
            {
#if UNITY_IPHONE || UNITY_ANDROID
                if (Application.isEditor)
                {
                    Debug.Log("PlayHaven: open request");
                    PlayHavenManager manager = PlayHavenManager.instance;
                    if (manager != null)
                    {
                        // mimic a payload for in-editor integration validation
                        // going to "dismiss"

                        Hashtable data = new Hashtable();
                        data["notification"] = new Hashtable();

                        Hashtable result = new Hashtable();
                        result["data"] = data;
                        result["hash"] = hashCode;
                        result["name"] = "success";

                        string jsonResult = JsonMapper.ToJson(result);
                        manager.HandleNativeEvent(jsonResult);
                    }
                }
                else
                {
                    if (Debug.isDebugBuild)
                    {
                        Debug.Log(string.Format("PlayHaven: open request (id={0})", hashCode));
                    }
                                        #if UNITY_IPHONE
                    _PlayHavenOpenRequest(hashCode, PlayHavenBinding.token, PlayHavenBinding.secret, customUDID);
                                        #elif UNITY_ANDROID
                    if (PlayHavenManager.IsAndroidSupported)
                    {
                        PlayHavenBinding.obj_PlayHavenFacade.Call("openRequest", hashCode);
                    }
                                        #endif
                }
#endif
            }
            public void Send(bool showsOverlayImmediately)
            {
                hashCode = GetHashCode();
#if UNITY_IPHONE || UNITY_ANDROID
                if (Application.isEditor)
                {
                    Debug.Log("PlayHaven: content request (" + mPlacement + ")");
                    PlayHavenManager manager = PlayHavenManager.instance;
                    if (manager != null)
                    {
                        // mimic a payload for in-editor integration validation
                        // going to "dismiss"

                        Hashtable data = new Hashtable();
                        data["notification"] = new Hashtable();

                        Hashtable result = new Hashtable();
                        result["data"] = data;
                        result["hash"] = hashCode;
                        result["name"] = "dismiss";

                        string jsonResult = JsonMapper.ToJson(result);
                        manager.HandleNativeEvent(jsonResult);
                    }
                }
                else
                {
                                        #if UNITY_IPHONE
                    _PlayHavenContentRequest(hashCode, PlayHavenBinding.token, PlayHavenBinding.secret, mPlacement, showsOverlayImmediately);
                                        #elif UNITY_ANDROID
                    if (PlayHavenManager.IsAndroidSupported)
                    {
                        PlayHavenBinding.obj_PlayHavenFacade.Call("contentRequest", hashCode, mPlacement);
                    }
                                        #endif
                }
#endif
            }