-
Notifications
You must be signed in to change notification settings - Fork 43
/
CordovaFacebook.ts
29 lines (27 loc) · 982 Bytes
/
CordovaFacebook.ts
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
module CC {
export class CordovaFacebook {
constructor(private appId: string) {
}
login(successcb?: (r: any) => void, failcb?: (err: any) => void) {
(<any>window).cordova.exec(
(response) => {
console.log("login call successful");
if (successcb) successcb(response);
},
(err) => {
console.log("login call failed with error: " + err);
if (failcb) failcb(err);
}, "CordovaFacebook", "login", []);
}
logout(successcb?: (r: any) => void) {
(<any>window).cordova.exec(
(response) => {
console.log("logout call successful");
if (successcb) successcb(response);
},
(err) => {
console.log(err)
}, "CordovaFacebook", "logout", []);
}
}
}