Is it possible to receive Web Pushes in an electron app?
I don't need to display the Notification, only data is important.
Maybe someone used Onesignal, successfully with electron?
Thanks!
Unfortunately this isn't possible at the moment.
Web Push requires the browser vendor to maintain a server that keeps a connection open to each user to deliver notifications, and to store notifications while a device is offline. Electron has no such system set up for it.
It may be possible to extend Electron to use the operating system's built-in notification system. For example, Apple does have OS X notifications (currently supported by OneSignal), and Windows has a notification system built into it too (which OneSignal will support soon). Using this would require writing native extensions that bridge Electron to the operating system. This would have the added benefit of supporting notification delivery while your Electron app was not open.
Edit: This is now possible with Pushy, a paid notification product that
now supports Electron.
This is technically possible but requires a bit of lifting. If you use the OneSignal REST API in your client you can add your device, and with electron-push-receiver (https://github.com/MatthieuLemoine/electron-push-receiver) you can receive and display the push notifications that OneSignal sends.
Start under "Add a device" in the REST docs here: https://documentation.onesignal.com/reference
You'll first register your device with FCM (firebase cloud messaging) and then pass that FCM token along to OneSignal via their REST API.
I just responded to this thread with a brief description of how to do this: https://github.com/OneSignal/OneSignal-Website-SDK/issues/98
The application where only four users can share the videos other three users can see the videos and vice versa. I am using cloudkit as a central server.
I would like to send a Push notification without using any Backend server setup to user if one user shared the video.
is there any third party library to obtain this?
Sorry no this is not possible. With Push notifications the Provider needs to send the notification to the APNS (Apple Push Notification Service) which will send it to the correct device.
This works like:
You are also not able to send files just notifications in the for of Text, sound etc. So no XML file via Push notifications sorry.
You could however do it were you notify the user through Push Notification that there is a file available and then download it when the app opens.
Apple provides CloudKit to handle the backend server for you. You can use push notifications though CloudKit by subscribing to record changes. You can pair devices with GameKit for peer to peer connection. Without more information on what you are trying to accomplish this is all the information I can provide.
I'm trying to add notifications to a private chat app that uses Firebase, unfortunately Firebase has an APN service but it must be configured and needs also a server app to manage it. I'd like to have the user notified when someone is texting him while the app is in the background. The problem is that APN (Apple Push Notifications) requires a server with a certificate and that is ok with me, but I'm looking for a way to send push notifications from an iOS device to another device, I mean device-to-device push notifications and the server has just to relay the messages as they are. In my case the APN server should only relay the messages that it receives from a source device to the destination device. I couldn't find a way to obtain that without writing sever code. I want to use pre-built existing services. Has anybody any idea on how to send push notifications from one device to another without configuring and writing server apps? I tried a workaround using the background fetch iOS feature, but the system si randomly giving my app execution time... and that means that my app could wait hours before being started by the system... so that is not a viable solution. Please help
Ok, probably what I found out could be helpful for others. Actually
what I'm looking for can be directly integrated in the app. You need a library like NWPusher (free on GitHub) which can be imported, and with just a few lines of code and the APN device token you get from the system, it is possibile to implement APN notifications... easily, but most importantly... for free.
UPDATE
Check also APNS framework on GitHub. It's written in Swift 3.0 and it supports the latest features.
You are essentially looking for a messaging / chat API to handle device-to-device communication. You might want to try Pusher or PubNub
I am developing an iOS app for a client which is Meraki controlled. The Meraki solution is controlled by the client, I just ship the ipa file via a plist file.
Now I want to add push notifications as an enhancement to the app. As Meraki works based on push notifications (Meraki Push Notification), I was wondering if I can actually use it to send app related push notifications?
So can I ask for the p12 file of the client, deploy it on our server and send push notifications on API calls (e.g. C# push notifications IIS) which would spare me using a third party provider or my own push service?
You can use the Meraki AP's Bluetooth Beacon if you have a model MR32/42/52/53/72. This sends a message directly to the mobile app. You'll need the mobile app to have the Apple iBeacon service running.
You can also use Meraki's CMX Location API to detect a device's MAC address. It sends an HTTP post to your server. You'll need a server to host a listener, but fortunately ciscoshipped.io will host it for free.
developers.meraki.com
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm working on a web app. How can I send push notifications to iOS users when there is new content?
To be more specific, in order for a web application to send push notifications to a mobile device, such as the iPhone, the mobile device must have registered to receive push notifications for a particular application. The registration for push notification is done through a native app and can only be performed through a native app. Once the native app is registered for push notification, it can send the authorization token to the server, which can be used in conjunction with the certificate used to provision the native client, to send the push notifications to the mobile device.
As specified in another answer, one option is to 'wrap' your web application in a native application. Meaning that you would create a native application that basically presents a UIWebView (for iPhone dev) to the user showing your web application. While this pretty much functions in the same manner as the native browser, you would be able to add the ability to register for push notifications using the native controls.
It would be beneficial to you to review the Apple's push notification document as it provides some pretty good information on how push messaging functions on the iPhone.
See these links provided by Peter Hosey:
https://support.apple.com/kb/HT201925
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html
While not yet supported on iOS (as of iOS 10), websites can send push notifications to Firefox and Chrome (Desktop/Android) with the Push API.
The Push API is used in conjunction with the older Web Notifications to display the message. The advantage is that the Push API allow the notification to be delivered even when the user is not surfing your website, because they are built upon Service Workers (scripts that are registered by the browser and can be executed in background at a later time even after your user has left your website).
The process of sending a notification involves the following:
a user visits your website (must be secured over HTTPS): you ask permission to display push notifications and you register a service worker (a script that will be executed when a push notification is received)
if the user has granted permission, you can read the device token (endpoint) which should be sent to the server and stored
now you can send notifications to the user: your server makes an HTTP POST request to the endpoint (which is an URL that contains the device token). The server which receives the request is owned by the browser manufacturer (e.g. Google, Mozilla): the browser is constantly connected to it and can read the incoming notifications.
when the user browser receives a notification executes the service worker, which is responsible for managing the event, retrieving the notification data from the server and displaying the notification to the user
The Push API is currently supported on desktop and Android by Chrome, Firefox and Opera.
You can also send push notifications to Apple / Safari desktop using APNs. The approach is similar, but with many complications (apple developer certificates, push packages, low-level TCP connection to APNs).
If you want to implement the push notifications by yourself start with these tutorials:
Push API: Push Notifications on the Open Web
Apple Push Notification system: Configuring Safari Push Notifications
If you are looking for a drop in solution I would suggest Pushpad, which is a service I have built.
Update (September 2017): Apple has started developing the service workers for WebKit (status). Since the service workers are a fundamental technology for web push, this is a big step forward.
No, only native iOS applications support push notifications.
UPDATE:
Mac OS X 10.9 & Safari 7 websites can now also send push notifications, but this still does not apply to iOS.
Read the Notification Programming Guide for Websites. Also check out WWDC 2013 Session 614.
You can use pushover if you don't want to create your own native app: https://pushover.net/
Google Chrome now supports the W3C standard for push notifications.
http://www.w3.org/TR/push-api/
ACTUALLY.. This is brand new mind you.. On the newest version of OS X (Mavericks) you CAN send push notifications from a webpage to the desktop. But according to the documentation, NOT iPhones:
Note: This document pertains to OS X only. Notifications for websites do not appear on iOS.
Currently Apple has plans to allow 2 kinds of push notifications:
OS X Website Push Notifications
and Local Notifications.
The obvious hurdle here is that this will not work on PCs, nor will it allow you to do android push notifications.
Furthermore, you actually can with versions as old as Snow Leapord, send push notifications from a website as long as said website is open and active. The new Mavericks OS will allow push notifications even if the site isnt opened, assuming you have already given permission to said site to send push notifications.
From the mouth of Apple:
In OS X v10.9 and later, you can dispatch OS X Website Push Notifications from your web server directly to OS X users by using the Apple Push Notification service (APNs). Not to be confused with local notifications, push notifications can reach your users regardless of whether your website or their web browser is open…
To integrate push notifications in your website, you first present an interface that allows the user to opt in to receive notifications. If the user consents, Safari contacts your website requesting its credentials in the form of a file called a push package. The push package also contains notification assets used throughout OS X and data used to communicate to a web service you configure. If the push package is valid, you receive a unique identifier for the user on the device known as a device token. The user receives the notification when you send the combination of this device token and your message, or payload, to APNs.
Upon receiving the notification, the user can click on it to open a webpage of your choosing in the user’s default browser.
Note: If you need a refresher on APNs, read the “Apple Push Notification Service” chapter in Local and Push Notification Programming Guide. Although the document is specific to iOS and OS X push notifications, paradigms of the push notification service still apply.
No, there is no way for an webapp to receive push notification. What you could do is to wrap your webapp into a native app which has push notifications.
The W3C started in 2010 a working group to implement notifications:
http://www.w3.org/2010/web-notifications/
This Working Group develops APIs that expose those mechanisms to Web Applications—so that Web developers creating, for example, Web-based e-mail clients and instant-messaging clients can more closely integrate their Web application behavior with the notification features of the operating systems of their end users.
Finally the result is like a bad joke as it works only if the specific website is open:
http://alxgbsn.co.uk/notify.js/
I think they missed to implement the possibility to add push urls so the browser is able to ask for notifications while its running in the background - and above all - if all tabs have been closed.
You can use HTML5 Websockets to introduce your own push messages. From Wikipedia:
"For the client side, WebSocket was to be implemented in Firefox 4,
Google Chrome 4, Opera 11, and Safari 5, as well as the mobile version
of Safari in iOS 4.2. Also the BlackBerry Browser in OS7 supports
WebSockets."
To do this, you need your own provider server to push the messages to the clients. If you want to use APN (Apple Push Notification) or C2DM (Cloud to Device Message), you must have a native application which must be downloaded through the online store.
Pushbullet is a great alternative for this.
However the user needs to have a Pushbullet account and the app installed (iOS, Android) or plugin installed (Chrome, Opera, Firefox and Windows).
You can use the API by creating a Pushbullet app, and connect your application's user to the Pushbullet user using oAuth2.
Using a library would make it much easier, for PHP I could recommend ivkos/Pushbullet-for-PHP.
Check out Xtify Web Push notifications. http://getreactor.xtify.com/ This tool allows you to push content onto a webpage and target visitors as well as trigger messages based on browser DOM events. It's designed specifically with mobile in mind.