how will my web service identify mspn service - push-notification

I am making use of microsoft push notification service to push notification from a web service to windows phone app. My doubt is that , how will i pass the message to mspn service (end point)? will we receive any information while we register app to mspn service?

Setting up push notifications has several steps, and to paraphrase the Push Notifications Overview for Windows Phone on MSDN:
Your application registers for push notifications via an instance of the HttpNotificationChannel class
The instance of HttpNotificationChannel does the negotiation with MPNS
Assuming step (2) was successful, the instance raises the ChannelUriUpdated event
You pass the URI in the ChannelUri property to your web service (along with whatever metadata you need to identify what push notifications should be sent to that URI)
Your webservice issues a POST request to the URI passed to it in step (4), with the relevant XML as the message body (that XML will change, depending on the type of notification you're trying to send)
The MPNS servers send that notification to the phone, which will update the Tile, show a Toast notification, or, if it was a RAW notification and your application is running, the HttpNotificationChannel object created in step 1 will raise the HttpNotificationReceived event.
To summarize, and directly answer your question, the endpoint is the URI from the ChannelUri property of your HttpNotificationChannel instance

Related

Outgoing HTTP requests involved in App Check token verification

I'm trying to verify Firebase App Check tokens on my custom backend. Everything is fine so far, but there's one thing I'm not sure about: My backend is hosted on a private network therefore I need to know if grabbing key sets from https://firebaseappcheck.googleapis.com/v1/jwks is the only necessary outgoing HTTP request involved in the verification process.
The answer is "Yes" according to https://github.com/firebase/firebase-admin-node/issues/2014#issuecomment-1353472578
Obtaining the Firebase App Check public JSON Web Key Set is the only outgoing request for the app check verify token API. The SDK might make other http calls during the initialization based on your environment (obtaining the service account or credentials etc.) or if you use other APIs in combination with the App check token verification.
The rest of the JWT verification happens all offline. We also cache the public keys (JWKS) for up to 6 hours, so if your environment doesn't lose its state then the outgoing request to fetch the keys should not happen (if the keys are cached) every time you call the API.

Method for the push notification messages to reach the website user

In terms of websites, How does push notification get displayed ?
Does service workers periodically check the web server for new data and display as notification
or
Server sends message to user based on user IP address or other network details ? in this case website background does not need to check server periodically.

What options are there for a push server in order to send notifications to a service worker

I'm building a web app that has a service worker, which displays a notification when a message is sent. I've been using the Web Push API example (https://web-push-codelab.glitch.me/) as it's backend.
But I'm not clear on how notifications are sent to a service worker. Do I need to create a backend service that pushes out notifications, and as part of the registration of the service worker, I have to subscribe to an endpoint that the backend server provides.
Also do I need a 3rd party service that sends out the notification? That my backend service talks to?
I know how to setup a service worker, but not how to create the service that the Push Manager subscribes to.

android GCM registration at app installation

I want to register my app for GCM services just after the user installs my app(i.e. before launch). Is this possible? Or else is there a hack available.
If you want follow the standard GCM client app registration process, your app has to launch in order register, because the app server and the client app must complete a client/server "handshake."
From the GCM documentation, it states that the client obtains a unique registration token and passes it to the app server, which stores the token and sends an acknowledgement back to the client app. The registration token exchanged in the handshake process is the same client app instance identifier used subsequently to send messages to the client.
so, if your app is not launched, you can not pass the registration token to the app server. For android, you need to use the Instance ID API to complete the process.
Sample code:
InstanceID instanceID = InstanceID.getInstance(this);
String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
(notice the R.string.gcm_defaultSenderID is a project number you acquire from the API console. )
There was a hack in this post, if you want to start a service after an app is installed. But it might not be a good practice for you to complete the registration process, because you hard code the Sender ID, Application ID and Sender Auth Token listed in this page.

Push mail API for receiving mails

I would like to know if there is an API which can receive push notifications for an email client.
Use Case: I would like the server to send my web service notifications on new email. I would not like to poll the server. I would like the server to send notification (PUSH) to the web application.
Also, what are the (if any) mail servers that support this kind of API?
Check out Cloudmailin which is a SAS that will do REST post back to your server

Resources