3 Star 0 Fork 0

Gitee 极速下载 / ADFBRequestDialogViewController

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/Antondomashnev/ADFBRequestDialogViewController
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

ADFBRequestDialogViewController

UIViewController with FBDialog inside to send Facebook app request.

In API 2.0 Facebook changed me/friends endpoint, so according changelog:

Friend list now only returns friends who also use your app: The list of friends 
returned via the /me/friends endpoint is now limited to the list 
of friends that have authorized your app.

Therefore if our app isn't a game with canvas support we have only two options to invite user's Facebook friends to our app:

Message app is pretty nice, but requests dialog isn't good enough for me. It's pure UIWebView, so there are no customization options of top bar, buttons and showing animation. Thats why I've developed an ADFBRequestDialogViewController - view controller wrapper for requests dialog. With it you can customize top elements and present dialog whatever you want with iOS UIViewController custom transition.

Comparison

Adding ADFBRequestDialogViewController to your project

CocoaPods

CocoaPods is the recommended way to add ADFBRequestDialogViewController to your project.

  1. Add a pod entry for ADFBRequestDialogViewController to your Podfile pod 'ADFBRequestDialogViewController'
  2. Install the pod(s) by running pod install.
  3. Include ADFBRequestDialogViewController wherever you need it with #import "ADFBRequestDialogViewController.h".

Source files

Alternatively you can directly add the ADFBRequestDialogViewController.h and ADFBRequestDialogViewController.m source files to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, then drag and drop ADFBRequestDialogViewController.h and ADFBRequestDialogViewController.m onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
  3. Include ADFBRequestDialogViewController wherever you need it with #import "ADFBRequestDialogViewController.h".

Usage

Before start using ADFBRequestDialogViewController in code check if it can be presented with + (BOOL)canBePresented; static method. It it returns YES you can use this view controller otherwise use facebook method to present dialog.

The simplest way to present ADFBRequestDialogViewController is

ADFBRequestDialogViewController *vc = [[ADFBRequestDialogViewController alloc] initWithSession:[FBSession activeSession] message:@"YO" title:@"Invite friends" parameters:nil handler:nil];
[self presentViewController:vc animated:YES completion:nil];

There are some properties to initialize underlying FBDialog

@property (nonatomic, strong) FBSession *session;
@property (nonatomic, strong) NSString *message;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) NSDictionary *parameters;
@property (nonatomic, copy) FBWebDialogHandler handler;

There are UI elements for customization

@property (nonatomic, strong) UIView *topView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *sendButton;
@property (nonatomic, strong) UIButton *cancelButton;
The MIT License (MIT) Copyright (c) 2014 Anton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

ADFBRequestDialogViewController 是 Facebook 请求对话框的视图控制器封装程序 展开 收起
Objective-C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/mirrors/ADFBRequestDialogViewController.git
git@gitee.com:mirrors/ADFBRequestDialogViewController.git
mirrors
ADFBRequestDialogViewController
ADFBRequestDialogViewController
master

搜索帮助