Але*_*бич 5 push-notification ios flutter
我在 Flutter 上为 iOS 设置推送通知时遇到问题。另一个开发人员也尝试添加 - 遇到了同样的问题。
TL;DR:任何人都可以通过稳定渠道的全新构建在 iOS Flutter 上运行推送吗?
我遵循此处描述的设置步骤:https : //pub.dev/packages/firebase_messaging
具体来说:
在 AppDelegate.swift 中添加了几行
if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate }
推不来。当应用程序在后台时,根本不是。
我还尝试了另一个步骤 - 发送个人推送。在 CURL 中发送代码如下所示:
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:key=AIza_legacy_key" \
-d \
'{
"to": "my_push_token",
"notification":
{"body": "test_body",
"title": "test_title"
},
"priority": "high",
}
' \
'https://fcm.googleapis.com/fcm/send'
Run Code Online (Sandbox Code Playgroud)
并且响应始终是这种类型: - 第一个请求是 InvalidRegistration - 第二个和下一个相同的调用是 NotRegistered
另一个人今年夏天发现了类似的问题并在GitHub上发帖,但线程被关闭:https : //github.com/flutter/flutter/issues/30486
我的颤振医生:
[?] Flutter (Channel unknown, v1.12.13+hotfix.7, on Mac OS X 10.15.3 19D76, locale ru-UA)
• Flutter version 1.12.13+hotfix.7 at /Users/reiven/flutter
• Framework revision 9f5ff2306b (2 weeks ago), 2020-01-26 22:38:26 -0800
• Engine revision a67792536c
• Dart version 2.7.0
[?] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/reiven/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio 3.6 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[?] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.7.5
[?] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[?] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio 3.6 Preview.app/Contents
• Flutter plugin version 43.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[?] Connected device (4 available)
• iPhone • 96c120610d684dbab7f5e4d036a7f48041755f96 • ios • iOS 12.3.1
• iPhone 11 Pro Max • 8ABC99D3-6C46-4A3D-968B-F5719AA92C97 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• Chrome • chrome • web-javascript • Google Chrome 79.0.3945.130
• Web Server • web-server • web-javascript • Flutter Tools
Run Code Online (Sandbox Code Playgroud)
ps我尝试过的一些事情:
| 归档时间: |
|
| 查看次数: |
2925 次 |
| 最近记录: |