how to update Application.Java for firebase messaging version 8 #4641
Unanswered
DeanPack
asked this question in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've upgraded all my firebase packages today, and I had to upgrade to version 8 for firebase messaging even though it is still in dev due to dependency issues. In Application.Java, I have:
`package com.halloglobal.flutterapp.hallo;
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;
import io.flutter.view.FlutterMain;
public class Application extends FlutterApplication implements PluginRegistrantCallback {
@OverRide
public void onCreate() {
super.onCreate();
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}
@OverRide
public void registerWith(PluginRegistry registry) {
FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
}
}`
Which has worked fine in the past, but now with this new version, I get this error:
Note: Recompile with -Xlint:deprecation for details.
/Users/hallo/Documents/HalloMonoRepo/hallo/android/app/src/main/java/com/halloglobal/flutterapp/hallo/Application.java:7: error: package io.flutter.plugins.firebasemessaging does not exist
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
^
/Users/hallo/Documents/HalloMonoRepo/hallo/android/app/src/main/java/com/halloglobal/flutterapp/hallo/Application.java:8: error: package io.flutter.plugins.firebasemessaging does not exist
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;
How do I need to change my Application.java to work with the new version?
Beta Was this translation helpful? Give feedback.
All reactions