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>
相关推荐
独隅10 小时前
Claude API 实战教程:从入门到完整项目
android·java·数据库·claude·claude code
且随疾风前行.14 小时前
Paint Cavans高级绘制:[一]Paint画笔高级应用
android·ui
郑州光合科技余经理16 小时前
同城小程序开发:同一笔单在用户端和商家端各显示到哪
android·java·开发语言·前端·后端·uni-app·php
pigdreams17 小时前
Google 官方 Android CLI:让AI直接读布局结构而不是用adb截图验证
android·人工智能·adb
1024奇点19 小时前
【仓颉语言入门 · 第二篇 第 15 课】
开发语言·数据库·ide·开源
hunterandroid19 小时前
[Android 从零到一] Glide 图片加载原理:三级缓存、生命周期绑定与内存优化
android
法的空间20 小时前
AI 编程时代,为什么 Dart 分析会拖慢大型项目的开发
android·flutter·ios
鱼儿也有烦恼20 小时前
客户端应用架构模式
android·架构
独隅20 小时前
Claude 高效应用实战指南
android·java·开发语言·claude·claude code
硅基手札21 小时前
Android 系统全景专栏 00 · 总目录
android·操作系统·嵌入式开发