{"id":2241,"date":"2024-03-01T15:19:12","date_gmt":"2024-03-01T09:49:12","guid":{"rendered":"https:\/\/larapush.com\/blog\/?p=2241"},"modified":"2024-03-01T15:23:33","modified_gmt":"2024-03-01T09:53:33","slug":"push-notifications-in-html5-and-javascript","status":"publish","type":"post","link":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/","title":{"rendered":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps"},"content":{"rendered":"\n<p class=\"has-background\" style=\"background-color:#2776e682\"><strong>Key Takeaways<\/strong>: While directly implementing push notifications through HTML5 and JavaScript within native apps isn&#8217;t feasible, alternative approaches exist to achieve this functionality using native development or hybrid app development frameworks.<\/p>\n\n\n\n<p>Push notifications are a crucial aspect of engaging users in mobile applications, providing real-time updates and information.<\/p>\n\n\n\n<p>While native app development has traditionally been the primary avenue for implementing push notifications on iOS and Android, HTML5 and JavaScript-based apps have increasingly gained popularity.<\/p>\n\n\n\n<p>In this blog post, we will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on both iOS and Android platforms.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_63 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Steps_to_implement_Push_Notifications_on_iOS_using_HTML5_and_JavaScript\" title=\"Steps to implement Push Notifications on iOS using HTML5 and JavaScript\">Steps to implement Push Notifications on iOS using HTML5 and JavaScript<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Server-Side_Component\" title=\"Server-Side Component\">Server-Side Component<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Client-Side_Code\" title=\"Client-Side Code\">Client-Side Code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Handling_Notifications\" title=\"Handling Notifications\">Handling Notifications<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Steps_to_implement_Push_Notifications_on_Android_using_HTML5_and_JavaScript\" title=\"Steps to implement Push Notifications on Android using HTML5 and JavaScript\">Steps to implement Push Notifications on Android using HTML5 and JavaScript<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Server-Side_Component-2\" title=\"Server-Side Component\">Server-Side Component<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Client-Side_Code-2\" title=\"Client-Side Code\">Client-Side Code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Handling_Notifications-2\" title=\"Handling Notifications\">Handling Notifications<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Steps_to_implement_Push_Notifications_on_iOS_using_HTML5_and_JavaScript\"><\/span>Steps to implement Push Notifications on iOS using HTML5 and JavaScript<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"833\" src=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/ios-1024x833.jpeg\" alt=\"Implementing Push Notifications on iOS using HTML5 and JavaScript\" class=\"wp-image-2242\" style=\"width:464px;height:377px\" srcset=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/ios-1024x833.jpeg 1024w, https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/ios-300x244.jpeg 300w, https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/ios-768x625.jpeg 768w, https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/ios-1536x1250.jpeg 1536w, https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/ios.jpeg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>For <em><a href=\"https:\/\/en.wikipedia.org\/wiki\/IOS\">iOS <\/a><\/em>apps, the Apple Push Notification Service (APNs) is the key player in delivering push notifications. While it&#8217;s true that only native iOS apps can directly receive push notifications, HTML5 and JavaScript-based apps can still leverage push notifications with a clever workaround.<\/p>\n\n\n\n<p>Here&#8217;s a step-by-step guide:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Server-Side_Component\"><\/span><strong>Server-Side Component<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul>\n<li>Set up a server-side component, preferably using a Node.js-based push server like pushd or pushsharp.<\/li>\n\n\n\n<li>Get the necessary credentials and permissions to communicate with APNs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Client-Side_Code\"><\/span><strong>Client-Side Code<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul>\n<li>Develop the HTML5 and JavaScript-based iOS app with a native shell to handle push notification events.<\/li>\n\n\n\n<li>Implement the necessary client-side code to register the device with the push server.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Handling_Notifications\"><\/span><strong>Handling Notifications<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul>\n<li>When a push notification is received by the server, it should be relayed to the iOS device through the APNs.<\/li>\n\n\n\n<li>The native shell around the HTML5 app should handle the notification event and display it within the app.<\/li>\n<\/ul>\n\n\n\n<p>While this approach involves a native shell, the core functionality and UI can still be HTML5 and JavaScript-based, allowing for a seamless user experience.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Steps_to_implement_Push_Notifications_on_Android_using_HTML5_and_JavaScript\"><\/span>Steps to implement Push Notifications on Android using HTML5 and JavaScript<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"562\" height=\"289\" src=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/image-6.png\" alt=\"Implementing Push Notifications on Android using HTML5 and JavaScript\" class=\"wp-image-2243\" style=\"width:604px;height:311px\" srcset=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/image-6.png 562w, https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/01\/image-6-300x154.png 300w\" sizes=\"(max-width: 562px) 100vw, 562px\" \/><\/figure><\/div>\n\n\n<p>For Android apps, Firebase Cloud Messaging (FCM) takes center stage in facilitating push notifications. The process is more straightforward compared to iOS.<\/p>\n\n\n\n<p>Here&#8217;s a guide for Android that you can follow &#8211;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Server-Side_Component-2\"><\/span><strong>Server-Side Component<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul>\n<li>Set up a server-side component, potentially using a Node.js-based push server compatible with FCM.<\/li>\n\n\n\n<li>Acquire the necessary credentials and permissions to communicate with FCM.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Client-Side_Code-2\"><\/span><strong>Client-Side Code<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul>\n<li>Develop the HTML5 and JavaScript-based Android app with a native shell to handle push notification events.<\/li>\n\n\n\n<li>Implement the client-side code to register the device with the FCM.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Handling_Notifications-2\"><\/span><strong>Handling Notifications<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul>\n<li>When a push notification is sent to the server, it should be forwarded to the Android device through FCM.<\/li>\n\n\n\n<li>The native shell should manage the notification event, ensuring a seamless presentation within the app.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Implementing push notifications in HTML5 and JavaScript-based iOS and Android apps is indeed possible.<\/p>\n\n\n\n<p>While iOS requires a native shell to handle notifications, the core app functionality can still be based on HTML5 and JavaScript. Android, on the other hand, offers a more straightforward integration with FCM.<\/p>\n\n\n\n<p>That&#8217;s it for this blog. We will be coming up with more such content soon to ensure you never every get stuck with your notification problems. <br><br>Till we get back, here are some resources you may love to read &#8211;<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/larapush.com\/blog\/push-notifications-in-react-native\/\">The Easiest Way To Implement Push Notifications in React Native<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/larapush.com\/blog\/implement-push-notifications-with-django\/\">How to implement push notifications with Django?&nbsp;<\/a><\/li>\n<\/ul>\n\n\n\n<p>Toodeloo!<\/p>\n","protected":false},"excerpt":{"rendered":"Key Takeaways: While directly implementing push notifications through HTML5 and JavaScript within native apps isn&#8217;t feasible, alternative approaches&hellip;","protected":false},"author":2,"featured_media":2320,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":""},"categories":[63],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps<\/title>\n<meta name=\"description\" content=\"We will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on iOS and Android platforms.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps\" \/>\n<meta property=\"og:description\" content=\"We will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on iOS and Android platforms.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"LaraPush Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-01T09:49:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-01T09:53:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swati Rath\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swati Rath\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\"},\"author\":{\"name\":\"Swati Rath\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/04ac49cd5ada8909d221c8fe54928e41\"},\"headline\":\"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps\",\"datePublished\":\"2024-03-01T09:49:12+00:00\",\"dateModified\":\"2024-03-01T09:53:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\"},\"wordCount\":538,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png\",\"articleSection\":[\"Guides\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\",\"url\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\",\"name\":\"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps\",\"isPartOf\":{\"@id\":\"https:\/\/larapush.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png\",\"datePublished\":\"2024-03-01T09:49:12+00:00\",\"dateModified\":\"2024-03-01T09:53:33+00:00\",\"description\":\"We will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on iOS and Android platforms.\",\"breadcrumb\":{\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png\",\"width\":900,\"height\":450,\"caption\":\"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/larapush.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/larapush.com\/blog\/#website\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"name\":\"LaraPush Blog\",\"description\":\"Stay Ahead, Stay Notified with LaraPush!\",\"publisher\":{\"@id\":\"https:\/\/larapush.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/larapush.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/larapush.com\/blog\/#organization\",\"name\":\"LaraPush\",\"url\":\"https:\/\/larapush.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"contentUrl\":\"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png\",\"width\":280,\"height\":60,\"caption\":\"LaraPush\"},\"image\":{\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/04ac49cd5ada8909d221c8fe54928e41\",\"name\":\"Swati Rath\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/11e4a0381950e817ca8360a0ce2c9544?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/11e4a0381950e817ca8360a0ce2c9544?s=96&d=mm&r=g\",\"caption\":\"Swati Rath\"},\"url\":\"https:\/\/larapush.com\/blog\/author\/swati-rath\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps","description":"We will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on iOS and Android platforms.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps","og_description":"We will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on iOS and Android platforms.","og_url":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/","og_site_name":"LaraPush Blog","article_published_time":"2024-03-01T09:49:12+00:00","article_modified_time":"2024-03-01T09:53:33+00:00","og_image":[{"width":900,"height":450,"url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png","type":"image\/png"}],"author":"Swati Rath","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swati Rath","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#article","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/"},"author":{"name":"Swati Rath","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/04ac49cd5ada8909d221c8fe54928e41"},"headline":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps","datePublished":"2024-03-01T09:49:12+00:00","dateModified":"2024-03-01T09:53:33+00:00","mainEntityOfPage":{"@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/"},"wordCount":538,"commentCount":0,"publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"image":{"@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png","articleSection":["Guides"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/","url":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/","name":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps","isPartOf":{"@id":"https:\/\/larapush.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage"},"image":{"@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png","datePublished":"2024-03-01T09:49:12+00:00","dateModified":"2024-03-01T09:53:33+00:00","description":"We will explore different methods for enabling push notifications in HTML5 and JavaScript-based apps on iOS and Android platforms.","breadcrumb":{"@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#primaryimage","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2024\/03\/Implementing-Push-Notifications-in-HTML5-and-JavaScript-on-iOS-and-Android-Apps.png","width":900,"height":450,"caption":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps"},{"@type":"BreadcrumbList","@id":"https:\/\/larapush.com\/blog\/push-notifications-in-html5-and-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/larapush.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Implementing Push Notifications in HTML5 and JavaScript on iOS and Android Apps"}]},{"@type":"WebSite","@id":"https:\/\/larapush.com\/blog\/#website","url":"https:\/\/larapush.com\/blog\/","name":"LaraPush Blog","description":"Stay Ahead, Stay Notified with LaraPush!","publisher":{"@id":"https:\/\/larapush.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/larapush.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/larapush.com\/blog\/#organization","name":"LaraPush","url":"https:\/\/larapush.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","contentUrl":"https:\/\/larapush.com\/blog\/wp-content\/uploads\/2022\/05\/LARAPUSH.png","width":280,"height":60,"caption":"LaraPush"},"image":{"@id":"https:\/\/larapush.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/04ac49cd5ada8909d221c8fe54928e41","name":"Swati Rath","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/larapush.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/11e4a0381950e817ca8360a0ce2c9544?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/11e4a0381950e817ca8360a0ce2c9544?s=96&d=mm&r=g","caption":"Swati Rath"},"url":"https:\/\/larapush.com\/blog\/author\/swati-rath\/"}]}},"_links":{"self":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/2241"}],"collection":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/comments?post=2241"}],"version-history":[{"count":5,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/2241\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/posts\/2241\/revisions\/2324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media\/2320"}],"wp:attachment":[{"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/media?parent=2241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/categories?post=2241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/larapush.com\/blog\/wp-json\/wp\/v2\/tags?post=2241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}