MultiAPICall 功能
借助适用于 iOS 的 MultiAPICall 功能,在单个请求中串联多个 WebViewGold API 调用。
这是一项 iOS 的可选功能,因为基于 Apple 的浏览器处理同一脚本上多次页面重新加载的方式与基于 Android 的浏览器不同。
这意味着在同一网页脚本中多次调用 window.location.href = "exampleAPItrigger" 在 iOS 上将无法正常工作,这与 Android 不同。
MultiAPICall 功能允许您在网页脚本末尾通过单次 window.location.href 赋值调用多个 API。如果您希望从应用中预加载多个数据功能以便在页面上使用,此功能会非常有用。
MultiAPICall 支持以下数据采集 API 作为条目:
"get-uuid", "user-disable-tracking", "getonesignalplayerid", "getappversion", "__haptics (light, medium, heavy, success, warning, error)"
使用 JavaScript 调用此类 URL 即可一次性调用多个 API(请务必加入检测以确保仅在 iOS 平台上使用):
<script>
// Example combination: "getonesignalplayerid" and "getappversion"
if (getMobileOperatingSystem() == "iOS") {
// iOS: Use MultiAPICall feature, separate API names by commas (","), NO spaces
window.location.href = "multiapicall://getonesignalplayerid,getappversion";
} else {
// Android: Can handle multiple calls at once, use normal API call structure
window.location.href = "getonesignalplayerid://";
window.location.href = "getappversion://";
}
</script>点击此处查看此功能的演示网页。检查该页面即可查看示例代码。