百度云推送

在百度上 搜索百度云推送http://push.baidu.com/

文档中心有个 3分钟快速入门 http://push.baidu.com/doc/guide/join

点击下载SDK 立即下载

点击创建应用 (注意包名) 创建完成 点击应用配置 有API KEY值

剩下看文档中心http://push.baidu.com/doc/android/api

 

注意 其中配置权限下面的放到MainActivity创建之下要不然会报设备为空

<activity android:label="@string/app_name" android:name="com.bawei.jinritioutiao.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

</activity>下

 

<!-- push service start -->
<!-- 用于接收系统消息以保证PushService正常运行 -->
<receiver android:name="com.baidu.android.pushservice.PushServiceReceiver" android:process=":bdservice_v1" > <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> <action android:name="com.baidu.android.pushservice.action.notification.SHOW" /> <action android:name="com.baidu.android.pushservice.action.media.CLICK" /> <!-- 以下四项为可选的action声明,可大大提高service存活率和消息到达速度 --> <action android:name="android.intent.action.MEDIA_MOUNTED" /> <action android:name="android.intent.action.USER_PRESENT" /> <action android:name="android.intent.action.ACTION_POWER_CONNECTED" /> <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> </intent-filter> </receiver> <!-- Push服务接收客户端发送的各种请求--> <receiver android:name="com.baidu.android.pushservice.RegistrationReceiver" android:process=":bdservice_v1" > <intent-filter> <action android:name="com.baidu.android.pushservice.action.METHOD" /> <action android:name="com.baidu.android.pushservice.action.BIND_SYNC" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.PACKAGE_REMOVED" /> <data android:scheme="package" /> </intent-filter> </receiver> <service android:name="com.baidu.android.pushservice.PushService" android:exported="true" android:process=":bdservice_v1" > <intent-filter > <action android:name="com.baidu.android.pushservice.action.PUSH_SERVICE" /> </intent-filter> </service> <!-- 4.4版本新增的CommandService声明,提升小米和魅族手机上的实际推送到达率 --> <service android:name="com.baidu.android.pushservice.CommandService" android:exported="true" /> <!-- push结束 --> <!-- 4.6版本新增的Activity声明,提升Push后台存活率 --> <activity android:launchMode="singleInstance" android:name="com.baidu.android.pushservice.PushKeepAlive" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

转载于:https://www.cnblogs.com/ldou/p/5320315.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值