小编Vor*_*avi的帖子

如何解决 macOS 中的 zsh: command not found: flutterfire 问题?

我按照文档在我的 flutter 应用程序中添加了 firebase。我收到 1 条警告和消息,例如

    Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
    You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):
Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):

  export PATH="$PATH":"$HOME/.pub-cache/bin"

Activated flutterfire_cli 0.1.1+2.
Run Code Online (Sandbox Code Playgroud)

之后我用了

flutterfire configure
Run Code Online (Sandbox Code Playgroud)

我收到此错误(不是错误)zsh: command not found: flutterfire 如何解决此问题?我这有什么环境错误吗?

firebase flutter

24
推荐指数
4
解决办法
3万
查看次数

API>25 中的前台服务在应用程序运行(可见)时是否强制通知

从 stackoverflow 和许多博客中,我确信前台服务在 API>25 中永远不会在没有通知的情况下运行。但我仍然感到困惑,当应用程序在屏幕上运行或可见时,通知是否是强制的。例如。当用户站在应用程序内时无需通知。那么这可以在应用程序运行时删除通知吗? 在服务舱

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    ......
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

        Notification.Builder builder = new Notification.Builder(this, ANDROID_CHANNEL_ID)
                .setContentTitle(getString(R.string.app_name))
                .setContentText(text)
                .setAutoCancel(true);

        Notification notification = builder.build();
        startForeground(1, notification);

    } 
return START_NOT_STICKY;
}
Run Code Online (Sandbox Code Playgroud)

活动中

Intent myService = new Intent(this, MyService.class);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        startForegroundService(myService);
    } else {
        startService(myService);
    }
Run Code Online (Sandbox Code Playgroud)

android foreground-service android-8.0-oreo

2
推荐指数
1
解决办法
2935
查看次数