当前位置:网站首页>[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 |
边栏推荐
猜你喜欢
随机推荐
t conditional judgment statement and if loop
汇编题答案
基于WPF重复造轮子,写一款数据库文档管理工具(一)
数值类型转换02
ScanNet数据集讲解与点云数据下载
种草一个让程序员男友编程时,记住一辈子的 IDEA 神仙插件!
JS底层手写
Mysql如何建立索引实现语句优化
表的创建、修改与删除
12.机器学习基础:评估机器学习模型
DFS对剪枝的补充
2022 the first of the new league henan (4) : zhengzhou university of light industry G - maze
install ambari
肖sir___面试就业课程____app
工程制图-齿轮
荧光标记多肽FITC/AMC/FAM/Rhodamine/TAMRA/Cy3/Cy5/Cy7-Peptide
肖sir ——自动化讲解
5.回顾简单的神经网络
接口测试框架实战(三)| JSON 请求与响应断言
UV 裂解的生物素-PEG2-叠氮|CAS:1192802-98-4生物素接头









