How does push work




















Subscribing a user requires two things. First, getting permission from the user to send them push messages. Second, getting a PushSubscription from the browser. A PushSubscription contains all the information we need to send a push message to that user. You can "kind of" think of this as an ID for that user's device. Before subscribing a user you'll need to generate a set of "application server keys", which we'll cover later on. They allow a push service to know which application server subscribed a user and ensure that it's the same server triggering the push messages to that user.

On your server, you'll save this subscription to a database and use it to send a push message to that user. When you want to send a push message to your users you need to make an API call to a push service. This API call would include what data to send, who to send the message to and any criteria about how to send the message.

Normally this API call is done from your server. A push service receives a network request, validates it and delivers a push message to the appropriate browser. If the browser is offline, the message is queued until the the browser comes online.

Each browser can use any push service they want, it's something developers have no control over. This isn't a problem because every push service expects the same API call.

Meaning you don't have to care who the push service is. You just need to make sure that your API call is valid. To get the appropriate URL to trigger a push message i.

The push service would be 'random-push-service. As you start working with push you'll notice this pattern. I mentioned that every web push service expects the same API call. The API call requires certain headers to be set and the data to be a stream of bytes. We'll look at libraries that can perform this API call for us as well as how to do it ourselves.

The data you send with a push message must be encrypted. The reason for this is that it prevents push services, who could be anyone, from being able to view the data sent with the push message. This is important given that it's the browser who decides which push service to use, which could open the door to browsers using a push service that isn't safe or secure. When you trigger a push message, the push service will receive the API call and queue the message.

This message will remain queued until the user's device comes online and the push service can deliver the messages. The instructions you can give to the push service define how the push message is queued.

The time-to-live for a push message. This defines how long a message should be queued before it's removed and not delivered. Define the urgency of the message.

You can also utilize them for e-commerce sites when you have a system of flash deals, for example. Because of different policies regarding the notifications, iOS, and Android users treat pushes differently. Compared to Android users, iOS users are less likely to open a notification. However, if they do so, they do it much faster than Android users. We suggest considering the differences between these two mobile platforms when planning your approach to push notifications.

Most of the iOS mobile apps feature a standard message about notifications when the app is first opened after the installation. However, if you change the wording there to make it look more enticing to stay up to date, the customers would be more responsive to it.

Unlike web notifications, these are driven mainly by the software installed on the computer. There are several cases when your business can benefit from push notifications to your potential or existing customers:. Push notifications are a wonderful marketing and user engagement tool.

The Notification Center is organized in chronological order, and users get to the Notification Center by swiping down from the top of the screen. Android devices show unread messages on the lock screen.

Users can turn sounds on or off, and pick the style that iOS uses to show a notification. Android uses a standard banner approach that users cannot change at an OS level. All mobile operating systems ask users for their permission to share location information. Publishers can deliver more relevant messages by using location data combined with behavioral data. Examples include:. Push notifications are a direct path of communication with users.

App publishers should treat the ability to communication with users via push notifications as a privilege, not a right. Some users will uninstall the app altogether.

Messaging strategies and tactics need to be measured and tested. Other strategies include:. Want to learn more about how Push Notifications can help you connect with customers at each stage of the customer lifecycle? Want more? Check out our blog for our latest thinking on creating more value for your brand and your customers at every stage of the customer journey.



0コメント

  • 1000 / 1000