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>
相关推荐
用户423816229071 分钟前
Android 16 WebView 页面顶部挖孔/通知栏不能显示UI问题排查
android
weixin_727535621 小时前
Loop 已死,Graph 新生:AI 工作流的范式革命
android·人工智能·rxjava
严同学正在努力2 小时前
从备份到恢复:我用 30 分钟恢复了误删的核心业务表
android·java·数据库·ai
梦想三三2 小时前
LangChain Output Parser 实战:从字符串到结构化数据的完整指南
android·服务器·langchain·github·uv
时时三省4 小时前
VScode 智能插件安装
ide·vscode·编辑器
爱笑鱼4 小时前
Binder(八):远端进程死了,BinderProxy 为什么还能收到通知?
android
Android-Flutter4 小时前
Kotlin 冷流与热流详解
android·kotlin
zhangphil5 小时前
Android ContentProvider/ContentResolver读图片,跨进程 IPC慢
android
yueqc15 小时前
Android .so 文件压缩
android·so·包体积
龚礼鹏5 小时前
深入解析 Android Automotive (AAOS) 启动流程与 CarService 核心机制(基于 Android 16 最新源码视角)
android