Skip to content

Commit

Permalink
Cleanup and cosmetic improvements to projects
Browse files Browse the repository at this point in the history
Summary: Removing code that wasn't ready

Test Plan: n/a

Reviewers: gregschechte, clang

Reviewed By: gregschechte

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D583756

Task ID: 1731992
  • Loading branch information
onebit committed Sep 25, 2012
1 parent 48843a7 commit ef58c14
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
84070D0B1540AA2B00E39703 = {
isa = PBXGroup;
children = (
85A928C616114684008699F1 /* Social.framework */,
84070D201540AA2B00E39703 /* BooleanOGSample */,
84070D191540AA2B00E39703 /* Frameworks */,
84070D171540AA2B00E39703 /* Products */,
Expand All @@ -116,6 +115,7 @@
84070D191540AA2B00E39703 /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928C616114684008699F1 /* Social.framework */,
B9A4167116113E93001E7A77 /* AdSupport.framework */,
DE1C9C2B15CC8FE400809B9E /* FBUserSettingsViewResources.bundle */,
DE1C9C2915CC8F9A00809B9E /* FacebookSDKResources.bundle */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
E2D6B80315413A560050835F = {
isa = PBXGroup;
children = (
85A928B81611462C008699F1 /* Social.framework */,
E2D6B81815413A570050835F /* FriendPickerSample */,
E2D6B81115413A570050835F /* Frameworks */,
E2D6B80F15413A570050835F /* Products */,
Expand All @@ -98,6 +97,7 @@
E2D6B81115413A570050835F /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928B81611462C008699F1 /* Social.framework */,
B9A4167816113EAE001E7A77 /* AdSupport.framework */,
DD37EA8515ABA4670015966B /* FacebookSDKResources.bundle */,
DD37EA8715ABA46B0015966B /* FacebookSDK.framework */,
Expand Down
2 changes: 1 addition & 1 deletion samples/Hackbook/Hackbook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
30EA734E13F5D21B003DC0D2 = {
isa = PBXGroup;
children = (
85A928BF16114663008699F1 /* Social.framework */,
30EA73CC13F5D50D003DC0D2 /* FBConnect */,
30EA736313F5D21B003DC0D2 /* Hackbook */,
30EA735C13F5D21B003DC0D2 /* Frameworks */,
Expand All @@ -143,6 +142,7 @@
30EA735C13F5D21B003DC0D2 /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928BF16114663008699F1 /* Social.framework */,
B9A4167F16113EC3001E7A77 /* AdSupport.framework */,
84750A9F160A259400C1A13D /* Accounts.framework */,
DD37EA8E15ABA4920015966B /* FacebookSDK.framework */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
5F6AF17E1532A37B00DDBD75 = {
isa = PBXGroup;
children = (
85A928A21611305A008699F1 /* Social.framework */,
5F6AF1931532A37B00DDBD75 /* HelloFacebookSample */,
5F6AF18C1532A37B00DDBD75 /* Frameworks */,
5F6AF18A1532A37B00DDBD75 /* Products */,
Expand All @@ -101,6 +100,7 @@
5F6AF18C1532A37B00DDBD75 /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928A21611305A008699F1 /* Social.framework */,
B9A4168616113ED6001E7A77 /* AdSupport.framework */,
5FC4959715C21151007EE54E /* CoreLocation.framework */,
DD37EAC215ABA8FE0015966B /* FacebookSDKResources.bundle */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
E2511732152BB6FE00CB342A = {
isa = PBXGroup;
children = (
85A928CD161146AC008699F1 /* Social.framework */,
E2511747152BB6FE00CB342A /* JustRequestSample */,
E2511740152BB6FE00CB342A /* Frameworks */,
E251173E152BB6FE00CB342A /* Products */,
Expand All @@ -96,6 +95,7 @@
E2511740152BB6FE00CB342A /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928CD161146AC008699F1 /* Social.framework */,
B9A4168D16113EE7001E7A77 /* AdSupport.framework */,
DDA290AC15ABA96200F533F9 /* FacebookSDK.framework */,
84605AAF15A77B8600197AA7 /* Accounts.framework */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
B9AF4B99152E43EE00E9BA6C = {
isa = PBXGroup;
children = (
85A928D4161146C7008699F1 /* Social.framework */,
B9AF4BAE152E43EE00E9BA6C /* PlacePickerSample */,
B9AF4BA7152E43EE00E9BA6C /* Frameworks */,
B9AF4BA5152E43EE00E9BA6C /* Products */,
Expand All @@ -101,6 +100,7 @@
B9AF4BA7152E43EE00E9BA6C /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928D4161146C7008699F1 /* Social.framework */,
B9A4169416113EF8001E7A77 /* AdSupport.framework */,
DD37EA7715ABA3E70015966B /* FacebookSDK.framework */,
DD37EA7515ABA3DF0015966B /* FacebookSDKResources.bundle */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
B98686AD151D0B3700616412 = {
isa = PBXGroup;
children = (
85A928DB161146E2008699F1 /* Social.framework */,
847BBEA9160B88E8004EC7CB /* Accounts.framework */,
B98686C2151D0B3700616412 /* ProfilePictureSample */,
B98686BB151D0B3700616412 /* Frameworks */,
B98686B9151D0B3700616412 /* Products */,
Expand All @@ -99,6 +97,8 @@
B98686BB151D0B3700616412 /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928DB161146E2008699F1 /* Social.framework */,
847BBEA9160B88E8004EC7CB /* Accounts.framework */,
B9A4169B16113F0A001E7A77 /* AdSupport.framework */,
DD37EA6E15ABA3AC0015966B /* FacebookSDK.framework */,
DD37EA6C15ABA39D0015966B /* FacebookSDKResources.bundle */,
Expand Down
2 changes: 1 addition & 1 deletion samples/Scrumptious/Scrumptious.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
B9CD0A64150EA4DD00560A93 = {
isa = PBXGroup;
children = (
85A928E216114706008699F1 /* Social.framework */,
B9CD0A79150EA4DD00560A93 /* Scrumptious */,
B9CD0A72150EA4DD00560A93 /* Frameworks */,
B9CD0A70150EA4DD00560A93 /* Products */,
Expand All @@ -126,6 +125,7 @@
B9CD0A72150EA4DD00560A93 /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928E216114706008699F1 /* Social.framework */,
B9A416A216113F1C001E7A77 /* AdSupport.framework */,
8534B4DE15CC657900348ED2 /* FBUserSettingsViewResources.bundle */,
DD55EAB015ABA246000A64B8 /* FacebookSDKResources.bundle */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
84C757AD152A38770070DD9C = {
isa = PBXGroup;
children = (
85A928E91611471C008699F1 /* Social.framework */,
84C757C2152A38770070DD9C /* SessionLoginSample */,
84C757BB152A38770070DD9C /* Frameworks */,
84C757B9152A38770070DD9C /* Products */,
Expand All @@ -96,6 +95,7 @@
84C757BB152A38770070DD9C /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928E91611471C008699F1 /* Social.framework */,
B9A416A916113F2D001E7A77 /* AdSupport.framework */,
DDA290A315ABA93700F533F9 /* FacebookSDK.framework */,
84A5DA9D15A68D1500FE54AF /* Accounts.framework */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
856DB03E153393C3006F6A33 = {
isa = PBXGroup;
children = (
85A928F016114738008699F1 /* Social.framework */,
856DB053153393C3006F6A33 /* SwitchUserSample */,
856DB04C153393C3006F6A33 /* Frameworks */,
856DB04A153393C3006F6A33 /* Products */,
Expand All @@ -119,6 +118,7 @@
856DB04C153393C3006F6A33 /* Frameworks */ = {
isa = PBXGroup;
children = (
85A928F016114738008699F1 /* Social.framework */,
B9A416B016113F3E001E7A77 /* AdSupport.framework */,
DD37EA6415ABA33D0015966B /* FacebookSDKResources.bundle */,
DD55EAA415AB9D1A000A64B8 /* FacebookSDK.framework */,
Expand Down
2 changes: 0 additions & 2 deletions src/FBFriendPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ - (void)viewDidLoad
self.tableView.delegate = self.selectionManager;
[self.dataSource bindTableView:self.tableView];
self.loader.tableView = self.tableView;

[FBUtility logInsightsEvent:@"_friendPickerLaunch" session:_session];
}

- (void)viewDidUnload {
Expand Down
6 changes: 1 addition & 5 deletions src/FBNativeDialogs.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,13 @@ + (BOOL)presentShareDialogModallyFrom:(UIViewController*)viewController

[composeViewController setCompletionHandler:^(SLComposeViewControllerResult result) {
BOOL cancelled = (result == SLComposeViewControllerResultCancelled);
NSString *eventToLog = cancelled ? @"_shareDialogCancel" : @"_shareDialogPost";
[FBUtility logInsightsEvent:eventToLog session:session];
if (handler) {
handler(cancelled ? FBNativeDialogResultCancelled : FBNativeDialogResultSucceeded, nil);
}
}];

[viewController presentModalViewController:composeViewController animated:YES];

[FBUtility logInsightsEvent:@"_shareDialogLaunch" session:session];


return YES;
}

Expand Down
2 changes: 0 additions & 2 deletions src/FBPlacePickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ - (void)viewDidLoad
self.tableView.delegate = self.selectionManager;
[self.dataSource bindTableView:self.tableView];
self.loader.tableView = self.tableView;

[FBUtility logInsightsEvent:@"_placePickerLaunch" session:_session];
}

- (void)viewDidUnload
Expand Down
3 changes: 0 additions & 3 deletions src/FBUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
withDefault:(NSString *)value
inBundle:(NSBundle *)bundle;

+ (void)logInsightsEvent:(NSString *)eventName
session:(FBSession *)session;

@end

#define FBConditionalLog(condition, desc, ...) \
Expand Down
102 changes: 0 additions & 102 deletions src/FBUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@

@implementation FBUtility

typedef enum {
AttributionIDSendNotChecked,
AttributionIDSendAllowed,
AttributionIDSendDisallowed
} AttributionIDSendStatus;

static AttributionIDSendStatus g_attributionIDSendStatus = AttributionIDSendNotChecked;

// finishes the parsing job that NSURL starts
+ (NSDictionary*)dictionaryByParsingURLQueryPart:(NSString *)encodedString {

Expand Down Expand Up @@ -153,98 +145,4 @@ + (NSString *)localizedStringForKey:(NSString *)key
return result;
}

+ (void)logInsightsEvent:(NSString *)eventName
session:(FBSession *)session {

NSString *appID = [FBSession defaultAppID];
if (!appID) {
return;
}

// Need to check whether attribution send is needed or allowed.
if (session || g_attributionIDSendStatus != AttributionIDSendNotChecked) {

// Have the information we need, send immediately.
[self sendInsightsEvent:eventName session:session];

} else {


NSString *pingPath = [NSString stringWithFormat:@"%@?fields=supports_attribution", appID, nil];
FBRequest *pingRequest = [[[FBRequest alloc] initWithSession:nil graphPath:pingPath] autorelease];

[pingRequest startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {

@try {

if (!error &&
[result respondsToSelector:@selector(objectForKey:)] &&
[[result objectForKey:@"supports_attribution"] boolValue]) {

g_attributionIDSendStatus = AttributionIDSendAllowed;

} else {

// Any error or malformed response winds up here.
g_attributionIDSendStatus = AttributionIDSendDisallowed;

}

[self sendInsightsEvent:eventName session:session];

} @catch (NSException *blockException) {

NSLog(@"Failure during logInsightsEvent ping callback: '%@'", blockException.reason);

}
}
];
}
}

+ (void)sendInsightsEvent:(NSString *)eventName
session:(FBSession *)session {

@try {

NSString *graphPath = [NSString stringWithFormat:@"%@/activities", [FBSession defaultAppID]];

NSString *attributionID = @"";
if (g_attributionIDSendStatus == AttributionIDSendAllowed) {
attributionID = [[UIPasteboard pasteboardWithName:@"fb_app_attribution" create:NO] string] ?: @"";
}

NSArray *customEvents = @[
@{ @"_eventName" : eventName }
];

NSError *myError = nil;
FBSBJSON *writer = [[FBSBJSON alloc] init];
NSString *customEventsJSON = [writer stringWithFragment:customEvents error:&myError];
FBConditionalLog(!myError, @"Shouldn't get a JSON encoding error");
[writer release];

NSDictionary *postParameters =
@{
@"event" : @"CUSTOM_APP_EVENTS",
@"attribution": attributionID,
@"custom_events" : customEventsJSON,
};

FBRequest *request = [[[FBRequest alloc] initWithSession:session
graphPath:graphPath
parameters:postParameters
HTTPMethod:@"POST"] autorelease];

// Fire and forget
[request startWithCompletionHandler:nil];

} @catch (NSException *exception) {

NSLog(@"Failure during sendInsightsEvent: '%@'", exception.reason);

}
}


@end

0 comments on commit ef58c14

Please sign in to comment.