一些开发博客发布了有关用于在Facebook iPhone App中打开各种视图的"fb://"网址方案的信息.无论我搜索多少,我都没有从任何官方Facebook消息来源中找到一个关于此的话.
既然信息是公开的,我相信我不是唯一一个想知道的人,是否使用这个url方案是正式批准的,我是否允许使用它,它是否正常工作,如果不是已经批准了,它会是什么,大概的时间表是什么?
预先感谢您对此主题的任何信息!
在我目前的项目中,我需要在iOS应用程序上分享whatsapp上的文本.
这是我在whatsapp上分享文字的代码: -
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}
Run Code Online (Sandbox Code Playgroud)
但是在iOS9中,canOpenURL总是返回false.
有iOS9隐私政策吗?谁能帮我吗.
提前致谢.
我希望有人能向我澄清协议和网址中的方案之间的技术差异.(或确定其他可以放入计划中的项目?)
最初我以为它们是相同的,而且这个计划只是它的另一个名称.
您可以在此维基百科文章中找到此处引用的方案.
没有传输层或编码
这是定义它们之间差异的正确方法,还是有更多的方法使两者不同?
当我处理协议或方案时,我怎么能清楚地说出来?(或者除了也有资格在方案中使用的协议之外的东西?因为似乎协议被放置在url的scheme部分中)
我在iOS上发现了一些关于应用程序间通信的文章,例如" iPhone上的双向应用程序集成:工作原理 "和" Apple批准的iPhone进程间通信 ".基本上他们使用自定义URL方案进行通信.我的问题是,如果我传递一些敏感数据,例如登录凭据,那么安全问题是什么?
我是一名移动网络开发人员,我想测试一些iOS设备,看看普通的iOS设备可以接受哪些mime-types和url方案.
在Android上,我可以安装一个名为PackageExplorer的应用程序,列出所有apks的所有"intent过滤器",并列出哪些文件mime-types(image/png,text/html,text/x-vcard)和url scheme(像geo:,tel:,sms:,mailto:,http://youtube.com)应用处理.
如果我可以告诉我的移动网页上的服务器或浏览器端支持/注册哪些方案和mime类型,那将是非常好的,但如果这不可能,我正在寻找iOS中的显示或应用程序来查看所有已注册的文件mime-types和url scheme协议,设备当前支持所有已安装的应用程序.
如何在iOS设备上找到所有已注册的scheme/mime intent过滤器?
更新:我不知道它是否完整,但我发现了一个在移动游猎中运行的网址方案的正式列表:http://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html(还在寻找哑剧型等)
可能重复:
在<script src ="...">中用//替换是否有效?
绝对URL省略协议(方案)以保留当前页面之一
在Javascript中使用//www.example.com自动选择http/https协议
我正在查看来自facebook的一些示例代码,我看到:
<script src="//connect.facebook.net/en_US/all.js"></script>
Run Code Online (Sandbox Code Playgroud)
他们使用//而不是http://- 这是我不知道的奇特吗?
我想使用Twitter应用程序从我的网络应用程序发送推文,而不是在安装推特客户端时使用推特按钮.
如果我在安装了Twitter应用程序的iPhone或Mac上,则在将Web应用程序重定向到"twitter://"URL时会打开此应用程序.(见http://handleopenurl.com/scheme/twitter)
但是,如果我只想在未安装Twitter应用程序的地方显示Twitter按钮,我该如何检查?假设我有这个代码.twitter_app_installed()应该如何?有没有办法检查是否window.location="twitter://...";不起作用?
<div class="twitter-button"><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://google.com" data-text="Hello World">Tweet</a></div>
<div class="twitter-app-button"><a href="twitter://post?message=Hello%20World%20http://google.com">Tweet</a></div>
<script>
function twitter_app_installed() { /* check if window.location="twitter://"; works */}
$(document).ready(function() {
if (twitter_app_installed()) $('.twitter-app-button').show();
else $('.twitter-button').show();
});
</script>
Run Code Online (Sandbox Code Playgroud)
另外:有没有正确的方法将URL添加到twitter://方案?
在Windows操作系统中,我有一个自定义URI方案,使用它
IE,Firefox,Opera,Safari,Google Chrome
推出Juniper路由器VPN SSH客户端(如思科).基本上,如果安装了SSH客户端,它的工作原理如下,从网页上可以启动VPN SSH Client.
<a href="juniper:open"> VPN SSH Client </a>
Run Code Online (Sandbox Code Playgroud)
问题:
有时用户没有从CD/DVD盒安装Juniper路由器SSH客户端应用程序,因此juniper:open什么都不做.
所以在这种情况下,我需要检测天气是否可用URL方案.
因此,我尝试了Javascript方法,但它没有完全正常工作.因为juniper:open实际上不是web链接.
我如何检测它呢?
<script>
// Fails
function test1(){
window.location = 'juniper:open';
setTimeout(function(){
if(confirm('Missing. Download it now?')){
document.location = 'https://www.junper-affiliate.com/setup.zip';
}
}, 25);
//document.location = 'juniper:open';
}
// Fails
function test2(h){
document.location=h;
var time = (new Date()).getTime();
setTimeout(function(){
var now = (new Date()).getTime();
if((now-time)<400) {
if(confirm('Missing. Download it now?')){
document.location = 'https://www.junper-affiliate.com/setup.zip';
} else {
document.location=h;
}
}
}, 300);
}
</script>
Run Code Online (Sandbox Code Playgroud)
然后:
<a onclick="test1()">TEST 1</a> …Run Code Online (Sandbox Code Playgroud) javascript firefox internet-explorer google-chrome url-scheme
我无法找到解决问题的方法.
我找到了许多自定义URL-Sheme的答案,如此(mycoolapp://somepath).
例如,这个插件添加了一个自定义URL-Sheme.
但我不想要一个自定义URL-Sheme,我想要一个像这样的"普通"Url(http://www.mycoolapp.com/somepath).
如果你在浏览器中打开它或者单击超链接,那么它会要求你打开我的应用程序(就像谷歌地图那样).
这个问题可能已经有了答案,但我找不到.
编辑:
如果您不知道我的意思,那么如果您点击Android设备上我的网站链接,那该怎么回事?

只需用我的应用程序选择.
有两个名为Sender&Receiver的测试应用程序
他们通过Url Scheme互相沟通.我想从发送者发送一个字符串给接收者,这可能吗?
关于字符串的细节:
我都在Sender和Receiver中创建Textfields,我会在Sender Textfield上发一些字符串.单击按钮时,字符串将显示在Receiver Textfield上.
我似乎必须在我的应用程序接收器中实现NSNotificationCenter.defaultCenter().postNotificationName
这是我的App Receiver代码:
在Appdelegate
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
calledBy = sourceApplication
fullUrl = url.absoluteString
scheme = url.scheme
query = url.query
}
Run Code Online (Sandbox Code Playgroud)
在viewController中
override func viewDidLoad() {
super.viewDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.displayLaunchDetails), name: UIApplicationDidBecomeActiveNotification, object: nil)
// Do any additional setup after loading the view, typically from a nib.
}
func displayLaunchDetails() {
let receiveAppdelegate = UIApplication.sharedApplication().delegate as! AppDelegate
if receiveAppdelegate.calledBy != nil {
self.calledByText.text = …Run Code Online (Sandbox Code Playgroud) url-scheme ×10
ios ×4
javascript ×3
iphone ×2
cordova ×1
facebook ×1
firefox ×1
html ×1
ios4 ×1
ios9 ×1
mime-types ×1
objective-c ×1
pass-data ×1
protocols ×1
security ×1
swift ×1
twitter ×1
url ×1
whatsapp ×1