web-push

Make Web push notification work using webview in a native android app?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:04:03
问题 I have a website which is responsive and push notification feature enabled. In my native android app, if i load my website in a WebView , then the pop up which usually comes in chrome/firefox to ask if user wants to allow push notification or not, doesn't shows up in WebView . And obviously the WebView won't support the same web push notification for the app. I know how to implement GCM or FCM in app to enable mobile push, but i wanted to know if it possible just to club the web push

How can we implement web push notification?

蹲街弑〆低调 提交于 2019-12-22 01:19:32
问题 How to implement push notification in browsers using the googles GCM service. What are the steps to implement the same. 回答1: The basic steps that you will have to do if you want to add push notifications in browsers are the following: First of all, you need an HTTP S webpage (GCM requires it for browser notifications). Secondly, you need to add some javascript code into your webpage that will do the following points: Ask the user for push permissions Register the browser that are accessing

Send Notification to specific user using onesignal

家住魔仙堡 提交于 2019-12-21 05:35:11
问题 I'm using onesignal for first time in my project. I have to send notification to specific users (wherever user is logged in either on chrome or android device) on some events like whatsapp sends notification on mobile as well as website too and only if user is logged in. I have successfully sent notification to all users. After some R&D on OneSignal, I come to know that I have to send notifications to specific playerId for this purpose. But here are some my questions/doubts. I think player Id

angular service-worker - handling push notification click

杀马特。学长 韩版系。学妹 提交于 2019-12-19 19:40:37
问题 How do I handle the push notification click in angular service worker. The SWPush does not have any methods. I have tried referencing a js which listens to the "notificationclick" event handler but it never got fired on the click of the notification button. 回答1: Call SWPush#requestSubscription. Here's a good article 回答2: I had to update my package.json to: "@angular/service-worker": "7.1.0" then this worked for me: this.swPush.notificationClicks.subscribe((result) => { console.log('clicked',

Web Push API Chrome, returning “Unauthorized Registration”

自作多情 提交于 2019-12-19 05:17:25
问题 I've been doing a google tutorial on how to send web push notifications on Chrome using web-push node module. The thing is, the tutorial also provides a companion server app that you are supposed to use in order to test sending push notifications from a server to the client. But, in both the companion app and even when using web-push cli on my local machine, when trying to send a notification I am getting a " Unauthorized Registration " error. Can't find anything online about this error -

Google Chrome Silent Push Notifications

北城余情 提交于 2019-12-18 13:15:52
问题 I've been reading through the docs for Chrome's implementation of the Web Push API here, and I noticed the API says "you promise to show a notification whenever you receive a push" and under limitations it's stated "you have to show a notification when you receive a push message". After implementing the example on my localhost, I used cURL to send a push notification successfully. I was curious, so I commented out the lines that actually call the showNotification function, and put in a

Php: Create web push notification

試著忘記壹切 提交于 2019-12-13 22:15:57
问题 I want to create a web push notification in Php but I don't have the exact procedure for it. Following is the code I found, but it is not working. <?php require __DIR__ . '/../vendor/autoload.php'; use Minishlink\WebPush\WebPush; $subscription = json_decode(file_get_contents('php://input'), true); $auth = array( 'VAPID' => array( 'subject' => '`enter code here`', 'publicKey' => '**********', 'privateKey' => '***********', ), ); $webPush = new WebPush($auth); $res = $webPush->sendNotification(

Generate the VAPID public key in Rails and pass it to Javascript

余生长醉 提交于 2019-12-13 17:54:14
问题 In order to use the Push API with VAPID I need an applicationServerKey : serviceWorkerRegistration.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: applicationServerKey // we've got it with getApplicationServerKey() defined below }); I generate it on the server side with Ruby: ecdsa_private_key = OpenSSL::PKey::EC.new 'prime256v1' ecdsa_private_key.generate_key sender.vapid_private_key = ecdsa_private_key.to_pem ecdsa_public_key = OpenSSL::PKey::EC.new ecdsa_private_key

Custom Push Service

冷暖自知 提交于 2019-12-13 02:52:34
问题 In the context of pushing notifications to web-browsers, the PUSH SERVICE acts as interface between the SERVICE WORKER and APPLICATION SERVER. My current understanding is that Google FCM is the Push Service for Google Chrome & FireFox browsers APNS (Apple Push Notification Service) is the Push Service for Safari browser Here, is it technically possible to substitute the ‘push service(s)’ (– i.e., Google FCM for Google Chrome & FireFox browsers and APNS for Safari) with a generic custom

google gcm raw_data (payload encryption) , push event not received

时光怂恿深爱的人放手 提交于 2019-12-13 02:08:06
问题 I need some help because i never receive push event in my serviceworker after payload encryption. First case without payload encrypted In this case, I receive push event in service worker: Request is : curl -s --header "Authorization: key=MY_KEY" --header "Content-Type: application/json" --header "TTL:86400" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"elmll0-ynBY:APA91bFe7xBGti92H4yrWo2bJT6aMY3IKo3j54yRGtS0NNQYpkqmI5f14EKSPz6_GCEs2PaX6zCD3Lvk