当前位置:网站首页>【HMS core】【FAQ】push kit、分析服务、视频编辑服务典型问题合集3
【HMS core】【FAQ】push kit、分析服务、视频编辑服务典型问题合集3
2022-07-30 15:15:00 【华为开发者论坛】
1、【分析服务】 【问题描述】
分析服务中,渠道名怎么配置?
【解决方案】
渠道名需要手动配置.
参考链接如下:
2、【推送服务】【问题描述】
服务端推送消息,消息体内定义intent,以便打开自定义的链接
"android": {
"notification": {
"click_action": {
"type": 1,
"intent": "intent://com.honor.push/deeplink?#Intent;scheme=pushscheme;launchFlags=0x04000000;i.age=180;S.name=abc;end"
}
}
}
其中launchFlags=0x04000000 取值有何意义?如果设置成其它值,如0x10000000会怎么样?
【解决方案】
launchFlags=0x04000000,意思是activity的launchMode对应intent的Flag为FLAG_ACTIVITY_CLEAR_TOP,具体含义请参考下图:

如果设置其他值,比如0x10000000,虽然正常情况下测试发现也可以实现FLAG_ACTIVITY_NEW_TASK的效果,但是不建议使用。
可以按照官网指导,生成intent参数时应用必须带上Intent.FLAG_ACTIVITY_CLEAR_TOP,如果不添加该选项有可能会显示重复的消息。
3、【视频编辑服务】【问题描述】
集成视频编辑服务,裁剪成功后,视频异常(视频裁剪尾端,裁剪成功后从头开始播放,会出现播放画面静止)
【解决方案】
建议对代码做一些调整,在VideoClipsPlayFragment.java文件中,修改onPlayStateChange函数:
将
if (mEditPreviewVieModel.isPersonTrackingStatus()) {
editor.playTimeLine(mCurrentTime, mPersonTrackingViewModel.getVideoEndTime());
} else {
editor.playTimeLine(mCurrentTime, mVideoDuration);
}
修改为
if (mEditPreviewVieModel.isPersonTrackingStatus()) {
editor.seekTimeLine(mCurrentTime, () -> editor.playTimeLine(mCurrentTime, mPersonTrackingViewModel.getVideoEndTime()));
} else {
editor.seekTimeLine(mCurrentTime, () -> editor.playTimeLine(mCurrentTime, mVideoDuration));
}
4、【推送服务】【问题描述】
在项目中添加了“agconnect-services.json”文件,但无法启用agcp插件。是否是因为Android Studio版本的问题,因为在最新的版本中,buildscript > dependencies已经不存在了
【解决方案】
2022年2月4日 新发布的Android Studio新版本Bumblebee 2021.1.1 Patch 1以及新的gradle plugin 7.1.0,在新的gradle plugin中对配置文件的规范做了一些调整,如果使用的是此版本及以后的gradle plugin,可以采用以下方式集成HMS Core SDK。
步骤 1 打开Android Studio项目级“build.gradle”文件。
步骤 2 如果App中添加了“agconnect-services.json”文件则需要在“buildscript > dependencies”中增加agcp插件配置。
buildscript {
dependencies {
...
//gradle plugin版本,可以自己选择版本
classpath 'com.android.tools.build:gradle:7.1.0-alpha03'
// 增加agcp插件配置,推荐您使用最新版本的agcp插件。
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
}
}
步骤 3 打开项目级“settings.gradle”文件,配置HMS Core SDK的Maven仓地址。
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
}
更多详情,请参考链接:文档中心。
欲了解更多更全技术文章,欢迎访问https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh
边栏推荐
猜你喜欢
随机推荐
websocket flv 客户端解封包
Sentinel
InputStream和OutputStream流的使用
Back waves are coming!Ali produced the "second generation" container technical manual and brain map, which is too fragrant
FME读写cass数据的方案及操作流程
本地事务与分布式事务
Shell脚本的概念
哨兵
几种常见的存储器
一文读懂Elephant Swap,为何为ePLATO带来如此高的溢价?
(科普文)什么是碎片化NFT(Fractional NFT)
Packages - Notes
Databases - create databases, tables, functions, etc.
让人上瘾的新一代开发神器,彻底告别Controller、Service、Dao等方法
TensorFlow custom training function
HTTP缓存小结
华为云重磅发布开源软件治理服务——软件成分分析
tiup env
L2-007 Family property (use of vector, set, map)
RobotStudio实现喷漆、打磨等功能(曲面路径生成与仿真)









