当前位置:网站首页>[Developers must see] [push kit] Collection of typical problems of push service service 2
[Developers must see] [push kit] Collection of typical problems of push service service 2
2022-08-03 04:32:00 【Huawei Developer Forum】
1. After adding Huawei sdk com.huawei.hms:push:5.3.0.301, does the compilation report an error?
Answer: If the application already contains com.tencent.tpns:huawei to encapsulate Huawei push, and the integrated compilation will conflict, you need to comment out 'com.tencent.tpns:huawei:1.2.1.2-release' and recompile
2. After the user receives multiple pushes, after clicking a message in the notification bar, other messages are eliminated. This is not the case for other apps. Is it a setting problem?
Answer: Please check whether there is a logic code (not a function provided by Huawei Push) to clear the notification bar message in the application in the several interfaces where you click on the message to jump, such as:
NotificationManager manager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);manager.cancelAll();3. The client changes the corner logo
private void clearBadge(Application application, int number){String packageName = application.getPackageName();Bundle bundle = new Bundle();bundle.putString("package", packageName);ComponentName launchClassComponent = application.getPackageManager().getLaunchIntentForPackage(packageName).getComponent();if (launchClassComponent == null) {return;}String launchClassName = launchClassComponent.getClassName();bundle.putString("class", launchClassName);bundle.putInt("badgenumber", number);try {Bundle result = application.getContentResolver().call(Uri.parse("content://com.huawei.android.launcher.settings/badge/"), "change_badge", null, bundle);Log.i(TAG, "clearBadge result = " + result);} catch (Exception e) {Log.i(TAG, "clearBadge error ");}}4. Open the push service but can't find the AppKey and APP Secret?
Answer: App Secret and AppKey have been renamed to Client Secret and Client ID in OAuth2.0 Client ID
5. Push message 502 error?
Scenario (test environment) 1: Please provide detailed log information. After connecting to the phone using adb, execute the following commands:
adb shell setprop log.tag.hwpush VERBOSE
adb logcat -v threadtime 1> D:\hwpush.log
Try to reproduce the problem scenario you encountered, and press the shortcut key "Ctrl+C" to complete the log capture.
At the same time, please record the device model, EMUI version number, HMS Core (APK) version number, integrated push service SDK version number, and steps to reproduce the problem as much as possible, so that we can solve the problem for you faster.technical positioning.
Scenario (current network environment) 2: [Problem description] The push server api sends messages. During 7:00-7:40 on November 15th, a large number of messages failed to be pushed, and the error 502 Bad Gateway was reported.
[Cause] The Auth server failed, which caused the obtained access_token to fail to authenticate when sending the message, resulting in a 502 error
[Solution] At present, the fault has been solved and the function of the service has been restored, please try again.
This answer is an operation reply, it has been guessed to be a bug of the current network before
| For more technical articles, please visit: https://developer.huawei.com/consumer/cn/forum/topic/0204810137454610216?fid=18?ha_source=zzh |
边栏推荐
猜你喜欢

Record some bugs encountered - when mapstruct and lombok are used at the same time, the problem of data loss when converting entity classes

【uni-APP搭建项目】

MySql 创建索引

【Harmony OS】【ArkUI】ets开发 基础页面布局与数据连接

【Harmony OS】【ARK UI】ETS 上下文基本操作

刚上线就狂吸70W粉,新型商业模式“分享购”来了,你知道吗?

t条件判断语句与if循环

【Harmony OS】【FAQ】鸿蒙问题合集1

软件开发的最大的区别是什么?

MCM箱模型建模方法及大气O3来源解析
随机推荐
DOM破环和两个实验的复现
flink sql任务变更,在sql里面增加几个字段后,从以前保存的savepoint恢复启动出错。
Can Oracle EMCC be installed independently?Or does it have to be installed on the database server?
记录一些遇见的bug——mapstruct和lombok同时使用时,转换实体类时数据丢失问题
汇编书摘抄
rosbag工具plotjuggler无法打开rosbag的问题
种草一个让程序员男友编程时,记住一辈子的 IDEA 神仙插件!
mysql 创建索引的三种方式
【精讲】利用原生js实现todolist
OpenFOAM提取等职面并计算面积
自考六级雅思托福备战之路
C#异步和多线程
DC-6靶场下载及渗透实战详细过程(DC靶场系列)
Shell编程的条件语句
私域流量引流方法?分享购火爆的商业模式,你值得拥有
【翻译】开发与生产中的Kubernetes修复成本对比
好消息!北京、珠海PMP考试时间来啦
WinForm的控件二次开发
Live | StarRocks technology insider: low base dictionary global optimization
redis键值出现 xacxedx00x05tx00&的解决方法