I have an android application in which I am trying to implement Azure Push Notification. I am doing the following steps:
Create an android application.
Register the android application developed in step one to get the token id.
Create a project in the Firebase Console and copy the legal server key.
Create a notification hub.In the notification hub under gcm register the legal server key generated in step 3.
Send a notification through test send feature of the azure portal.
I am getting success message but nothing is delivered to the device. Am I missing any step? Please suggest my work is stuck because of this.
Related
We are trying to implement Push Notifications for Dynamics 365 marketing. Using the documentation from Microsoft Create push notifications
My Android studio successfully receive test notifications from Firebase in my emulator we well as on my Android Phone.
Device FcmToken and ApiToken sent successfully to D365. Like in this article Device registration for Android applications
D365 say its got a valid connection to my app as well as found my device. I can also see my mobile devices was registered with the correct Contact id.
I configured then a push and using the "Test Send" and selecting the app and the contact I receive a screen pop-up "Test message has been sent successfully"
However I never receive the notification on the device.
Firebase test messages works perfectly.
Hope someone can help me in pointing out what I'm missing.
Thanks in advance.
I want to send dynamic notification through custom activity which I have created in journey builder. I am able to send only static notifications right now.
It is integrated with third party app through which the notifications will be send. I have integrated that using heroku and github. What changes should I make in config.json, activity.js and customActvity.js.
I have followed below site to create this custom activity and also the same github repository which is given there
https://www.vish-sfmc.com/post/new-changes-new-you
Below is the screenshot of error which I am getting after journey execution. Please tell me why I getting this error, if I need to do changes in node js or in marketing cloud.
First, I should clarify that I'm only using free modules and service plans on the Azure side, using a Bizspark subscription.
I'm currently trying to run the app in the following tutorial:
https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-push
Everything works on the client side, items are correctly sent and stored in the database. However, I can't make the NodeJS server send push notifications to devices.
I basically copy and pasted the code on the tutorial for the nodeJS back-end on the tutorial, redeployed/restarted the server, but not a single push notification is sent.
I tried to see where in the code something was wrong, so I went and used some logger.info here and there. I then found out that context.push is undefined.
However, I did connect the mobile app to the notification hub in the "push" category in the menu of my mobile-app in Azure (it does appear connected).
Push page on my mobile app
Google cloud messaging is also correctly configured, I get the push notification for the successful registration when I start the app.
What am I missing? Is it because I'm using free plans (notification hub, database, service plan)?
First of all, you could test sending notifications via the Azure portal, to do this, please see steps below.
Go to the Azure portal and navigate to your notification hub.
Click on Test Send under the SUPPORT + TROUBLESHOOTING menu.
Select the platform you used, then fill payload message and click Send button.
Almost immediately (but in reality, it could be a few minutes because of PNS delays), you will see the push notification alert on your application.
For node.js backend on Azure mobile apps, you could use the following lines of code to send a push notification to all registered clients.
var payload = {
data: {
message: 'Hello!'
}
};
notificationHubService.gcm.send(null, payload, function(error){
if(!error){
//notification sent
}
});
For more info, please check out this tutorial.
I did try the test send a few times and it worked perfectly, hence why I couldn't understand how it couldn't work. I couldn't use the exact same code #aaron-chen-msft posted as I use the basic back-end nodeJS server on Azure (the quickstart one, so I would need to install the "azure" npm package), but I added the following string to my mobile app settings (application settings tab) on azure:
key : MS_NotificationHubName value : MyNotificationHubName (here, Poke-Forgh)
Context.push was then not undefined, but the notifications weren't sent, so I got inspired by #aaron-chen-msft's code and I edited the nodeJS code to specifically send notifications to GCM:
context.push.gcm.send(null, payload, function (error) { ... }
And it finally worked. Thanks!
I'm quite new on Node.js and without any knowledge on mobile development apps but I would add push notifications into my server app.
On npm I found this module:
https://www.npmjs.com/package/node-pushnotifications
but, after some search and if I understand well, I should have some specific credentials for sending notifications to all devices, first question is: is correct?
Assuming that the answer is yes, are there something to jump this check? Another module, some test credentials or what you want?
I would some generic solution but, if it is not possible, it could be useful also an IOS compatible solution.
This is the best packages for push notification for nodejs:
ios: https://www.npmjs.com/package/apn
android: https://www.npmjs.com/package/node-gcm
APNS is a push notification service for apple(mobile) devices.
You need to integrate SDK's provided by the 'apple developer doc' in your app to integrate push notification services. Then, Once the app installs in the mobile a token will be generated(unique for a specific device).You need to save this token.
From your server side You can send the push notifications to a device with the token that you got.
There is also an SDK to send Push notification from server side.
The best Provider is AWS, you can check this in details by this link
I've set up an Azure Notification Hub and I have gone through all the steps to incorporate Push Notification into my Android app. The app has been working fine, receiving the push notifications just like it should. Then today I went to try and send a push and it failed. So I tried from the Azure Portal and it failed there too.
It seems to be only Android related though, as the devices that run my app in iOS are receiving the Push Notification like they should. I know for a fact I have not changed anything in my code. But instead of getting the Push Notification like I should I now get the following message in Azure portal.
The Push Notification System rejected the request because of an invalid credential
Does anyone have any idea why this would happen? I'm stumped.
I thought at first maybe it was something with my API key (which again I have not changed) so I checked. The Google Cloud Message API Key in the Azure Portal matches what I have in my Google API Console, so it's not that.
What could it be?
Ok, so here is how I fixed my issue:
In Google API Manager I used to only have an api key of type - Android
I created another key of type - Server, and copied that into my azure gcm config, and away she goes... notifications working again