注意:這是一個ionic(Capacitor)專案,我正在使用Android Studio進行測驗。
requestNotificationsPermissions(): void {
PushNotifications.requestPermission().then(result => {
如果(result.granted){
PushNotifications.register()。
}
}).catch((err: any) => {
console.log(err)。
});
}
uj5u.com熱心網友回復:
我看到你正在使用PushNotifications。
當我忘記在我的Android專案檔案夾中包含google-services.json時,這種情況曾經發生在我身上。如果是這種情況,請將google-services.json包含在android/app/檔案夾中。
請看官方插件檔案。https://capacitorjs.com/docs/apis/push-notifications#android
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/310126.html
標籤:
