Skip to content

Commit bdbcaef

Browse files
authored
Merge pull request #1 from wouter-veeken/fix-english-v1.0
Edit English for reference docs
2 parents 02750cb + 9519f81 commit bdbcaef

11 files changed

+131
-122
lines changed

ios/flutter_line_sdk.podspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Pod::Spec.new do |s|
22
s.name = 'flutter_line_sdk'
33
s.version = '1.0.0'
4-
s.summary = 'A Flutter plugin for allowing users to use the native LINE SDKs with Dart in Flutter apps.'
4+
s.summary = 'A Flutter plugin for using the LINE SDKs with Dart in Flutter apps.'
55
s.description = <<-DESC
6-
A Flutter plugin for allowing users to use the native LINE SDKs with Dart in Flutter apps.
6+
A Flutter plugin using the LINE SDKs with Dart in Flutter apps.
77
DESC
88
s.homepage = 'https://developers.line.biz'
99
s.license = { :file => '../LICENSE' }
@@ -19,4 +19,3 @@ A Flutter plugin for allowing users to use the native LINE SDKs with Dart in Flu
1919

2020
s.ios.deployment_target = '10.0'
2121
end
22-

lib/flutter_line_sdk.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020
//
2121

22-
/// A Flutter plugin for allowing users to use the native LINE SDKs with Dart in Flutter apps.
22+
/// A Flutter plugin for using the LINE SDKs with Dart in Flutter apps.
2323
///
24-
/// This package is a Dart/Flutter compatible wrapper for using the native LINE SDK Swift and
25-
/// LINE SDK Android in your flutter app. To use this plugin and LINE related APIs, you need to
26-
/// register a channel on [LINE Developers Site](https://developers.line.biz/en/) first and setup
27-
/// everything in the LINE Developers console.
28-
///
29-
/// For more, read the [Getting started with LINE Login](https://developers.line.biz/en/docs/line-login/getting-started/)
30-
/// guide.
24+
/// This package is a Dart/Flutter compatible wrapper for using the
25+
/// [LINE SDK for iOS Swift](https://developers.line.biz/en/docs/ios-sdk/swift/overview/) and
26+
/// [LINE SDK for Android](https://developers.line.biz/en/docs/android-sdk/overview/) in your
27+
/// Flutter app.
28+
29+
/// To use this plugin and LINE's APIs, you need to register and configure a channel in the
30+
/// [LINE Developers console](https://developers.line.biz/console/). For details, see
31+
/// [Getting started with LINE Login](https://developers.line.biz/en/docs/line-login/getting-started/).
3132
///
32-
/// As an overview, after you install this flutter_line_sdk package, you still need to config
33-
/// your Xcode Runner project as well as the Android build.gradle file with your channel i
34-
/// nformation. Please read the "Linking your app to your channel" section for both
33+
/// After installing this flutter_line_sdk package, update your Xcode Runner project and Android
34+
/// `build.gradle` file with your channel information. For details, see the "Linking your app to
35+
/// your channel" section in our setup guides for
3536
/// [iOS](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/) and
36-
/// [Android](https://developers.line.biz/en/docs/android-sdk/integrate-line-login/) to setup
37-
/// your project.
37+
/// [Android](https://developers.line.biz/en/docs/android-sdk/integrate-line-login/).
3838
///
39-
/// After that, you can use an `import` directive to include flutter_line_sdk to your project and
40-
/// call `await LineSDK.instance.setup($channel_id);` to setup the plugin. For the most basic use case, you can
41-
/// invoke the `login` method to make your users login with their LINE accounts.
39+
/// After that, use an `import` directive to include flutter_line_sdk in your project and call
40+
/// `await LineSDK.instance.setup($channel_id);` to set up the plugin. For the most basic use case,
41+
/// invoke the `login` method to prompt your users to log in with their LINE accounts.
4242
///
4343
library flutter_line_sdk;
4444

@@ -53,4 +53,4 @@ part 'src/model/login_option.dart';
5353
part 'src/model/login_result.dart';
5454
part 'src/model/stored_access_token.dart';
5555
part 'src/model/user_profile.dart';
56-
part 'src/model/bot_friendship_status.dart';
56+
part 'src/model/bot_friendship_status.dart';

lib/src/line_sdk.dart

Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,54 @@
2020
//
2121

2222
/// {@template error_handling}
23-
/// This method just redirects the work to the native LINE SDK. If any error happens during the native process,
24-
/// a [PlatformException] will be thrown. You can check [PlatformException.code] and [PlatformException.message]
25-
/// for detail information of an error. However, since the implementation in native side is different on iOS and
26-
/// Android, the error code and message could be different too. See [LineSDKError](https://developers.line.biz/en/reference/ios-sdk-swift/Enums/LineSDKError.html)
27-
/// on iOS and [LineApiError](https://developers.line.biz/en/reference/android-sdk/reference/com/linecorp/linesdk/LineApiError.html) on Android
28-
/// to get more information about error handling.
23+
/// This method redirects calls to the LINE SDK for the relevant native platform (iOS or Android).
24+
/// If an error happens in the native platform, a [PlatformException] is thrown. See
25+
/// [PlatformException.code] and [PlatformException.message] for error details.
26+
///
27+
/// The LINE SDK implementation differs between iOS and Android, which means error codes and messages
28+
/// can also be different. For platform-specific error information, see
29+
/// [LineSDKError](https://developers.line.biz/en/reference/ios-sdk-swift/Enums/LineSDKError.html)
30+
/// (iOS) and
31+
/// [LineApiError](https://developers.line.biz/en/reference/android-sdk/reference/com/linecorp/linesdk/LineApiError.html)
32+
/// (Android).
2933
/// {@endtemplate}
3034
3135
part of flutter_line_sdk;
3236

33-
/// A general manager class for LINE SDK Login features.
37+
/// A general manager class for LINE SDK login features.
3438
///
35-
/// Don't create your own instance of this. Instead, call [LineSDK.instance] to get
36-
/// a shared singleton and call other methods on it.
39+
/// Don't create your own instance of this class. Instead, call [LineSDK.instance] to get a shared
40+
/// singleton on which you can call other methods.
3741
class LineSDK {
3842

39-
/// The method channel connected to native side of the LINE SDK.
43+
/// The method channel connected to the native side of the LINE SDK.
4044
///
41-
/// Normally you should not use this channel directly. Instead, call the public methods on
42-
/// this `LineSDK` class.
45+
/// Don't use this channel directly. Instead, call the public methods on the [LineSDK] class.
4346
static const MethodChannel channel =
4447
const MethodChannel('com.linecorp/flutter_line_sdk');
4548

4649
/// The shared singleton object of `LineSDK`.
4750
///
48-
/// Always use this instance to interact with the login process of the LINE SDK.
51+
/// Always use this instance (rather than a self-created instance) to interact with the login
52+
/// process of the LINE SDK.
4953
static final LineSDK instance = LineSDK._();
5054

5155
LineSDK._();
5256

53-
/// Sets up the SDK with [channelId] and an optional [universalLink].
57+
/// Sets up the SDK with a [channelId] and optional [universalLink].
5458
///
55-
/// This method should be called once and only once, before any other methods in LineSDK.
56-
/// You can find your [channelId] in the [LINE Developers Site](https://developers.line.biz/).
59+
/// This method should be called once and only once, before any other methods in [LineSDK].
60+
/// Find your [channelId] in the [LINE Developers Console](https://developers.line.biz/console).
5761
///
58-
/// If you need to navigate from LINE back to your app by universal link, you also need to
59-
/// set it in the LINE Developers Site, prepare your server and domain to handle the URL, then
60-
/// pass the URL in [universalLink]. For more about it, check the
61-
/// [Universal Links support](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/)
62-
/// section in documentation. If you do not pass a [universalLink] value in this method, LINE SDK
63-
/// will use the traditional URL scheme to open your app when using the LINE app to login.
62+
/// If you need to navigate from LINE back to your app via a universal link, you must also:
63+
/// 1. Specify the link URL in the LINE Developers Console
64+
/// 2. Prepare your server and domain to handle the URL
65+
/// 3. Pass the URL in [universalLink].
66+
///
67+
/// For more about this, see the section "Universal Links support" in
68+
/// [Setting up your project](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/).
69+
/// If you don't pass a [universalLink] in this method, LINE SDK will use the traditional URL
70+
/// scheme to open your app when logging in through LINE.
6471
Future<void> setup(String channelId, {String universalLink}) async {
6572
await channel.invokeMethod(
6673
'setup',
@@ -71,22 +78,26 @@ class LineSDK {
7178
);
7279
}
7380

74-
/// Logs in to the LINE Platform with the specified [scopes] and [option], by either opening the LINE app
75-
/// for existing logged in user there or a web view if LINE app is not installed on user's device.
81+
/// Logs the user into LINE with the specified [scopes] and [option], by either opening the
82+
/// LINE client for an existing logged in user, or a web view if the LINE client isn't installed
83+
/// on the user's device.
7684
///
77-
/// By default, the login process will use only `"profile"` as its required scope. If you need other scopes
78-
/// send all of them (including the default `"profile"`) as a list to [scopes].
85+
/// By default, the login process uses only `"profile"` as its required scope. If you need
86+
/// more scopes, put the ones you want (in addition to the default `"profile"`) in [scopes] as a
87+
/// list.
7988
///
80-
/// If the value of [scopes] contains `"profile"`, the user profile will be retrieved during the login process
81-
/// and contained in the [LoginResult.userProfile] property in the result value. Otherwise, it will be null.
89+
/// If [scopes] contains `"profile"`, the user profile is returned in the result as
90+
/// [LoginResult.userProfile]. If `"profile"` is not included, the value of [LoginResult.userProfile]
91+
/// will be null.
8292
///
83-
/// An access token will be issued if the user authorizes your app. This token and a refresh token will be automatically
84-
/// stored in a secured place in your app for later use. You do not need to refresh the access token manually because
85-
/// any following API calls will attempt to refresh the access token if necessary. However, if you would like to refresh
86-
/// the access token manually, use [refreshToken()].
93+
/// An access token is issued if the user authorizes your app. This token, along with a refresh
94+
/// token, is automatically stored in a secure place in your app for later use. You don't need to
95+
/// refresh the access token manually. Any following API calls will try to refresh the access
96+
/// token when necessary. However, you can refresh the access token manually with [refreshToken()].
8797
///
88-
/// You can control some other login behaviors, like whether only trying to login with web page or what the approch
89-
/// being used for bot prompting. To do that, create a proper [LoginOption] object and pass it to the [option] parameter.
98+
/// You can control some other login behaviors, like whether to use a web page for login, or how
99+
/// to ask the user to add your bot as a friend. To do so, create a [LoginOption] object and pass
100+
/// it to the [option] parameter.
90101
///
91102
/// {@macro error_handling}
92103
Future<LoginResult> login(
@@ -115,12 +126,12 @@ class LineSDK {
115126

116127
/// Gets the current access token in use.
117128
///
118-
/// This returns a `Future<StoredAccessToken>` and the access token value in use is contained
119-
/// in the result [StoredAccessToken.value].
129+
/// This returns a `Future<StoredAccessToken>`, with the access token value contained in the
130+
/// result [StoredAccessToken.value]. If the user isn't logged in, it returns a `null` value as
131+
/// the [Future] result.
120132
///
121-
/// If the user is not logged in, it returns a `null` value as the [Future] result.
122-
/// However, a valid [StoredAccessToken] object does not mean the access token itself is valid since it could be
123-
/// expired or revoked by user from other devices or LINE app.
133+
/// A valid [StoredAccessToken] object doesn't necessarily mean the access token itself is valid.
134+
/// It may have expired or been revoked by the user from another device or LINE client.
124135
///
125136
/// {@macro error_handling}
126137
Future<StoredAccessToken> get currentAccessToken async {
@@ -131,7 +142,7 @@ class LineSDK {
131142

132143
/// Gets the user’s profile.
133144
///
134-
/// To use this method, the `"profile"` scope is required.
145+
/// Using this method requires the `"profile"` scope.
135146
///
136147
/// {@macro error_handling}
137148
Future<UserProfile> getProfile() async {
@@ -140,14 +151,14 @@ class LineSDK {
140151
return UserProfile._(json.decode(result));
141152
}
142153

143-
/// Refreshes the access token.
154+
/// Refreshes the access token.
144155
///
145156
/// If the token refresh process finishes successfully, the refreshed access token will be
146-
/// automatically stored in user's device. You can wait for the result of this method or
147-
/// use [currentAccessToken] to get it.
157+
/// automatically stored in the user's device. You can wait for the result of this method or get
158+
/// the refreshed token with [currentAccessToken].
148159
///
149-
/// Normally, you do not need to refresh the access token manually because any API call will
150-
/// attempt to refresh the access token if necessary.
160+
/// You don't need to refresh the access token manually. Any API call will attempt to refresh the
161+
/// access token when necessary.
151162
///
152163
/// {@macro error_handling}
153164
Future<AccessToken> refreshToken() async {
@@ -156,7 +167,7 @@ class LineSDK {
156167
return AccessToken._(json.decode(result));
157168
}
158169

159-
/// Checks whether the stored access token is valid against to LINE auth server.
170+
/// Checks whether the stored access token is valid against the LINE authentication server.
160171
///
161172
/// {@macro error_handling}
162173
Future<AccessTokenVerifyResult> verifyAccessToken() async {
@@ -165,9 +176,10 @@ class LineSDK {
165176
return AccessTokenVerifyResult._(json.decode(result));
166177
}
167178

168-
/// Gets the friendship status of the user and the bot linked to your LINE Login channel.
179+
/// Gets the friendship status between the user and the official account linked to your LINE Login
180+
/// channel.
169181
///
170-
/// To use this method, the `"profile"` scope is required.
182+
/// Using this method requires the `"profile"` scope.
171183
///
172184
/// {@macro error_handling}
173185
Future<BotFriendshipStatus> getBotFriendshipStatus() async {

lib/src/model/access_token.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121

2222
part of flutter_line_sdk;
2323

24-
/// An access token which is used to access the LINE Platform.
24+
/// An access token used to access the LINE Platform.
2525
///
2626
/// Most API calls to the LINE Platform require an access token as evidence of successful
2727
/// authorization. A valid access token is issued after the user grants your app the
2828
/// permissions that your app requests. An access token is bound to permissions (scopes)
29-
/// that define the API endpoints that you can access. Choose the permissions for your
29+
/// that define which API endpoints you can access. Choose the permissions for your
3030
/// channel in the LINE Developers site and set them in the login method used in your app.
3131
///
32-
/// An access token expires after a certain period. [expiresIn] specifies the time duration
33-
/// from this access token being issued until it expires.
32+
/// An access token expires after a certain period. [expiresIn] specifies the amount of time
33+
/// until the token expires, counting from the moment of issue.
3434
///
3535
/// By default, the LINE SDK stores access tokens in a secure place on the device running
3636
/// your app and obtains authorization when you access the LINE Platform through the
@@ -49,20 +49,20 @@ class AccessToken {
4949
/// The value of the access token.
5050
String get value => _data['access_token'];
5151

52-
/// Number of seconds until the access token expires.
53-
/// Counting from when the token issued by server.
52+
/// Number of seconds until the access token expires,
53+
/// counting from when the server issued the token.
5454
num get expiresIn => _data['expires_in'];
5555

5656
/// The raw string value of the ID token bound to the access token.
5757
///
58-
/// The value exists only if the access token is obtained with the "openID"
58+
/// The value exists only if the access token is obtained with the `openID`
5959
/// permission.
6060
String get idTokenRaw => _data['id_token'];
6161

6262
/// The valid scopes bound to this access token.
6363
List<String> get scopes => _data['scope'].split(" ");
6464

6565
/// The expected authorization type when this token is used in a request
66-
/// header. Fixed to "Bearer" for now.
66+
/// header. Fixed to `Bearer` for now.
6767
String get tokenType => _data['token_type'];
68-
}
68+
}

lib/src/model/access_token_verify_result.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
part of flutter_line_sdk;
2323

24-
/// The response to the token verification API.
24+
/// Response to [LineSDK.verifyAccessToken].
2525
class AccessTokenVerifyResult {
2626
AccessTokenVerifyResult._(this._data);
2727

@@ -37,6 +37,6 @@ class AccessTokenVerifyResult {
3737
List<String> get scopes => _data['scope'].split(" ");
3838

3939
/// Number of seconds until the access token expires.
40-
/// Counting from when the request received by server.
40+
/// Counting from when the server received the request.
4141
num get expiresIn => _data['expires_in'];
42-
}
42+
}

lib/src/model/bot_friendship_status.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
part of flutter_line_sdk;
2323

24-
/// The response to a request for getting the friendship status of
25-
/// the user and the bot linked to your LINE Login channel.
24+
/// Response to [LineSDK.getBotFriendshipStatus].
2625
class BotFriendshipStatus {
2726
BotFriendshipStatus._(this._data);
2827

@@ -33,7 +32,7 @@ class BotFriendshipStatus {
3332

3433
/// Indicates the friendship status.
3534
///
36-
/// `true` if the bot is a friend of the user and the user has not blocked the bot.
37-
/// `false` if the bot is not a friend of the user or the user has blocked the bot.
35+
/// `true` if the bot is a friend of the user and the user hasn't blocked the bot.
36+
/// `false` if the bot isn't a friend of the user or the user has blocked the bot.
3837
bool get isFriend => _data['friendFlag'];
39-
}
38+
}

lib/src/model/login_option.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,21 @@
2121

2222
part of flutter_line_sdk;
2323

24-
/// Options can be used for logging in to the LINE Platform.
24+
/// Options related to LINE login process.
2525
class LoginOption {
26-
/// Uses the web authentication flow instead of the LINE app-to-app authentication flow.
26+
27+
/// Enable to use web authentication flow instead of LINE app-to-app authentication flow.
2728
///
28-
/// By default, LINE SDK will check and prefer to use LINE app to login.
29-
/// Set this to `true` if you want to skip LINE app but use the web authentication flow.
29+
/// By default, LINE SDK will try to use the LINE app to log in. Set the value to `true` to use
30+
/// the web authentication flow instead.
3031
bool onlyWebLogin;
3132

32-
/// Strategy used to show "adding bot as friend" option on the consent screen.
33+
/// Strategy to use for displaying "add bot as friend" option on consent screen:
3334
///
34-
/// This has two possible value for now:
35-
///
36-
/// - "normal": Includes an option to add a bot as friend on the consent screen.
37-
/// - "aggressive": Opens a new screen to add a bot as a friend after the user agrees to
38-
/// the permissions on the consent screen.
35+
/// - `normal`: A button for adding the bot as a friend is displayed on the consent screen.
36+
/// - `aggressive`: After the user grants the requested permissions on the consent screen, a new
37+
/// screen opens asking the user to add the bot as a friend.
3938
String botPrompt;
4039

4140
LoginOption(this.onlyWebLogin, this.botPrompt);
42-
}
41+
}

0 commit comments

Comments
 (0)