-
Notifications
You must be signed in to change notification settings - Fork 6
/
facebook.cs
303 lines (226 loc) · 10.8 KB
/
facebook.cs
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
//
// MonoTouch bindings for Facebook iOS SDK
// use with libfacebook_ios_sdk.a
//
// Facebook Objective-C Source w/ MonoTouch modifications :
// https://github.com/kevinmcmahon/facebook-ios-sdk
//
// MIT X11 licensed
//
// Copyright 2011 Kevin McMahon (http://www.kevfoo.com)
//
// These bindings are for:
// https://github.com/kevinmcmahon/facebook-ios-sdk/commit/4dae61bc5eb8d01cbeea734cb305619675163ab2
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.UIKit;
namespace FacebookSdk
{
[BaseType (typeof (NSObject))]
interface Facebook {
//@property(nonatomic, copy) NSString* accessToken;
[Export ("accessToken", ArgumentSemantic.Copy)]
string AccessToken { get; set; }
//@property(nonatomic, copy) NSDate* expirationDate;
[Export ("expirationDate", ArgumentSemantic.Copy)]
NSDate ExpirationDate { get; set; }
//@property(nonatomic, assign) id<FBSessionDelegate> sessionDelegate;
[Export ("sessionDelegate", ArgumentSemantic.Assign)]
FBSessionDelegate SessionDelegate { get; set; }
//@property(nonatomic, copy) NSString* localAppId;
[Export ("localAppId", ArgumentSemantic.Copy)]
string LocalAppId { get; set; }
//- (id)initWithAppId:(NSString *)app_id;
[Export ("initWithAppId:")]
IntPtr Constructor (string app_id);
//- (void)authorize:(NSArray *)permissions delegate:(id<FBSessionDelegate>)delegate;
[Export ("authorize:delegate:")]
void Authorize (string[] permissions, FBSessionDelegate fbSessionDelegate);
//- (void)authorize:(NSArray *)permissions delegate:(id<FBSessionDelegate>)delegate localAppId:(NSString *)localAppId;
[Export ("authorize:delegate:localAppId:")]
void Authorize (string[] permissions, FBSessionDelegate fbSessionDelegate, string localAppId);
//- (BOOL)handleOpenURL:(NSURL *)url;
[Export ("handleOpenURL:")]
bool HandleOpenUrl (NSUrl url);
//- (void)logout:(id<FBSessionDelegate>)delegate;
[Export ("logout:")]
void Logout (FBSessionDelegate fbSessionDelegate);
//- (FBRequest*)requestWithParams:(NSMutableDictionary *)params andDelegate:(id <FBRequestDelegate>)delegate;
[Export ("requestWithParams:andDelegate:")]
FBRequest RequestWithParams (NSDictionary parms, FBRequestDelegate fbRequestDelegate);
//- (FBRequest*)requestWithMethodName:(NSString *)methodName andParams:(NSMutableDictionary *)params andHttpMethod:(NSString *)httpMethod andDelegate:(id <FBRequestDelegate>)delegate;
[Export ("requestWithMethodName:andParams:andHttpMethod:andDelegate:")]
FBRequest RequestWithMethodName (string methodName, NSDictionary parms, string httpMethod, FBRequestDelegate fbRequestDelegate);
//- (FBRequest*)requestWithGraphPath:(NSString *)graphPath andDelegate:(id <FBRequestDelegate>)delegate;
[Export ("requestWithGraphPath:andDelegate:")]
FBRequest RequestWithGraphPath (string graphPath, FBRequestDelegate fbRequestDelegate);
//- (FBRequest*)requestWithGraphPath:(NSString *)graphPath andParams:(NSMutableDictionary *)params andDelegate:(id <FBRequestDelegate>)delegate;
[Export ("requestWithGraphPath:andParams:andDelegate:")]
FBRequest RequestWithGraphPath (string graphPath, NSDictionary parms, FBRequestDelegate fbRequestDelegate);
//- (FBRequest*)requestWithGraphPath:(NSString *)graphPath andParams:(NSMutableDictionary *)params andHttpMethod:(NSString *)httpMethod andDelegate:(id <FBRequestDelegate>)delegate;
[Export ("requestWithGraphPath:andParams:andHttpMethod:andDelegate:")]
FBRequest RequestWithGraphPath (string graphPath, NSDictionary parms, string httpMethod, FBRequestDelegate fbRequestDelegate);
//- (void)dialog:(NSString *)action andDelegate:(id<FBDialogDelegate>)delegate;
[Export ("dialog:andDelegate:")]
void Dialog (string action, FBDialogDelegate fbDialogDelegate);
//- (void)dialog:(NSString *)action andParams:(NSMutableDictionary *)params andDelegate:(id <FBDialogDelegate>)delegate;
[Export ("dialog:andParams:andDelegate:")]
void Dialog (string action, NSDictionary parms, FBDialogDelegate fbDialogDelegate);
//- (BOOL)isSessionValid;
[Export ("isSessionValid")]
bool IsSessionValid { get; }
}
[Model]
[BaseType (typeof (NSObject))]
interface FBSessionDelegate {
//@optional- (void)fbDidLogin;
[Abstract, Export ("fbDidLogin")]
void FbDidLogin ();
//- (void)fbDidNotLogin:(BOOL)cancelled;
[Abstract, Export ("fbDidNotLogin:")]
void FbDidNotLogin (bool cancelled);
//- (void)fbDidLogout;
[Abstract, Export ("fbDidLogout")]
void FbDidLogout ();
}
[BaseType (typeof (NSObject))]
interface FBRequest {
//@property(nonatomic,assign) id<FBRequestDelegate> delegate;
[Export ("delegate", ArgumentSemantic.Assign)]
FBRequestDelegate Delegate { get; set; }
//@property(nonatomic,copy) NSString* url;
[Export ("url", ArgumentSemantic.Copy)]
string Url { get; set; }
//@property(nonatomic,copy) NSString* httpMethod;
[Export ("httpMethod", ArgumentSemantic.Copy)]
string HttpMethod { get; set; }
//@property(nonatomic,retain) NSMutableDictionary* params;
[Export ("params", ArgumentSemantic.Retain)]
NSDictionary Params { get; set; }
//@property(nonatomic,assign) NSURLConnection* connection;
[Export ("connection", ArgumentSemantic.Assign)]
NSUrlConnection Connection { get; set; }
//@property(nonatomic,assign) NSMutableData* responseText;
[Export ("responseText", ArgumentSemantic.Assign)]
NSMutableData ResponseText { get; set; }
//+ (NSString*)serializeURL:(NSString *)baseUrl params:(NSDictionary *)params;
[Static, Export ("serializeURL:params:")]
string SerializeUrl (string baseUrl, NSDictionary parms);
//+ (NSString*)serializeURL:(NSString *)baseUrl params:(NSDictionary *)params httpMethod:(NSString *)httpMethod;
[Static, Export ("serializeURL:params:httpMethod:")]
string SerializeUrl (string baseUrl, NSDictionary parms, string httpMethod);
//+ (FBRequest*)getRequestWithParams:(NSMutableDictionary *) params httpMethod:(NSString *) httpMethod delegate:(id<FBRequestDelegate>)delegate requestURL:(NSString *) url;
[Static, Export ("getRequestWithParams:httpMethod:delegate:requestURL:")]
FBRequest GetRequestWithParams (NSDictionary parms, string httpMethod, FBRequestDelegate fbRequestDelegate, string url);
//- (BOOL) loading;
[Export ("loading")]
bool Loading { get; }
//- (void) connect;
[Export ("connect")]
void Connect ();
}
[Model]
[BaseType (typeof (NSObject))]
interface FBRequestDelegate {
//@optional- (void)requestLoading:(FBRequest *)request;
[Abstract, Export ("requestLoading:")]
void RequestLoading (FBRequest request);
//- (void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response;
[Abstract, Export ("request:didReceiveResponse:")]
void Request (FBRequest request, NSUrlResponse response);
//- (void)request:(FBRequest *)request didFailWithError:(NSError *)error;
[Abstract, Export ("request:didFailWithError:")]
void Request (FBRequest request, NSError error);
//- (void)request:(FBRequest *)request didLoad:(id)result;
[Abstract, Export ("request:didLoad:")]
void Request (FBRequest request, NSObject result);
//- (void)request:(FBRequest *)request didLoadRawResponse:(NSData *)data;
[Abstract, Export ("request:didLoadRawResponse:")]
void Request (FBRequest request, NSData data);
}
[BaseType (typeof (UIView))]
interface FBDialog {
//@property(nonatomic,assign) id<FBDialogDelegate> delegate;
[Export ("delegate", ArgumentSemantic.Assign)]
FBDialogDelegate Delegate { get; set; }
//@property(nonatomic, retain) NSMutableDictionary* params;
[Export ("params", ArgumentSemantic.Retain)]
NSDictionary Params { get; set; }
//@property(nonatomic,copy) NSString* title;
[Export ("title", ArgumentSemantic.Copy)]
string Title { get; set; }
//- (NSString *) getStringFromUrl: (NSString*) url needle:(NSString *) needle;
[Export ("getStringFromUrl:needle:")]
string GetStringFromUrl (string url, string needle);
//- (id)initWithURL: (NSString *) loadingURL params: (NSMutableDictionary *) params delegate: (id <FBDialogDelegate>) delegate;
[Export ("initWithURL:params:delegate:")]
IntPtr Constructor (string loadingURL, NSDictionary parms, FBDialogDelegate fbDialogDelegate);
//- (void)show;
[Export ("show")]
void Show ();
//- (void)load;
[Export ("load")]
void Load ();
// get:(NSDictionary*)getParams;
[Export ("getParams")]
NSDictionary GetParams { get; }
//- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated;
[Export ("dismissWithSuccess:animated:")]
void DismissWithSuccess (bool success, bool animated);
//- (void)dismissWithError:(NSError*)error animated:(BOOL)animated;
[Export ("dismissWithError:animated:")]
void DismissWithError (NSError error, bool animated);
//- (void)dialogWillAppear;
[Export ("dialogWillAppear")]
void DialogWillAppear ();
//- (void)dialogWillDisappear;
[Export ("dialogWillDisappear")]
void DialogWillDisappear ();
//- (void)dialogDidSucceed:(NSURL *)url;
[Export ("dialogDidSucceed:")]
void DialogDidSucceed (NSUrl url);
//- (void)dialogDidCancel:(NSURL *)url;
[Export ("dialogDidCancel:")]
void DialogDidCancel (NSUrl url);
}
[Model]
[BaseType (typeof (NSObject))]
interface FBDialogDelegate {
//@optional- (void)dialogDidComplete:(FBDialog *)dialog;
[Abstract, Export ("dialogDidComplete:")]
void DialogDidComplete (FBDialog dialog);
//- (void)dialogCompleteWithUrl:(NSURL *)url;
[Abstract, Export ("dialogCompleteWithUrl:")]
void DialogCompleteWithUrl (NSUrl url);
//- (void)dialogDidNotCompleteWithUrl:(NSURL *)url;
[Abstract, Export ("dialogDidNotCompleteWithUrl:")]
void DialogDidNotCompleteWithUrl (NSUrl url);
//- (void)dialogDidNotComplete:(FBDialog *)dialog;
[Abstract, Export ("dialogDidNotComplete:")]
void DialogDidNotComplete (FBDialog dialog);
//- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError *)error;
[Abstract, Export ("dialog:didFailWithError:")]
void Dialog (FBDialog dialog, NSError error);
//- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL *)url;
[Abstract, Export ("dialog:shouldOpenURLInExternalBrowser:")]
bool Dialog (FBDialog dialog, NSUrl url);
}
[BaseType (typeof (FBDialog))]
interface FBLoginDialog {
//-(id) initWithURL:(NSString *) loginURL loginParams:(NSMutableDictionary *) params delegate:(id <FBLoginDialogDelegate>) delegate;
[Export ("initWithURL:loginParams:delegate:")]
IntPtr Constructor (string loginURL, NSDictionary parms, FBLoginDialogDelegate fbLoginDialogDelegate);
}
[Model]
[BaseType (typeof (NSObject))]
interface FBLoginDialogDelegate {
//- (void)fbDialogLogin:(NSString*)token expirationDate:(NSDate*)expirationDate;
[Abstract, Export ("fbDialogLogin:expirationDate:")]
void FbDialogLogin (string token, NSDate expirationDate);
//- (void)fbDialogNotLogin:(BOOL)cancelled;
[Abstract, Export ("fbDialogNotLogin:")]
void FbDialogNotLogin (bool cancelled);
}
}