public void RegisterForRemoteNotifications()
        {
            if (!m_registeredForOneSignalPushNotifications)
            {
                m_registeredForOneSignalPushNotifications = true;

                OneSignal.RegisterForPushNotifications();
                OneSignal.SetSubscription(true);
            }
        }
Пример #2
0
        /// <summary>
        /// Registers to receive remote notifications via Push Notification service.
        /// </summary>
        /// <description>
        /// Call this method to initiate the registration process with Push Notification service.
        /// When registration process completes, <see cref="DidFinishRegisterForRemoteNotificationEvent"/> is fired.
        /// If registration succeeds, then you should pass device token to the server you use to generate remote notifications.
        /// </description>
        /// <remarks>
        /// \note If you want your app’s remote notifications to display alerts, play sounds etc you must call the <see cref="RegisterNotificationTypes"/> method before registering for remote notifications.
        /// </remarks>
        public void RegisterForRemoteNotifications()
        {
#if (!USES_ONE_SIGNAL || UNITY_EDITOR)
            m_platform.RegisterForRemoteNotifications();
#else
            if (!m_registeredForOneSignalPushNotifications)
            {
                m_registeredForOneSignalPushNotifications = true;

                OneSignal.RegisterForPushNotifications();
                OneSignal.SetSubscription(true);
            }
#endif
        }
        /// <summary>
        /// Registers to receive remote notifications via Push Notification service.
        /// </summary>
        /// <description>
        /// Call this method to initiate the registration process with Push Notification service.
        /// When registration process completes, <see cref="DidFinishRegisterForRemoteNotificationEvent"/> is fired.
        /// If registration succeeds, then you should pass device token to the server you use to generate remote notifications.
        /// </description>
        /// <remarks>
        /// \note If you want your app’s remote notifications to display alerts, play sounds etc you must call the <see cref="RegisterNotificationTypes"/> method before registering for remote notifications.
        /// </remarks>
        public void RegisterForRemoteNotifications()
        {
#if (!USES_ONE_SIGNAL || UNITY_EDITOR)
            m_platform.RegisterForRemoteNotifications();
#else
            if (!m_registeredForOneSignalPushNotifications)
            {
                m_registeredForOneSignalPushNotifications = true;

                OneSignal.RegisterForPushNotifications();
                OneSignal.SetSubscription(true);

#if NP_DEBUG
                Debug.Log("[NotificationService] One Signal Library don't give access to device token. It handles internally and passes to its server.");
#endif
                DidRegisterRemoteNotification(null);
            }
#endif
        }
 public void RegisterForPushNotifications()
 {
     OneSignal.RegisterForPushNotifications();
 }