Giter VIP home page Giter VIP logo

Comments (6)

onevcat avatar onevcat commented on August 29, 2024 1

The Email is contained in the idToken in the "email" field, if the user set it in LINE. You can use this code to get it:

final result = await LineSDK.instance.login(scopes: ["profile", "openid", "email"]);
final idToken = result.accessToken.idToken;
final userEmail = (idToken != null) ? idToken['email'] : null;

Please be careful since the user can choose to not share his/her email with you, or he/she might even not yet set an email address bound to the LINE account, this value could be null and you have to consider a way to handle it.

It is now a bit hard to use and not obvious. We will soon add a getter for the email address and release a new version for it.

from flutter_line_sdk.

Selecao avatar Selecao commented on August 29, 2024

If using this SDK we can get lineUserId:

final loginResult = await LineSDK.instance.login(scopes: ["profile", "openid", "email"]);
final lineUserId = loginResult.userProfile?.userId;

How we can get lineEmail?

from flutter_line_sdk.

onevcat avatar onevcat commented on August 29, 2024

Per #58, once it gets merged, you can use the email to get it:

final result = await LineSDK.instance.login(scopes: ["profile", "openid", "email"]);
final userEmail = result.accessToken.email;

from flutter_line_sdk.

Selecao avatar Selecao commented on August 29, 2024

Per #58, once it gets merged, you can use the email to get it:

final result = await LineSDK.instance.login(scopes: ["profile", "openid", "email"]);
final userEmail = result.accessToken.email;

@onevcat there is no field .email after merging (already merged right?) but result.accessToken.idToken?['email'] has what i need, thank you!

from flutter_line_sdk.

onevcat avatar onevcat commented on August 29, 2024

Sorry for the confusion, it is not tagged/released yet. I meant you can use it from the next version of flutter_line_sdk. I will prepare a tag for it today but it should be totally fine to just use your current way. They are the same.

from flutter_line_sdk.

onevcat avatar onevcat commented on August 29, 2024

Version 2.2.0 was just released with this change. Find more in the pub.dev or repo release page.

from flutter_line_sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.