-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some refactoring, removed unnecessary permissions in the manifest, bu…
…mp version to 1.0-beta11
- Loading branch information
Andrewerr
committed
Nov 18, 2021
1 parent
d0732b1
commit 2b36c93
Showing
8 changed files
with
54 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...rc/main/java/com/polar/nextcloudservices/NotificationProcessors/OpenBrowserProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.polar.nextcloudservices.NotificationProcessors; | ||
|
||
// This processor is default processor for user click event | ||
// It is used to open web page and has priority 1 | ||
// So it is executed first and can be overriden by per-app processors | ||
|
||
|
||
import android.app.NotificationManager; | ||
import android.app.PendingIntent; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
|
||
import androidx.core.app.NotificationCompat; | ||
|
||
import com.polar.nextcloudservices.AbstractNotificationProcessor; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
public class OpenBrowserProcessor implements AbstractNotificationProcessor { | ||
public final int priority = 1; | ||
@Override | ||
public NotificationCompat.Builder updateNotification(int id, NotificationCompat.Builder builder, | ||
NotificationManager manager, | ||
JSONObject rawNotification, | ||
Context context) throws JSONException { | ||
String link = rawNotification.getString("link"); | ||
Intent intent = new Intent(Intent.ACTION_VIEW); | ||
intent = intent.setData(Uri.parse((link))); | ||
PendingIntent pending_intent = PendingIntent.getActivity(context,0, intent, | ||
PendingIntent.FLAG_UPDATE_CURRENT); | ||
return builder.setContentIntent(pending_intent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* Added credits(thanks to @Devansh-gaur-1611) | ||
* Added app queries for Nextcloud SSO authentication | ||
* Now app notifcation opens browser when clicked |