I am rewriting an app from Xamarin to Flutter, I have been struggling with push notification for some time now.
I followed this guide: https://learn.microsoft.com/en-us/azure/developer/mobile-apps/notification-hubs-backend-service-flutter
I have implemented everything for Android and the cross platform code. Not yet started with IOS. The backend and notification hub is up and running for the Xamarin project, which I know is working.
When I register the device I get a 200 and it seems to be working. When I run a test push in Notification hub I get this:
Image of error code in Notification hub
When I try to send one more push I get nothing until I deregister and register again and I will get the error again.
When registering I use push channel, deviceId, platform, and a tag.
I have added the google-services.json file in the app folder of the android project.
Suggest you to check if the notification hub is configured correctly and tags or tag expressions are used correctly. Also, registration needs to be re-register everytime your app start-up.
You may refer to this article for troubleshoot: Diagnose dropped notifications in Azure Notification Hubs
Current project:
SDK Version - 39.0.0
Android standalone build
Hello there!
I having no push notifications on standalone build, what i did:
added firebase account with app info provided in app.json
putted google-services.json into app root and added path in expo.android.googleServicesFile in app.json
added key with expo push:android:upload --api-key <my-key> and tried to change it with a new one
added android push notification channel in application
Just in case, tried to send push notification on device token from getDevicePushTokenAsync() directly with firebase endpoint using my key and everything works.
long story short - did everything according documentation. In case of certain changes, expo.io needs FCM for sending push notifications via expo packages.
sending push notification on token from getExpoPushTokenAsync() doesn’t work at all except iPhone build.
Could you please help me with my problem? maybe i lost something in my steps to make my push notification work properly?
We have developed a hybrid application using MobileFirst 7.1.0 and are looking to implement push notifications. With the recent changes regarding GCM to FCM, I'm wondering if it would be possible to add the project to FCM and use the API Key and Sender ID? I have seen the documentation has been updated for MobileFirst 8.0 and wondering if the same will work on 7.1.0.
The documentation has indeed did not yet get updated for 7.1, but it is the same as for 8.0 (the part of registering the project in FCM Console and obtaining the key and senderId), so you can follow the same instructions.
Visit the Firebase Console.
Create a new project and provide a project name.
Click on the Settings “cog wheel” icon and select Project settings.
Click the Cloud Messaging tab to generate a Server API Key and a Sender ID and click Save.
i am not receiving notification after sending it through firebase console , i tried sending many notification but received one or two from around 20 notifications, i followed this guide firebase messaging from github
,why am i not receiving notification, my app is installed in one emulator and in one of my phone but when i receive notification which i have sent through notification panel i get them either on phone or emulator never got them on both.
below is the screenshot of my console
check your android app configuration in firebase console
use a restful client to make the request, i suggest
chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/dhc.html,
there you can see the response of the request, if your request are sent sucessfully or if you have error, and the response tells what kind of error you have
check android app , in the method onMessageReceived and print everything to see if you receive information, besides you can print the property "from" who is the id_number of your proyect, and you can see if the messages come from your firebase android app
check firebase documentation.
I've implemented everything just with the guides and its working pretty well
I solved the same problem.
The problem seems to be the browser compatibility/version. Mozilla Firefox could easily handle this.
Make sure your app is running in the background.
Open the Firebase notification console in the FireFox browser and send notifications.
Make sure token is generated
FirebaseInstanceId.getInstance().getToken();
in my case, the package name defined at firebase console isn't the same as defined on gradle and manifest of the app (i changed it one time in the app), so the app won't be able to receive notifications sent from firebase console.
They both have to be the same!
I did not add a new firebase project, just go to project settings at console and add new android app with another package name and have a look at the newly generated google-services.json and change some lines at you android studio project.
Besides the tips that Pavul Zavala said ، keep this in mind that just data message can received by FirebaseMessagingService even application closed or run in background and notification message can't handle(till this moment) when application run in background.
And all message that sent via FireBase console Contains , they always include a notification key
more detail at :
Push notification works incorrectly when app is on background or not running
In my case, what helped me is creating a new simulator in Android Studio
Few things to check:
in Firebase console https://console.firebase.google.com/ add/configure the project
in Android Studio connect to Firebase - Manu -> Tolls -> Firebase -> Cloud Messaging (Connect, Add FCM to your app)
Send notification from Firebase console
So, again, I recreated Virtual Device (open AVD manger and create the same device with the same API level)
I will be happy if somebody will save the time using this post :)
Ideally it shouldn't behave like that but it might be due to following reasons:
Check the notification priority of your app in the app settings of the device.
You might be sending the token of one particular device, Your target should be User segment.
I can't seem to find a document on how to push to Gear2 from my Android app. The closest I can find is this tutorial on building the Integrated app, but it's a fetching scheme (data only transferred when the user presses a button on the watch) http://developer.samsung.com/events/developer-blog/blog/Tutorial-How-to-build-a-Basic-Integrated-Gear-Application
So I'm wondering is the push is done via standard Android Wearable Notification, like here ? http://developer.android.com/training/wearables/notifications/creating.html
or any pointer to documents?
Thanks.
http://img-developer.samsung.com/contents/cmm/SamsungGearApplication_UIDesignGuideline_1.0.pdf.
section 3.4
Notifications app section.
I don't think any code is necessary (though I haven't tested this myself)
The default behaviour is to push all notifications, but it can be controlled using Gear Manager App.