Commit 21754b08 authored by zhuchuanyong's avatar zhuchuanyong

feat:推送

parent 344c7873
...@@ -6,12 +6,12 @@ android { ...@@ -6,12 +6,12 @@ android {
defaultConfig { defaultConfig {
manifestPlaceholders = [ // manifestPlaceholders = [
"plus.unipush.appid" : "pPyZWvH3Fa6PXba19ID0091", // "plus.unipush.appid" : "pPyZWvH3Fa6PXba19ID0091",
"plus.unipush.appkey" : "b7dOGlNPHR7pqwUxcXPVi44", // "plus.unipush.appkey" : "b7dOGlNPHR7pqwUxcXPVi44",
"plus.unipush.appsecret": "IxVYAT9qws8dlNElacmSg12", // "plus.unipush.appsecret": "IxVYAT9qws8dlNElacmSg12",
"apk.applicationId":"com.vt.gemeap" // "apk.applicationId":"com.vt.gemeap"
] // ]
multiDexEnabled true multiDexEnabled true
applicationId "com.vt.gemeap" applicationId "com.vt.gemeap"
minSdkVersion 21 minSdkVersion 21
...@@ -40,7 +40,6 @@ android { ...@@ -40,7 +40,6 @@ android {
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: []) implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
implementation "com.android.support:support-v4:28.0.0" implementation "com.android.support:support-v4:28.0.0"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" > android:theme="@style/AppTheme" >
<activity <activity
android:name=".MyApplication" android:name="io.dcloud.PandoraEntry"
android:configChanges="orientation|keyboardHidden|keyboard|navigation" android:configChanges="orientation|keyboardHidden|keyboard|navigation"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask" android:launchMode="singleTask"
......
package com.vt.gemeap;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import net.vtstar.KeepAlive.KeepLive;
import net.vtstar.KeepAlive.config.ForegroundNotification;
import net.vtstar.KeepAlive.config.ForegroundNotificationClickListener;
import net.vtstar.KeepAlive.config.KeepLiveService;
import io.dcloud.PandoraEntry;
public class MyApplication extends PandoraEntry {
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
KeepLive.startWork(this.getApplication(), KeepLive.RunMode.ROGUE,
new ForegroundNotification("服务运行中...", "等待任务", R.drawable.icon1,
new ForegroundNotificationClickListener() {
@Override
public void foregroundNotificationClick(Context context, Intent intent) {
Log.e("1111", "foregroundNotificationClick: 点击事件");
}
}), new KeepLiveService() {
@Override
public void onWorking() {
Log.e("1111", "KeepLiveService: onWorking");
}
@Override
public void onStop() {
Log.e("1111", "KeepLiveService: onStop");
}
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment