Creator.configure(uiDelegate: self)
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(options: authOptions,completionHandler: {_, _in})
UIApplication.shared.registerForRemoteNotifications()
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
ZCNotificationService.registerAPNS(deviceToken: deviceToken)
}
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
if let userInfo = notification.request.content.userInfo as? [String: Any] {
print("is Creator Server : \(ZCNotificationService.isCreatorServerNotification(notificationInfo: userInfo))")
// Change this to your preferred presentation option
}
completionHandler([[.badge, .alert, .sound]])
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
if let notificationInfo = response.notification.request.content.userInfo as? [String: Any] {
if (ZCNotificationService.isCreatorServerNotification(notificationInfo: userInfo)) == true
{
if let zcnotification = ZCNotificationService.zcNotification(notificationInfo) {
// We are showing the record summay as an example.
let summaryVC = ZCUIService.getRecordSummaryViewController(for: zcnotification)
window?.rootViewController?.present(UINavigationController.init(rootViewController: summaryVC), animated: true, completion: nil)
}
}
else
{
// Not from Zoho Creator server
}
completionHandler()
}
}
ZCNotificationService.unRegisterAPNS {
}
Note: Removing this configuration will cause your iOS app’s users to stop receiving push notifications that are triggered by the workflows in your Creator application or from the iOS apps created using Mobile SDK.
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.