line / flutter_line_sdk

A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.
https://developers.line.biz/
Apache License 2.0
213 stars 42 forks source link

how to get line email? #57

Closed Selecao closed 2 years ago

Selecao commented 2 years ago

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?

_Originally posted by @Selecao in https://github.com/line/flutter_line_sdk/issues/46#issuecomment-1109795855_

Selecao commented 2 years ago

Is it something wrong with your scopes after successfull login? Why Flutter console display that i have no email scopes after login, but when i logged there was a field with "profile", "openid", "email" final lineScopes = loginResult.scopes.join(', '); // => openid, profile Line developer console: Email address permission: Applied I'm using this sdk to login in mobile app with Line

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.5, on Ubuntu 20.04.4 LTS 5.13.0-40-generic, locale ru_RU.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] Connected device (3 available) [✓] HTTP Host Availability tested on: Android 11 RKQ1.200826.002 phone: Xiaomi Poco F2 Pro

Selecao commented 2 years ago

Screenshot_2022-04-29-14-16-02-050_com android chrome

but when i logged there was a field with "profile", "openid", "email"

onevcat commented 2 years ago

Please see the comment in https://github.com/line/flutter_line_sdk/issues/46#issuecomment-1120541491