Closed fauzy6493 closed 4 years ago
Solved already.
@Override
public void registerWith(PluginRegistry registry) {
BackgroundLocationPlugin.registerWith(registry.registrarFor("com.almoullim.background_location.BackgroundLocationPlugin"));
FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
SharedPreferencesPlugin.registerWith(registry.registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin"));
SqfliteSqlCipherPlugin.registerWith(registry.registrarFor("com.davidmartos96.sqflite_sqlcipher.SqfliteSqlCipherPlugin"));
}
2. Restart Debug. Hot reload is not enough to refresh register plugin.
I close this issue. Thanks David.
This issue should be reopened, because it is too old. I use flutter 2.0.5 and I do not know how to solve it!!! Please, help
@mishatron I'm sorry, but I've never used Firebase FCM, so I don't know very much about it. Could you share a simple project on github that reproduces the error? Also, in case your Flutter project was created long ago, this may be necessary https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
I did some tries and detected that problem is gone if I remove shrinkResources true from build.gradle on android. why?
@mishatron I'm not sure how that could be related. If you have a simple example app I wouldn't mind taking a look
Hi, i don't know why, but on very old Android devices i have this issue (FCM and Sqlite... libraries) . My solution is manually registration plugin in FlutterActivity
public class MainActivity extends FlutterActivity {
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
super.configureFlutterEngine(flutterEngine);
if(!flutterEngine.getPlugins().has(SqflitePlugin.class)){
flutterEngine.getPlugins().add(new SqflitePlugin());
}
if(!flutterEngine.getPlugins().has(SqfliteSqlCipherPlugin.class)){
flutterEngine.getPlugins().add(new SqfliteSqlCipherPlugin());
}
}
}
Hi David,
I need integration with firebase_messaging onBackgroundMessage handler.
The code successfully run when apps is on foreground, but when apps go to background and retrieve some data using onBackgroundMessage handler. Error is coming like this:
MissingPluginException(No implementation found for method getDatabasesPath on channel com.davidmartos96.sqflite_sqlcipher)
Another plugin i can resolved by register plugin in application level (android):
But when i try same way to register: SqfliteSqlCipherPlugin.registerWith(registry.registrarFor("com.davidmartos96.sqflite_sqlcipher.SqfliteSqlCipherPlugin"));
is not solved when i receive onBackgroundMessage handler.
How can i use plugin in backgroundmode?