我正在使用 Flutter 开发一个食品配送应用程序。我最近实现了 flutter_local_notifications 并且通知工作正常。但有一个问题是通知默认情况下不会显示为弹出窗口。默认情况下,通知设置中的“显示为弹出窗口”选项处于禁用状态。
默认安装应用程序时,有什么方法可以启用“显示为弹出窗口”选项吗?
这是我的通知配置代码:
void registerNotification() {
// This function registers the user for receiving push notifications.
// After registering the user, it creates a new field inside the 'userForChat' Database
// The field is called: 'pushToken' which is later used to configure Firebase Automatic Cloud Messaging
firebaseMessaging.requestNotificationPermissions();
firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) {
print('onMessage: $message');
Platform.isAndroid
? showNotification(message['notification'])
: showNotification(message['aps']['alert']);
return;
},
onResume: (Map<String, dynamic> message) {
print('onResume: $message');
return;
},
onLaunch: (Map<String, dynamic> message) { …Run Code Online (Sandbox Code Playgroud) android push-notification android-notifications flutter firebase-cloud-messaging
我试图通过客户端提供给我的 API 读取 json 文件,但它给出 HTTP 错误 405,表示方法不允许。谁能告诉我我做错了什么吗?
这个 api 请求片段是给我的:
curl 'http://finelistings.com/backend/apis/webbrands/' -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '{}' --compressed --insecure
Run Code Online (Sandbox Code Playgroud)
curl 'http://finelistings.com/backend/apis/webbrands/' -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '{}' --compressed --insecure
Run Code Online (Sandbox Code Playgroud) 因此,我正在开发一款应用程序,允许用户使用一些基本信息(例如姓名、职务等)离线创建帐户。我希望用户能够完全离线使用该应用程序。但我也想保留一个选项来创建一个具有某些身份验证方法的帐户,例如社交登录、电子邮件、电话。用户在本地创建帐户后可以通过其设置执行此操作。一旦他们创建/连接帐户,我想将本地可用的数据备份到 firebase 数据库。
但我很困惑哪种方法最适合这个。我应该为此使用 Sqflit 或共享首选项包吗?
提前感谢您的帮助。