// 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 }
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 }