The notification has no target applications - c#

I just started demo app for azure push notification. In my demo, I can broadcast notifications to all Windows devices but I want to send it individual user using tag. So I follow all the instructions and demo code from Azure Notification Hubs Notify Users with .NET backend.
But I getting error while sending push notification for window and WP. Here is my code :
outcome = await Notifications.Instance.Hub.SendWindowsNativeNotificationAsync(toast, userTag);
I getting follwing error :
The remote server returned an error: (400) Bad Request. The
notification has no target applications. The notification format is
windows. Review the credentials specified in the notification hub
description and the notification format.
.TrackingId:2aca8783-c5eb-41f8-a821-6f457806ca86_G7,TimeStamp:11/29/2016
1:40:07 PM
I have not register my app on windows store. I guess it is creating problem but then why it is working for broadcast? When I send it individual user with tag then it gives above error.
Please let me know where I am wrong. Is it necessary to register app on windows store for send notificaton with tag for single user?

Have you gone through Register your app for the Windows Store and Configure your notification hub?
If so, does test send (from the portal) work? (Here's an example how to do it from the classic Azure portal and Visual Studio, see "Verify message notifications" section.)
Are there any differences between the broadcast template and the one you use to send to individual users?

According the logs, the Notification Hub you use does not have WNS credentials (Package SID and secret key) properly configured. While those credentials are required.
And it is also seen that no push notification were actually sent to devices, for last 7 days at least. So, maybe another Notification Hub was used for the broadcast, and that one has all the credentials in place...

Related

Is there a simply way to receive Webhooks, Push Notifications, or SMS in Windows Forms?

So I've developed an app that needs data from the website TradingView. Currently, I have alerts set on TradingView to send an email to my Gmail account, which my app regularly polls looking for emails with a specific subject line, then parses the necessary data from them. Obviously, this induces some lag between the TV alert and when my app receives the data.
TradingView ALSO has the ability to send a Webhook, Push Notification, or SMS alert with any desired syntax data. I was wondering if there would be a simple solution to receive Webhook, Push Notification, or SMS data on my Windows Forms app and bypass the email step.
Suggestions?
WebHooks are URLs that are used to call back to when state changes or new information is available. You could set up your WinForms app to respond to a webhook, but your WinForms application would have to have an HTTP server running, and your webhook URI would need to point at your PC.
So, if your IP address is 1.2.3.4 and your webserver is running on port 8090, your URL may look like this: http://1.2.3.4:8090/api/myWebHook
Make sure your network exposes port 8090 for IP address 1.2.3.4
This is a very generic response, i am sure there are more hoops to jump through than just these steps.

Why Azure Push Notification stops working when user is no longer using App or App is on Idle for a long time?

I have a problem with Push notifications which works sometimes and just stops working after a while when a user is no longer using the app. My app registers for push notification with Azure using Web API 2.0 back end when it launches . After a user has successfully logged in to the app , it then updates the registration record to add the username as Tag . According to my knowledge Azure registration has a long life span which is supposed to be sometime in 9999/12/31 23:59:59. My question is , Does both PNS handlers for Android FCM and IOS APNS expires , If they do how can I register the app with Azure again if the user is not using the app for sometime so they wont miss notifications?
One of the most common questions from Azure Notification Hubs customers is how to troubleshoot when notifications that are sent from an application don't appear on client devices. They want to know where and why notifications were dropped, and how to fix the issue. This article identifies why notifications might get dropped or not be received by devices. Learn how to analyze and determine the root cause.
It's critical to first understand how the Notification Hubs service pushes notifications to a device.
In a typical send notification flow, the message is sent from the application back end to Notification Hubs. Notification Hubs does some processing on all the registrations. The processing takes into account the configured tags and tag expressions to determine "targets." Targets are all the registrations that need to receive the push notification. These registrations can span any or all our supported platforms: iOS, Google, Windows, Windows Phone, Kindle, and Baidu for China Android.
With the targets established, the Notification Hubs service pushes notifications to the push notification service for the device platform. Examples include the Apple Push Notification service (APNs) for Apple and Firebase Cloud Messaging (FCM) for Google. Notification Hubs pushes notifications split across multiple batches of registrations. Notification Hubs authenticates with the respective push notification service based on the credentials that you set in the Azure portal, under Configure Notification Hub. The push notification service then forwards the notifications to the respective client devices.
The final leg of notification delivery takes place between the platform push notification service and the device. Any of the four major components in the push notification process (client, application back end, Notification Hubs, and the platform push notification service) might cause notifications to be dropped.
Failure to deliver notifications might occur during the initial test/staging phase. Dropped notifications at this stage might indicate a configuration issue. If failure to deliver notifications occurs in production, either some or all of the notifications might be dropped. In this case, a deeper application or messaging pattern issue is indicated.
Below is the very good article , which explains the diagnosis over dropped connection , and how we can can configure the notification hub setting so that wi will not have any dropped connection .
Notification Hubs Push Notification Fixer
Here i am listing some common misconfiguration which we usually do
* Ensure that your notification hub name (without typos) is the same in each of these locations:
* Where you register from the client.
* Where you send notifications from the back end.
* Where you configured the push notification service credentials.
* Ensure that you use the correct shared access signature configuration strings on the client and on the application back end. Generally, you must use **DefaultListenSharedAccessSignature** on the client and **DefaultFullSharedAccessSignature** on the application back end (grants permissions to send notifications to Notification Hubs).
You must maintain two different hubs: one hub for production, and another hub for testing. This means that you must upload the certificate that you use in a sandbox environment to a separate hub than the certificate and hub that you are going to use in production. Don't try to upload different types of certificates to the same hub. This might cause notification failures.
If you inadvertently upload different types of certificates to the same hub, we recommend that you delete the hub and start fresh with a new hub. If for some reason you can't delete the hub, at a minimum, you must delete all the existing registrations from the hub.
1. Ensure that the *server key* that you obtained from Firebase matches the server key that you registered in the Azure portal.
![Firebase server key][3]
2. Ensure that you have configured **Project ID** on the client. You can obtain the value for **Project ID** from the Firebase dashboard.
![Firebase Project ID][1]
Hope this helps.

Add single push notification to single device

I'm creating an ios application using swift for the client and C# for the server. I currently have a web app hosted in azure that communicate with the client via web api. Now I need to employ push notifications
I'm looking at Azure tutorials as my push notification provider, but it seems that it only cares about sending mass broadcasting. My need is to send custom notifications per user/device for specific notification such as "someone liked your profile" or "someone wants to connect with you" or that sort of 1-1 notifications. But look at azure example here at the section: Update server project to send push notifications (.Net) #3, there is no indication of sending a message to only one device, but rather to any device who connect to the specific hub.
So, I think the azure tutorials are not what I am looking for.
look at this lean code: He doesn't seem to be relying on any server like azure to send his notification. He is not using a hub either. He is just sending everything from a TcpClient and his notification is direct at 1 device like need it (note the deviceID he is receiving). But I've read that you must use an APNS provider all the time, so, where is his?
so, do I have to use Azure (if I want to stick to MS) to do 1-1 push notification? Does it support that? Any good tutorial about that? Or I don't need it and just simple block of C# is enough?
(I would try the code in option #2 out, but I have to setup the certificate and report back before being allocated more time)
after much investigation and trials, I found out that I don't have to rely on azure, its push notification or anything like that. I can do the entire thing by executing C# code like #2.
All I had to do is setup the .p12 certificate and give it a password. Bring it over from Mac to my pc and executed the C# code and was able to receive notifications on my phone.

How to send a message from a windows azure server to a client mobile app(iOS) without the client sending any request?

I am maintaining a queue at the server end to which users can add files. And the queue on the app which shows the files that have been added by different users has to be dynamically updated. I dont want to poll the server periodically to check if there is any new item on the queue. Is there any way to notify the client app that a new item has arrived on the queue and u have to poll the server now to retrieve that file? And I dont want a push notification, as with push notification the user will be notified, i rather want the message to be handled internally and the app should poll the server when the message is received
Please let me know if you have any ideas, i am struck on my project because of this issue.
Thanks
Push notifications are exactly for that, although your app will have to register initially (for security) - http://weblogs.asp.net/scottgu/archive/2012/12/04/ios-support-with-windows-azure-mobile-services-now-with-push-notifications.aspx
Bitsian,
You can use Windows Azure Service Bus Notification Hubs. Its just released few days ago (not even a week). It will support multiplatform push nottification (ios,android,windows 8,win phone now)
http://msdn.microsoft.com/library/jj927170.aspx
Check this link. It has some great video tutorials to start on
I found an answer to my question. Its Web Sockets!! Web Sockets can be used to maintain persistent connections between client and server. And there is a library for that - SignalR
SignalR is a new library which was introduced for ASP.Net developers to build real time web applications where server needs to continuously push data to clients.
Some links for SignalR
http://blogs.msdn.com/b/webdev/archive/2012/12/17/signalr-building-real-time-web-applications.aspx
http://www.mikesdotnetting.com/Article/206/SignalR-And-Knockout-In-ASP.NET-Web-Pages-Using-WebMatrix

PushSharp APNS Feedback Service Example

We have implemented PushSharp for sending push notifications to our enterprise iOS devices. This is being sent from a Windows machine and we customized the PushSharp code to be called from a console app which is scheduled to run every minute (checks SQL Server DB for push notifications to send and then sends what is returned). This all works fine, but I have been unable to find an example of how to call the feedback service with this library. I see there is a FeedbackService.cs class that looks to handle the connections with Apple's feedback service, but the documentation doesn't cover how it works or how you use it.
Does anyone have a good tutorial or an example of how to use the feedback service?
From the source code, looks like you don't use it directly.
You can register to the Events.OnDeviceSubscriptionExpired of the PushService.
The event arguments will populate the parameter deviceInfo with the apple device id.

Categories

Resources