当前位置:网站首页>[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 |
边栏推荐
猜你喜欢
随机推荐
unity2D横板游戏教程6-敌人AI以及受击动画
2.何为张量
接口和协议
【Harmony OS】【FAQ】鸿蒙问题合集1
CobalStrike(CS)基础超级详细版
修饰生物素DIAZO-生物素-PEG3-DBCO|重氮-生物素-三聚乙二醇-二苯基环辛炔
汇编书摘抄
传统企业如何转型社交电商,泰山众筹的玩法有哪些?
DDL操作数据库、表、列
接口测试如何准备测试数据
DC-3靶场搭建及渗透实战详细过程(DC靶场系列)
私域流量引流方法?分享购火爆的商业模式,你值得拥有
DC-4靶场搭建及渗透实战详细过程(DC靶场系列)
好消息!北京、珠海PMP考试时间来啦
Smart fitness gesture recognition: PP - TinyPose build AI virtual trainer!
path development介绍
2022河南萌新联赛第(四)场:郑州轻工业大学 E - 睡大觉
DC-5靶场下载及渗透实战详细过程(DC靶场系列)
WinForm(二):WinFrom中Main函数的入参和出参
Test drive: project management module - curd development project