Skip to content

Commit

Permalink
native cordova facebook login
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Aug 12, 2015
1 parent ee55deb commit fb3dfa4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .meteor/cordova-plugins
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
com.ionic.keyboard@https://github.com/driftyco/ionic-plugin-keyboard/tarball/66926f5e25fcd71b65799adaf12fa0b2df65ce78
com.ionic.keyboard@https://github.com/driftyco/ionic-plugin-keyboard/tarball/66926f5e25fcd71b65799adaf12fa0b2df65ce78
[email protected]
31 changes: 20 additions & 11 deletions client/views/login/services.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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'
10 changes: 5 additions & 5 deletions mobile-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
// });
// Pass preferences for a particular PhoneGap/Cordova plugin
App.configurePlugin('com.phonegap.plugins.facebookconnect', {
APP_NAME: 'Rocket.Chat',
APP_ID: '835103589938459'
});

0 comments on commit fb3dfa4

Please sign in to comment.