コード例 #1
0
 private void SetBuildedLocalPushNotice()
 {
     if (this.isRecieveEndBuildingPushNotice && this.userFacilityList != null && 0 < this.userFacilityList.Count)
     {
         List <TimeSpan> list = new List <TimeSpan>();
         foreach (UserFacility userFacility in this.userFacilityList)
         {
             if (!string.IsNullOrEmpty(userFacility.completeTime))
             {
                 DateTime d    = DateTime.Parse(userFacility.completeTime);
                 TimeSpan item = d - ServerDateTime.Now;
                 if (item.TotalSeconds > 0.0)
                 {
                     list.Add(item);
                 }
             }
         }
         if (list.Count > 0)
         {
             if (list.Count > 1)
             {
                 list.Sort((TimeSpan a, TimeSpan b) => (int)(a.TotalSeconds - b.TotalSeconds));
             }
             string @string = StringMaster.GetString("LocalNotice-03");
             NpPush.LocalPushSendRequestCode(@string, 1, (int)list[0].TotalSeconds, 1);
         }
         this.userFacilityList = null;
     }
 }
コード例 #2
0
 private void SetStaminaLocalPushNotice()
 {
     if (this.isRecieveStaminaMaxPushNotice && 0 < this.staminaRecovery)
     {
         string @string = StringMaster.GetString("LocalNotice-01");
         NpPush.LocalPushSendRequestCode(@string, 1, this.staminaRecovery, 0);
         this.staminaRecovery = 0;
     }
 }
コード例 #3
0
    public void ClearGardenPushNotice()
    {
        string @string = PlayerPrefs.GetString("RESERVED_GARDEN_NOTICE", string.Empty);

        if (!string.IsNullOrEmpty(@string))
        {
            PlayerPrefs.DeleteKey("RESERVED_GARDEN_NOTICE");
            NpPush.CancelLocalNotifications(2);
        }
    }
コード例 #4
0
 private void ResetGardenPushNotice()
 {
     if (this.isRecieveGardenPushNotice)
     {
         string @string = PlayerPrefs.GetString("RESERVED_GARDEN_NOTICE", string.Empty);
         if (string.IsNullOrEmpty(@string))
         {
             if (this.gardenDataList.Count == 0)
             {
                 return;
             }
         }
         else
         {
             if (this.gardenDataList.Count == 0)
             {
                 PlayerPrefs.DeleteKey("RESERVED_GARDEN_NOTICE");
                 return;
             }
             if (@string != this.gardenDataList[0].monsterID)
             {
                 PlayerPrefs.DeleteKey("RESERVED_GARDEN_NOTICE");
             }
             else
             {
                 if ((this.gardenDataList[0].growEndDate - ServerDateTime.Now).TotalSeconds > 0.0)
                 {
                     return;
                 }
                 PlayerPrefs.DeleteKey("RESERVED_GARDEN_NOTICE");
             }
         }
         foreach (PushNotice.GardenPushNoticeData gardenPushNoticeData in this.gardenDataList)
         {
             TimeSpan timeSpan = gardenPushNoticeData.growEndDate - ServerDateTime.Now;
             if (timeSpan.TotalSeconds > 0.0)
             {
                 string string2 = StringMaster.GetString("LocalNotice-02");
                 NpPush.LocalPushSendRequestCode(string2, 1, (int)timeSpan.TotalSeconds, 2);
                 PlayerPrefs.SetString("RESERVED_GARDEN_NOTICE", gardenPushNoticeData.monsterID);
                 break;
             }
         }
     }
 }
コード例 #5
0
 private void ClearBuildedLocalPushNotice()
 {
     NpPush.CancelLocalNotifications(1);
 }
コード例 #6
0
 private void ClearStaminaLocalPushNotice()
 {
     NpPush.CancelLocalNotifications(0);
 }
コード例 #7
0
 public void FastSetStaminaLocalPushNotice()
 {
     global::Debug.Log("+プッシュ通知テスト関数実行");
     NpPush.LocalPushSendRequestCode("プッシュテスト", 1, 60, 0);
 }
コード例 #8
0
 private void Initialize()
 {
     this.npPush = new NpPush(base.gameObject, this);
     this.DeleteLocalPushNotice();
     this.npPush.GetDeviceToken("994857230643");
 }
コード例 #9
0
 private void DeleteLocalPushNotice()
 {
     NpPush.BadgeNumberChange(0);
     this.ClearStaminaLocalPushNotice();
     this.ClearBuildedLocalPushNotice();
 }