I have FCM backgroung message handling code in my Flutter(v 3.19.6) project as below:
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler1);
And top level function defined as below :
@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler1(RemoteMessage message) async {
//await handleRemoteMessage(message);
}
However I want to remove this function without uninstalling the app , When I try to comment both the above snippet, and just update the app (Not hot restart but flutter clean & flutter run) , I am getting runtime error
NoSuchMethodError: No top-level getter _firebaseMessagingBackgroundHandler1 declared.
Is there any way to remove this vm entry without getting error.
I have checked to do this but not allowed by flutter
FirebaseMessaging.onBackgroundMessage(null);
5