Try to push InApp message to my IOS Apps using swift. But I got popup notification instead of template design. After i click the notification , only then the template is showing.
How to make the template message appear right away without click the notification
When push in app message it will go to code below and show notification, not the card template
It goes to 2 functions
1.
func userNotificationCenter(_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
let userInfo = notification.request.content.userInfo
if let messageID = userInfo[gcmMessageIDKey] {
print("Message ID: \(messageID)")
}
handleFCM(with: userInfo)
completionHandler([.alert,.badge])
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
if let messageID = userInfo[gcmMessageIDKey] {
print("Message ID: \(messageID)")
}
handleFCM(with: userInfo)
completionHandler(UIBackgroundFetchResult.newData)
}
And then when notif click show the in app
My Expectation is: Just show the in app with trasparent background without click notification first