Exemple #1
0
 // Update is called once per frame
 void Update()
 {
             #if UNITY_IPHONE
     if (!tokenSent)
     {
         byte[] token = NotificationServices.deviceToken;
         if (token != null)
         {
             // send token to a provider
             tokenSent = true;
             string deviceToken = System.BitConverter.ToString(token).Replace("-", "");
             GTPushBinding.registerDeviceToken(deviceToken);
             Debug.Log("deviceToken is : " + deviceToken + " cid is : " + GTPushBinding.getClientId() + " version is : " + GTPushBinding.getVersion());
         }
     }
             #endif
 }
Exemple #2
0
    //-------------------------------------------------------------------------
    public void onReceiveClientId(string clientId)
    {
        Debug.Log("GeTuiSdkDidRegisterClient clientId : " + clientId);
#if UNITY_IOS
        if (!tokenSent)
        {
            byte[] token = NotificationServices.deviceToken;
            if (token != null)
            {
                // send token to a provider
                tokenSent = true;
                string deviceToken = System.BitConverter.ToString(token).Replace("-", "");
                GTPushBinding.registerDeviceToken(deviceToken);
                Debug.Log("deviceToken is : " + deviceToken + " cid is : " + GTPushBinding.getClientId() + " version is : " + GTPushBinding.getVersion());
            }
        }
#endif

//#if (UNITY_IPHONE || UNITY_ANDROID)
//        GTPushBinding.setTag("ge,tui");
//        GTPushBinding.bindAlias("getui");
//        GTPushBinding.unBindAlias("getui");
//#endif
    }