Question by
NCPLNaveen · Mar 29, 2016 at 04:43 AM ·
c#notificationspush notificationnotificationservices
local notification scheduling for every one hour.
Hello Every one, from past week i'm trying to implement local notifications using unity' s localnotifications. I have been using this script. is this a right script or need to change. thank you. Note: The App is crashing when i introduced in start function, right now im using few plugins like prime31, onesignal etc.
public void local_Notifications(){
UnityEngine.iOS.LocalNotification notifications = new UnityEngine.iOS.LocalNotification();
notifications.alertAction = "Let's do it";
notifications.alertBody = "repeats for every one min";
notifications.soundName = UnityEngine.iOS.LocalNotification.defaultSoundName;
notifications.fireDate = System.DateTime.Now.AddMinutes (1);
notifications.repeatInterval = UnityEngine.iOS.CalendarUnit.Hour;
UnityEngine.iOS.NotificationServices.ScheduleLocalNotification (notifications);
#if UNITY_IOS
UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge | UnityEngine.iOS.NotificationType.Sound);
#endif
Debug.Log ("localnotifications enabled");
}
Comment
Your answer
Follow this Question
Related Questions
Admob with Firebase Bottom Banner Problem 0 Answers
How to Schedule a Remote Notification daily at certain time. 3 Answers
How to detect if push notification is launched from lock screen or received in-app 0 Answers
Push notifications Android 0 Answers
IOS Notification LOGIC Error,IOS notificaiton issue 0 Answers