質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

解決済

1回答

1384閲覧

Firebaseにてプッシュ通知を送りたいが届かない

abebebe0715

総合スコア9

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2023/05/02 07:20

編集2023/05/02 07:37

実現したいこと

  • IOS(Androidも)アプリでプッシュ通知を受け取りたい

前提

FireBaseよりプッシュ通知を送る機能を製造中です。
本家サイトの設定は
FireBaseコンソール
Xcode内での設定は正常に終わっているかと思っています。
https://firebase.google.com/docs/cloud-messaging/ios/client?hl=ja

発生している問題・エラーメッセージ

2023-05-02 16:13:53.636685+0900 XXXXProject[83357:19643671] 10.8.1 - [FirebaseAnalytics][I-ACS023007] Analytics v.10.8.1 started 2023-05-02 16:13:53.637025+0900 XXXXProject[83357:19643486] [Firebase/Crashlytics] Version 10.8.1 2023-05-02 16:13:53.637022+0900 XXXXProject[83357:19643671] 10.8.1 - [FirebaseAnalytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r) 2023-05-02 16:13:53.637528+0900 XXXXProject[83357:19643671] 10.8.1 - [FirebaseMessaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration. 2023-05-02 16:13:53.827200+0900 XXXXProject[83357:19643678] 10.8.1 - [FirebaseAnalytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement 2023-05-02 16:13:53.938414+0900 XXXXProject[83357:19643486] WF: === Starting WebFilter logging for process XXXXProject 2023-05-02 16:13:53.938466+0900 XXXXProject[83357:19643486] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2023-05-02 16:13:53.938498+0900 XXXXProject[83357:19643486] WF: _WebFilterIsActive returning: NO 2023-05-02 16:13:53.944442+0900 XXXXProject[83357:19643486] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2023-05-02 16:13:53.944478+0900 XXXXProject[83357:19643486] WF: _WebFilterIsActive returning: NO APNs token retrieved: 32 bytes Firebase registration token: Optional("ccrrUYgo3ksQpH2gpTCvkh:APA91bEmePqD5orki-xpXFXAiCLOsowxsfUFsChg8AvKkO85JzC5MCdA0KySf649WpF_xKjA-ZPEJN39hM7FT0ZHx5P8tqR9Mp2LCwMbFpT2NHwM-jEjy-WayJS4s946CoOoI6VxL97W") ua1; Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 2023-05-02 16:13:54.355591+0900 XXXXProject[83357:19643678] 10.8.1 - [FirebaseAnalytics][I-ACS023012] Analytics collection enabled 2023-05-02 16:13:54.356286+0900 XXXXProject[83357:19643678] 10.8.1 - [FirebaseAnalytics][I-ACS023220] Analytics screen reporting is enabled. Call Analytics.logEvent(AnalyticsEventScreenView, parameters: [...]) to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist 2023-05-02 16:13:54.448012+0900 XXXXProject[83357:19643678] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 142.251.42.202:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-02 16:13:54.448091+0900 XXXXProject[83357:19643678] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 142.251.42.202:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed 2023-05-02 16:13:54.453480+0900 XXXXProject[83357:19643678] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2.1 142.251.42.202:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-02 16:13:54.453553+0900 XXXXProject[83357:19643678] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2.1 142.251.42.202:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed 2023-05-02 16:13:54.543115+0900 XXXXProject[83357:19643678] 10.8.1 - [FirebaseInAppMessaging][I-IAM130004] Failed restful api request to fetch in-app messages: seeing http status code as 403 with body as { "error": { "code": 403, "message": "Firebase In-App Messaging API has not been used in project 140704145615 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseinappmessaging.googleapis.com/overview?project=140704145615 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.rpc.Help", "links": [ { "description": "Google developers console API activation", "url": "https://console.developers.google.com/apis/api/firebaseinappmessaging.googleapis.com/overview?project=140704145615" } ] }, { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "SERVICE_DISABLED", "domain": "googleapis.com", "metadata": { "consumer": "projects/140704145615", "service": "firebaseinappmessaging.googleapis.com" } } ] } } 2023-05-02 16:13:54.544925+0900 XXXXProject[83357:19643678] 10.8.1 - [FirebaseInAppMessaging][I-IAM700002] Error happened during message fetching Error Domain=NSURLErrorDomain Code=403 "(null)" 2023-05-02 16:13:54.685640+0900 XXXXProject[83357:19643671] [connection] nw_endpoint_handler_set_adaptive_read_handler [C3.1 172.217.175.234:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-02 16:13:54.685791+0900 XXXXProject[83357:19643671] [connection] nw_endpoint_handler_set_adaptive_write_handler [C3.1 172.217.175.234:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed 2023-05-02 16:14:25.384250+0900 XXXXProject[83357:19644229] [connection] nw_endpoint_handler_set_adaptive_read_handler [C4.1 172.217.31.138:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-02 16:14:25.384330+0900 XXXXProject[83357:19644229] [connection] nw_endpoint_handler_set_adaptive_write_handler [C4.1 172.217.31.138:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed 2023-05-02 16:14:59.101273+0900 XXXXProject[83357:19644447] [connection] nw_endpoint_handler_set_adaptive_read_handler [C5.1 172.217.161.74:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-02 16:14:59.101424+0900 XXXXProject[83357:19644447] [connection] nw_endpoint_handler_set_adaptive_write_handler [C5.1 172.217.161.74:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed

該当のソースコード

swift

1AppDelegate.swift 2は以下のサンプルソースを使用しています 3https://github.com/firebase/quickstart-ios/tree/master/messaging/MessagingExampleSwift

試したこと

公式サイトを見ての実装。
実機上に通知が表示されません。

どこが悪いのか判別できずにおります。
ポイント等をご指示いただけると嬉しいです。。

補足情報(FW/ツールのバージョンなど)

Xcode14.3

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Firebaseは使ったことがないのですが、
ログを見たところで回答してみますね。

ポイントは次の部分かなと思います。

log

12023-05-02 16:13:54.543115+0900 XXXXProject[83357:19643678] 10.8.1 - [FirebaseInAppMessaging][I-IAM130004] Failed restful api request to fetch in-app messages: seeing http status code as 403 with body as { 2 "error": { 3 "code": 403, 4 "message": "Firebase In-App Messaging API has not been used in project 140704145615 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseinappmessaging.googleapis.com/overview?project=140704145615 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", 5 "status": "PERMISSION_DENIED",

Messaging APIが対象のプロジェクトで無効になっているっぽいですね。
有効にしてみたらいかがでしょうか。
有効してから数分待つ必要があるみたいですね。

投稿2023/05/02 10:57

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

abebebe0715

2023/05/08 00:23

返信本当にありがとうございます。 ご指摘の通り無効になっておりました。 有効にして試してみたいと思います!!
abebebe0715

2023/05/08 00:39

同じ部分のログですが以下のようにご指摘部分のエラーはなくなりました。 まだ通知が来ない状態ではありますが、受取部分の問題かもしれません。 再度公式サイトをみて実装を見直してみようと思います。 ふさぎこんでいましたので本当にありがとうございました! 2023-05-08 09:25:27.497311+0900 XXXXProject[84984:19846125] 10.8.1 - [FirebaseAnalytics][I-ACS023007] Analytics v.10.8.1 started 2023-05-08 09:25:27.497554+0900 XXXXProject[84984:19846088] [Firebase/Crashlytics] Version 10.8.1 2023-05-08 09:25:27.497844+0900 XXXXProject[84984:19846125] 10.8.1 - [FirebaseAnalytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r) 2023-05-08 09:25:27.497973+0900 XXXXProject[84984:19846125] 10.8.1 - [FirebaseMessaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration. 2023-05-08 09:25:27.709240+0900 XXXXProject[84984:19846120] 10.8.1 - [FirebaseAnalytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement 2023-05-08 09:25:27.711999+0900 XXXXProject[84984:19846088] WF: === Starting WebFilter logging for process XXXXProject 2023-05-08 09:25:27.712029+0900 XXXXProject[84984:19846088] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2023-05-08 09:25:27.712060+0900 XXXXProject[84984:19846088] WF: _WebFilterIsActive returning: NO 2023-05-08 09:25:27.716190+0900 XXXXProject[84984:19846088] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2023-05-08 09:25:27.716228+0900 XXXXProject[84984:19846088] WF: _WebFilterIsActive returning: NO 2023-05-08 09:25:27.728151+0900 XXXXProject[84984:19846121] 10.8.1 - [FirebaseAnalytics][I-ACS023012] Analytics collection enabled 2023-05-08 09:25:27.767166+0900 XXXXProject[84984:19846121] 10.8.1 - [FirebaseAnalytics][I-ACS023220] Analytics screen reporting is enabled. Call Analytics.logEvent(AnalyticsEventScreenView, parameters: [...]) to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist APNs token retrieved: 32 bytes Firebase registration token: Optional("ccrrUYgo3ksQpH2gpTCvkh:APA91bEmePqD5orki-xpXFXAiCLOsowxsfUFsChg8AvKkO85JzC5MCdA0KySf649WpF_xKjA-ZPEJN39hM7FT0ZHx5P8tqR9Mp2LCwMbFpT2NHwM-jEjy-WayJS4s946CoOoI6VxL97W") ua1; Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 2023-05-08 09:25:28.162959+0900 XXXXProject[84984:19846121] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 172.217.175.234:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-08 09:25:28.163016+0900 XXXXProject[84984:19846121] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 172.217.175.234:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed 2023-05-08 09:25:28.167687+0900 XXXXProject[84984:19846121] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2.1 142.250.207.10:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-08 09:25:28.167767+0900 XXXXProject[84984:19846121] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2.1 142.250.207.10:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed 2023-05-08 09:25:28.196440+0900 XXXXProject[84984:19846121] [connection] nw_endpoint_handler_set_adaptive_read_handler [C3.1 142.251.222.42:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed 2023-05-08 09:25:28.196491+0900 XXXXProject[84984:19846121] [connection] nw_endpoint_handler_set_adaptive_write_handler [C3.1 142.251.222.42:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed
abebebe0715

2023/05/08 05:27

プッシュ通知を受け取ることができました! 本当にありがとうございました!! ベテランの方ですと些細なことかもしれないのですが 初心者ですと全てが迷路のようでして。。 ご指示、ご指摘いただきまして本当に助かりました!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問