//------------------------------------------------------------------
    /// Requests a Device Identifier for Push Notifications.
    //------------------------------------------------------------------
    private void RegisterForPushNotification()
    {
        UnityEngine.Debug.Log("PushNotificationDemoSceneController : RegisterForPushNotification - Attempting to register!");

#if UNITY_ANDROID
        GooglePushNotificationHandler.GenerateDeviceID(k_senderID);
        GooglePushNotificationHandler.SetNotificationIcon("notificationicon");
#elif UNITY_IOS
        iOSPushNotificationHandler.Register();
#endif
    }
    //------------------------------------------------------------------
    /// Initilisation that creates an instance of ChilliConnect and subscribes
    /// to Push Notification listener events.
    //------------------------------------------------------------------
    private void Awake()
    {
        m_chilliConnect = new ChilliConnectSdk(k_chilliConnectToken, false);

#if UNITY_ANDROID && !UNITY_EDITOR
        GooglePushNotificationHandler.SetRecieverGameObject("GooglePushNotificationListener");
        GameObject.FindObjectOfType <GooglePushNotificationListener>().RegistrationSucceededEvent = OnPluginRegistered;
        GameObject.FindObjectOfType <GooglePushNotificationListener>().RegistrationFailedEvent    = OnPluginFailed;
#elif UNITY_IOS
        GameObject.FindObjectOfType <iOSPushNotificationListener>().RegistrationSucceededEvent = OnPluginRegistered;
        GameObject.FindObjectOfType <iOSPushNotificationListener>().RegistrationFailedEvent    = OnPluginFailed;
#endif
    }
Ejemplo n.º 3
0
 //------------------------------------------------------------------
 private void Awake()
 {
     GooglePushNotificationHandler.SetRecieverGameObject(name);
 }