Skip to content

Commit

Permalink
Facebook iOS SDK 3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisp-fb committed Apr 30, 2014
1 parent 27fa392 commit 296771f
Show file tree
Hide file tree
Showing 217 changed files with 10,018 additions and 3,232 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -10,3 +10,6 @@
[submodule "vendor/appledoc"]
path = vendor/appledoc
url = git://github.com/tomaz/appledoc.git
[submodule "Bolts-IOS"]
path = Bolts-IOS
url = git://github.com/BoltsFramework/Bolts-iOS.git
1 change: 1 addition & 0 deletions Bolts-IOS
Submodule Bolts-IOS added at f7f65d
Expand Up @@ -53,7 +53,7 @@ - (IBAction)pickFriendsButtonClick:(id)sender {
// if the session is open, then load the data for our view controller
if (!FBSession.activeSession.isOpen) {
// if the session is closed, then we open it here, and establish a handler for state changes
[FBSession openActiveSessionWithReadPermissions:nil
[FBSession openActiveSessionWithReadPermissions:@[@"public_profile", @"user_friends"]
allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState state,
Expand Down
43 changes: 20 additions & 23 deletions samples/HelloFacebookSample/HelloFacebookSample/HFViewController.m
Expand Up @@ -117,16 +117,14 @@ - (void)loginViewFetchedUserInfo:(FBLoginView *)loginView

- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
// test to see if we can use the share dialog built into the Facebook application
FBShareDialogParams *p = [[FBShareDialogParams alloc] init];
FBLinkShareParams *p = [[FBLinkShareParams alloc] init];
p.link = [NSURL URLWithString:@"http://developers.facebook.com/ios"];
#ifdef DEBUG
[FBSettings enableBetaFeatures:FBBetaFeaturesShareDialog];
#endif
BOOL canShareFB = [FBDialogs canPresentShareDialogWithParams:p];
BOOL canShareiOS6 = [FBDialogs canPresentOSIntegratedShareDialogWithSession:nil];
BOOL canShareFBPhoto = [FBDialogs canPresentShareDialogWithPhotos];

self.buttonPostStatus.enabled = canShareFB || canShareiOS6;
self.buttonPostPhoto.enabled = NO;
self.buttonPostPhoto.enabled = canShareFBPhoto;
self.buttonPickFriends.enabled = NO;
self.buttonPickPlace.enabled = NO;

Expand Down Expand Up @@ -192,19 +190,20 @@ - (IBAction)postStatusUpdateClick:(UIButton *)sender {
// allows the app to publish without any user interaction.

// If it is available, we will first try to post using the share dialog in the Facebook app
FBAppCall *appCall = [FBDialogs presentShareDialogWithLink:urlToShare
name:@"Hello Facebook"
caption:nil
description:@"The 'Hello Facebook' sample application showcases simple Facebook integration."
picture:nil
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if (error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];
FBLinkShareParams *params = [[FBLinkShareParams alloc] initWithLink:urlToShare
name:@"Hello Facebook"
caption:nil
description:@"The 'Hello Facebook' sample application showcases simple Facebook integration."
picture:nil];
FBAppCall *appCall = [FBDialogs presentShareDialogWithParams:params
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if (error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];

if (!appCall) {
// Next try to post using Facebook's iOS6 integration
Expand Down Expand Up @@ -243,12 +242,10 @@ - (IBAction)postPhotoClick:(UIButton *)sender {
// Just use the icon image from the application itself. A real app would have a more
// useful way to get an image.
UIImage *img = [UIImage imageNamed:@"Icon-72@2x.png"];


BOOL canPresent = [FBDialogs canPresentShareDialogWithPhotos];
NSLog(@"canPresent: %d", canPresent);
BOOL canPresent = [FBDialogs canPresentShareDialogWithPhotos];
NSLog(@"canPresent: %d", canPresent);

FBShareDialogPhotoParams *params = [[FBShareDialogPhotoParams alloc] init];
FBPhotoParams *params = [[FBPhotoParams alloc] init];
params.photos = @[img];

FBAppCall *appCall = [FBDialogs presentShareDialogWithPhotoParams:params
Expand Down
4 changes: 2 additions & 2 deletions samples/RPSSample/RPSSample/RPSGameViewController.m
Expand Up @@ -396,7 +396,7 @@ - (BOOL)shareGameActivity {
action[@"gesture"] = builtInOpenGraphObjects[_lastPlayerCall]; // set action's gesture property
action[@"opposing_gesture"] = builtInOpenGraphObjects[_lastComputerCall]; // set action's opposing_gesture property

FBOpenGraphActionShareDialogParams *params = [[FBOpenGraphActionShareDialogParams alloc] init];
FBOpenGraphActionParams *params = [[FBOpenGraphActionParams alloc] init];
params.action = action;
params.actionType = @"fb_sample_rps:throw";
params.previewPropertyName = @"gesture";
Expand All @@ -407,7 +407,7 @@ - (BOOL)shareGameActivity {
}

- (BOOL)shareGameLink {
FBShareDialogParams *params = [[FBShareDialogParams alloc] init];
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:@"https://developers.facebook.com/"];
params.name = @"Rock, Papers, Scissors Sample Application";

Expand Down
Binary file removed samples/Scrumptious/Icon-72.png
Binary file not shown.
Binary file removed samples/Scrumptious/Icon.png
Binary file not shown.
Binary file removed samples/Scrumptious/Icon@2x.png
Binary file not shown.
4 changes: 2 additions & 2 deletions samples/Scrumptious/ReadMe.txt
Expand Up @@ -9,8 +9,8 @@ The example utilizes several controls for the Facebook SDK including:
FBLoginView - used on the landing page for authenticating the user.
FBFriendPickerViewController - presented from the main UI to pick friends.
FBPlacePickerViewController - presented from the main UI to pick a location.
FBuserSettingsViewController - used to log the user out.
FBUserSettingsViewController - used to log the user out.

Furthermore, the sample demonstrates usage of Open Graph objects and actions. While the functionality is
quite constrained in order to be of reasonable size for a sample, the Facebook integration could serve
as the basis for more full-featured applications. In particular, look for the text "Facebook SDK" to identify
Expand Down

0 comments on commit 296771f

Please sign in to comment.