I was using an instance of the Push service in my app, but now I want to move my app to a different organization.
I found this link that saying that the Push service is discontinued: https://developer.ibm.com/bluemix/2015/12/15/important-mobile-services-announcement/, so I have migrated from the Push service to the IBM Push Notification service. After making the change I have the following problem.
I am not able to see my registered devices in the monitoring area of Bluemix yet I can fetch the list of registered devices using a REST API. Why is that happening? Screenshot
I am not able to find a REST API to send a notification to a particular deviceID like I was doing before with the Push service. How can I do that with the new service? Alternatively, is there a way to create an instance of the original Push service in my new organization?
The registered devices list was removed in the move to the new push service as you note, I'll reach out to the push team to see about the possibility of reintroducing it and add a comment with their reply. Right now you are correct in that the only way to grab the list of devices and their deviceIds is through the REST API.
You should be able to use POST /apps/{applicationId}/messages, specifying any number of deviceIDs in the 'target' array . You can see the full json model for the call by clicking the "Model" tag under the "Response Class" header rather than "Model Schema" as shown:
Related
On this page they explain Web Push with Service Workers stating
Chrome currently uses Firebase Cloud Messaging (FCM) as its push service. FCM recently adopted the Web Push protocol. and then explaining Firebase and so on...
Since the Service Worker gives me a unique endpoint and a pubkey, it seems to me that technically it should be possible to use that endpoint directly, without anything additionally - except if Google deliberally forces a registration.
I mean, just send a POST request to that endpoint, sending just the notification data encrypted/authenticated using the pubkey without any "VAPID".
Do I absolutely need a Firebase account or is it possible to access the endpoint directly (without additional registration) if I just want to send a notification to a single device?
It's 2021 and all major browsers implement a push service and support VAPID now. You use a web push library (Javascript, Python, C#,..) of choice.
There is no need to register anywhere.
The technical mechanism in short is this:
You generate two VAPID keys once using the push library. One key is private and one is public.
The public key is used in the javascript as "application server key" when subscribing to the push service of the browser.
If the subscription is successful you receive a subscription object from the browser containing an endpoint and two additional keys.
The endpoint is an address depending on the web browser / manufacturer and the service it is currently using. The endpoints look like (Oct 2021) e.g.
Google Chrome h_tt_ps://fcm.googleapis.com/fcm/send/cz9gl....., Microsoft Edge h_tt_ps://wns2-par02p.notify.windows.com/w/?toke....., Mozilla Firefox h_tt_ps://updates.push.services.mozilla.com/wpush/v2/gAAAAABhaUA....
If your server program has this information (endpoint and keys from subscription object) it can send a push message to the endpoint with the push library. The corresponding service in the web, hosted by the manufacturer sends this to the browser's service on the device.
There is the PushAPI which shall get used.
But it doesn't is supported by every Browser at the moment.
You can find nice examples in the Service Worker Cookbook of Mozilla
I can now get the Registration ID from the mobile and the push notification is working properly. I can access the list with the help of REST APIs but what I want to know is how to access the Registration ID list in the Bluemix itself where I'm not creating any tag.
As you stated above, with the Bluemix Push Notification Service you can use REST APIs in order to gather the deviceIds from registered devices. We also provide a document that allows you to test these APIs directly in the browser:
https://mobile.ng.bluemix.net/imfpushrestapidocs/#!/devices/get_apps_applicationId_devices
Currently we do not provide a list of registered deviceIDs via the Bluemix dashboard, but you can use the Monitoring tab in the Push Notification dashboard to gather some statistics on the number of registered devices.
I have developed an android application with the Parse push notification service and I can send notification from the Parse website.
How can I send push notifications through my own website using ASP.net? Is there any way?
I checked the Parse documentation but i get confused, I would really appreciate it if someone would help me.
Thanks
I ran into similar confusion. I wasn't even sure how to properly setup the user so that I could send a push notification directly to them. Then I found the following post:
Channels and Targeted Push Notifications
Note the last item under the Channels heading:
Most apps might find it useful to have a channel for each user so that
they can send messages to a user across all their devices and have
users follow others in the app.
So, now I know that I should subscribe each user to a channel that uniquely identifies the user (e.g., the 'bobsmith#foo.org' channel).
After I have subscribed the user to their channel, I can call Parse's REST API via my ASP.NET application. See Sending Pushes in the Parse REST API Developers Guide.
For an ASP.NET/C# example of how to submit a push notification check out this answer.
I have a chat that uses Parse.com to store messages.
How can I send a Push Notification every time a row has been added to a custom class called Chat? Is there a proper way of doing this?
You should check out parse.com cloud code guide, specially the part: Performing actions after a save
Also check out the send push notifications section.
Basically you can setup a method to be triggered everytime a chat is saved. This code will run automatically on parse servers.
Simply call the send code when you add your row.
There are a lot of tutorial about sending push notification, especially with a chat as example.
For example here : http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
Self-Edit : Fixed bad link
I want to collect device attributes and send them to the mdm server using push notification.
Steps involved are:
create a configuration profile with mdm payload
get device token
use apple push notification service to send a notification to the device.
get back device attributes
do same with multiple devices which the company manages
Questions:
Will the user always need to act on a message or I can send a message onto the device without user action and get the work done?
Do I need an app on the device to send back the token?
It sounds like you're trying to use push notifications to poll iOS devices and return information.
Push notifications do not provide a mechanism to execute code on a device without user interaction. You would have to have an application loaded on the device, and the user would have to click through from the notification to your app.
In iOS, applications generally don't run unless the user is actively interacting with them. There are a few exceptions (e.g. background audio.)
You do need to have an app running to get the device token. You call registerForRemoteNotificationTypes. See APNs docs for more information.
Edited to add more information:
Looks like the MDM protocol uses push notifications to do just what you describe. However, there's nothing about it in Apple's "Local and Push Notification Programming Guide" (linked above).
Apparently Apple keeps tight control over the MDM documentation (see here and here).
However, I did find this paper from blackhat describing how the system works.
My earlier point about not executing arbitrary code on a device without user interaction still applies. There's a finite set of commands that can be executed (see Appendix A).
I came across this question when searching for iOS push notification access payload without user interaction - Just want to add that, in iOS 7 and above, it is possible to send silent push notifications to app, and app can process them without user interaction.
However, I've also found some discussions saying that the silent push notifications are not delivered reliably, in this SO post. That's why I'm still looking for alternate ways to retrieve payloads of the normal remote push notifications. Doesn't look like there's a way.