Permalink
Browse files

Step 17.10: Create linkFacebook method in phone service

  • Loading branch information...
darkbasic committed Jun 9, 2017
1 parent 4c0c566 commit d7d5c0b5d3d01db9ca6dc62beb08da87586c9002
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/services/phone.ts
View
@@ -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) => {

0 comments on commit d7d5c0b

Please sign in to comment.