Notifications have become an integral part of our mobile app experience, and messaging apps like Status are no exception. To ensure seamless communication, effective notification systems are crucial. In this article, we'll delve into how Status has implemented a privacy-preserving local notification system to revolutionize its Android app.
The Need for Notification Support
Until recently, Status app users were left in the dark when it came to receiving messages. Without any indication of incoming messages, users would only discover them if they happened to be using the app at the time. This lack of visibility led to a subpar user experience, with messages potentially going unread for extended periods. To address this issue, Status introduced version 1.4, which brings notification support to Android.
The Challenge: Preserving Privacy
In today's notification frameworks, implementing push notifications typically comes at the cost of privacy. However, as the core value proposition of the Status app is centered around user privacy, a compromise was not an option. To achieve this, Status had to find a way to work around the lack of privacy in traditional push notification systems.
The Solution: Local Notifications
Status tackled this challenge by implementing local notifications, which are generated by the app itself when it receives messages. This approach allows for timely notifications without compromising user privacy. The key to this solution lies in the concept of foreground services, which enable the Status app to continue receiving messages and generating notifications even when running in the background.
How Local Notifications Work
When a message is received by the Status app while it's not in the foreground, a notification is generated locally. This process is made possible by implementing a foreground service, which ensures the app remains active and continues to receive messages. The user must opt-in to enable notifications, ensuring that they remain in control of their experience.
Technical Underpinnings
From a technical standpoint, the Status app's local notification system relies on events from status-go being handled by the handleSignal method. These signals are then passed to the clojurescript part of the app, which manages the generation and handling of notifications. When the user interacts with a notification, an Intent is generated, which is handled by a BroadcastReceiver that updates the state of local notifications.
Conclusion
The introduction of notification support in Status app v1.4 marks a significant milestone in providing users with a seamless messaging experience. By leveraging local notifications and foreground services, Status has successfully implemented a privacy-preserving message notification system for Android. With this feature, users can now stay informed about incoming messages without compromising their privacy.