codenameone - 将 Youtube iOS 应用中的 URL 分享到我的 Codename One iOS 应用
问题描述
我需要将一个视频链接从 Youtube 应用程序共享到我在 iOS 上的 Codename One 应用程序。
根据:https ://stackoverflow.com/a/38036939/1277576,这似乎是可能的
使用 Codename One,我尝试添加这些构建提示:
ios.plistInject=<key>CFBundleURLTypes</key><array><dict><key>CFBundleURLName</key><string>net.informaticalibera.myappname</string></dict><dict><key>CFBundleURLSchemes</key><array><string>https</string></array></dict></array>
ios.urlScheme=<string>https</string>
我将此代码添加到一个简单的项目中:
public void start() {
if (current != null) {
current.show();
return;
}
String url = Display.getInstance().getProperty("AppArg", null);
Form hi = new Form("Test case", BoxLayout.y());
if (url != null) {
hi.add(new SpanLabel("Intercepted URL:\n" + url));
} else {
hi.add(new Label("No URL was intercepted"));
}
hi.show();
}
但它不起作用:当我分享视频链接时,Youtube 为我提供了几个应用程序,但不是我的。
解决方案
您还需要在本机代码中实现它,如果我没记错的话,我认为 xcode 项目也需要更改。目前我们对此用例没有官方支持,但您可以为此提交 RFE。
推荐阅读
- aws-lambda - botocore.exceptions.ClientError:调用CreateBucket操作时发生错误(AccessDenied):访问被拒绝
- wix - WiX 组件 GUID 可以在不同的产品安装中复制吗
- javascript - 将 2 个应用程序合并在一起 (ASP.NET MVC - JavaScript)
- javascript - 数组在订阅范围之外变得未定义
- javascript - 是否可以使用 Google Map JavaScript API/JavaScript 在地图上放置一个大圆圈?
- python - 是否有任何不使用 Java 的 mdbtools 替代品?
- matlab - Octave:向/从文本文件写入/读取 f(x,y) 出错
- batch-file - 如何在 bat 中处理下一个命令之前等待应用程序结束?
- c# - 如何从 DecryptStringFromBytes_Aes 获得与 .NET C# 但在 Node js 中相同的结果?
- php - 是否可以在 symfony 5 中自定义违反约束错误渲染?