【发布时间】:2021-01-09 13:18:18
【问题描述】:
我能找到的唯一插件就是这个https://github.com/EddyVerbruggen/Custom-URL-scheme
我尝试安装它并检查它的 iOS 实现,它在 plugins/cordova-plugin-customurlscheme/src/ 内是空的(没有找到 ios 文件夹,只有 android 和 window)。我查了plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js,内容是:
"use strict";
/*
Q: Why an empty file?
A: iOS doesn't need plumbing to get the plugin to work, so..
- Including no file would mean the import in index.html would differ per platform.
- Also, using one version and adding a userAgent check for Android feels wrong.
- And if you're not using PhoneGap Build, you could paste your handleOpenUrl JS function here.
*/
没有意义,根据我的理解,应该在AppDelegate中实现func application(_application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:] ) -> Bool,但是它是空的。这种情况下,怎么覆盖handleOpenURL中的JS会起作用呢?
我真的找不到其他人,谁能推荐类似的可行插件?我的场景是,当A应用调用B应用时,我的B应用是cordova应用,我需要一个监听器/回调来捕获url内容。
更新:
在MAF标签中添加,因为问题是由Oracle MAF框架引起的,没想到,以为问题来自Cordova。
【问题讨论】:
标签: ios cordova cordova-plugins oracle-maf