Android Notification - First Cut #391

Merged
dan merged 1 commits from android_tests into master 2020-11-25 01:31:02 +00:00
Owner

This commit has the basics of notifications on Android working again, updated to the
latest Android SDK way of doing things (with channel IDs and grouping).

Android users will get notified when the app is open for new Peer Messages across all profiles.

In the future, this should be extended to add notifications for new peer invites, actual have actionable actions (accept/block)
and maybe even work when the app isn't open...

This commit has the basics of notifications on Android working again, updated to the latest Android SDK way of doing things (with channel IDs and grouping). Android users will get notified when the app is open for new Peer Messages across all profiles. In the future, this should be extended to add notifications for new peer invites, actual have actionable actions (accept/block) and maybe even work when the app isn't open...
dan was assigned by sarah 2020-11-25 00:53:46 +00:00
erinn was assigned by sarah 2020-11-25 00:53:46 +00:00
Member

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/822

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/822
dan reviewed 2020-11-25 01:20:16 +00:00
@ -32,2 +29,3 @@
private static String NOTIFICATION_CHANNEL_ID = "cwtch_notification_channel";
private static int CONTENT_NOTIFICATION_ID = 2;
private static String CONTENT_NOTIFICATION_ID_NAME = "Notifications from Peers";
  • string valueify as per below comment
* string valueify as per below comment
@ -72,0 +62,4 @@
Notification groupSummary =
new Notification.Builder(m_instance)
.setContentTitle("Cwtch")
.setContentText("New Message from Peer: " + o)

for strings, can you add these to android/res/values/strings.xml and load them here with getString(R.string.idName);

I think that gives us a translatable path forward for Java, amazingly

for strings, can you add these to `android/res/values/strings.xml` and load them here with `getString(R.string.idName);` I think that gives us a translatable path forward for Java, amazingly
@ -72,0 +77,4 @@
.setGroup(NOTIFICATION_CHANNEL_ID)
.setWhen(System.currentTimeMillis())
.setAutoCancel(true)
.setContentTitle("New Message from Peer: " + o)
  • string valueify
* string valueify
@ -72,0 +78,4 @@
.setWhen(System.currentTimeMillis())
.setAutoCancel(true)
.setContentTitle("New Message from Peer: " + o)
.setContentText("[redacted: Open Cwtch App to see the Message]");
  • string valueify
* string valueify
@ -117,3 +92,1 @@
description = "Cwtch Content Notification Channel";
importance = NotificationManager.IMPORTANCE_DEFAULT;
channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, CONTENT_NOTIFICATION_ID_NAME, importance);
String description = "Cwtch Notification Channel";
  • string valueify
* string valueify
dan merged commit 3d509c6810 into master 2020-11-25 01:31:01 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.