-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathLocalNotificationsService.java
36 lines (28 loc) · 1.15 KB
/
LocalNotificationsService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.mythichelm.localnotifications.services;
import android.content.Intent;
import android.app.IntentService;
import android.util.Log;
import com.mythichelm.localnotifications.LocalNotificationsPlugin;
import io.flutter.plugin.common.MethodChannel;
public class LocalNotificationsService extends IntentService {
private static MethodChannel sSharedChannel;
public LocalNotificationsService() {
super("LocalNotificationsService");
}
public static MethodChannel getSharedChannel() {
return sSharedChannel;
}
public static void setSharedChannel(MethodChannel channel) {
if (sSharedChannel != null && sSharedChannel != channel) {
Log.d(LocalNotificationsPlugin.LOGGING_TAG, "sSharedChannel tried to overwrite an existing Registrar");
return;
}
Log.d(LocalNotificationsPlugin.LOGGING_TAG, "sSharedChannel set");
sSharedChannel = channel;
}
@Override
public void onHandleIntent(Intent intent) {
LocalNotificationsPlugin.customLog("LocalNotificationsService handling intent in the background");
LocalNotificationsPlugin.handleIntent(intent);
}
}