我正在尝试编写一个可以搜索我公司的应用程序.当它返回结果时,我想要包含一个功能,只需按一下按钮即可将此人添加到"联系人"应用程序中.
问题是,我找不到通过自定义URL方案启动联系人应用程序的方法,并将新人员信息作为参数.有没有人知道这是否可能,如果是的话,如何去做?
我正在开发一个管理我自己的URL方案的应用程序,所以我实现了回调:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions (NSDictionary *)launchOptions
{
// Get our launch URL
if (launchOptions != nil)
{
// Launch dictionary has data
NSURL* launchURL = [launchOptions objectForKey: UIApplicationLaunchOptionsURLKey];
// Parse the URL
NSString* hostString = [launchURL host];
blah blah blah...
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但我需要启动调用者应用程序(即打开URL的应用程序).所以我的问题是,这可能吗?
我一直在玩,UIApplicationLaunchOptionsSourceApplicationKey但我无法通过其应用程序Bundle ID启动应用程序.我可以吗?
我也尝试了未记录launchApplicationWithIdentifier:的UIApplication,但我需要一个真正的解决方案,似乎解决方法只适用于模拟器.
有任何想法吗?谢谢!
我想从我的iPhone应用程序发布一个图像到pinterest帐户,没有任何API发布,因为我试图将它与URL Scheme集成,但没有成功.这是代码,
- (void)pinThroughURLScheme {
NSString *urlString = PinterestURLMake(self.image, nil, @"alt", @"image.jpeg", NO);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
}
NSString *PinterestURLMake(UIImage *image, NSString *urlString, NSString *alt, NSString *title, BOOL isVideo) {
NSString *base64ImageString = [NSString stringWithFormat:@"data:image/png;base64,%@", NSStringFromUIImage(image)];
NSString *encodedBase64ImageString = [base64ImageString urlEncodeUsingEncoding:NSUTF8StringEncoding];
NSString *encodedURLValue = [urlString urlEncodeUsingEncoding:NSUTF8StringEncoding];
NSString *encodedAltValue = [alt urlEncodeUsingEncoding:NSUTF8StringEncoding];
NSString *encodedTitleValue = [[NSString stringWithFormat:@"%@ %.0fx%.0f pixels", title, image.size.width, image.size.height] urlEncodeUsingEncoding:NSUTF8StringEncoding];
NSString *videoValue = isVideo ? @"true" : @"false";
return [NSString stringWithFormat:@"pinterest://pin/create/bookmarklet/?url=URL-OF-THE-PAGE-TO-PIN&media=URL-OF-THE-IMAGE-TO-PIN&description=ENTER-YOUR-DESCRIPTION-FOR-THE-PIN",
encodedBase64ImageString,
urlString ? [NSString stringWithFormat:@"&url=%@", encodedURLValue] : …Run Code Online (Sandbox Code Playgroud) 在我的UIWebView中,我想添加一个选项,将当前页面添加到Safari的阅读列表中.我知道这个功能存在,因为GMail在长按链接时提供它,但我找不到任何关于使用哪种URL方案的信息.
我尝试打开我的应用程序,如果从safari浏览器安装在iPhone中,只需传递,myApp:// using javascript document.location="myApp://";如果没有重定向到另一个网页,以显示应用程序详细信息.但是当app没有安装safari时抛出"无法打开页面"警报,如果重定向到另一个网页那个时候也会自动提醒警报框.如果应用程序没有安装在设备上,任何人都可以帮助我如何在没有safari的情况下重定向网页无法打开页面警报.
我的代码:简单地onload="checkdevice();return false;"
用textarea中的html文件和正文显示消息"document.getElementById('txtMsg').value"
function checkdevice() Check browser detection
{
if((navigator.userAgent.match(/iPhone/)) || (navigator.userAgent.match(/iPad/)) || (navigator.userAgent.match(/iPod/)))
{
document.getElementById('txtMsg').value ="Running on iPhone /iPod /iPad Device";
checkAppExists();
return true;
}
else
{
document.getElementById('txtMsg').value ="Please run this page on iPhone / iPod / iPad Device";
checkAppExists();
return false;
}
}
function checkAppExists()
{
var time = (new Date()).getTime();
window.location="myApp://";
setTimeout(function(){
var now = (new Date()).getTime();
if((now-time)< 400)
{
window.location="http://mydomin.com/appdetails.html";
}
else
{
document.getElementById('txtMsg').value ="App Installed"; …Run Code Online (Sandbox Code Playgroud) 我正在使用fb-messenger://撰写打开Facebook Messenger Composer,但我无法将预定义的消息放入作曲家.
有人知道参数吗?
无计划的网址是否像
//blog.flowl.info/
Run Code Online (Sandbox Code Playgroud)
在HTTP(rfc?)中有效,就像在普通的HTTP 请求和响应中一样,或者它们仅在HTML属性和内容中有效吗?
HTTP/1.1 302 - Moved
Location: //blog.flowl.info
GET //blog.flowl.info
Run Code Online (Sandbox Code Playgroud)
更新:
我现在有两个矛盾的答案.哪个是对的?
Sidequestion:为什么浏览器甚至会解决这些问题:
//blog.flowl.info/
->
http://blog.flowl.info/
Run Code Online (Sandbox Code Playgroud)
代替:
//blog.flowl.info/
->
http://blog.flowl.info///blog.flowl.info/
Run Code Online (Sandbox Code Playgroud) 如果你想检查你的用户是否有Gmail(这样你可以切换到Gmail发送电子邮件),你可以看看他们是否可以打开"googlegmail:/// co?to ="
Google的新应用Google Inbox是否有相同的功能?
我试过"googleinbox:///",但它没有用.
有没有可以找到这些链接的地方?尝试过:http://handleopenurl.com/,但是甚至没有Gmail(编辑现在这个网站已经死了.)
谢谢
我已经在我的应用程序中创建了URL方案。我只是想通过电子邮件打开我的应用程序。我在浏览器中复制了自定义URL方案myapp://,它正在打开我的应用程序。但是,当我尝试通过iOS邮件客户端中的电子邮件打开它时,它没有打开。要通过电子邮件打开我的应用程序,还需要做些其他事情吗?
我想为我的应用设置应用链接,但仅限于它在某些路径上有效.换句话说,在我的清单中:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.mydomain.com/[mypath]" />
<data android:scheme="https" android:host="www.mydomain.com/[mypath]" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
我不希望每个拥有我的域名的网址都能打开应用程序 - 他们可以照常在浏览器中打开.我只想要在应用程序中打开包含特定子路径的URL.这种模式是允许的还是应用程序链接的"全有或全无"?
链接到开发人员文档:http: //developer.android.com/training/app-links/index.html
url-scheme ×10
ios ×8
iphone ×3
objective-c ×3
cocoa-touch ×2
safari ×2
android ×1
applinks ×1
custom-url ×1
email ×1
html ×1
http ×1
nsurl ×1
pinterest ×1
uri ×1