- 安卓運行良好
2.從 firebase 站點到 iOS 真實設備運行良好(在此推送到 ios 下方是可以的)
3. 從 iOS 遠程推送到 andriod 運行良好
- 但是到 iOS 的遠程推送訊息不起作用
我的Xcode

我的資訊

我的 Appdelegate.swift
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure() //add this before the code below
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
uj5u.com熱心網友回復:
其實我遇到過這個問題,經過長時間的研究發現我沒有允許通知的權限,所以使用permission_handler插件來請求遠程通知的權限。
像這樣:
Future<Map<Permission, PermissionStatus>> requestPermission() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.notification
].request();
return statuses;
}
- 卸載應用程式
- 添加上面的代碼
- 啟動時呼叫此函式
- 給予許可
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/359622.html
