Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova facebook login #459

Merged
merged 2 commits into from
Aug 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
com.phonegap.plugins.facebookconnect@https://github.com/Wizcorp/phonegap-facebook-plugin/tarball/0e61babb65bc1716b957b6294c7fdef3ce6ace79
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'
});