{"id":10917,"date":"2018-07-06T08:23:30","date_gmt":"2018-07-06T08:23:30","guid":{"rendered":"https:\/\/www.itwriting.com\/blog\/?p=10917"},"modified":"2018-07-06T08:24:01","modified_gmt":"2018-07-06T08:24:01","slug":"pusher-a-nice-solution-for-sending-messages-and-notifications-to-web-and-mobile-apps","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/10917-pusher-a-nice-solution-for-sending-messages-and-notifications-to-web-and-mobile-apps.html","title":{"rendered":"Pusher: a nice solution for sending messages and notifications to web and mobile apps"},"content":{"rendered":"<p><a href=\"https:\/\/pusher.com\/\" target=\"_blank\">Pusher<\/a> is a London company which runs cloud services for publish\/subscribe in web and mobile applications. The idea is to deliver real-time updates, a concept that has many use cases. Examples include price updates in finance apps, status updates to track a delivery, news updates, or anything where users want to monitor progress or keep in touch with fast-moving developments.<\/p>\n<p>The service passed my \u201cget up and running quickly\u201d test. I created a free account (limited to 100 connections and 200k messages per day) and a new channel:<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"540\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image_thumb-7.png\" border=\"0\"><\/a>&nbsp;<\/p>\n<p>I\u2019m guessing it runs on AWS, looking at the datacentre locations:<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"119\" title=\"image\" style=\"margin: 0px; display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image_thumb-8.png\" border=\"0\"><\/a><\/p>\n<p>I chose a JavaScript client and ASP.NET MVC for the back end. On my PC I pasted the JavaScript into a web page running locally on Apache (in Windows Subsystem for Linux). I also created a new ASP.NET MVC project and added the sample code with some trivial modifications. I was able to send a message to the web page; it triggers an annoying alert but of course you could easily amend this to update the UI in more user-friendly ways.<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"392\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image_thumb-9.png\" border=\"0\"><\/a><\/p>\n<p>Of course you could roll your own solution for this but what you get with Pusher is all the plumbing pre-done for many different clients and automatic scalability.<\/p>\n<p>Pusher also has a service called Beams (formerly Push Notifications) which lets you send notifications to Android and IOS apps.<\/p>\n<p>Pusher or roll your own? As with many cloud services, you are putting a high level of trust in Pusher (security and reliability) if you use the service, and you will need a paid subscription:<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image-10.png\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"339\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image_thumb-10.png\" border=\"0\"><\/a><\/p>\n<p>You are saving considerable development time though, and as Google and Apple update their SDKs or change the rules, Pusher will presumably adapt accordingly.<\/p>\n<p>Can Azure easily do this, I wondered? I headed over to Azure <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/notification-hubs\/\" target=\"_blank\">Notification Hubs<\/a>. I noticed that the amount of admin you have to do to support each device is greater. Second, Microsoft <a href=\"https:\/\/feedback.azure.com\/forums\/218849-notification-hubs\/suggestions\/4621850-add-support-for-azure-notification-hubs-to-push-me\" target=\"_blank\">promised<\/a> to support \u201cpush to web\u201d in March 2016:<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image-11.png\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"276\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image_thumb-11.png\" border=\"0\"><\/a><\/p>\n<p>\u2026 but has not done so nor even bothered to update those asking:<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image-12.png\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"529\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2018\/07\/image_thumb-12.png\" border=\"0\"><\/a><\/p>\n<p>It is odd that Microsoft, with all its drive behind Azure, is still in the habit of leaving customers in the dark in certain areas.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pusher is a London company which runs cloud services for publish\/subscribe in web and mobile applications. The idea is to deliver real-time updates, a concept that has many use cases. Examples include price updates in finance apps, status updates to track a delivery, news updates, or anything where users want to monitor progress or keep &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/10917-pusher-a-nice-solution-for-sending-messages-and-notifications-to-web-and-mobile-apps.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Pusher: a nice solution for sending messages and notifications to web and mobile apps<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,10,19,26,1519,95],"tags":[645,1544],"class_list":["post-10917","post","type-post","status-publish","format-standard","hentry","category-android","category-azure","category-cloud-computing","category-development","category-tech","category-web-2","tag-notifications","tag-pusher"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/10917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=10917"}],"version-history":[{"count":1,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/10917\/revisions"}],"predecessor-version":[{"id":10918,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/10917\/revisions\/10918"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=10917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=10917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=10917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}