December 31, 2020
Are you looking for an easy solution for handling push notifications? If the answer is Yes, then AirNotifier would be a great and user-friendly choice.
In this guide, we’ll be looking at:
- AirNotifier: an overview
- Getting Started with AirNotifier
- Workflow of AirNotifier
Whether you’re new to AirNotifier, or just wanted to get an overview of how it works, this AirNotifier for beginners guide will show you what this push notification server can do and how you can get started on integrating AirNotifier into your projects.
AirNotifier: An Overview
To start with, AirNotifier is a push notification server used for sending real-time notifications to mobile and desktop applications. A few useful features of AirNotifier include a web interface, an option to broadcast messages to all registered devices, an activity log, and a REST API. If these features sound interesting to you, then please read on for more details.
AirNotifier supports a range of platforms, including iOS, Android, Chrome browsers, and Windows 10 desktop applications.
An unlimited number of devices can be registered to AirNotifier. AirNotifier would be a good option if you don’t want to be charged when you exceed a specific number of registered devices. Whether you want to implement push notifications on a project with a small or large user base, AirNotifier will be able to handle the number of users and devices you have.
As AirNotifier is open source, not only would this mean that the push notification server doesn’t have any additional fees, but that there is also more control over how AirNotifier can work for you. AirNotifier can be installed on your own server so you would be able to have control over the data that comes through.
This can be a disadvantage to some people who want a push notification server that is ready right out of the box, although usually these would be paid services, like Pusher and OneSignal. AirNotifier provides a simple way of sending push notifications at no extra cost.
Web Admin UI
AirNotifier comes with a web interface that lets you configure several of its settings, view the access keys and device tokens stored, as well as an activity log that logs events such as when a new device token has been added and registered, or when a message has been sent to a registered device.
You can also add users to your AirNotifier server, so multiple people can create and manage push notifications for different applications.
AirNotifier also has a broadcast feature where messages can be sent to all registered devices – this can be particularly useful when you want to send any urgent notifications.
The interface also features tabs for tokens and logs. The list of tokens will let you view the registered devices, whereas the logs will show when a token is registered, or deleted, or when a notification has been sent to a registered token.
Access keys in AirNotifier allow your sites to access AirNotifier. Multiple access keys can be created for an application, and configured with different permissions. These permissions include adding or removing device tokens, and sending notifications and broadcasts to the registered devices.
Getting started with AirNotifier
Once you’ve followed the installation steps outlined on Airnotifier’s GitHub, setting up push notifications will be a pretty straightforward experience. AirNotifier’s simple user interface makes it effortless to navigate through, so the next few steps should be easy enough to digest.
First, we want to create a new application in AirNotifier. The sidebar on the left of the web interface will have a + Create button – clicking this will allow you to create a new app by entering the app’s short name and optionally, a description of the app. Don’t forget to save!
Once the application is created, several options will be displayed on the interface for configuration. Feel free to explore the different features and get familiar with the application interface.
At the top, there are a few tabs for Settings, Access keys, Tokens, etc.
The next step would be to create an access key so your mobile application and site can access AirNotifier. Click on the Create access key button, this will be where you set the details of the key (like a description of what the key does) and the different permissions (like whether or not you want to enable send notifications and the broadcast feature).
The access key will be generated – this key is what you’ll use when you want to send a request to AirNotifier (for example, when registering a device token, or sending a notification to a registered device).
You can make as many access keys as you like! This is a useful feature as sometimes you’d want to have different permissions for different applications. For example, you’d want to provide an access key that allows only the creation and deletion of a token – this would be used in mobile applications as devices would need to register its token to AirNotifier. On the other hand, an access key that only allows for sending notifications or broadcasts can be set in a site or backend.
Now that we’ve set up the AirNotifier application and access key(s), we can move on to setting up AirNotifier so that it can communicate with push notification services like Apple Push Notifications Service (APNs) and Firebase Cloud Messaging (FCM). This is important to set up as AirNotifier cannot directly push notifications to iOS and Android devices.
As outlined above, AirNotifier cannot directly send push notifications to iOS and Android devices. Instead, it needs to communicate with APNs and FCM so that the platforms’ devices can receive notifications.
Under the Settings tab of your AirNotifier application, there should be several configuration settings for Apple’s APNs, Google’s FCM and Windows’ WNS.
To configure APNs for iOS, the Development Push Notification certificate and private key should be uploaded to AirNotifier.
The process for setting up Google’s FCM is pretty straightforward as well. For FCM, the Project ID and JSON key should be available in the Firebase app project settings (accessed through the Firebase console). This should be pasted to AirNotifier’s FCM fields (shown in the image below).
The installation guides on AirNotifier’s GitHub go into more detail on how to add the APNs/FCM settings. For iOS applications, Apple has some documentation on configuring remote notification support, whereas for Android applications, Firebase has a few guides on how to setup Cloud Messaging. These details relate more to the development of the mobile app rather than the AirNotifier setup, and assuming you’re already developing a mobile application with push notification functionality, APNs/FCM should already be included in the codebase.
AirNotifier acts as a gateway between your site and APNs/FCM – communication is done through REST APIs. When you’re ready to send notifications to your devices and mobile applications, you would just need to implement a way to send POST requests to AirNotifier, along with the message we want to include in the notification.
AirNotifier’s GitHub on its API outlines several different requests (for example, sending notifications, adding a device token, and deleting an existing device token) that can be implemented in the mobile application’s and site’s code.
Custom options for sending notifications (like scheduling) would need to be implemented in the codebase as well – users should remember that AirNotifier can only perform simple actions and more complex functionality should be added on top of AirNotifier’s services.
Workflow of AirNotifier
- Configure the APNs/FCM settings in the AirNotifier web interface. If the settings are properly configured, AirNotifier should now be able to communicate with APNs/FCM.
2. When the app is first launched, the app registers itself to APNs or FCM. APNs/FCM generates a device token and returns this to the app, where it is stored for later use. At this point, the app has the device token, and APNs/FCM can communicate with the app.
So AirNotifier is able to communicate with APNs/FCM, and APNs/FCM is able to communicate with the app. If AirNotifier wants to send a push notification to the app, it would not be possible as of now due to AirNotifier not knowing who to send the message to (it needs a device token for this). The next few steps outline this process.
3. The app should have an access key for AirNotifier – either this is hardcoded in the app, or the app can get the key from the site database/server (the latter option would be more efficient in case the access key changes). At this point, the app has the device token and access key stored.
4. With the access key, the app can now send and register its device token to AirNotifier (this is sent through a POST request from the app). With the token now registered, AirNotifier should now know where to send the message.
5. When a site needs to send push notifications to a mobile application, the site would have to communicate with AirNotifier (by sending a POST request), and in turn AirNotifier sends the message to APNs/FCM for it to be processed and sent out to the mobile applications.
In conclusion, AirNotifier allows you to send push notifications to mobile devices with very minimal setup.
Of course, there is the option of just having the site communicate with APNs and FCM directly instead of having to go through AirNotifier, but this would force you to do more work in order to integrate, update, and handle push notifications directly from the site. With AirNotifier, the site simply needs to connect with the push notification server, and AirNotifier handles the rest.
AirNotifier is definitely an option to consider if you want to implement push notifications that are simple and straightforward.
AirNotifier AirNotifier is a great tool for software development teams. It provides a ready-made, easy-to-integrate way to send real time notifications to a range of different platforms. Most notably, it integrates with both of the major push notification services...