Firebase In App Messaging PERMISSION_DENIED - android

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.

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.

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

Related

Flutter: Missing google_app_id. Firebase Analytics disabled

I want to send a notification from a device to another but when I sent it I got in the receiver device :
D/FLTFireMsgReceiver( 8876): broadcast received for message
E/FA ( 8876): Missing google_app_id. Firebase Analytics disabled. See ...
I searched in the internet but no solution works from me so I add all the verification that I found that they need to be :
In the ProjectName/android/app/Build.gradle :
In the ProjectName/android/Build.gradle :
And I added the google-services.json in the path "ProjectName/android/app/"
The problem is the API Firebase Analytics is not installed so if you need to install it and activate it :
You must follow Literally the SDK setup and configuration of google:
Then restart your Pc or Mac.

AbstractCommandTask: Exception occurred while processing task: com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null

I was using for Amazon In-App Purchases (IAP) in-app-purchasing-2.0.76.jar and switched to com.amazon.device:amazon-appstore-sdk:3.0.2 after their latest update. I followed the instructions provided by Amazon for the migration to AppstoreSDK.
I also followed the updated instructions for AppTester as described here.
But, I receive an Authentication Exception:
D/Kiwi: AbstractCommandTask: Exception occurred while processing task: com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null
com.amazon.a.a.n.a.a.a: AUTH_TOKEN_VERIFICATION_FAILURE: null: null
at com.amazon.a.a.n.a.b.a(AuthenticationTokenVerifier.java:94)
at com.amazon.a.a.n.a.a.a(AbstractCommandTask.java:204)
at com.amazon.a.a.n.a.a.a(AbstractCommandTask.java:131)
at com.amazon.a.a.n.b.b$1.run(SimpleTaskPipeline.java:179)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
Thus, the listener for methods: PurchasingService.getUserData(); and PurchasingService.getPurchaseUpdates(true); is not triggered.
Tried and failed:
Update ProGuard for possible obfuscation in Amazon classes.
Remove V2 signing for debug .apk.
Ensure that I am in Sandbox Mode.
Update AppstoreAuthenticationKey.pem file from Amazon Developer Console.
Update amazon.sdktester.json file from Amazon Developer Console.
Compare existing code with the documentation provided by Amazon.
Note: The exact same implementation with in-app-purchasing-2.0.76.jar was working.
All the above were tested in Amazon Kindle Fire HD 10 tablet running Fire OS 7.3.2.2
Any thoughts?
As you mention the Amazon App Tester app, I presume you receive the AUTH error during local testing.
If so, check your final merged AndroidManifest.xml contains the receiver tags needed for the Amazon App Tester to respond to your sandbox API requests:
https://developer.amazon.com/docs/in-app-purchasing/iap-implement-iap.html#responsereceiver
I had the same issue using build flavours (one for Google, one for Amazon) and the receiver tags were being ignored in the Amazon manifest.

In App Messaging not working Due to "Service Fetch Error"

We just implemented in app messaging, in our existing application on Play Store. But, the in app messaging is not working, not showing any popup, So, we tried to use updated JSON, still there is no improvement and mentioned logs are showing which has errors "Service Fetch Error".
Please help.
Implementations:
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-config:21.0.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:20.1.0'
implementation 'com.google.firebase:firebase-analytics:19.0.1'
Logs:
2021-09-27 12:04:06.759 14919-14919/com.hubhopper I/FIAM.Headless: went foreground
2021-09-27 12:04:06.770 14919-14919/com.hubhopper I/FIAM.Display: Binding to activity: DashBoardActivity
2021-09-27 12:04:06.771 14919-14919/com.hubhopper I/FIAM.Headless: Setting display event component
2021-09-27 12:04:06.920 14919-14971/com.hubhopper I/FIAM.Headless: Forcing fetch from service rather than cache. Test Device: false | App Fresh Install: true
2021-09-27 12:04:06.931 14919-14971/com.hubhopper I/FIAM.Headless: Recoverable exception while reading cache: /data/user/0/com.hubhopper/files/fiam_impressions_store_file (No such file or directory)
2021-09-27 12:04:07.211 14919-14919/com.hubhopper I/FIAM.Headless: Starting InAppMessaging runtime with Installation ID dA_tOxrhRJGCYmjyGXjM9A
2021-09-27 12:04:07.471 14919-15020/com.hubhopper W/FIAM.Headless: Service fetch error: Firebase Installations Service is unavailable. Please try again later.
2021-09-27 12:07:54.178 14919-14919/com.hubhopper I/FIAM.Display: Unbinding from activity: DashBoardActivity
2021-09-27 12:07:54.178 14919-14919/com.hubhopper I/FIAM.Headless: Removing display event component
2021-09-27 12:07:57.064 14919-14919/com.hubhopper I/FIAM.Headless: went foreground
2021-09-27 12:07:57.066 14919-14919/com.hubhopper I/FIAM.Display: Binding to activity: DashBoardActivity
2021-09-27 12:07:57.066 14919-14919/com.hubhopper I/FIAM.Headless: Setting display event component
2021-09-27 12:07:57.071 14919-14971/com.hubhopper I/FIAM.Headless: Forcing fetch from service rather than cache. Test Device: false | App Fresh Install: true
2021-09-27 12:07:57.074 14919-14971/com.hubhopper I/FIAM.Headless: Recoverable exception while reading cache: /data/user/0/com.hubhopper/files/fiam_impressions_store_file (No such file or directory)
2021-09-27 12:07:57.252 14919-16103/com.hubhopper W/FIAM.Headless: Service fetch error: Firebase Installations Service is unavailable. Please try again later.
It's also not working using with firebase-BOM.
Here is the guidance, our api key on Google Cloud credentials is not working for firebase installations from starting.
https://github.com/firebase/firebase-android-sdk/blob/master/firebase-installations/API_KEY_RESTRICTIONS.md
Now, in https://console.cloud.google.com/apis/api/firebaseinstallations.googleapis.com/metrics
metrics we are getting 200 and in app messaging is also working fine.
So, if you are facing "Firebase Installations Service is unavailable" error then update the google_services.json file by making new credentials on google cloud OR restrict the firebase installations in the current key you are using for android.
Thank You.

Firebase Crashlytics : Settings request failed - After migrate from fabric

After I migrate to crashlytics from fabric, crash reports does not shown on Firebase console anymore.
I followed upgrade document for migration.
I tried force crash to test and i logged with adb logcat -s FirebaseCrashlytics, I noticed an error with reading settings.
FirebaseCrashlytics: Settings request failed.
09-29 16:09:56.619 683 721 D FirebaseCrashlytics: Requesting settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/1:657730209335:android:0f0486036fa5647e/settings
09-29 16:09:56.619 683 721 D FirebaseCrashlytics: Settings query params were: {instance=23c94567f3a0450c2c4276ef9c4f083d3e073ab9, build_version=714012888, display_version=7.14.0.128, source=1}
09-29 16:09:56.641 683 721 E FirebaseCrashlytics: Settings request failed.
Here is my settings.
{"settings_version":3,"cache_duration":86400,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":false,"firebase_crashlytics_enabled":false},"app":{"status":"activated","update_required":false,"report_upload_variant":2,"native_report_upload_variant":2},"fabric":{"org_id":"5e00a1546bfe67fb08000062","bundle_id":"com.univera.android"}}
firebase_crashlytics_enabled" status false in settings.
Crashlytics enabled on console.
I m using version 17.2.1 implementation 'com.google.firebase:firebase-crashlytics:17.2.1' and i enabled CrashlyticsCollection FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
Why firebase_crashlytics_enabled" status false in my settings and whats wrong about settings request.
Does anyone see the raports on firebase console after migrate from fabric ?
Your app must execute the following line to initialize Firebase at start-up:
FirebaseApp.initializeApp(getContext());
Also, you may want to set a user id so that crashes are tagged with the user id in the Firebase console:
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mFirebaseAnalytics.setUserId("yourUserTag");
I faced the same issue, having this error :
E/FirebaseCrashlytics: Settings request failed.
java.net.SocketException: socket failed: EPERM (Operation not permitted)
This was a device specific issue. I have this error on a Xiaomi Mi A3, but when I launched the app on an emulator I had no error and the crashes appeared well in crashlytics.
There is no need to initialize Firebase in your code as matdev said.
Try running your app on a different device or emulator and see if the problem persists.
I fixed this issue by adding firebase-settings.crashlytics.com to allow domain list in network-security-config
This may help
https://stackoverflow.com/a/70858796/8499308

Invalid authentication token after 1 hour - Disk Persistence in Firebase

I'm using Firebase UI Auth to handle email signin in my app and I enabled Disk Persistence so that the data can be accessed offline. But after signed in for an hour in the app, I get this warning in the logcat.
W/PersistentConnection: pc_0 - Auth token revoked: expired_token (Auth token is expired.)
W/PersistentConnection: pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)
W/PersistentConnection: pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)
... repeatedly
... and sometimes
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
When I received this message, the app can't do any firebase save/retrieve new uncached data operation unless I sign out/clear data and then sign in again. Then the problem happened again after about an hour after signed in. I have followed this token refresh troubleshooting guide (added my debug and production key SHA1 to both Firebase and Google API Console) and it does not fix this. I have used the latest google-services.json from the Firebase Console in my project.
I'm also already using latest Firebase SDK and Play Services library
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.firebaseui:firebase-ui-auth:0.4.3'
I enabled the persistence in the Application class.
public class Application extends android.app.Application {
#Override
public void onCreate() {
super.onCreate();
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
}
}
Any ideas? Feel free to comment if you need more clarification or if I do not provide enough information.
Thank you
The kid 22fb7e6f95c657f4407e04e97c984bb6dbbcfeb3 is not recognized by the Firebase server. getToken() should definitely return different tokens if the account emails are different. Please file a ticket to Firebase, including the whole token payload from both your apps.
In Firebase 3, the maximum life-time of a JWT is 60 minutes. So after 1 hour, you will have to regenerate the access token. As for the invalid claim "kid", you do not need to pass any kid payload to your JWT.
NOTE: The problem you are facing is because of the recent changes made to the JWT structure and work flow. I faced the same problems - I revised my code as per the new JWT specs and things started working.

Categories

Resources