I am implementing FCM push Notification.
I get notification when App is in foreground.
But I do not get Notification in the background.
In server end I have set content-available => true
On iOS 10, should I implement any other method or where do I get background notification?
@available(iOS 10.0, *)
func userNotificationCenter(center: UNUserNotificationCenter, willPresentNotification notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void)
{
print("userNotificationCenter : Forground")
completionHandler([.Alert,.Sound,.Badge])
}
@available(iOS 10.0, *)
func userNotificationCenter(center: UNUserNotificationCenter, didReceiveNotificationResponse response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void)
{
//Code Todo After User presess notification
}
PHP Server Payload Code :
$payloadFeild = array(
'registration_ids' => $gotoFcmUidVar,
'data' => array('MsgKey'=>json_encode($fcmMsgVar)),
'content_available' => true,
'priority' => 'high'
);