android studio 离线打包配置push模块

1.依赖引入
SDK\libs aps-release.aar, aps-unipush-release.aar, gtc.aar, gtsdk-3.2.11.0.aar,

从android studio的sdk中找到对应的包放到HBuilder-Integrate-AS\simpleDemo\libs下面


2.打开build.gradle,在defaultConfig添加manifestPlaceholders节点,如下图所示,将io.dcloud.HBuilder替换成自己的应用包名,将appid等信息替换成申请之后的appid等

javascript 复制代码
android {
    defaultConfig {
        manifestPlaceholders = [
				"GETUI_APPID": "unipush的appid",
                "plus.unipush.appid" : "unipush的appid",
                "plus.unipush.appkey" : "unipush的key",
                "plus.unipush.appsecret": "unipush的secret",
                "apk.applicationId":"io.dcloud.HBuilder"
        ]
    }
}

3.AndroidManifest.xml配置
在io.dcloud.PandoraEntry的Activity标签下追加intent-filter,注意不能和其他的intent-filter内容合并到一起!

javascript 复制代码
<intent-filter>
	<action android:name="android.intent.action.VIEW"/>
	<category android:name="android.intent.category.DEFAULT" />
	<category android:name="android.intent.category.BROWSABLE" />
	<data android:host="io.dcloud.unipush" android:path="/" android:scheme="unipush" />
</intent-filter>

4.dcloud_properties.xml配置
在properties中添加如下配置,features节点与services节点必须同时配置

javascript 复制代码
<properties>
	<features>
		<feature name="Push" value="io.dcloud.feature.aps.APSFeatureImpl">
			<module name="unipush" value="io.dcloud.feature.unipush.GTPushService"/>
		</feature>
	</features>	
	<services>
		<service name="push" value="io.dcloud.feature.aps.APSFeatureImpl"/>
	</services>
</properties>
相关推荐
监督者修8 分钟前
从零构建 GIS 数据引擎:方案驱动架构的设计与实践
android·架构·kotlin
Yoke13 分钟前
从零到三端:用 Kotlin Multiplatform + Compose 构建跨平台财务追踪应用
android
gxgldyh24 分钟前
Android Framework源码解析(六):Launcher3 启动流程详解——AMS 如何拉起系统桌面?
android
XiaoLeisj25 分钟前
HandlerThread 与 IntentService 使用及源码解析
android·handler
我命由我1234510 小时前
Android Studio - Android Studio 自定义预览尺寸
android·java·ide·java-ee·android studio·android-studio·android runtime
取个名字太难了~12 小时前
越用越便宜,越用越强大:影像 SDK 的边际成本递减与网络效应实践
android·数码相机·美颜·相机连接·demu
CHNE_TAO_EMSM14 小时前
Android studio 打开文件时自动下载源码
前端·javascript·android studio
AFinalStone16 小时前
Android 7系统网络(四)Native层(下)—netd Controller详解
android·网络
爱笑鱼16 小时前
Handler(一):post 之后,Runnable 到底在哪个线程执行?
android
木木子2217 小时前
[特殊字符] 音乐播放器——状态驱动的多媒体控制
android·开发语言·华为·php·harmonyos