添加android sdk 常驻通知栏 接口

This commit is contained in:
远方夕阳 2020-08-01 10:29:38 +08:00
parent 2cfb492b4b
commit 1a37056754
4 changed files with 8 additions and 17 deletions

View File

@ -10,7 +10,6 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-lite:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="module-library">
<library name="Maven: android:android:8.0.0">
<CLASSES>

View File

@ -15,7 +15,6 @@
<java.version>1.8</java.version>
<protobuf.lite.version>3.0.1</protobuf.lite.version>
<netty.version>4.1.44.Final</netty.version>
<slf4j.version>1.7.30</slf4j.version>
</properties>
<dependencies>
@ -28,12 +27,6 @@
<version>${protobuf.lite.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>

View File

@ -56,8 +56,6 @@ public class CIMPushManager {
protected static final String ACTION_HIDE_PERSIST_NOTIFICATION = "ACTION_HIDE_PERSIST_NOTIFICATION";
protected static final String KEY_SEND_BODY = "KEY_SEND_BODY";
/**
* 初始化,连接服务端在程序启动页或者 在Application里调用
*/
@ -160,7 +158,7 @@ public class CIMPushManager {
}
Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.putExtra(KEY_SEND_BODY, body);
serviceIntent.putExtra(CIMPushService.KEY_SEND_BODY, body);
serviceIntent.setAction(ACTION_SEND_REQUEST_BODY);
startService(context, serviceIntent);

View File

@ -45,11 +45,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
*/
public class CIMPushService extends Service {
public final static String KEY_DELAYED_TIME = "KEY_DELAYED_TIME";
public final static String KEY_LOGGER_ENABLE = "KEY_LOGGER_ENABLE";
public final static String KEY_NOTIFICATION_MESSAGE = "KEY_NOTIFICATION_MESSAGE";
public final static String KEY_NOTIFICATION_CHANNEL = "KEY_NOTIFICATION_CHANNEL";
public final static String KEY_NOTIFICATION_ICON = "KEY_NOTIFICATION_ICON";
static final String KEY_SEND_BODY = "KEY_SEND_BODY";
static final String KEY_DELAYED_TIME = "KEY_DELAYED_TIME";
static final String KEY_LOGGER_ENABLE = "KEY_LOGGER_ENABLE";
static final String KEY_NOTIFICATION_MESSAGE = "KEY_NOTIFICATION_MESSAGE";
static final String KEY_NOTIFICATION_CHANNEL = "KEY_NOTIFICATION_CHANNEL";
static final String KEY_NOTIFICATION_ICON = "KEY_NOTIFICATION_ICON";
private final static String TRANSIENT_NTC_CHANNEL_ID = "CIM_PUSH_TRANSIENT_NTC_ID";
private final static String PERSIST_NTC_CHANNEL_ID = "CIM_PUSH_PERSIST_NTC_ID";
@ -134,7 +135,7 @@ public class CIMPushService extends Service {
}
if (CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) {
connectorManager.send((SentBody) intent.getSerializableExtra(CIMPushManager.KEY_SEND_BODY));
connectorManager.send((SentBody) intent.getSerializableExtra(KEY_SEND_BODY));
}
if (CIMPushManager.ACTION_CLOSE_CIM_CONNECTION.equals(action)) {