Title: Flutter App connection
Last modified: June 18, 2020

---

# Flutter App connection

 *  Resolved [matteo raggi](https://wordpress.org/support/users/whichtransfers/)
 * (@whichtransfers)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/flutter-app-connection/)
 * hi, if I want to ake an ios and android app with FLUTTER language, how could 
   I do social login trough that code too and not only trough the wordpress website?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fflutter-app-connection%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Ramona](https://wordpress.org/support/users/nextend_ramona/)
 * (@nextend_ramona)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/flutter-app-connection/#post-13005054)
 * Hi [@whichtransfers](https://wordpress.org/support/users/whichtransfers/)
 * The part of the registration that Nextend Social Login’s REST API can help you
   with is checking if there’s any user in your site who has already registered 
   with the currently used social account. _Everything else must be done with custom
   coding._
 * Before continuing please note that **we can not provide support for custom coding**!
 * Let’s say someone tries to register/login via Google. This is the process you’ll
   need to achieve:
 * 1) Communication between the user and your mobile app
    You need to create a way
   for the user to communicate with Google API. (Basically a way to display the 
   authentication and authorization window. So the user will be able to login and
   authorize your Google App. Once the user logged in and authorized your app, it
   will return an access token, which is used for the validation.
 * 2) “User validation”
    Once you have the access token you can use this to communicate
   with Nextend Social Login (NSL) which will check whether there’s any user registered
   to your site with the given access token. Nextend Social Login REST Api endpoints:
   Method: POST /wp-json/nextend-social-login/v1/google/get_user For example: [https://example.com/wp-json/nextend-social-login/v1/google/get_user](https://example.com/wp-json/nextend-social-login/v1/google/get_user)
   the file itself can be found here: wp-content/plugins/nextend-facebook-connectNSL/
   REST.php if you would like to check it.
 * POST Args:
    access_token > NSL needs the access token as a JSON, like these: 
   [https://gist.github.com/nextend/b733d402ee2e2cee59b632f6e4741a9d](https://gist.github.com/nextend/b733d402ee2e2cee59b632f6e4741a9d)
 * So I would suggest checking your OAuth 2 access token if it is correct or not.
   We also have a Test form code snippet, what you could use for this purpose. So
   you could try posting your access token via the test form:
    [https://gist.github.com/nextend/4d3c701c8d99972824025e4dfdeccac0](https://gist.github.com/nextend/4d3c701c8d99972824025e4dfdeccac0)
   Important: You need to replace the “xyz.com” with your own domain.
 * Once the Access Token is posted the endpoint it can return either:
    Success -
   > status 200 -> json encoded WP user id, for example: “44” Fail -> if the status
   code isn’t 200 then an error happened -> For example: {“code”:”error”,”message”:”
   The access token could not be decrypted”,”data”:null}
 * 3a) Access token found – Login process
    If NSL returns the WordPress user ID 
   you’ll need to log them in to your mobile app.
 * 3b) Access token not found – Registration process
    If NSL did not find any user
   with the given access token, you need to create a new WordPress user using WordPress’
   REST API. Then log them in and you can link the user with the social provider.
 * These codes can be helpful at the 3rd step: [https://gist.github.com/nextend/012ca54957e27dbea952fc42195fb0d1](https://gist.github.com/nextend/012ca54957e27dbea952fc42195fb0d1)
   
   for linking the social account to the WordPress user. line 1-11: will verify 
   that the access token is valid, if it is valid it will retrieve the social user
   id ( this ISN’T the WordPress user id! ) line 13-16: will connect the social 
   provider account with the WordPress user ID.
 *  [maniwp001](https://wordpress.org/support/users/maniwp001/)
 * (@maniwp001)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/flutter-app-connection/#post-13326568)
 * Hi [@nextend_ramona](https://wordpress.org/support/users/nextend_ramona/)
 * Thank you so much for this plugin. Could you please help me out here?
    Where 
   do I add following code to link the user with the social provider?
 * [https://gist.github.com/nextend/012ca54957e27dbea952fc42195fb0d1](https://gist.github.com/nextend/012ca54957e27dbea952fc42195fb0d1)
 * Looking forward for your prompt response.
 *  Plugin Support [Laszlo](https://wordpress.org/support/users/laszloszalvak/)
 * (@laszloszalvak)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/flutter-app-connection/#post-13327921)
 * Hi [@maniwp001](https://wordpress.org/support/users/maniwp001/)
 * I am sorry, but as my colleague mentioned above we can not provide support for
   custom coding.
    Anyways you should run this code, when you passed the user’s 
   access token to Nextend Social Login’s REST API and it didn’t manage to find 
   any users on your site with the given access token. So basically after the registration.
 * Note:
    Since the usage of our REST API was a common topic, we have already created
   a documentation that I am sure you will find useful. If you are interested you
   can find the documentation of our REST API here:
    - [https://nextendweb.com/nextend-social-login-docs/nextend-social-login-rest-api/](https://nextendweb.com/nextend-social-login-docs/nextend-social-login-rest-api/)
 * The part you are interested in, can be found under the “How can I use the REST
   API in my application?” section at the 3rd point.
 * Best regards,
    Laszlo.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Flutter App connection’ is closed to new replies.

 * ![](https://ps.w.org/nextend-facebook-connect/assets/icon.svg?rev=3336394)
 * [Nextend Social Login and Register](https://wordpress.org/plugins/nextend-facebook-connect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextend-facebook-connect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextend-facebook-connect/)
 * [Active Topics](https://wordpress.org/support/plugin/nextend-facebook-connect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextend-facebook-connect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextend-facebook-connect/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [Laszlo](https://wordpress.org/support/users/laszloszalvak/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/flutter-app-connection/#post-13327921)
 * Status: resolved