Page 1 of 2

appery login after facebook oauth

Posted: Wed Sep 10, 2014 1:26 pm
by Michael4771079

Looking for guidence on this as it not included in the tutorial

I have the oauth facebook login working and I need to use the response to login to appery.io db.

(the User name and User email are showing in alert on screen after fb login "User name: xxxxxx User email: xxxxxxx@zzzzzzzzz)

I added 2 response paramaters to the fb Post service and mapped them to textinputs on the screen, but there not showing?

unsure if this is the correct approach.

the service does work as I can see the message posted on the timeline and the user name and email are alerts on the screen

Here are some screenshots

Image

Image

Image


appery login after facebook oauth

Posted: Wed Sep 10, 2014 8:49 pm
by Kateryna Grynko

Hi Michael,

Could you please post a screenshot of service response in browser network tab?


appery login after facebook oauth

Posted: Wed Sep 10, 2014 9:00 pm
by Michael4771079

Hi Katya,
how can I show you this in browser, it only works on device, and shows nothing in wienre on iphone


appery login after facebook oauth

Posted: Wed Sep 10, 2014 9:13 pm
by Michael4771079

Katya,
this is network tab in wienre and the graph service is ok, but return doesnt show in app, happy to show anything you think will help.

thanks

Image


appery login after facebook oauth

Posted: Thu Sep 11, 2014 2:49 am
by Yurii Orishchuk

Hi Michael,

Please show us following screen shots:

  1. Show screen shot with service request: http://prntscr.com/4loun7/direct

  2. Your service "settings" tab and "request" tab.

    Regards.


appery login after facebook oauth

Posted: Thu Sep 11, 2014 10:33 am
by Michael4771079

Hi,
here are the screenshots requested

thanks

http://prntscr.com/4loun7/direct is just blank when clicked

Image Image Image


appery login after facebook oauth

Posted: Thu Sep 11, 2014 6:19 pm
by Michael4771079

Hi Katya,
any idea whats wrong here?


appery login after facebook oauth

Posted: Fri Sep 12, 2014 1:23 am
by Yurii Orishchuk

Hi Michael,

Here is what you have to do to get your service work:

1 Open "getFeed" service settings.

2 Set URL with following value: http://prntscr.com/4lz9ui/direct

pre

https://graph.facebook.com/me/feed

/pre

3 Navigate to request tab and add "access_token" request parameter. http://prntscr.com/4lzaat/direct

4 Open this service datasource mapping and navigate to request tab. Then add link from "accessToken" lsv to "access_token" request parameter. http://prntscr.com/4lzazg/direct

That's all in this case your service should work.

Also you can add "success" event handler for this datasource and populate it with following code:

pre

//This will print response to console.
console.log(data);

/pre

Regards.


appery login after facebook oauth

Posted: Fri Sep 12, 2014 1:42 pm
by Michael4771079

Hi,
I dont have a getFeed service although I can create it,
after fb login access_token is returned in an alert with this code

codeOAuth.popup('facebook', function(error, result) {
if (error) {
alert(error); // do something with error
return;
}

result.get('/me').done(function(data) {

Code: Select all

 alert("User name: " + data.name + ". User email: " + data.email); 

  facebook_service.execute({data:{ 
      "user_id":data.id, "access_token":result.access_token 

  }}); 

});
});/code

and on success of facebookRest service (message to timeline) with the following

Image

I tried to save access token to lsv by adding the following pice of code to the above and tested in weinre, but after alerts I just get the spinner spinning

Image

How do I save the access token from the returned alert to lsv?


appery login after facebook oauth

Posted: Sat Sep 13, 2014 10:13 am
by Michael4771079

can anyone help here?

thanks