mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-15 03:54:54 +00:00
Pass json settings as an argument
This commit is contained in:
parent
a5e60b235d
commit
f2016a7c33
@ -155,7 +155,7 @@ public class ForegroundService extends Service {
|
|||||||
.setTicker(settings.optString("ticker", ""))
|
.setTicker(settings.optString("ticker", ""))
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setPriority(Notification.PRIORITY_MIN)
|
.setPriority(Notification.PRIORITY_MIN)
|
||||||
.setSmallIcon(getIconResId());
|
.setSmallIcon(getIconResId(settings));
|
||||||
|
|
||||||
if (bigText || text.contains("\n")) {
|
if (bigText || text.contains("\n")) {
|
||||||
notification.setStyle(
|
notification.setStyle(
|
||||||
@ -196,9 +196,10 @@ public class ForegroundService extends Service {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the resource ID of the app icon.
|
* Retrieves the resource ID of the app icon.
|
||||||
|
*
|
||||||
|
* @param settings A JSON dict containing the icon name.
|
||||||
*/
|
*/
|
||||||
private int getIconResId() {
|
private int getIconResId(JSONObject settings) {
|
||||||
JSONObject settings = BackgroundMode.getSettings();
|
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
Resources res = context.getResources();
|
Resources res = context.getResources();
|
||||||
String pkgName = context.getPackageName();
|
String pkgName = context.getPackageName();
|
||||||
|
Loading…
Reference in New Issue
Block a user