public override void OnMessageReceived(RemoteMessage remoteMessage) { //Displaying data in log //It is optional Logger.Trace("From: " + remoteMessage.From); Logger.Trace("Notification Message Title: " + remoteMessage.GetNotification().Title); Logger.Trace("Notification Message Body: " + remoteMessage.GetNotification().Body); //Calling method to generate notification _localNotificationService.Show(remoteMessage.GetNotification().Title ?? "PSY Innovate", remoteMessage.GetNotification().Body); base.OnMessageReceived(remoteMessage); }
private void AlertUser(PrayTimeKind prayKind, TimeSpan remainingTime) { var message = $"{prayKind.Stringify()} namazi vaktinin çıkması için kalan süre: {remainingTime.Hours}:{remainingTime.Minutes}:{remainingTime.Seconds}" + $"{Environment.NewLine}Bildirim Zamanı: {DateTime.Now.ToString("HH:mm")}"; var notification = new Plugin.LocalNotification.LocalNotification { NotificationId = 100, Title = "Namaz Vakti", Description = message, ReturningData = "Dummy data", BadgeNumber = 1 }; notificationService.Show(notification); }
/// <summary> /// Completes the workout /// </summary> private void FinishWorkout() { // Stops the timer Timer.Stop(); // Reset the number of set numberOfSet = 0; // Deselects sets Workout.DeselectSets(); // Changes the user's maximum number of repetitions Settings.NumberOfRepetitions = Workout.Sets[1].Repetitions; // Date for next workout Settings.NextWorkoutDate = DateTime.Now.AddDays(1); // Creates new notification var notification = new LocalNotification { NotificationId = 100, Title = "Time for a workout!", Description = string.Format("{0}, it's time for your daily push-up workout!", Settings.UserName), NotifyTime = Settings.NextWorkoutDate, }; // Sends notification notificationService.Show(notification); // Changes the text inside of a circle button ButtonText = "Skip break?"; // Changes the text above the button UpperLabelText = string.Format("Come back tomorrow! "); // Changes the information text InformationText = string.Format("You've completed {0} push-ups, nice!", Workout.SetsSum); }