You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to use the background capabilities of firebase_messaging, to allow processing messages when the app is not in the foreground. However this causes problems I followed the instructions as in the screenshot below.
For my project the main package resides within kotlin. Thus the project structure is .../app/src/main ,where there are both kotlin and java folders. The mainactivity resides within the kotlin class, thus when adding an application class, I did this here as instructed, as kotlin and java have interoperability, I simply converted the class to kotlin and it is as follows.
This however yields the following error C:\Users\amir2\AndroidStudioProjects\dating\android\app\src\main\kotlin\com\dating\Application.kt: (16, 48): Type mismatch: inferred type is PluginRegistry but FlutterEngine was expected and fails compilation within 3 seconds, I have updated the manifest as instructed as well, and set the name to .Application
After further digging, i even tried to change the structure to java, so no kotlin use now, this didnt change anything as i thought. The example code provided i assume has errors as public final class GeneratedPluginRegistrant { public static void registerWith(@NonNull FlutterEngine flutterEngine) {. The example code provided wants to provide a type of PluginRegistry to a function which takes a FlutterEngine type. This is a mistake in the example provided on the https://pub.dev/packages/firebase_messaging documentation for when enabling background messaging.
I do not know still how to enable this appropriately then.
The text was updated successfully, but these errors were encountered:
amir2202
changed the title
Enabling background messaging using kotlin
Enabling background messaging
Aug 21, 2020
amir2202
changed the title
Enabling background messaging
Enabling background messagin (cloud messaging), documentation
Aug 21, 2020
I have tried to use the background capabilities of firebase_messaging, to allow processing messages when the app is not in the foreground. However this causes problems I followed the instructions as in the screenshot below.
For my project the main package resides within kotlin. Thus the project structure is .../app/src/main ,where there are both kotlin and java folders. The mainactivity resides within the kotlin class, thus when adding an application class, I did this here as instructed, as kotlin and java have interoperability, I simply converted the class to kotlin and it is as follows.
This however yields the following error
C:\Users\amir2\AndroidStudioProjects\dating\android\app\src\main\kotlin\com\dating\Application.kt: (16, 48): Type mismatch: inferred type is PluginRegistry but FlutterEngine was expected
and fails compilation within 3 seconds, I have updated the manifest as instructed as well, and set the name to .ApplicationAfter further digging, i even tried to change the structure to java, so no kotlin use now, this didnt change anything as i thought. The example code provided i assume has errors as
public final class GeneratedPluginRegistrant { public static void registerWith(@NonNull FlutterEngine flutterEngine) {
. The example code provided wants to provide a type of PluginRegistry to a function which takes a FlutterEngine type. This is a mistake in the example provided on the https://pub.dev/packages/firebase_messaging documentation for when enabling background messaging.I do not know still how to enable this appropriately then.
The text was updated successfully, but these errors were encountered: