Exemplo n.º 1
0
    // Mostra uma mensagem na tela com um botao
    public override void showMessage(string title = "", string message = "", string button = "")
    {
        if (title.IsEmpty())
        {
            title = Flow.messageOkDialog.transform.FindChild("BackgroundBorder").FindChild("BackgroundTitle").FindChild("TitlePanel").FindChild("Title").GetComponent <SpriteText>().Text;
        }

        if (message.IsEmpty())
        {
            message = Flow.messageOkDialog.transform.FindChild("BackgroundBorder").FindChild("BackgroundBody").FindChild("MessagePanel").FindChild("Message").GetComponent <SpriteText>().Text;
        }

        if (button.IsEmpty())
        {
            try
            {
                button = Flow.messageOkDialog.transform.FindChild("BackgroundBorder").FindChild("BackgroundBody").FindChild("ConfirmButtonPanel").FindChild("ConfirmButton").FindChild("control_text").GetComponent <SpriteText>().Text;
            }
            catch
            {
                button = default_ok_button;
            }
        }

        EtceteraAndroid.showAlert(title, filterMessage(message), button);
    }
Exemplo n.º 2
0
    public void NotificationOnOff()
    {
        if (GameData.isMusicON)
        {
            MainDriver.Instance.PlayButtonSound();
        }
        if (GameData.isNotifcationON)
        {
            GameData.isNotifcationON = false;
            notificationText.text    = "OFF";
            notificationText.color   = offColor;
        }
        else
        {
            GameData.isNotifcationON = true;
            notificationText.text    = "ON";
            notificationText.color   = onColor;

                        #if UNITY_ANDROID
            EtceteraAndroid.cancelNotification(Constants.H4);
            EtceteraAndroid.cancelNotification(Constants.H8);
            EtceteraAndroid.cancelNotification(Constants.D1);
            EtceteraAndroid.cancelNotification(Constants.D3);
            EtceteraAndroid.cancelNotification(Constants.D7);
            EtceteraAndroid.cancelNotification(Constants.D14);
            EtceteraAndroid.cancelNotification(Constants.D30);
            EtceteraAndroid.cancelAllNotifications();
                        #elif UNITY_IOS
            NotificationServices.ClearLocalNotifications();
            NotificationServices.CancelAllLocalNotifications();
                        #endif
        }
        PlayerPrefs.SetBool(Constants.KEY_NOTIFICATIONS, GameData.isNotifcationON);
        PlayerPrefs.Flush();
    }
Exemplo n.º 3
0
    public void NativeShare(ShareType type, string msg = "")
    {
        string Message = "";

        for (int i = 0; i < Messages.Count; i++)
        {
            if (Messages[i].ShareType == type)
            {
                if (Messages[i].Append.Append == AppendAction.Begin)
                {
                    Message += msg + " ";
                }
                Message = AppendMessages(Message, i, Messages[i].Append.Append, msg);
                if (Messages[i].Append.Append == AppendAction.End)
                {
                    Message += msg;
                }
            }
        }

        Debug.Log(Message);

        #if UNITY_IOS
        string[] array = new string[] { Message };
        SharingBinding.shareItems(array);
        #endif

        #if UNITY_ANDROID
        EtceteraAndroid.shareWithNativeShareIntent(Message, null, null);
        #endif
    }
Exemplo n.º 4
0
    public IEnumerator ShowPopup(string title, string message, string[] buttons, System.Action <string> pressed)
    {
        HideSpinner();

        this._buttonPressed = "none";
        if (buttons.Length > 2)
        {
            Debug.LogWarning("UIPopup.ShowPopup can only show 2 buttons.", gameObject);
            yield return(null);
        }
                #if UNITY_IOS && !UNITY_EDITOR
        EtceteraBinding.showAlertWithTitleMessageAndButtons(title, message, buttons);
                #elif UNITY_ANDROID && !UNITY_EDITOR
        if (buttons.Length < 2)
        {
            EtceteraAndroid.showAlert(title, message, buttons[0]);
        }
        else
        {
            EtceteraAndroid.showAlert(title, message, buttons[0], buttons[1]);
        }
                #else
        cam.enabled = true;
        customAlert.Show(title, message, buttons);
                #endif
        while (this._buttonPressed == "none")
        {
            yield return(new WaitForEndOfFrame());
        }

        pressed(_buttonPressed);
    }
Exemplo n.º 5
0
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Show Inline Web View"))
        {
            EtceteraAndroid.inlineWebViewShow("http://prime31.com/", 160, 430, Screen.width - 160, Screen.height - 100);
        }


        if (GUILayout.Button("Close Inline Web View"))
        {
            EtceteraAndroid.inlineWebViewClose();
        }


        if (GUILayout.Button("Set Url of Inline Web View"))
        {
            EtceteraAndroid.inlineWebViewSetUrl("http://google.com");
        }


        if (GUILayout.Button("Set Frame of Inline Web View"))
        {
            EtceteraAndroid.inlineWebViewSetFrame(80, 50, 300, 400);
        }


        endColumn(true);


        if (GUILayout.Button("Schedule Notification in 5 Seconds"))
        {
            EtceteraAndroid.scheduleNotification(5, "Notiifcation Title", "The subtitle of the notification", "Ticker text gets ticked", "my-special-data");
        }


        if (GUILayout.Button("Schedule Notification in 10 Seconds"))
        {
            EtceteraAndroid.scheduleNotification(10, "Notiifcation Title", "The subtitle of the notification", "Ticker text gets ticked", "my-special-data");
        }


        if (GUILayout.Button("Check for Noitifications"))
        {
            EtceteraAndroid.checkForNotifications();
        }


        endColumn();


        if (bottomRightButton("Previous Scene"))
        {
            Application.LoadLevel("EtceteraTestScene");
        }
    }
Exemplo n.º 6
0
 public void askForReview(string appName, string bundleId, int launchCount, int hoursBetweenPrompts)
 {
     #if UNITY_ANDROID
     EtceteraAndroid.askForReview(3, 0, 3, "Review " + appName + "!", "Review " + appName + " if you like it.", false);
     #elif UNITY_IPHONE
     EtceteraBinding.askForReview(launchCount, hoursBetweenPrompts,
                                  "Review " + appName + "!", "Review " + appName + " if you like it.", bundleId);
     #endif
 }
Exemplo n.º 7
0
 public void showReviewPage()
 {
     #if UNITY_ANDROID
     bool isAmazon = AppConfigs.platformIsAmazon;
     EtceteraAndroid.openReviewPageInPlayStore(isAmazon);
     #elif UNITY_IPHONE
     EtceteraBinding.openAppStoreReviewPage(AppConfigs.appStoreId);
     #endif
 }
Exemplo n.º 8
0
    public void askForReview(string appName, string bundleId)
    {
#if UNITY_ANDROID
        EtceteraAndroid.askForReviewNow("Review " + appName + "!", "Review " + appName + " if you like it.");
#elif UNITY_IPHONE
        //EtceteraBinding.openAppStoreReviewPage(AppConfigs.pu
        EtceteraBinding.askForReview("Review " + appName + "!", "Review " + appName + " if you like it.", bundleId);
#endif
    }
Exemplo n.º 9
0
 // Abre a tela para o usuario escolher uma foto
 public override void cameraRoll(float x, float y, string photo_name)
 {
     /*take_picture = default_take_picture;
      * from_library = default_from_library;
      *
      * this.photo_name = photo_name;
      *
      * showMessageOkCancel("Upload your picture", "Would you like to take a picture or choose one from your library?", take_picture, from_library);*/
     EtceteraAndroid.promptForPictureFromAlbum(PHOTO_WIDTH, PHOTO_HEIGHT, photo_name);
 }
Exemplo n.º 10
0
 public void Open()
 {
             #if UNITY_EDITOR
     UniFileBrowser.use.OpenFileWindow(ImageUploadAlert.Instance.OpenFile);
             #elif UNITY_IPHONE
     EtceteraBinding.promptForPhoto(0.2f);
             #elif UNITY_ANDROID
     EtceteraAndroid.promptForPictureFromAlbum("");
             #endif
 }
Exemplo n.º 11
0
    public void ShowSpinner()
    {
        eventSystem.enabled = false;
#if UNITY_IOS
        EtceteraBinding.showActivityView();
#endif
#if UNITY_ANDROID
        EtceteraAndroid.showProgressDialog("", "");
#endif
    }
Exemplo n.º 12
0
 public void ShowPromptMessage(string pMsg, float pDuration)
 {
                 #if UNITY_IPHONE
     CocoCommonBinding.ShowPromptMessage(pMsg, pDuration);
                 #elif UNITY_ANDROID
     EtceteraAndroid.showToast(pMsg, true);
                 #else
     Debug.Log("GamePluginManager->ShowPromptMessage: " + pMsg + ", " + pDuration);
                 #endif
 }
Exemplo n.º 13
0
    public void saveImageToLibrary(string name, string fileToSave)
    {
#if UNITY_IPHONE
        EtceteraBinding.saveImageToPhotoAlbum(fileToSave);
#elif UNITY_ANDROID
        EtceteraAndroid.saveImageToGallery(fileToSave, name);
#else
        // TODO save to server on web
        // TODO save to desktop photos
#endif
    }
Exemplo n.º 14
0
    /// <summary>
    /// Hiện prompt chọn album ảnh từ native
    /// </summary>
    public void PromptPictureFromAlbum(DelegateChooseImageDone whenDone)
    {
        onChooseImageDone = whenDone;

#if UNITY_ANDROID
        EtceteraAndroid.promptForPictureFromAlbum(512, 512, "esimoAvatar.jpg");
#elif UNITY_IPHONE
        EtceteraBinding.promptForPhoto(0.25f, PhotoPromptType.Album);
#else
        NotificationView.ShowMessage("Hiện chỉ hỗ trợ đổi ảnh trên mobile", 2f);
#endif
    }
Exemplo n.º 15
0
    public void HideSpinner()
    {
                #if UNITY_IOS
        EtceteraBinding.hideActivityView();
                #endif
                #if UNITY_ANDROID
        EtceteraAndroid.hideProgressDialog();
                #endif


        eventSystem.enabled = true;
    }
Exemplo n.º 16
0
        public static void ShowPrompt(string message)
        {
#if !UNITY_EDITOR
        #if UNITY_IOS
            CocoCommonBinding.ShowPromptMessage(message, 2f);
        #elif UNITY_ANDROID
            EtceteraAndroid.showToast(message, true);
        #endif
#else
            Debug.LogErrorFormat("CocoNative->ShowPrompt: {0}", message);
#endif
        }
Exemplo n.º 17
0
    public void showWebView(string title, string url)
    {
#if UNITY_EDITOR
        Application.OpenURL(url);
#elif UNITY_ANDROID
        EtceteraAndroid.showWebView(url);
#elif UNITY_IPHONE
        EtceteraBinding.showWebPage(url, false);
#else
        Application.OpenURL(url);
#endif
    }
Exemplo n.º 18
0
    void Awake()
    {
        P31Prefs.setInt("level1", 1);
        mainCamera = this.gameObject;

#if UNITY_ANDROID
        EtceteraAndroid.askForReview(1, 1, 2, "Do you like this game?", "Please review the game if you do!", false);
#endif
#if UNITY_IOS
        EtceteraBinding.askForReview(1, 0.5f, "Do you like this game?", "Please review the game if you do!", "950049277");
#endif
    }
Exemplo n.º 19
0
        //
        void ClearLocalNotifications()
        {
#if UNITY_IOS
            UnityEngine.iOS.NotificationServices.ClearLocalNotifications();
            UnityEngine.iOS.NotificationServices.CancelAllLocalNotifications();
#if ETCETERA
            EtceteraBinding.setBadgeCount(0);
#endif
#endif
#if UNITY_ANDROID && ETCETERA
            EtceteraAndroid.cancelAllNotifications();
#endif
        }
Exemplo n.º 20
0
    // Mostra o loading com uma mensagem
    public override void loadingMessage(string title = "", string message = "")
    {
        if (title.IsEmpty())
        {
            title = Flow.loadingDialog.transform.FindChild("BackgroundBorder").FindChild("BackgroundTitle").FindChild("TitlePanel").FindChild("Title").GetComponent <SpriteText>().Text;
        }
        if (message.IsEmpty())
        {
            message = Flow.loadingDialog.transform.FindChild("BackgroundBorder").FindChild("BackgroundBody").FindChild("MessagePanel").FindChild("Message").GetComponent <SpriteText>().Text;
        }

        EtceteraAndroid.showProgressDialog(title, message);
    }
Exemplo n.º 21
0
        void SecheduleLocalNotification()
        {
            int dealyInSeconds = 0;

            for (int i = 0; i < notifications.Length; i++)
            {
                switch (notifications[i].dealyType)
                {
                case FierDealy.Seconds:
                    dealyInSeconds = notifications[i].dealy;
                    break;

                case FierDealy.Mintes:
                    dealyInSeconds = notifications[i].dealy * 60;
                    break;

                case FierDealy.Hours:
                    dealyInSeconds = notifications[i].dealy * 3600;
                    break;

                case FierDealy.Days:
                    dealyInSeconds = notifications[i].dealy * 86400;
                    break;
                }
#if UNITY_IOS
                notif           = new UnityEngine.iOS.LocalNotification();
                notif.fireDate  = DateTime.Now.AddSeconds(dealyInSeconds);
                notif.alertBody = notifications[i].message;
                notif.applicationIconBadgeNumber = (i + 1);
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(notif);
#endif
#if UNITY_ANDROID && ETCETERA
                string title = GameUtility.APPNAME;
                if (!string.IsNullOrEmpty(notifications[i].androidTitle))
                {
                    title = notifications[i].androidTitle;
                }
                AndroidNotificationConfiguration anc = new AndroidNotificationConfiguration(dealyInSeconds, title, notifications[i].message, "");
                anc.secondsFromNow = dealyInSeconds;
                anc.title          = title;
                anc.subtitle       = notifications[i].message;
                anc.tickerText     = title;
                anc.smallIcon      = "small_icon";
                anc.largeIcon      = "small_icon";
                anc.extraData      = "";
                anc.requestCode    = 0;
                //int notifID = EtceteraAndroid.scheduleNotification(anc);
                EtceteraAndroid.scheduleNotification(anc);
#endif
            }
        }
Exemplo n.º 22
0
    /// <summary>
    /// Gửi tin nhắn đến một đầu số
    /// </summary>
    public bool PromptSendMessage(DelegateSendSMS whenDone, string message, string[] recepent)
    {
        onSendSms = whenDone;
#if UNITY_ANDROID
        EtceteraAndroid.showSMSComposer(message, recepent);
        return(EtceteraAndroid.isSMSComposerAvailable());
#elif UNITY_IPHONE
        if (isIphone())
        {
            EtceteraBinding.showSMSComposer(recepent, message);
        }
        return(isIphone());
#else
        return(false);
#endif
    }
Exemplo n.º 23
0
    public void showEmailView(string to, string subject, string body, bool isHtml)
    {
#if UNITY_IPHONE
        if (EtceteraBinding.isEmailAvailable())
        {
            EtceteraBinding.showMailComposer(to, subject, body + " -- Sent From iOS", isHtml);
        }
        else
        {
            EtceteraBinding.showWebPage("mailto:" + to, false);
        }
#elif UNITY_ANDROID
        EtceteraAndroid.showEmailComposer(to, subject, body + " -- Sent From Android", isHtml);
#else
        Application.OpenURL("mailto:" + to);
#endif
    }
Exemplo n.º 24
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;
        PlayerPrefs.EnableEncryption(true);
        Instance.isTutorial = PlayerPrefs.GetBool(Constants.TUTORIAL, true);
        Instance.bestScore  = PlayerPrefs.GetInt(Constants.BEST_SCORE, 0);
        Instance.starsCnt   = PlayerPrefs.GetInt(Constants.STAR_TOTAL, 0);
        Instance.totalGames = PlayerPrefs.GetInt(Constants.GAME_COUNT, 0);
        Instance.playerID   = PlayerPrefs.GetInt(Constants.PLAYER_ID, 0);
        Instance.isSound    = PlayerPrefs.GetBool(Constants.SOUND, true);
        Instance.isNoads    = PlayerPrefs.GetBool(Constants.NO_ADS, false);
        Instance.isFBLiked  = PlayerPrefs.GetBool(Constants.FB_LIKE, false);

        audioSource = transform.GetComponent <AudioSource>();
                #if UNITY_ANDROID
        PlayGamesPlatform.Activate();
        EtceteraAndroid.cancelNotification(Constants.H4);
        EtceteraAndroid.cancelNotification(Constants.H8);
        EtceteraAndroid.cancelNotification(Constants.D1);
        EtceteraAndroid.cancelNotification(Constants.D3);
        EtceteraAndroid.cancelNotification(Constants.D7);
        EtceteraAndroid.cancelNotification(Constants.D14);
        EtceteraAndroid.cancelNotification(Constants.D30);
        var key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA19JDG1hIuDeEDYaOxZyqYlv4OgX5+7+/+AcTRNMMhImND9UZsa2Ymh7xzQVUPYlyXOVSBW3RbenhZXWJPA3ZXZvk68hMACGIWGe2ZEFZqYiSELnk1C4XmKeTReC8Z5Y/NgSpSyzI++rvsSuA4j3Xe6SL3lbGUa+eOzmi42yJFU91zWdje6nA2XQFmMk6KqyaRT4Dwh2ntssPP0mQl6JiwJ8nSfp8JodIepYndBgNQ/OLBcko5ktFl1fIzqHJU0ZP6K7kF6i+vPe8H5M3Oal2Mw15/zfLIN+nE1R2IbauOQS7DmCKrMxTqPjUbajbOXJ4An77IhtwSrMkksDjet3/2wIDAQAB";
        GoogleIAB.init(key);
                #elif UNITY_IOS
        UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge);

        UnityEngine.iOS.NotificationServices.ClearLocalNotifications();
        UnityEngine.iOS.NotificationServices.CancelAllLocalNotifications();

        // clear badge number
        UnityEngine.iOS.LocalNotification temp = new UnityEngine.iOS.LocalNotification();
        temp.fireDate = DateTime.Now;
        temp.applicationIconBadgeNumber = -1;
        temp.alertBody = "";
        UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(temp);
                #endif

        //Initialize Heyzap
        HeyzapAds.Start("790edd987b2facf1eb7117dfc97d354b", HeyzapAds.FLAG_NO_OPTIONS);

        Invoke("SignIn", 0.5f);
        Invoke("Play", splashHoldTime);
        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 25
0
        /// <summary>
        /// show url
        /// </summary>
        /// <param name="url"></param>
        public void ShowURL(string url)
        {
#if UNITY_IOS && !UNITY_EDITOR
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                EtceteraBinding.showWebPage(url, false);
                return;
            }
#elif UNITY_ANDROID
            if (Application.platform == RuntimePlatform.Android)
            {
                EtceteraAndroid.showWebView(url);
                return;
            }
#else
            Application.OpenURL(url);
#endif
        }
Exemplo n.º 26
0
    void OnApplicationPause(bool pauseStatus)
    {
        if (pauseStatus)
        {
            Main.Instance.isLeaderBoard = false;
            {
                                #if UNITY_ANDROID
                Main.Instance._fourHrNotificationId = EtceteraAndroid.scheduleNotification(Main.Instance.fourHr, "Egg Drop", Main.Instance.msg_h4, "Egg Drop", "four-hour-note", "small_icon", "large_icon", Constants.H4);
//				Main.Instance._eightHrNotificationId = EtceteraAndroid.scheduleNotification( Main.Instance.eightHr, "Egg Drop", Main.Instance.msg_h8, "Egg Drop", "eight-hour-note", "small_icon", "large_icon", Constants.H8 );
                Main.Instance._oneDayNotificationId      = EtceteraAndroid.scheduleNotification(Main.Instance.oneDay, "Egg Drop", Main.Instance.msg_d1, "Egg Drop", "one-day-note", "small_icon", "large_icon", Constants.D1);
                Main.Instance._threeDayNotificationId    = EtceteraAndroid.scheduleNotification(Main.Instance.threeDay, "Egg Drop", Main.Instance.msg_d3, "Egg Drop", "three-day-note", "small_icon", "large_icon", Constants.D3);
                Main.Instance._sevenDayNotificationId    = EtceteraAndroid.scheduleNotification(Main.Instance.sevenDay, "Egg Drop", Main.Instance.msg_d7, "Egg Drop", "seven-day-note", "small_icon", "large_icon", Constants.D7);
                Main.Instance._fourteenDayNotificationId = EtceteraAndroid.scheduleNotification(Main.Instance.fourteenDay, "Egg Drop", Main.Instance.msg_d14, "Egg Drop", "fourteen-day-note", "small_icon", "large_icon", Constants.D14);
                Main.Instance._thirtyDayNotificationId   = EtceteraAndroid.scheduleNotification(Main.Instance.thirtyDay, "Egg Drop", Main.Instance.msg_d30, "Egg Drop", "thirty-day-note", "small_icon", "large_icon", Constants.D30);
                                #elif UNITY_IOS
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_h4, 4));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_h8, 8));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d1, 24));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d3, 72));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d7, 168));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d14, 336));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d30, 720));
                                #endif
            }
        }
        else
        {
                        #if UNITY_ANDROID
            EtceteraAndroid.cancelNotification(Constants.H4);
            EtceteraAndroid.cancelNotification(Constants.H8);
            EtceteraAndroid.cancelNotification(Constants.D1);
            EtceteraAndroid.cancelNotification(Constants.D3);
            EtceteraAndroid.cancelNotification(Constants.D7);
            EtceteraAndroid.cancelNotification(Constants.D14);
            EtceteraAndroid.cancelNotification(Constants.D30);
            //			EtceteraAndroid.cancelAllNotifications();
                        #elif UNITY_IOS
            NotificationServices.ClearLocalNotifications();
            NotificationServices.CancelAllLocalNotifications();
                        #endif
        }

        Main.Instance.isLeaderBoard = false;
    }
Exemplo n.º 27
0
    /// <summary>
    /// update 
    /// </summary>
    void Update()
    {
        m_curState.onUpdate();

#if UNITY_ANDROID
        // 按返回键退出,先提示一次
        if( UnityEngine.Input.GetKeyDown( KeyCode.Escape ))
        {
            float time = Time.realtimeSinceStartup;

            if ((time - m_lastBackTime) > 2.0f)
                EtceteraAndroid.showToast("再按一次退出", false);
            else
                Application.Quit();

            m_lastBackTime = time;
        }
#endif
    }
Exemplo n.º 28
0
    void OnApplicationPause(bool pauseStatus)
    {
        if (pauseStatus)
        {
            if (GameData.isNotifcationON)
            {
                                #if UNITY_ANDROID
                _fourHrNotificationId = EtceteraAndroid.scheduleNotification(fourHr, "WordSearch", msg_h4, "WordSearch", "four-hour-note", "small_icon", "large_icon", Constants.H4);
//				_eightHrNotificationId = EtceteraAndroid.scheduleNotification( eightHr, "WordSearch", msg_h8, "WordSearch", "eight-hour-note", Constants.H8 );
                _oneDayNotificationId      = EtceteraAndroid.scheduleNotification(oneDay, "WordSearch", msg_d1, "WordSearch", "one-day-note", "small_icon", "large_icon", Constants.D1);
                _threeDayNotificationId    = EtceteraAndroid.scheduleNotification(threeDay, "WordSearch", msg_d3, "WordSearch", "three-day-note", "small_icon", "large_icon", Constants.D3);
                _sevenDayNotificationId    = EtceteraAndroid.scheduleNotification(sevenDay, "WordSearch", msg_d7, "WordSearch", "seven-day-note", "small_icon", "large_icon", Constants.D7);
                _fourteenDayNotificationId = EtceteraAndroid.scheduleNotification(fourteenDay, "WordSearch", msg_d14, "WordSearch", "fourteen-day-note", "small_icon", "large_icon", Constants.D14);
                _thirtyDayNotificationId   = EtceteraAndroid.scheduleNotification(thirtyDay, "WordSearch", msg_d30, "WordSearch", "thirty-day-note", "small_icon", "large_icon", Constants.D30);
                                #elif UNITY_IOS
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_h4, 4));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_h8, 8));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_d1, 24));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_d3, 72));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_d7, 168));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_d14, 336));
                UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(msg_d30, 720));
                                #endif
            }
        }
        else
        {
                        #if UNITY_ANDROID
            EtceteraAndroid.cancelNotification(Constants.H4);
//			EtceteraAndroid.cancelNotification( Constants.H8 );
            EtceteraAndroid.cancelNotification(Constants.D1);
            EtceteraAndroid.cancelNotification(Constants.D3);
            EtceteraAndroid.cancelNotification(Constants.D7);
            EtceteraAndroid.cancelNotification(Constants.D14);
            EtceteraAndroid.cancelNotification(Constants.D30);
            EtceteraAndroid.cancelAllNotifications();
                        #elif UNITY_IOS
            UnityEngine.iOS.NotificationServices.ClearLocalNotifications();
            UnityEngine.iOS.NotificationServices.CancelAllLocalNotifications();
                        #endif
        }
        PlayerPrefs.Flush();
    }
Exemplo n.º 29
0
    // Funcao auxiliar para a escolha de foto
    private void handlePhotoOption(string choice)
    {
        string photo_name = this.photo_name;

        if (photo_name == null)
        {
            photo_name = System.Guid.NewGuid().ToString();
        }
        this.photo_name = null;

        if (choice == take_picture)
        {
            EtceteraAndroid.promptToTakePhoto(PHOTO_WIDTH, PHOTO_HEIGHT, photo_name);
        }
        else if (choice == from_library)
        {
            EtceteraAndroid.promptForPictureFromAlbum(PHOTO_WIDTH, PHOTO_HEIGHT, photo_name);
        }
    }
Exemplo n.º 30
0
    void OnApplicationQuit()
    {
        Main.Instance.isLeaderBoard = false;
        if (Main.Instance.isFirstTimeUser)
        {
            PlayerPrefs.SetBool(Constants.KEY_FIRST_TIME, false);
            float avgScore = 0;
            if (Main.Instance.sessionGameCount > 0)
            {
                avgScore = Main.Instance.totalScoreOfSession / Main.Instance.sessionGameCount;
            }
        }
        else
        {
            float avgScore = 0;
            if (Main.Instance.sessionGameCount > 0)
            {
                avgScore = Main.Instance.totalScoreOfSession / Main.Instance.sessionGameCount;
            }
        }

        {
                        #if UNITY_ANDROID
            Main.Instance._fourHrNotificationId = EtceteraAndroid.scheduleNotification(Main.Instance.fourHr, "Egg Drop", Main.Instance.msg_h4, "Egg Drop", "four-hour-note", "small_icon", "large_icon", Constants.H4);
//			Main.Instance._eightHrNotificationId = EtceteraAndroid.scheduleNotification( Main.Instance.eightHr, "Egg Drop", Main.Instance.msg_h8, "Egg Drop", "eight-hour-note", "small_icon", "large_icon", Constants.H8 );
            Main.Instance._oneDayNotificationId      = EtceteraAndroid.scheduleNotification(Main.Instance.oneDay, "Egg Drop", Main.Instance.msg_d1, "Egg Drop", "one-day-note", "small_icon", "large_icon", Constants.D1);
            Main.Instance._threeDayNotificationId    = EtceteraAndroid.scheduleNotification(Main.Instance.threeDay, "Egg Drop", Main.Instance.msg_d3, "Egg Drop", "three-day-note", "small_icon", "large_icon", Constants.D3);
            Main.Instance._sevenDayNotificationId    = EtceteraAndroid.scheduleNotification(Main.Instance.sevenDay, "Egg Drop", Main.Instance.msg_d7, "Egg Drop", "seven-day-note", "small_icon", "large_icon", Constants.D7);
            Main.Instance._fourteenDayNotificationId = EtceteraAndroid.scheduleNotification(Main.Instance.fourteenDay, "Egg Drop", Main.Instance.msg_d14, "Egg Drop", "fourteen-day-note", "small_icon", "large_icon", Constants.D14);
            Main.Instance._thirtyDayNotificationId   = EtceteraAndroid.scheduleNotification(Main.Instance.thirtyDay, "Egg Drop", Main.Instance.msg_d30, "Egg Drop", "thirty-day-note", "small_icon", "large_icon", Constants.D30);
                        #elif UNITY_IOS
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_h4, 4));
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_h8, 8));
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d1, 24));
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d3, 72));
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d7, 168));
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d14, 336));
            UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(getNotification(Main.Instance.msg_d30, 720));
                        #endif
        }
        PlayerPrefs.Flush();
    }