- 創建 Firebase 專案
- GoogleService-Info.plist 放到 Runner (通常情況)
- 上傳 APNs
- https://developer.apple.com -> Certificates, Identifiers & Profiles -> Keys -> (+ 按鈕) -> Apple Push Notifications service (APNs) 打勾 -> 下載 .p8 檔
- https://console.firebase.google.com -> 專案設定 -> 雲端通訊 -> iOS 應用程式設定
- XCode -> Runner -> Signing & Capability -> 新增
Push Notifications
和Background Modes
(有兩個選項要打勾) - 配置 info.plist
- 創建 Firebase 專案
- google-services.json 放到 android/app (通常情況)
- android/app/src/main/AndroidManifest.xml 新增
<intent-filter> <action android:name="FLUTTER_NOTIFICATION_CLICK" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
- android/build.gradle
buildscript { dependencies { // ... other dependencies classpath 'com.google.gms:google-services:4.3.3' // 新增這一行 版本找最新的 } }
- android/app/build.gradle
apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' // 新增這一行
// 待補