第三方应用使用urlScheme跳转到uniapp开发的app时,该有哪些配置呢?
1. app是android离线打包,所以uniapp的云打包配置就不能使用了(manifest.json中配置scheme)
2. 配置
- 找到android离线打包的android目录,其中的AndroidManifest.xml文件。
- uniapp离线打包application节点下会有两个uniapp需要配置的activity,io.dcloud.PandoraEntry 和?io.dcloud.PandoraEntryActivity
- 在io.dcloud.PandoraEntry的activity节点下,新添加intent-filter,主要是配置scheme
<intent-filter>
<data android:scheme=""
android:host=""
android:port="" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter> 4. 踩坑:千万不要在io.dcloud.PandoraEntryActivity的activity配置,不起作用 5. 以上,就可以从第三方应用跳转过来了~~~
3. 如果要接受传的参数该怎么办呢?
? ? ? ? 1. 在App.vue的onShow生命周期中调用
? ? ? ? ?2. 可以使用uniapp的plus方法获取具体参数????????????????
onShow: function () {
console.log("App Show");
var args = plus.runtime.arguments;
if (args) {
// 处理args参数,如直达到某新页面等
}
},
? ??
以上就是uniapp离线打包app,并且第三方跳转到应用的过程~~~
|