iOS 直播登录facebook

卖肉直播ios网址,iOS 直播登录facebook

1

先FQ吧

2

要实现facebook在自己app的三方登录或者分享等功能,首先注册facebook的账号,并成为开发者 附网址:https://developers.facebook.com

3

傻瓜条款同意之类就跳过了

点击下载sdk

 

4

Add the Facebook SDK to your Xcode Project From the Facebook SDK folder, drag the folder  FBSDKCoreKit.Framework, FBSDKLoginKit.Framework, FBSDKShareKit.Framework into your Xcode Projects Framework folder. 这是一段sdk的使用介绍,直接复制的,大概意思就是拖几个文件到Xcode工程里面去   5 Configure your info.plist  在plist文件加一些东西  "Open As Source Code".右击选择,下面的代码随便找个地方塞进去
<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fb592511104230426</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>592511104230426</string>
<key>FacebookDisplayName</key>
<string>SGShop</string>

如果你编译你的应用程序与iOS SDK 9.0或以上,你将受到应用程序传输安全性的影响  也是在plist添加吧

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>fbcdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>akamaihd.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

 


如果你使用Facebook的任何对话框(如。、登录、分享、应用邀请等),可以执行应用程序切换到Facebook应用程序,应用程序的。plist还需要处理这个问题。加

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fb-messenger-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
</array>

 

 
6


去工程复制bundle id过来

7
导入sdk
#import <FBSDKCoreKit/FBSDKCoreKit.h>

- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [[FBSDKApplicationDelegate sharedInstance] application:application
                           didFinishLaunchingWithOptions:launchOptions];
  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                         openURL:url
                                               sourceApplication:sourceApplication
                                                      annotation:annotation];
 
  

这样配置就完成了,接下来就是按照需求实现功能

下面以facebook登录为例子(facebook官网的例子)

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

In the ViewController.m file, add the following code to the viewDidLoad method:
FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
loginButton.center = self.view.center;
[self.view addSubview:loginButton];

Add this method in your app's AppDelegate.m file:
- (BOOL)application:(UIApplication *)application
             openURL:(NSURL *)url
   sourceApplication:(NSString *)sourceApplication
          annotation:(id)annotation {
   return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                         openURL:url
                                               sourceApplication:sourceApplication
                                                      annotation:annotation];
}

这样就实现了facebook的三方登录咯




iOS 直播登录facebook的相关内容如下:

真人直播ios 安卓免费下载| 小奶猫ios下载地址| 模拟ios系统| ios 怎样facebook| 向日葵app下载ios| 金鱼直播app下载ios| ios数据迁移到安卓| 卡哇伊直播ios|

TAG标签:

文章标题:iOS 直播登录facebook

转载注明出处:http://www.puyangxw.cn/newszx/473106.html

说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!

随机标签推荐

濮阳新闻