Getting tired of setting up all of your push notifications manually? For certain kinds of push notifications, you don’t have to. You can automate them with the push API!
How does it work?
The push API allows you to send push notifications to iOS and Android devices by writing some code or depending on a tool like Postman to send them out for you. In other words, with the Push API, you can allow pretty much any system (for example, an order management or point of sale system) to send users push notifications.
You can specify through the API whether or not you want to send it to one or multiple users based on their unique identifiers, a predefined audience, or just a broadcast notification to all of your users. If you want to go deeper, you can even target groups of users based on profile attributes that you’ve set up ahead of time within your app.
How do I use it?
The real advantage in using the push API is integrating it within your existing systems.
Say, you are looking for a way to send an authorization code to your mobile app to help a user sign in on your website on their laptop. After the user requests that you send the message to their device, you can send them a push notification using a webhook in your own backend that listens for that signal and immediately fires off a network request to the push API.
Or rather, say that you’re an e-commerce app which is looking to send users notifications for various stages of their orders. You can set up a hook that notices when a user checks out to send them a push notification of their confirmation, another notification when the item has shipped, and finally one when the item has been delivered.
Here’s one more: You’re a sports app or a vendor and you want to take advantage of an event like a football game to send out a message and drive engagement. Instead of annoying your users during the action, you hook into a sports score API to determine when the breaks in the game are, and then send a message during those breaks.
That’s only a few use cases, and that doesn’t even cover the number of recurring use cases, such as sending a weekly or daily notification such as a news digest.
Is there anything I need to do before I can use the Push API?
The push API is available to any Localytics customer that has access to push notifications. In case you haven’t, you’ll need to integrate Localytics push notifications within your app.
Can I send rich media like images, gifs, and videos through push API?
Yes! You can send rich media by attaching a url in the “extras” payload. Be careful about how large your attachment is — iOS may not render the full notification for a variety of reasons, including the attachment size, battery, network, and a number of other things that they’ve kept under wraps. You will also need Go to the full article.
Source:: Business 2 Community