I am using firebase_messaging 5.1.2 plugin for push notification in flutter I have use below code for receive notification in
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage: $message");
_showItemDialog(message);
},
onBackgroundMessage: myBackgroundMessageHandler,
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
_navigateToItemDetail(message);
},
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
_navigateToItemDetail(message);
},
);
For ios i have integrated :
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
For enabling push notification in ios flutter
void iOS_Permission() {
_firebaseMessaging.requestNotificationPermissions(
IosNotificationSettings(sound: true, badge: true, alert: true));
_firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
print("Settings registered: $settings");
});
}
By using PHP script i am sending push notification to both platform ios and android ... android works fine ...where as my ios device unable to get notification. 1- i have crated pem certificate for registering APNS and its works fine my php script says message successfully delivered...have also checked php scrip its fine.
i connect my ios device to system and rum my flutter app through xcode and seeing the log and sending the notification but in log i cant see the this is printing print("onMessage: $message"); have checked by killing app ,background app everything but notification is not coming in ios.
i think onMessage function is not calling in ios ,
have enable all settings in ios too... i can not identifying the problem.
please help me stuck in this why notification is not coming in ios.