示例#1
0
        void SyncDataAndNotifications()
        {
            //check before so can get latest update if reset
            CheckForGoLive();

            Console.WriteLine("SyncDataAndNotificationss");
            NotifySyncing();
            ServiceSyncStatus status = MyMoodService.Current.SyncDataWithServer();

            NotifySyncComplete(status);

            string version = NSBundle.MainBundle.ObjectForInfoDictionary("Version").ToString();

            if (version != ApplicationState.Current.CurrentVersion && ApplicationState.Current.ForceUpdate > 0)
            {
                InvokeOnMainThread(delegate {
                    NSNotificationCenter.DefaultCenter.PostNotificationName("ForceVersionUpdate", null);
                });
            }

            if (status.HasPromptUpdates)
            {
                InvokeOnMainThread(delegate {
                    Console.WriteLine("Has Prompt Updates");

                    NotificationManager.SyncNotificationsWithPrompts(MoodPrompt.All());
                    ShowBadgeNumber();

                    NSNotificationCenter.DefaultCenter.PostNotificationName("PromptsUpdated", null);
                });
            }

            //check if go live has been set
            CheckForGoLive();
        }
示例#2
0
 public MoodPromptTableSource() : base()
 {
     this._MoodPrompts = MoodPrompt.All().OrderByDescending(l => l.ActiveFrom).ToList();
 }