Exemple #1
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 #2
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 #3
0
 public void initPush(string appId, string appKey, string appSecret)
 {
     GTPushBinding.StartSDK(appId, appKey, appSecret);
     GTPushBinding.setListenerGameObject(PushReceiver.instance().gameObject.name);
     GTPushBinding.registerUserNotification();
 }