PluginRegistry cannot be converted to FlutterEngine
 
I'm try firebase cloud messaging on flutter.
I read https://pub.dev/packages/firebase_messaging documentation. 
Bu this documentation is out of date.
	

package your.package.name

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;

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);
  }
}	
		

Bu this is wrong.
The Correct code as are follows.
	

package your.package.name

import io.flutter.app.FlutterApplication;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;

public class Application extends FlutterApplication implements PluginRegistrantCallback {
	@Override
	public void onCreate() {
		super.onCreate();
		FlutterFirebaseMessagingService.setPluginRegistrant(this);
	}

	@Override
	public void registerWith(PluginRegistry registry) {
		GeneratedPluginRegistrant.registerWith((FlutterEngine) registry);
	}
}
		
 

Author: Engin ATALAY
Date: 9.01.2021 12:52:52
View Count: 1433
 
 

COMMENTS
 
No comments yet. Be the first to comment who you are.
 
 
 
 
 
 
 
WRITE COMMENT
 
 
Your Name :
 
 
 
E-mail :
 
 
 
Your Message :
 
 
 
 
 
 
 
This project : ASP.NET MVC , RAZOR, Entity Framework , CSS , HTML , JQUERY(2.0.2) , AJAX the C# side-tier architecture was developed with logic.
 
Yukarı Çık