Reputation: 11
I am trying to send notifications to users through Firebase Cloud Messaging (testing sending from the console) and Flutter.
I have:
void internNotifications() async {
FirebaseMessaging messaging = FirebaseMessaging.instance;
String token = await messaging.getToken(
vapidKey:
"BP_yTdkgwyo2GEdNdjn8KIz874lEdaKaDWVz5wHKpb1_48RBU4UKUmPiRhG1DT7ViHvY7cy8goNZOQE3a0X6yiM",
);
RemoteMessage initialMessage =
await FirebaseMessaging.instance.getInitialMessage();
if (initialMessage != null) {
_handleMessage(initialMessage);
}
FirebaseMessaging.onMessageOpenedApp.listen(_handleMessage);
NotificationSettings settings = await messaging.requestPermission(
alert: true,
announcement: false,
badge: true,
carPlay: false,
criticalAlert: false,
provisional: false,
sound: true,
);
print('User granted permission: ${settings.authorizationStatus}');
}
void _handleMessage(RemoteMessage message) {
if (message.data['type'] == 'chat') {
Navigator.pushNamed(
context,
'/chat',
);
}
}
When I attempt to send a firebase cloud notification to my users of a particular bundle while simulating via Xcode on my physical device, Firebase reads that the notification is "scheduled" and nothing goes through.
To ensure, I have tried this when the app is in the foreground and background (but not completed exited)
Thanks for the help in advance
Upvotes: 1
Views: 482
Reputation: 530
I believe this is on Firebase's end and not iOS. You should check the schedule of the notification: Firebase Scheduling Section
Upvotes: 0