This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version.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.




