<service
android:name=“.service.JpushBackgroudeService”
android:enabled=“true”
android:exported=“false”
android:process=“:pushcore”>
<receiver
android:name=“.receiver.PushBackgroudeBrocast”
android:enabled=“true”
android:exported=“false”>
<receiver
android:name=“包名”
android:enabled=“true”
android:exported=“false”>
<activity
android:name=“cn.jpush.android.service.JNotifyActivity”
android:exported=“true”
android:taskAffinity=“jpush.custom”
android:theme=“@android:style/Theme.Translucent.NoTitleBar”>
在gradle中的
defaultConfig{
ndk {
abiFilters ‘armeabi-v7a’, ‘x86’, ‘x86_64’, ‘armeabi-v7a’//,‘arm64-v8a’
}
manifestPlaceholders = [
JPUSH_PKGNAME: applicationId,
JPUSH_APPKEY : “你的ID”, //JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL: “developer-default”, //暂时填写默认值即可.
]
}
这样 配置就算可以了,然后在包下,复制从官网下载的demo,到包里,参考地址:https://docs.jiguang.cn//jpush/client/Android/android_3m/
比如TagAliasOperatorHelper这个工具类 改好以后在全局的Applition中 初始化
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
String registrationID = JPushInterface.getRegistrationID(this);//这个可以传给后台 推送到具体的个人
如上配置好之后:
检查一下有没有通知栏权限
package xxx;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.Applic