Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Firebase Test msgs working, but not Azure hubs

$
0
0

Using Xamarin.Forms 2.5, Xamarin.Firebase.Messaging & Xamarin.GooglePlayServices.Base v60.1142.0.
I am using my own custom backend to register with Azure. The backend is a WebAPI that uses Microsoft.Azure.Notifications 1.0.9

My Xamarin.Android phone client successfully registers with Firebase and gets a token. It then calls my backend to register and the register is succesfull.

The backend code is something like this.

registration = new GcmRegistrationDescription(deviceUpdate.Handle);
template = "{ \"data\" : {\"message\":\"" + "$(message)\"}}";
registration.Tags = new HashSet(deviceUpdate.Tags);
registration.Tags.Add("username:" + USERNAME);
hub.CreateGcmTemplateRegistrationAsync(Id, template, registration.Tags);

This is successful.
Then I go to the Visual Studio 2017/ServerExplorer/NotificationHubs/ and double click it.
There is a registration that is listed that has the tags I added.
When I go to Test Send, regardless of my tag, broadcast, and message, there is never any "Message Result" displayed towards the bottom and I never get a notification on the Android Xamarin client.
When I go to Test Send in the Azure Portal, and attempt either broadcast or to my "username:myusername" tag, it always says "No matching targets".

However, If I go to the firebase console and send a message to my Token, my Android Emulator successfully gets the notification.
So I am really at a loss as how to proceed. I googled around but it appears nobody has the same problem I am describing.

Is there any real good reasons to use Azure Notification hubs? Perhaps I should just take that component out and have my backend communicate directly with Firebase and APNS?

Thanks for any suggestions.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>