diff --git a/.meteor/cordova-plugins b/.meteor/cordova-plugins index 029983507c2e3..9ac5d034274fc 100644 --- a/.meteor/cordova-plugins +++ b/.meteor/cordova-plugins @@ -1 +1,2 @@ -com.ionic.keyboard@https://github.com/driftyco/ionic-plugin-keyboard/tarball/66926f5e25fcd71b65799adaf12fa0b2df65ce78 \ No newline at end of file +com.ionic.keyboard@https://github.com/driftyco/ionic-plugin-keyboard/tarball/66926f5e25fcd71b65799adaf12fa0b2df65ce78 +com.phonegap.plugins.facebookconnect@https://github.com/Wizcorp/phonegap-facebook-plugin/tarball/0e61babb65bc1716b957b6294c7fdef3ce6ace79 diff --git a/client/views/login/services.coffee b/client/views/login/services.coffee index 0112f2a12c2c2..b70288a7b79b4 100644 --- a/client/views/login/services.coffee +++ b/client/views/login/services.coffee @@ -29,17 +29,26 @@ Template.loginServices.events 'click .external-login': -> return unless this.service? - loginWithService = "loginWith" + (if this.service is 'meteor-developer' then 'MeteorDeveloperAccount' else _.capitalize(this.service)) + # login with native facebook app + if Meteor.isCordova and this.service is 'facebook' + facebookConnectPlugin.login ["public_profile"], -> + FlowRouter.go 'index' + , (error) -> + console.log JSON.stringify error, null, ' ' + toastr.error error.errorCode + ' - ' + error.errorMessage + return + else + loginWithService = "loginWith" + (if this.service is 'meteor-developer' then 'MeteorDeveloperAccount' else _.capitalize(this.service)) - serviceConfig = {} + serviceConfig = {} - Meteor[loginWithService] serviceConfig, (error) -> - if error?.error is 'github-no-public-email' - alert t("github_no_public_email") - return + Meteor[loginWithService] serviceConfig, (error) -> + if error?.error is 'github-no-public-email' + alert t("github_no_public_email") + return - console.log error - if error - toastr.error error.message - return - FlowRouter.go 'index' + console.log error + if error + toastr.error error.message + return + FlowRouter.go 'index' diff --git a/mobile-config.js b/mobile-config.js index cacad969310ff..da228bc838424 100644 --- a/mobile-config.js +++ b/mobile-config.js @@ -54,8 +54,8 @@ App.setPreference('StatusBarBackgroundColor', '#000000'); App.setPreference('ShowSplashScreenSpinner', false); App.accessRule('*'); -// // Pass preferences for a particular PhoneGap/Cordova plugin -// App.configurePlugin('com.phonegap.plugins.facebookconnect', { -// APP_ID: '1234567890', -// API_KEY: 'supersecretapikey' -// }); \ No newline at end of file +// Pass preferences for a particular PhoneGap/Cordova plugin +App.configurePlugin('com.phonegap.plugins.facebookconnect', { + APP_NAME: 'Rocket.Chat', + APP_ID: '835103589938459' +});