I'm working on a multi-platform app which includes push notifications. The issue I'm facing is described in the images below
1st Scenario :
2nd Scenario :
However, when I test notification hub (using azure portal or Visual Studio), I receive notifications on all the devices.
It seems that Azure Notification Hub is ignoring Android devices when an iOS device uses the same account (tag).
Any help would be appreciated
For that type of issues, use the Service Bus Explorer. Likely, your Android app did not subscribe successfully for some reason. Subscribing different apps working on the different platforms to the same tag should not be a problem - i saw it working many times, and implemented that by myself.
If you see in the Service Bus Explorer (see registrations for your NH, and search for your android app registration and the tags field) that your android app is subscribed to the tag, but you see no notifications, check if your notification is malformed.
Related
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
Idea of this project :
Create a portal where anyone can create custom advertisement and push
it to the all the registered devices.(Supports only Android for now.)
Registered devices are the one which has android app installed in it.
Implementation:
For push notifications: Firebase Cloud Messaging is used.
Android App: simple app with FCM integrated into it.
Web UI: where a client can submit ad job.
server: interacts with FCM to send notification in batches
When client submits ad job, using device registered tokens were sending ads.
Once FCM sends notification to devices, "Acknowledge delivered" and "Acknowledge Clicked" are received from registered devices.
Major Goal:
I wanted to see how my server responds/handles when million or more
acknowledgements received from the all devices.
So for this purpose, i explored the below services which provides us virtual and physical devices online
AWS Device Farm
Xamarin test cloud
Google Firebase
private cloud where millions of AVDs can be running. [Dint research much on this part]
But for million android devices, first three are charging hefty.
for time-being, i have done simulation to test this scenario.
but wanted to test in real world scenario?
How can it be done?
Thanks for answering guys.
I have set up the GCM Client according to the example in the Xamarin component store. Furthermore I have followed the tutorial on Notification Hub.
I run my test on the Android 4.4.2 Emulator with Google API 19 and on various android devices (4.4, 5.1). I am working with the latest version of Xamarin.
In the emulator the PushHandlerService.OnRegistered is called and I can register the device token in the notification hub. However, the PushHandlerService.OnMessage method is not called when I send a message.
On real devices, not even the PushHandlerService.OnRegistered is called.
I have tried to send the message via notification hub and directly via the GCM service (HTTP Post). Both calls to the services succeed, but the message does not arrive in my app. I have tried notification messages with notification and/or data payload while the app is active or closed. I added my google account to the emulator. I have ensured that my google project number and package name are correct (google developer console corresponds to app).
How can I investigate my issue further?
Is there a possibility to see the delivery log in GCM?
Is there a way to see if the notification message at least arrives in my emulator's operating system?
What can go wrong so that my emulator receives a registration ID, but not the real device?
I finally ended up with the new GCM API according to the Xamarin tutorial: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/android/
Furthermore I unblocked the GCM ports on our firewall: : 5228, 5229, 5230
I'm using Visual Studio and Cordova to create crossplatform (iOS, Android) app and i'm using also azure hub notification and the mobile services.
It's possible to use just one mobile services with different app and send them different push?
How does it work?
Thanks
Yes technically you can using tags. You can have two different apps using same mobile service and being tagged on notifications hub as two different app type.
So when you need to push something to type 1 apps you specify this tag along with the message to notifications hub.
Let me know if you need more details.
I am a newbie to AWS and am exploring it for a mobile application targeted for Android and iOS platforms.One of my application's requirement is to provide push notifications wherein users subscribe to particular topic(s) and then get notifications for those topics.I had gone through Amazon SNS which intends to do exactly the same. Moreover, I have also tested sending push notifications to registered devices from AWS console. This works like a charm.
However,this is a manual process and I want this to be dynamic but without using an intermediate server. Rather I want to do this from the device(s) themselves using AWS Android, iOS SDKs. Thus I have following queries-
Can the Topics for SNS push notifications be created from within app?
Can Subscriptions to a particular topic be managed from the app itself?
Most importantly can push messages be published from devices to all subscribed devices of that topic?
Thanks in advance !
I am currently working on AWS SNS on iOS, and the answer to your questions are :
YES, topics can be created from within the app itself
YES, Subscriptions can be managed from the app also
YES, Push messages can be published from devices to all subscribed devices of a topic.
Please correct me if I'm wrong. And let me know if sample codes are needed.
Thank you.