Skip to content

Commit

Permalink
Step 17.10: Create linkFacebook method in phone service
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbasic committed Oct 16, 2017
1 parent e8ad8d7 commit f402102
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/services/phone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@ export class PhoneService {
});
}

linkFacebook(): Promise<any> {
return new Promise((resolve, reject) => {
const options = {
requestPermissions: ['public_profile', 'user_friends', 'email']
};

// TODO: add link-accounts types to meteor typings
(<any>Meteor).linkWithFacebook(options, (error: Error) => {
if (error) {
reject(new Error(error.message));
} else {
resolve();
}
});
});
}

logout(): Promise<void> {
return new Promise<void>((resolve, reject) => {
Meteor.logout((e: Error) => {
Expand Down

0 comments on commit f402102

Please sign in to comment.