Exemple #1
0
    //
    //GetuiSDK 回调
    //

    /**
     *  SDK登入成功返回clientId
     *
     *  @param clientId 标识用户的clientId
     *  说明:启动GeTuiSdk后,SDK会自动向个推服务器注册SDK,当成功注册时,SDK通知应用注册成功。
     *  注意: 注册成功仅表示推送通道建立,如果appid/appkey/appSecret等验证不通过,依然无法接收到推送消息,请确保验证信息正确。
     */
    public void onReceiveClientId(string clientId)
    {
        Debug.Log("GeTuiSdkDidRegisterClient clientId : " + clientId);
                #if (UNITY_IPHONE || UNITY_ANDROID)
        GTPushBinding.setTag("ge,tui");
        GTPushBinding.bindAlias("getui");
        GTPushBinding.unBindAlias("getui");
                #endif
    }
Exemple #2
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 #3
0
    // Use this for initialization
    void Start()
    {
                #if UNITY_IPHONE
        tokenSent = false;
        GTPushBinding.StartSDK(appId, appKey, appSecret);
        GTPushBinding.setListenerGameObject(this.gameObject.name);
        GTPushBinding.registerUserNotification();
                #endif

                #if UNITY_ANDROID
        GTPushBinding.initPush(this.gameObject.name);
                #endif

                #if (UNITY_IPHONE || UNITY_ANDROID)
        Debug.Log("isPushTurnOn is : " + GTPushBinding.isPushTurnOn());
                #endif
    }
Exemple #4
0
    public void Init(string app_id, string app_key, string app_secret)
    {
#if UNITY_IPHONE
        tokenSent = false;
        GTPushBinding.StartSDK(app_id, app_key, app_secret);
        GTPushBinding.setListenerGameObject(this.gameObject.name);
        GTPushBinding.registerUserNotification();
        // 注册 VoIP 通知
        GTPushBinding.voipRegistration();
#endif

#if UNITY_ANDROID
        GTPushBinding.initPush(this.gameObject.name);
#endif

#if (UNITY_IPHONE || UNITY_ANDROID)
        Debug.Log("getui sdk version is : " + GTPushBinding.getVersion());
        Debug.Log("isPushTurnOn is : " + GTPushBinding.isPushTurnOn());
#endif
    }
Exemple #5
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
    }
 public void initPush(string appId, string appKey, string appSecret)
 {
     GTPushBinding.initPush(PushReceiver.instance().gameObject.name);
 }
Exemple #7
0
 public void initPush(string appId, string appKey, string appSecret)
 {
     GTPushBinding.StartSDK(appId, appKey, appSecret);
     GTPushBinding.setListenerGameObject(PushReceiver.instance().gameObject.name);
     GTPushBinding.registerUserNotification();
 }