我与刚果排雷中心一道执行了 flu碎的推动通知,该通知在 app子、背景和 app子关闭时非常有效。 但是,我寻求一种方式来显示我的通知,即如果你不在通知内就象在顶点上浮动(目前通知中无改动)那样,那么,什么情况会显示宽松通知。
如你在上面图像中看到的那样,用户在装置上的彩色镜子里,另一张电灯的播音电显示。 下面是我在 flu忙中执行的内容:
FirebaseMessaging.instance.getInitialMessage().then((message) {
print(message);
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
print(message);
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
print(message);
});
我和roid体的表现如下:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app_name">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<application
android:allowBackup="false"
android:label="app_name"
android:icon="@mipmap/ic_launcher">
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<service
android:name="MyNavigationService"
android:foregroundServiceType="location" >
</service>
<receiver
android:name="app_name.FirebaseBroadcastReceiver"
android:exported="false"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</receiver>
<!--service
android:name="app_name.java.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service-->
<service
android:name="app_name.service.MyFirebaseInstanceIDService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="A......"/>
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:exported="true"
android:showWhenLocked="false"
android:turnScreenOn="false"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
我的共和国版面:firebase_messaging:^13.0.4/code>。