Firebase In App Messaging PERMISSION_DENIED
Asked Answered
D

3

7

I did setup for firebase in App messaging. Created campaign and my app can't deliver it. In logcat I got following logs

2019-02-26 11:22:40.616 16131-16131/app.package.name I/FIAM.Headless: Starting InAppMessaging runtime with Instance ID ciy4xtnJqBQ
2019-02-26 11:22:42.153 16131-16131/app.package.name I/FIAM.Headless: Setting display event listener
2019-02-26 11:22:42.457 16131-16131/app.package.name I/FIAM.Headless: went foreground
2019-02-26 11:22:42.464 16131-16157/app.package.name I/FIAM.Headless: Forcing fetch from service rather than cache. Test Device: false | App Fresh Install: true
2019-02-26 11:22:42.472 16131-16157/app.package.name W/FIAM.Headless: Recoverable exception while reading cache: /data/user/0/app.package.name/files/fiam_impressions_store_file: open failed: ENOENT (No such file or directory)
2019-02-26 11:22:42.483 16131-16157/app.package.name I/FIAM.Headless: Fetching campaigns from service.
2019-02-26 11:22:42.999 16131-16157/app.package.name W/FIAM.Headless: Service fetch error: PERMISSION_DENIED: Requests to this API firebaseinappmessaging.googleapis.com method google.internal.firebase.inappmessaging.v1.sdkserving.InAppMessagingSdkServing.FetchEligibleCampaigns are blocked.

Setup

Android studio 3.3.1

com.google.firebase:firebase-inappmessaging-display:17.0.5

com.google.firebase:firebase-core:16.0.7

Firebase in app messaging API enabled in Google Cloud Console

What could be reason of?

2019-02-26 11:22:42.999 16131-16157/app.package.name W/FIAM.Headless: Service fetch error: PERMISSION_DENIED: Requests to this API firebaseinappmessaging.googleapis.com method google.internal.firebase.inappmessaging.v1.sdkserving.InAppMessagingSdkServing.FetchEligibleCampaigns are blocked.
During answered 26/2, 2019 at 8:42 Comment(0)
D
6

The reason of the issue was restriction on API key for Android app. So InAppMessaging API was enabled for the whole project but it also require add InAppMessaging API to the specific platform API key restriction.

During answered 26/2, 2019 at 11:47 Comment(4)
@NovoLucas They have to wait two days before they can accept it. If you think this answer is useful you can always upvote it.Fragmentation
Can you elaborate on this, How to do that?Allman
Didn't get the point. Can you specify your answer with more details, please?Gian
More detailed instructions: stackoverflow.com/a/58496014Rectal
S
2

you have to add the firebase InApp Messaging permission to your Google Cloud API, can be done from the Google Cloud Console

Subbasement answered 12/10, 2021 at 11:42 Comment(0)
C
2

Go to your project on Google Cloud Console. In Apis Key click on Android Key. You need remove the restrictions on the apis needed for it.

Google Cloud Console

enter image description here

Cheerio answered 22/5 at 20:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.