Пример #1
0
        /// <summary>
        /// iOS,Androidそれぞれの端末登録を行う
        /// </summary>
        /// <param name="usePush">true:プッシュ通知有効 false:プッシュ通知無効</param>
        /// <param name="useAnalytics">true:開封通知有効 false:開封通知無効</param>
        /// <param name="androidSenderId">Android SenderId</param>
        /// <param name="getLocation">true:位置情報有効 false:位置情報無効</param>
        private static void RegisterPush(bool usePush, bool useAnalytics, String androidSenderId, bool getLocation = false)
        {
            //Push関連設定
            _usePush         = usePush;
            _useAnalytics    = useAnalytics;
            _androidSenderId = androidSenderId;

            // Register
            if (usePush)
            {
                //Installation基本情報を取得
                NCMBManager.CreateInstallationProperty();
                if (!getLocation)
                {
                    #if UNITY_ANDROID
                    NCMBPush.Register(androidSenderId);
                    #elif UNITY_IOS
                    NCMBPush.Register(useAnalytics);
                    #endif
                }
                else
                {
                    #if UNITY_ANDROID
                    //not Analytics
                    NCMBPush.RegisterWithLocation(androidSenderId);
                    #elif UNITY_IOS
                    NCMBPush.RegisterWithLocation();
                    #endif
                }
            }
        }