I have resolved my issue. It appears that the fcmv1 template notification only functions correctly when the 'enableTestSend' parameter in the NotificationHubClient initialization is set to false.
Test notifications with FcmV1 sent from Azure Hub Notifications are not working.
Hi,
I have been reading about FcmV1 due the migration of FCM by Google.
After the configuration in Google (FCM v1) in Azure, I have tried make a "Test Send" BUT the message never is sent.
By the contrary, when I send a message from Android (Legacy) it works fine.
What I thought was when I configured Google (FCM v1) I could sent a test messages and it would worked, but it did not.
Azure Notification Hubs
-
PORRAS MIRANDA JONATHAN GERARDO 60 Reputation points
2024-03-18T18:13:04.7033333+00:00 I aploaded a bigger image.
-
SnehaAgrawal-MSFT 21,766 Reputation points
2024-03-19T11:14:47.57+00:00 @PORRAS MIRANDA JONATHAN GERARDO Thanks for reaching here! Could you please confirm if you have followed below official documents for complete set up.
- Google Firebase Cloud Messaging (FCM) migration using SDKs.
- Google Firebase Cloud Messaging (FCM) migration using REST APIs.
Let us know.
-
Julio Velasco 0 Reputation points
2024-03-21T17:43:42.8033333+00:00 We have the same problem here, and yes, I've followed the guides you provided, that I think are unuseful because we're just testing the test option directly against firebase after the 3 parameter configuration on v1.
-
PORRAS MIRANDA JONATHAN GERARDO 60 Reputation points
2024-03-21T20:18:40.5766667+00:00 @SnehaAgrawal-MSFT I have not done the changes in the client, but I think a least the message from Azure should said that found some subscribers.
I have not done the changes in the client (mobile application) but I doubt if the "send test”, from Azure should find someone.
We are just testing the message from Azure to Firebase, what we hope is.
Azure could find somebody, but it seems Azure did not find anybody to deliver the message.
-
SnehaAgrawal-MSFT 21,766 Reputation points
2024-03-22T13:44:18.5166667+00:00 @PORRAS MIRANDA JONATHAN GERARDO Thanks for clarification. I am having internal discussion on this, will update you soon.
-
PORRAS MIRANDA JONATHAN GERARDO 60 Reputation points
2024-03-22T15:04:17.21+00:00 Hi SnehaAgrawal-MSFT, Thanks. We will wait the news.
-
soni adogeri 0 Reputation points
2024-03-25T05:34:46.1233333+00:00 Have the same problem legacy works fine, but the new version doesn't.
-
Deleted
This comment has been deleted due to a violation of our Code of Conduct. The comment was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
-
David Yeung 55 Reputation points
2024-03-26T03:38:47.4333333+00:00 same here,
Generate new private key from firebase console✔️
set up private key, client email, project id to azure Google (FCM v1) ✔️
get the token from android app✔️
Test the push notification using Firebase console push✔️
register the token using FcmV1TemplateRegistrationDescription✔️
Send notification in program (SendTemplateNotificationAsync) ❌-> no device received
Send notification in Azure Portal ❌-> no device received
-
SnehaAgrawal-MSFT 21,766 Reputation points
2024-03-26T05:15:54.32+00:00 @PORRAS MIRANDA JONATHAN GERARDO Could you please confirm if you have created FcmV1Registration? It seems like there’s no target fcmv1 registration.
Documentation of creating fcmv1 registration: Azure Notification Hubs and the Google Firebase Cloud Messaging (FCM) migration using REST API and the Azure portal | Microsoft Learn
-
David Yeung 55 Reputation points
2024-03-26T07:05:40.2333333+00:00 I found that if i create the registration with CreateFcmV1NativeRegistrationAsync, i can receive notification from azure test push.
but if i create the registration with CreateFcmV1TemplateRegistrationAsync, i cannot receive the notification from azure test push.
seems like there are some issue on the TemplateRegistration
-
Mar 30 Reputation points
2024-03-27T08:07:57.92+00:00 I can confirm that the fcvmv1 template registration is not working. I followed the guide, created a service account, supplied the values in de AZN. Created a registration FcmV1TemplateRegistrationDescription with a single tag. The registration is created and can be retrieved with the registration endpoint and deviceToken filter.
However, test send with custom template does not seem to find the registration with that tag. It reports 0 passed, 0 failed
Sending with the api also doesn't send the message
-
SnehaAgrawal-MSFT 21,766 Reputation points
2024-03-28T12:29:00.0866667+00:00 Could you please confirm below-
- If you select “Custom Template” as a platform type on Test Send?
- What REST API endpoint did you use for template send? What header value did you use for ServiceBusNotification-Format?
- Also details like namespace name, hub name, correlation Id and datetime is required to further investigate.
Suggest you send email to AzCommunity[at]microsoft[dot]com referencing this thread,
-
Mar 30 Reputation points
2024-03-29T13:31:55.8766667+00:00 I just sent a mail with more info about as you requested, I hope it helps resolving the issue.
-
PORRAS MIRANDA JONATHAN GERARDO 60 Reputation points
2024-04-01T20:36:43.0433333+00:00 Hi. In my case:
- I already had made the change in Azure (three parameters)
- I added reference in my Xamarin App to the nuget "Microsoft.Azure.NotificationHubs" Version="4.2.0"
- I registered a new tag using CreateFcmV1NativeRegistrationAsync method
- I sent a "Test message" with Android (FCM v1) from Azure
and the message arrived at the device just added.
What I see is we must migrate all the devices already registered in Android Legacy to Android (FCM v1), which a think is not very good news.
-
SnehaAgrawal-MSFT 21,766 Reputation points
2024-04-04T11:32:36.0933333+00:00 @PORRAS MIRANDA JONATHAN GERARDO Reached out to you privately.
-
Smitha Kalluparambil 85 Reputation points
2024-04-19T15:17:28.0233333+00:00 @SnehaAgrawal-MSFT I am not able to call SendTemplateNotificationAsync() and send a notification to the registered device. When sending notification from "Test Send" in Azure Portal, it does not get delivered
-
Ortiz Rozalen, Luis Miguel 0 Reputation points
2024-04-22T09:09:43.5766667+00:00 Hello everyone,
I ran into the same challenge while migrating my project to integrate with FCM v1, but I think I've found a solution that might help. Initially, I had problems sending notifications after setting up Google FCM v1 in Azure. However, through a redesign process, I managed to overcome this obstacle.
Instead of relying on templates, I changed my approach by registering on Azure Notification Hub without templates. I then created the notification payload in the new FCM v1 format. Using the
SendNotificationAsync
method with theFcmV1Notification
object, I was able to send and receive notifications seamlessly.Documentation or information on the migration process, especially regarding the use of templates, did not seem very valuable. Consequently, I opted for this alternative solution.
If you are interested, I would be happy to provide you with more details and help you solve your problem.
Best regards.
-
Andreas Leitel 45 Reputation points
2024-04-22T11:48:22.5966667+00:00 There is another question that is probably related to the same problem: https://learn.microsoft.com/en-us/answers/questions/1658068/pushnotifications-upgrade-to-fcmv1-is-not-deliveri
The main problem seems to be that SendTemplateNotificationAsync(...) does not properly handle the template id in the tagsExpression - or CreateOrUpdateInstallationAsync(...) does not properly persist the template / tags combination. In either case: calling SendTemplateNotificationAsync(...) while passing the tagsExpression with a template id does not result in a notification being sent to the device.
-
Mar 30 Reputation points
2024-04-22T13:39:43.2+00:00 We are able to send notifications with a (simple) tag expression using template registrations. However, it just does not work in the Test Send feature on the portal.
One of the reasons we had a hard time getting it to work was the format of the message. Our messages contained values that are no longer allowed.
Try sending messages with the api, not with the Test Send feature
-
Noor, Zoya 0 Reputation points
2024-04-24T14:31:07.77+00:00 - @Ortiz Rozalen, Luis Miguel I am using the below code for the device registration, but the method CreateFcmV1NativeRegistrationAsync throws error. // Create new Registration
- var deviceToken = "device-token"; var tags = new HashSet<string> { "tag1", "tag2" }; FcmV1RegistrationDescription registration = await hub. CreateFcmV1NativeRegistrationAsync(deviceToken, tags);
- Could you please share the document that you are following or any resources that could be helpful please.
Sign in to comment
1 answer
Sort by: Most helpful
-
David Yeung 55 Reputation points
2024-04-29T08:27:52.52+00:00 -
Smitha Kalluparambil 85 Reputation points
2024-04-29T13:19:10.5066667+00:00 I feel the code has changed since the errors we received. I am pretty sure we tried this option. I now receive a notification when I created a notification client with EnableTestSend set to false. However, when I checked the outcome, it still showed Success = 0 and Failure = 0. I would expect the call to work as it previously did, sending a notification regardless of whether EnableTestSend is set to true or false.
State : Enqueued
Success : 0
Failure : 0
Results :
NotificationId :
TrackingId : 539f8880-4XXX
Sign in to comment -