@@ -323,6 +323,30 @@ private void showNotification(
323323 .setColor (ContextCompat .getColor (getApplicationContext (), R .color .colorPrimary ))
324324 .setContentIntent (contentIntent );
325325
326+ String actionOpen =
327+ Extras .getNestedValue (String .class , extras , "client::notification" , "actions" , "open" );
328+
329+ if (actionOpen != null ) {
330+ Intent actionOpenIntent = new Intent ();
331+ actionOpenIntent .setAction (Intent .ACTION_VIEW );
332+ actionOpenIntent .setData (Uri .parse (actionOpen ));
333+ PendingIntent pendingIntent = PendingIntent .getActivity (getApplicationContext (), 123 , actionOpenIntent , PendingIntent .FLAG_IMMUTABLE );
334+ b .addAction (new NotificationCompat .Action .Builder (null , "open" , pendingIntent ).build ());
335+ }
336+
337+ String actionShare =
338+ Extras .getNestedValue (String .class , extras , "client::notification" , "actions" , "share" );
339+
340+ if (actionShare != null ) {
341+ Intent sendIntent = new Intent ();
342+ sendIntent .setAction (Intent .ACTION_SEND );
343+ sendIntent .putExtra (Intent .EXTRA_TEXT , Uri .parse (actionShare ));
344+ sendIntent .setType ("text/plain" );
345+ Intent shareIntent = Intent .createChooser (sendIntent , null );
346+ PendingIntent pendingIntent = PendingIntent .getActivity (getApplicationContext (), 124 , shareIntent , PendingIntent .FLAG_IMMUTABLE );
347+ b .addAction (new NotificationCompat .Action .Builder (null , "share" , pendingIntent ).build ());
348+ }
349+
326350 CharSequence formattedMessage = message ;
327351 if (Extras .useMarkdown (extras )) {
328352 formattedMessage = markwon .toMarkdown (message );
0 commit comments