Skip to content

Instantly share code, notes, and snippets.

@GonzaloEspinoza
Forked from Klerith/Application.java
Created November 6, 2020 21:32
Show Gist options
  • Select an option

  • Save GonzaloEspinoza/6762612f35ac8ce92674c9f4ce7d56ed to your computer and use it in GitHub Desktop.

Select an option

Save GonzaloEspinoza/6762612f35ac8ce92674c9f4ce7d56ed to your computer and use it in GitHub Desktop.
Android Push Notification File para FCM
package com.tu-dominio.pushapp; <------ CAMBIAR!!!!
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;
// Nota, esta linea la agregue
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;
public class Application extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}
@Override
public void registerWith(PluginRegistry registry) {
// GeneratedPluginRegistrant.registerWith(registry);
FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment