DrayTek Push Notification Server
Introduction
Requirement:
- The company requires a mechanism to push notifications to its mobile applications.
Solution:
- Build a standalong server that provides RESTful APIs for other servers or devices to initiate push requests
- Facilitate iOS and Android apps in submitting Firebase tokens and retrieving notification lists and details.
- Integrate with Google firebase to push the notifications to the users’ iPhons and Android phones.
- Implement iOS & Android test APPs to send firebase token and receive notifications.
- Provide a server backend control center in Web.
Development IDE & languages
- Server: PyCharm, Python & Django
- Backend control center: Vue, Javascript
- iOS test APP: XCode, Swift
- Android test APP: Android Studio, Kotlin
Server Architecture
- Server docker containers
- Containers status
Server related items
- Use swagger for all RESTful APIs
- Provide doc link for all the RESTFul APIs definition
- Use GoAccess as web log analyzer
- Backend control center
Others
- Deploy the server to GCP
- Setup the iOS & Android projects in Google firebase console
- Daily backup DB to Google Bucket
Usage
Normal (has sound) / Alarm (no sound) notification
two-factor authentication notification
Use firebase data message when pushing to Android. Use notification message when pushing to iOS.Normal/alarm notification & authentication notification on iWatch
Challenges and what I learned
- Have done so many push notifications on APP side, this is my first time to implement it in both server and apps.
- Learned Python Django, PostgreSQL, Django REST framework (DRF) and swagger, CronTab
- Learned Docker, NginX, PostgreSQL
- Learned Google VM & Bucket
- Learned Difference between Firebase data message and notification message.
Comment