mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-26 09:14:54 +00:00
parent
53f3278722
commit
8ad9802ea6
@ -196,11 +196,16 @@ public class ForegroundService extends Service {
|
|||||||
Intent intent = context.getPackageManager()
|
Intent intent = context.getPackageManager()
|
||||||
.getLaunchIntentForPackage(pkgName);
|
.getLaunchIntentForPackage(pkgName);
|
||||||
|
|
||||||
|
int smallIcon = getIconResId(settings);
|
||||||
|
if (smallIcon == 0) { //If no icon at all was found, fall back to the app's icon
|
||||||
|
smallIcon = context.getApplicationInfo().icon;
|
||||||
|
}
|
||||||
|
|
||||||
NotificationCompat.Builder notification = new NotificationCompat.Builder(context, CHANNEL_ID)
|
NotificationCompat.Builder notification = new NotificationCompat.Builder(context, CHANNEL_ID)
|
||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setContentText(text)
|
.setContentText(text)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setSmallIcon(getIconResId(settings))
|
.setSmallIcon(smallIcon)
|
||||||
.setShowWhen(settings.optBoolean("showWhen", true));
|
.setShowWhen(settings.optBoolean("showWhen", true));
|
||||||
|
|
||||||
if (!subText.equals("")) {
|
if (!subText.equals("")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user