极光推送的配置

Appliaction

public class MyAppliaction extends Application {
@Override
public void onCreate() {
super.onCreate();
JPushInterface.init(this);
}
}

AndroidManifest.xml中

AndroidManifest.xml权限

//复制





















AndroidManifest.xml配置

    **<!-- Required SDK 核心功能-->
    <!-- 可配置 android:process 参数将 PushService 放在其他进程中 -->
    <service
        android:name="cn.jpush.android.service.PushService"
        android:enabled="true"
        android:exported="false" >
        <intent-filter>
            <action android:name="cn.jpush.android.intent.REGISTER" />
            <action android:name="cn.jpush.android.intent.REPORT" />
            <action android:name="cn.jpush.android.intent.PushService" />
            <action android:name="cn.jpush.android.intent.PUSH_TIME" />
        </intent-filter>
    </service>
    <!-- since 3.0.9 Required SDK 核心功能-->
    <provider
        android:authorities="自己的包名.DataProvider"
        android:name="cn.jpush.android.service.DataProvider"
        android:exported="true"
        />
    <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的 JPush 服务相互拉起的功能。 -->
    <!-- 若不启用该功能可删除该组件,或把 enabled 设置成 false ;拉起服务被关闭,App 不会通过拉起服务拉起其他的 App,也不会被其他 App 拉起。 -->
    <service
        android:name="cn.jpush.android.service.DaemonService"
        android:enabled="true"
        android:exported="true">
        <intent-filter >
            <action android:name="cn.jpush.android.intent.DaemonService" />
            <category android:name="自己的包名"/>
        </intent-filter>
    </service>
    <!-- since 3.1.0 Required SDK 核心功能-->
    <provider
        android:authorities="自己的包名.DownloadProvider"
        android:name="cn.jpush.android.service.DownloadProvider"
        android:exported="true"
        />
    <!-- Required SDK 核心功能-->
    <receiver
        android:name="cn.jpush.android.service.PushReceiver"
        android:enabled="true" >
        <intent-filter android:priority="1000">
            <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />
            <category android:name="自己的包名"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.USER_PRESENT" />
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
        </intent-filter>
        <!-- Optional -->
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <action android:name="android.intent.action.PACKAGE_REMOVED" />
            <data android:scheme="package" />
        </intent-filter>
    </receiver>
    <!-- Required SDK 核心功能-->
    <activity
        android:name="cn.jpush.android.ui.PushActivity"
        android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.NoTitleBar"
        android:exported="false" >
        <intent-filter>
            <action android:name="cn.jpush.android.ui.PushActivity" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="自己的包名" />
        </intent-filter>
    </activity>
    <!-- SDK 核心功能-->
    <activity
        android:name="cn.jpush.android.ui.PopWinActivity"
        android:configChanges="orientation|keyboardHidden"
        android:exported="false"
        android:theme="@style/MyDialogStyle">
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="自己的包名" />
        </intent-filter>
    </activity>
    <!-- Required SDK 核心功能-->
    <service
        android:name="cn.jpush.android.service.DownloadService"
        android:enabled="true"
        android:exported="false" >
    </service>
    <!-- Required SDK 核心功能-->
    <receiver android:name="cn.jpush.android.service.AlarmReceiver" />
    <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default"/>
    <!-- Required. AppKey copied from Portal -->
    <meta-data android:name="JPUSH_APPKEY" android:value="自己的key"/>**

grild中

sourceSets {
main {
jniLibs.srcDirs = [‘libs’]
}
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值