简体   繁体   English

从我的应用程序打开Facebook应用程序

[英]Open Facebook application from my app

有人可以告诉URL方案从我的应用程序打开Facebook应用程序吗?

Use fb:// . 使用fb://

canOpenURL returns a BOOL value indicating whether or not the URL's scheme can be handled by some app installed on the device. canOpenURL返回一个BOOL值,指示URL的方案是否可以由设备上安装的某个应用程序处理。 If canOpenURL returns YES then the application is present on the device. 如果canOpenURL返回YES则应用程序出现在设备上。 If the user has Facebook installed on their device we open it. 如果用户在其设备上安装了Facebook,我们将其打开。 If the user does not have Facebook installed we open the page through a link, which will launch Safari. 如果用户没有安装Facebook,我们通过链接打开页面,这将启动Safari。

// Check if FB app installed on device
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]) {
   [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/355356557838717"]];
}
else {
   [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.facebook.com/DanielStormApps"]];
}

Check out iPhone URL Schemes for a list of what else you can achieve via URL Schemes. 查看iPhone URL Schemes ,了解您可以通过URL Schemes实现的其他功能。

Also, starting at iOS 9 you must include LSApplicationQueriesSchemes in your info.plist . 此外,从iOS 9开始,您必须在info.plist包含LSApplicationQueriesSchemes

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Facebook应用程序打开我的应用程序 - Open my app from facebook app iOS:如何在我的应用程序中打开Facebook App中的特定帖子? - iOS: How do I open a specific post in the Facebook App from within my application? 从我的应用程序打开本机 Snapchat 应用程序 - Open native Snapchat App from my Application 从应用程序打开Facebook页面 - open Facebook page from the app 打开IOS应用程序,该应用程序通过fbconnect和/或来自Facebook应用程序或Facebook网站的sharekit使用sharekit - Open IOS Application which uses sharekit via fbconnect and/or sharekit from facebook app or facebook website Adobe Air应用程序-打开Facebook应用程序进行登录 - Adobe Air Application - open facebook app to login 是否可以从iMessage应用程序链接打开我的应用程序? - Is it possible to open my application from iMessage app link? 如何从WatchKit应用程序在iPhone上打开应用程序? - How can I open the application on iPhone from my WatchKit app? 从我的应用程序启动 Facebook 应用程序并打开一个不属于我的个人资料 - Launch Facebook app from my app and make it open a profile which is not mine 从我的iOS应用程序中打开Word文档,然后在MSWord应用程序中对其进行编辑,然后将已编辑的文件恢复到我的应用程序中 - Open a word doc from my iOS application and edit it in MSWord app and get the edited file back in my application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM