onLaunch, onResume are not working after update flutter 1.17.1 stable.
when tap notification, show error.
Fatal: failed to find callback.
Same error here!
Hi @YeomDongUk
can you please provide your flutter doctor -v ,
your flutter run --verbose,
your pubspec.yaml
and a reproducible minimal code sample.
Thank you
same here

it is result of flutter doctor -v.

Hi @YeomDongUk
thank you for your doctor
could you please provide the remaining info listed above
Please refrain from posting pictures if not necessary.
Thank you

it is my pubspec.yaml
Hi @YeomDongUk
could you please provide
a reproducible minimal code sample.
Please refrain from posting pictures if not necessary.
Thank you
void main() async {
WidgetsFlutterBinding.ensureInitialized();
AppConfig.init();
FirebaseMessage.init();
await LocalNotification.init();
Analytics.init();
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle.dark.copyWith(
statusBarColor: Colors.black,
statusBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
),
);
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
runZoned(() => runApp(MyApp()), onError: (error, stackTrace) async {
Logger().e(error.toString());
await FlutterCrashlytics()
.reportCrash(error, stackTrace, forceCrash: false);
});
}
class FirebaseMessage {
static void init() {
if (instance == null) {
_instance = FirebaseMessage();
if (instance._firebaseMessaging == null) {
instance._firebaseMessaging = FirebaseMessaging();
instance._firebaseCloudMessagingListen();
}
}
}
void configure(String userId) {
try {
instance.firebaseMessaging.configure(
onMessage: (Map
Logger().i("onMessage: $fcm");
Map
if (fcm['data'] != null) data = Map
switcher(
clickAction: data["click_action"],
callback: () =>
LocalNotification.instance.onFeedback(fcm: data, userId: userId),
);
}, onLaunch: (Map
Logger().i("onLaunch: $fcm");
Map
if (fcm['data'] != null) data = Map
switcher(
clickAction: data["click_action"],
callback: () => goFeedbackPage(
lectureId: data['lectureId'],
userId: userId,
),
);
}, onResume: (Map
Logger().i("onResume: $fcm");
Map
if (fcm['data'] != null) data = Map
switcher(
clickAction: data["click_action"],
callback: () => goFeedbackPage(
lectureId: data['lectureId'],
userId: userId,
),
);
});
} catch (error) {
Logger().e(error);
// throw Exception(error);
}
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
FirebaseMessage.instance.configure(user.authId);
return ....;
}
}
I can receive onMessage but can't not receive onLaunch and onResume. This happens only on Android.
Hi there,
Is this issue resolved. I am also facing same issue on Android. onLaunch and onResume are not getting called. Can anyone help me here?
Most helpful comment
same here