Firebase cloud messaging shows There was an error loading targeting options - firebase

I used Firebase cloud messaging to send the notification to the users but from last one week i am getting this error while targetting the App
There was an error loading targeting options.

I have same problem. Interesting thing, that message was shown when I switch to topic, play with it and when I returned back got that message.
So, I save as draft my notification, because I don't want to lose my filled data. Reload page or open again and now it is work as expected.

Related

Firebase Crashlytics Webhook for Slack won't report recurring crashes

I have successfully set up the Webhook for Slack so that it will report crashes on Firebase Crashlytics. This is working completely fine!
However, when it detects the same crash multiple times,
it will report the first crash to the slack channel just fine, but the second time and after the same crash is detected, it does not report to the slack channel.
Is this how it's supposed to be?
I want to notify Slack of all crashes.
I can see in the slack integration settings section that the following settings that can be/is turned on.
Please check my image. ↓
enter image description here
Thank you for watching. :D
This is working as expected. As you can see in the screenshot Triggered when your app experiences a crash Crashlytics hasn't seen before, the notifications will be triggered when a new issue is detected.
After that, crashes that fall in the same issue won't trigger a notification as Crashlytics has already seen them before.
Check this blog post that explains this in detail for the different types of alerts.

Can't create Firebase Cloud Messages From Console

For some reason, I don't see the ability for me to create FCMs from the Firebase console. It's not a browser issue as I tried on multiple browsers. It's not a permissions issue either since I am the owner of the project.
I tried implementing cloud functions to send FCMs and ever since when I go into the Cloud Messaging panel of the Firebase console I can no longer see the option to create messages.
Any insight would help!
Update--This is the error I'm getting from the JavaScript console:

Firebase Cross Platform Push Notification Plugin Duplicating MainActivity

I'm using the following plugin for implementing and handling FCM push notifications in my xamarin application and there's one little unaddressed problem I'm facing.
I was hoping someone else has already figured it out and could help me.
THE PROBLEM:
It seems to be duplicating my MainActivity although I have the LaunchMode set to SingleTop.
There's an event called OnNotificationReceived that's provided by the library.
This event fires as expected, only once, when the application is in the foreground.
When I minimize the application (let it run in the background), send a notification to the device and tap on the notification, it opens the application, as expected, but if I send another notification after that, while the application is in the foreground, The OnNotificationReceived Event is fired twice.
I've tried changing the NotificationActivityFlags property to SingleTop.
I've tried changing my MainActivity's Launch Mode to SingleTop
I tried running the sample application they've provided to check if its something that I'm doing wrong, and still the same thing happens.
Logging the issue in their Github repository
None of the above have worked.
The issue can be reproduced by:
downloading the sample from the repository, link provided above
replacing their google-services.json file with your own from the Firebase
console.
change the package name of the sample of the application to the one you
have registered on Firebase
following the steps above that I've mentioned
ADDITIONAL INFO
Version Number of Plugin: 1.3.0
Device Tested On: Huawei P8 Lite Android Version 6.0
Version of VS: Visual Studio 2019
Version of Xamarin: 3.4.0.1009999
Update:
Unfortunately, the method below has not proven successful after attempting to implement it, I should have thought of the fact that I'm still going to need the notification object for iOS, earlier.
Myself and the team are going to implement a way to keep track of the users platform on the server and send them a notification either with or without the notification based on their platform, since iOS handles FCM notifications differently from Android. For now we're going to use Google's Instance ID service to determine what platform existing users are on.
Workaround:
I hope this helps someone in the future, if not I hope someone can provide me with a better solution.
In order to have my cake and eat it, basically be able to keep the notification object in the payload instead of removing it and having to further customise the payload to display notifications just for iOS, I changed the MainActivity's (the activity thats launched when a user taps on the notification) Launch mode to SingleInstance. That way I can keep my notification object in the payload and not have to worry about the OnNotificationReceived event being triggered twice.

How do you access OneSignal's database on Android & iOS in Flutter?

I am using OneSignal in my Flutter application to receive notifications. I have created my own table within Flutter to save notifications but I cannot save messages that have been sent whilst the app has been terminated. However, I have found that the OneSignal package has it's own database installed on the device which captures everything no matter what state the application is in! So, to avoid duplicating data I want to use this database instead. It is located outside of the flutter app folder which is my issue (see image below).
How do I access this database? Does anybody know if it is the same on iOS (I haven't been able to check at this time).
Many thanks.
It's important to understand that if an app has been terminated, any onReceived handler will not be fired. We don't recommend using the local db at all. Your best bet is to use the respective notification extender services for each platform. Though you will have to write native code for this! Cheers
Edit:
ANDROID - NotificationExtenderService - This can be setup to receive silent notifications when your app is not running or to override how notifications are shown in the notification shade. See the Background Data and Notification Overriding section to set this up.

How to View Firebase Notification Delivery Reports?

We use Firebase to send push notifications to both Android and iOS devices. We use Http (not XMPP).
How to get delivery reports for push notifications? We want to check if a push is delivered to devices (both Android and iOS).
I cannot see any stats or reports in Firebase console.
Please help.
As seen in the Possible Duplicate Post I linked, there is currently no available reports for FCM, other than what can be seen in the Firebase Console (if you sent the message using the console) and using the Diagnostics/Statistics tool in your Play Dev Console.
There is no API that retrieves these FCM log details as of the moment. However, there's been a recent improvement in the Firebase Notifications console where stats (sent count only for now) for messages sent using the FCM API is included in the Firebase Notification console stats. From my answer in the similar post:
As of August 2018, stats for messages sent using the FCM API are now visible from the console. From the Cloud Messaging section, click on the Reports tab. From there, you will be able to filter by message type (notification, data, and all)
It would seem that the Impressions and Opens are still only available for messages sent using the console. But Sends for sure now counts the messages sent using the FCM API.
Reference: https://firebase.googleblog.com/2018/08/in-app-messaging-crashlytics.html
Our findings: In order to view statistics for Data messages, the data messages will need to include an analytics label. Check to make sure that these are included. It is just a label, https://firebase.google.com/docs/cloud-messaging/understand-delivery#adding-analytics-labels-to-messages so even without the analytics label, the message should still be sent. It just won't be tracked by their reporting. Data messages do not automatically generate a notification though. Different app states and message types will have different message receiving behavior. A data message should be received in onMessage or setBackgroundMessageHandler for JavaScript clients. Try checking these callbacks to see if the message is received there. I'd highly recommend checking out the quickstart, which should be working fine. You can use it as a base to build off or reference to compare with your app to identify potential problem areas. So our understanding is that it needs to be handled properly on the mobile end, https://firebase.google.com/docs/cloud-messaging/js/receive (though this is the javascript client, it will still apply to mobile).
You can rather go to the Google cloud console to check messages sent.
Select period from available options on top right of the page.
https://console.cloud.google.com/apis/dashboard?folder=&organizationId=&project=[project-name]
The delivery report added to the FCM:
Received (available only on Android devices) — The data message or notification message has been received by the app. This data is available when the receiving Android device has FCM SDK 18.0.1 or higher installed.
https://firebase.google.com/docs/cloud-messaging/understand-delivery#message-delivery-reports

Resources