-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFacebookHelpers.m
96 lines (64 loc) · 1.92 KB
/
FacebookHelpers.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//
// FacebookHelpers.m
// AvocadoTest1
//
// Created by Jake on 12-04-16.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "FacebookHelpers.h"
@implementation FacebookHelpers
@synthesize facebook;
static FacebookHelpers *facebookHelpers;
+(FacebookHelpers*)facebookHelpers
{
@synchronized([FacebookHelpers class])
{
if (!facebookHelpers)
facebookHelpers = [[self alloc] init];
return facebookHelpers;
}
return nil;
}
-(id)init
{
self = [super init];
if (self)
{
facebook = [[Facebook alloc] initWithAppId:@"24287653320" andDelegate:self];
}
return self;
}
-(void)postToFacebook
{
NSString *appID = @"24287653320";
NSString *primaryLink = @"http://itunes.apple.com/us/app/pita-factory/id503487275?ls=1&mt=8";
NSString *appName = @"Pita Factory";
NSString *caption = @"Om nom nom";
NSString *description = @"Order Pitas through your phone and never get out a piece of plastic again!";
NSString *actionJSON = @"{\"name\" : \"Download\", \"link\": \"http://itunes.apple.com/us/app/pita-factory/id503487275?ls=1&mt=8\"}";
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
appID, @"app_id",
primaryLink, @"link",
appName, @"name",
caption, @"caption",
description, @"description",
actionJSON, @"actions",
nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];
}
- (void)fbDidLogin {
}
-(void)fbDidLogout
{
}
-(void)fbDidNotLogin:(BOOL)cancelled
{
}
- (void)fbDidExtendToken:(NSString*)accessToken
expiresAt:(NSDate*)expiresAt
{
}
- (void)fbSessionInvalidated
{
}
@end