After upgraded to embedded v2 I was never able to get PNs working on android again, after lots of searching and various code samples I did manage to get rid of the terminal error, but while I know the notifications are definitely arriving, they foreground nor background notifications are running.
I have flutter_local_notifications setup, I even tried rolling back to v2 after getting the terminal errors gone, and still nothing.
I have since tried upgrading to v8 of firebase_messaging which definitely seems like a great improvement but all that happened after that was iOS stopped rendering them as well.
I have been up and down the docs for both plugins, I have made sure to add the required proguard and K8 configurations, but as I understand that is for release and even in dev I cannot get the showing up on the phone or simulator.
Application.java
package com.example.mpkgname;
import io.flutter.app.FlutterApplication;
public class Application extends FlutterApplication {
@Override
public void onCreate() {
super.onCreate();
}
}
MainActivity.java
package com.example.member_ui_flutter;
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
}
I have setup requestPermission
and setForegroundNotificationPresentationOptions
for iOS as well as onMessage.listen
and onBackgroundMessage
Notification display logic:
final androidPlatformChannelSpecifics = const AndroidNotificationDetails(
'channelid',
'flutterfcm',
'your channel description',
playSound: true,
enableVibration: true,
importance: Importance.max,
priority: Priority.high,
);
final iOSPlatformChannelSpecifics = const IOSNotificationDetails();
final platformChannelSpecifics = NotificationDetails(
android: androidPlatformChannelSpecifics,
iOS: iOSPlatformChannelSpecifics,
);
final payload = _setupNotificationPayload(message);
await flutterLocalNotificationsPlugin.show(
0,
payload['title'],
payload['body'],
platformChannelSpecifics,
payload: jsonEncode(payload),
);
I honestly do not know if this is even enough info to help, I am at a complete loss now, I am getting no errors, even if I wrap a try-catch around the notification display, there are no apparent platform errors. Nothing is tripping up in debug mode