iOS Overview: How to Create Local Notifications in iOS10:
From iOS10 and onwards Apple deprecated UILocalNotification . We need to use UNNotificationRequest instead. UNNotificationRequest is def...
This blog is for giving an overview of what is recent in iOS technology and for other mobile related topics. I am here by sharing what I have learned and wish to use this Blog as an open discussion forum. I have just started blogging. Please give your suggestions as well, it will help me to improve myself.
Monday, 19 September 2016
How to Create Local Notifications in iOS10
From iOS10 and onwards Apple deprecated UILocalNotification. We need to use UNNotificationRequest instead.
UNNotificationRequest is defined under UserNotifications framework. UNNotificationRequest consists of the following two objects or properties.
(a) UNNotificationContent
It defines the contents on the notification. For local notifications, create a UNMutableNotificationContent object and configure the contents of that object instead.
(b) UNNotificationTrigger
This is for defining an event that triggers the delivery of the notification.
Before triggering a notification, the first step from the App we should do is requesting authorisation for user interactions. The first time your app requests authorization, the user is alerted and given an opportunity to deny or grant that authorization.
Once the notification is triggered and the application is in background , notification UI will pop up with a sound.
UNNotificationRequest is defined under UserNotifications framework. UNNotificationRequest consists of the following two objects or properties.
(a) UNNotificationContent
It defines the contents on the notification. For local notifications, create a UNMutableNotificationContent object and configure the contents of that object instead.
(b) UNNotificationTrigger
This is for defining an event that triggers the delivery of the notification.
Before triggering a notification, the first step from the App we should do is requesting authorisation for user interactions. The first time your app requests authorization, the user is alerted and given an opportunity to deny or grant that authorization.
Requesting authorization for user interactions in Objective C
Requesting authorization for user interactions in Swift
Creating a simple local notification in Objective C
Creating a simple local notification in Swift
Once the notification is triggered and the application is in background , notification UI will pop up with a sound.
Subscribe to:
Posts (Atom)