当前位置:网站首页>[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 |
边栏推荐
猜你喜欢
随机推荐
Dialog manager in the fourth chapter: the dialog message loop
BIOTIN ALKYNE CAS:773888-45-2价格,供应商
WinForm(二):WinFrom中Main函数的入参和出参
Jmeter 模拟多用户登录的两种方法
种草一个让程序员男友编程时,记住一辈子的 IDEA 神仙插件!
工程水文学知识点
【翻译】开发与生产中的Kubernetes修复成本对比
How many moments have you experienced the collapse of electronic engineers?
JS底层手写
leetcode刷题学习之路
【Harmony OS】【ARK UI】轻量级数据存储
DC-3靶场搭建及渗透实战详细过程(DC靶场系列)
UV 裂解的生物素-PEG2-叠氮|CAS:1192802-98-4生物素接头
Redis连接不上的报错解决方案汇总
私域流量时代来临,电商企业如何布局?
表的创建、修改与删除
刚上线就狂吸70W粉,新型商业模式“分享购”来了,你知道吗?
肖sir ——自动化讲解
mysql 创建索引的三种方式
5.回顾简单的神经网络