北京现代全部车型报价伊兰特-4s店旧车置换新车流程
2023年11月18日发(作者:长安福特汽车)
Android开发之推送服务(三)集成Oppo和vivo推送
Oppo推送服务,也是在Oppo?机中使?的?较多。?且现在Oppo和Vivo两款?机最早提出美颜功能,所以这两款?机在市场上的占有率
还是?较?的。
Oppo推送?前已经开发注册,Vivo?前只对部分应?开发了推送服务功能。所以?前部分应??法使?vivo推送的暂时不要着急,后?都
会有的。
OPPO推送
?先还是先去Oppo开放平台注册??的账号和添加应?,然后获取AppKey和AppId等信息,这些操作就不再??叙述,具体查看
这?同时将Oppo平台使?指南的官?地址写出来,其实就是如何使?控制台,后?会针对?个特殊的内容,?如传递?定义数据等截图具
体分析。
OPPO推送SDK下载
Oppo为我们提供了,其中还包括?个官?提供的demo,不过这个demo我没有仔细看过。希望以后有时间可以将demo仔细的看?遍
OPPO推送集成
将下载的SDK中Oppo推送的jar包拷贝出来,直接放在libs?件夹中。
在执?Oppo推送之前,最好先判断当?机是否是Oppo?机,判断使?下?的内容
if(rCase().contains(\"oppo\")){
initOppoPush();
}
然后在Application中执?Oppo推送初始化
/**
* 初始化OPPO推送
*/
protected void initOppoPush() {
//在执?Oppo推送注册之前,需要先判断当前平台是否?持Oppo推送
android:name=\".OPPOPushMessageActivity\" android:configChanges=\"keyboardHidden|orientation\" android:launchMode=\"singleTask\" 2019年2?15?15:10:13 OPPO官?对这个地?的样式做了调整 1.如果传递的是Intent Action ,如图 public class OPPOPushMessageActivity extends AppCompatActivity { public String type = \"\"; public String url = \"\"; public String innerUrl = \"\"; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { te(savedInstanceState); // 取参数值 if (getIntent().getExtras() != null) { // 取参数值 Bundle bundle = getIntent().getExtras(); Set HashMap if (set != null) { android:name=\"_key\" android:value=\"xxxxxxxxxxxxx\" /> android:name=\"_id\" android:value=\"xxxxxxx\" /> android:name=\"dClientService\" android:exported=\"true\" /> android:name=\"oxyClientActivity\" android:exported=\"false\" android:screenOrientation=\"portrait\" android:theme=\"@android:style/eBar\" /> 之后需要在Application中执?Vivo推送的注册 /** public class IVivoPushMessageReceiver extends OpenClientPushMessageReceiver { @Override public void onNotificationMessageClicked(Context context, UPSNotificationMessage upsNotificationMessage) { long msgId; String customeContent = \"\"; if (upsNotificationMessage != null) { msgId = Id(); customeContent = pContent(); Log.e(\"NPL\", \"获取通知内容如下:msgId = \" + msgId + \";customeContent=\" + customeContent); }
2022大众途安最新谍照-欧尚x7 plus
更多推荐
vivo最新款手机2022款
发布评论