小编kun*_*369的帖子

用新图标替换颤动中的应用程序启动器图标

我正在寻找更改app icon我当前应用程序的。我手杖周围的包名称flutter_launcher_icons

我还发现我可以通过将图像mipmap-xxxhdpi放入android/app/res文件夹来完成。它有效。

所以我的问题是为什么我们需要额外的 package( flutter_launcher_icons) 。

android dart flutter

5
推荐指数
1
解决办法
8763
查看次数

在 Flutter FlutterFirebaseMessaging 插件中的 Application.java 中找不到包

我正在使用 firebase 消息传递。我按照插件自述文件中给出的步骤进行操作。但是我的应用程序 .java 出现错误。

应用程序.java

package com.app.demoapp;
import com.transistorsoft.flutter.backgroundfetch.BackgroundFetchPlugin;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;

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

  @Override
  public void registerWith(PluginRegistry registry) {
    GeneratedPluginRegistrant.registerWith(registry);
  }
}
Run Code Online (Sandbox Code Playgroud)

错误:

error: cannot find symbol
    FlutterFirebaseMessagingService.setPluginRegistrant(this);                                                     
                                   ^                                                                               
  symbol:   method setPluginRegistrant(Application)                                                                
  location: class FlutterFirebaseMessagingService                                                                  
1 error                                                                                                            
Run Code Online (Sandbox Code Playgroud)

android flutter firebase-cloud-messaging

5
推荐指数
1
解决办法
1864
查看次数

单击通知按钮未在颤动中打开应用程序

我已经集成了用于通知的 firebase-messaging 插件,但单击通知应用程序如果在后台或被杀死,则不会打开。我想在单击通知时打开应用程序。

下面是我的代码

    void firebaseCloudMessagingListeners() {
      FirebaseMessaging _firebaseMessaging = new FirebaseMessaging();
      _firebaseMessaging.getToken().then((token){
        print(token);
      });

     _firebaseMessaging.requestNotificationPermissions(
            const IosNotificationSettings(sound: true, badge: true, alert: true));
        _firebaseMessaging.onIosSettingsRegistered
            .listen((IosNotificationSettings settings) {
          print("Settings registered: $settings");
        });

      _firebaseMessaging.configure(
        onMessage: (Map<String, dynamic> message) async {
          _showNotificationWithDefaultSound(message['notification']['body']);

          print('on message $message');
          return;
        },
        onResume: (Map<String, dynamic> message) async {
          _showNotificationWithDefaultSound(message['data']['body']);
          print('on message $message');
          return;
        },

        onLaunch: (Map<String, dynamic> message) async {
          _showNotificationWithDefaultSound(message['data']['body']);
          print('on message $message');
        },
      );
    }

    _showNotificationWithDefaultSound(message) async {
      FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
          new FlutterLocalNotificationsPlugin();

      var android = …
Run Code Online (Sandbox Code Playgroud)

android dart flutter firebase-cloud-messaging

4
推荐指数
1
解决办法
4898
查看次数

标签 统计

android ×3

flutter ×3

dart ×2

firebase-cloud-messaging ×2