push notification azure to FCM topics - json

I want to push notification messages from azure notification hub to the FCM using topics.
Example: I want to send a message to the FCM from notification hub. but this message will be directed to topics. When using postman for example, I just have to send this json:
{
"to" : "/topics/scalability",
"notification":{"body":"topics message sent"}
}
to https://fcm.googleapis.com/fcm/send (while providing the FCM key ofcourse).
By doing this, I am able to receive the notification on a chrome app I put in place (the app is just the same as you can find here
Now my problem is that when I send this same message on Notification hub (Azure), I don't receive it on my web app. My understanding is that the Notification Hub does not push the message (json) in its simple format, but why is that ?
Since I successfully pushed the message to FCM, isn't the FCM supposed to interpret the
"to" : "/topics/scalability
part ?

I found a workaround. I send notifications using the simple version of the Notification hub method:
// Send the message to FCM NotificationOutcome outCome = await this.hubClient.SendGcmNativeNotificationAsync(payload).
I then receive all the messages from my chrome app

Azure Notification Hub supports registering tags with individual device. And you can use tag expressions to target specific sets of devices, or more specifically registrations, when sending a push notification through Notification Hubs. For targeting, you should use tag expression instead FCM ‘to’ property. Please see below article for more details on routing/expressions.
https://learn.microsoft.com/en-us/azure/notification-hubs/notification-hubs-tags-segment-push-message

I know this is an old question but I also was confused by this when starting my first Topics-based notification hub app, so hope this saves someone, somewhere some time. What SHOULD, in my opinion, be explicitly stated somewhere in the azure NH documentation, is that using the hub with PNS such as Firebase will OVERRIDE any PNS specific Topics functionality. My understanding is that if you decide to go the Hub route, you ditch Firebase Topics etc and work exclusively with Hub Tags.
If you think about it, it actually makes a lot of sense as it means the Hub is dealing with Topic filtering rather than firing off all messages and making the PNS systems do their individual things.
So in short, if you go the NH route, you cant use PNS topics, I found the two don't play nicely together.

Related

Banno Messaging - SkipInbox and DeepLink

I am testing the POST method to send our users Alerts via the Admin API page linked below and I have two questions.
First, what is the SkipInbox setting supposed to do? From my testing, it makes no impact within Banno or to push notifications. Is the setting meant to skip sending an email notification of the alert?
Second, how is the DeepLink supposed to work? In testing, I do not see a link within the alert or the push notification. Is this also specific to an email notification of the alert?
https://jackhenry.dev/open-api-docs/admin-api/api-reference/v0/alerts/details/#/Send%20Alerts/post_a_mobile_api_v0_institutions__institutionId__users__userId__alert_send_generic
First: [Edited] The skipInbox request parameter is deprecated and should not be used. The functionality for that parameter is not implemented.
Second: The deepLink parameter isn't supported yet in the Banno Online + Banno Mobile (Android / iOS) client apps.

Receive push notification from server when app is closed

I need advice after looking a lot about receive push/toast notifications regardless of the status of the application (closed or open).
The application communicates with a NodeJS API.
The idea is that a user logs in once to the application and then can receive notifications (depending on his account): i the user restarts his system for example, at startup he receives notifications without having to open the application (like the Mail application for example).
Most tutorials on MSDN use Azure and I don' use this. I would like to know if you have tips or links (tutorials, ...) for doing this in an UWP (or WinRT) application.
Thanks in advance for your help.
Regards
You can send push notifications from your NodeJS api via Windows Notification Service. This service has nothing to do with azure but when using Azure Notifications Hub it will be easier to get it implemented, but again this is not required;
In essence:
- register your app in dev center
- obtain a client id and client secret to use WNS in the dev center
- When your app launch it obtains a push notification channel uri and sends this to your backend. Your backend need to save all the URI's for the different devices
- When you have a notification select the uri's of the devices you want to send the push notification to
- post a xml message (based on what you want to update, tile, toast, badge or raw) to the URI's. To be able to post you need to authenticatie with the client id and client secret
more detailed read: https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-windows-push-notification-services--wns--overview#

GCM: Subscribe Chrome extension to a topic

I'm currently trying to develop a Chrome extension which can receive notifications using GCM. When the extension is first installed, I register it using chrome.gcm.register(['my_sender_id'], function(registration_id) { console.log(registration_id); });.
I would like to send push messages to everyone who has the extension installed. However, the problem is that GCM requires you to specify the registration ID's of everyone you want to send the message to; you can't just send it to everyone who's connected to the sender ID.
While it would be possible to push the registration ID to a database when the extension is installed, and then consult this database each time I want to send a message, this solution seems sub-optimal (also from a security point of view, since the pushing of the registration ID would be done client-side).
However, Google introduced a solution for this a few years ago: topics. It's possible to simply register each device to a 'global' topic (for example) and when you then want to send a message, you only have to specify the 'global' topic as the receiver. However, I can't find how this registration process is done for Chrome extensions. I've looked everywhere, but it seems like Chrome's GCM module doesn't support this yet. Am I correct in this and if so, is there an alternative way to pull this off?
Any help would be greatly appreciated!
If you call chrome.instanceID.getToken and then use the InstanceID API from your server to subscribe to a topic, it seems to work, but then the chrome extension doesn't get messages when you push to that topic, so I'm not sure if Google just needs to enable something on their side to make it work. But this is the closest I could get to it in any case.
firebaser here
Thanks for the great feedback. There is no way at the moment to subscribe to a topic from a browser. We're aware that having such an API would simplify the development model. We'd love to add this to Firebase, but as usual can't make any promises or commitments.

Are GCM subscription IDs and instance IDs the same thing? (subscribe to topics via web)

I'm trying to set up GCM for HTML5 push notifications through Chrome. I want these subscriptions to use topics, so that I don't have to maintain a list of subscribed IDs myself. However, all of the topic documentation I can find refers to subscribing through the iOS and Android APIs, but not through the web.
I found documentation on relationship mapping that makes it seem like I can control topic subscriptions by sending requests from my server, but it requires an instance ID. The documentation I've been able to find for Chrome web notifications talks about a subscription ID.
Are they the same? i.e., could I send my subscription ID to my server, to then forward onto the GCM server API? Or are the instance ID and subscription ID two different things? They don't look the same in the examples provided (the instance ID start xxxxxx:yyyyy) so I'm concerned this won't work.
To answer my own question: they are in fact one and the same. Unfortunately, it seems that topics do not work with Chrome push notifications. The API displays the topic message as being sent, but the browser never receives it.

There is a way to send custom data in push notification in Windows Phone?

I know that are Raw Notifications on WNS but the whole content of the notification is showed in the notification. I wanted to do like APNS and GCM does. A custom properties in the json payload that it's delivered to the app but its not showed to the user. There is a way to do that in WNS?
You can send parameters in launch attribute, it can be similar to url. For example, for toast notifications:
<toast launch="?param1=sample&param2=sample2">
</toast>
and parse it in the application. Value from launch attribute can be retrieved in OnLaunched handler. HERE is an article about handling activation from a toast notification (from MSDN).
Note: you can put into launch any other format you want. I suggested uri-based parameter because it is easy to parse using WwwFormUrlDecoder, which is mentioned HERE.