You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you so much for taking your time to contribute! fullter_line_sdk is not very different from any other open source projects. It will
4
-
be fantastic if you help us by doing any of the following:
3
+
Thanks a lot for taking the time to contribute!
5
4
6
-
- File an issue in [the issue tracker](https://github.com/line/fullter_line_sdk/issues)
5
+
flutter_line_sdk is not much different from other open source projects. It would
6
+
be fantastic to get your help with any of the following:
7
+
8
+
- File an issue in [the issue tracker](https://github.com/line/flutter_line_sdk/issues)
7
9
to report bugs and propose new features and improvements.
8
-
- Ask a question using [the issue tracker](https://github.com/line/fullter_line_sdk/issues).
9
-
- Contribute your work by sending [a pull request](https://github.com/line/fullter_line_sdk/pulls).
10
+
- Ask a question using [the issue tracker](https://github.com/line/flutter_line_sdk/issues).
11
+
- Contribute your work by sending [a pull request](https://github.com/line/flutter_line_sdk/pulls).
10
12
11
13
## Contributor license agreement
12
14
13
-
When you are sending a pull request and it's a non-trivial change beyond fixing typos, please sign
Copy file name to clipboardExpand all lines: README.md
+51-42Lines changed: 51 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
1
# flutter_line_sdk
2
2
3
-
A Flutter plugin for allowing users to use the native LINE SDKs with Dart in Flutter apps.
3
+
A [Flutter] plugin that lets developers access LINE's native SDKs in Flutter apps with [Dart].
4
4
5
-
It provides a quick way to integrate LINE Login features to your app. Once installed, you can navigate your users to use
6
-
LINE app or a web page to login with their LINE account. A quick example usage as below:
5
+
The plugin helps you integrate LINE Login features in your app. You can redirect users to LINE or a web page where they log in with their LINE credentials. Example:
For more examples, see the [example app](https://github.com/line/flutter_line_sdk/tree/master/example) and the related [API definitions](#).
27
+
For more examples, see the [example app](https://github.com/line/flutter_line_sdk/tree/master/example) and [API definitions].
29
28
30
29
## Prerequisites
31
30
32
-
- iOS 10.0 or later as the deployment target.
33
-
- Android `minSdkVersion` set to 17 or higher (Android 4.2 or later).
31
+
- iOS 10.0 or later as the deployment target
32
+
- Android `minSdkVersion` set to 17 or higher (Android 4.2 or later)
33
+
-[LINE Login channel linked to your app](https://developers.line.biz/en/docs/line-login/getting-started/)
34
34
35
-
To use the LINE SDK with your Flutter app, you need to have a valid LINE Channel bounded to your app.
36
-
If you do not have one yet, please follow the [Getting started with LINE Login](https://developers.line.biz/en/docs/line-login/getting-started/)
37
-
to create your channel.
35
+
To access your LINE Login channel from a mobile platform, you need some extra configuration. In the [LINE Developers console][console], go to your LINE Login channel settings, and enter the below information on the **App settings** tab.
38
36
39
-
You also need some additional setup when you want to use the channel on a mobile platform.
40
-
Once you have created a channel, go to the "App settings" page of the console and complete the following fields.
37
+
### iOS app settings
41
38
42
-
For iOS:
39
+
| Setting | Description |
40
+
|-------|---------|
41
+
| iOS bundle ID | Bundle identifier of your app. In Xcode, find it in your **Runner** project settings, on the **General** tab. Must be lowercase, like `com.example.app`. You can specify multiple bundle identifiers by typing each one on a new line. |
42
+
| iOS scheme | Set to `line3rdp.`, followed by the bundle identifier. For example, if your bundle identifier is `com.example.app`, set the iOS scheme to `line3rdp.com.example.app`. Only one iOS scheme can be specified. |
43
+
| iOS universal link | Optional. Set to the universal link configured for your app. For more information on how to handle the login process using a universal link, see [Universal Links support](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/#universal-link-support). |
43
44
44
-
- iOS bundle ID: Bundle identifier of your app found in the "General" tab in your "Runner" Xcode project settings. Must be lowercase. For example, `com.example.app`. You can specify multiple bundle identifiers by entering each one on a new line.
45
-
- iOS scheme: Set to `line3rdp.` followed by the bundle identifier. For example, if your bundle identifier is `com.example.app`, set the iOS scheme to `line3rdp.com.example.app`. Only one iOS scheme can be specified.
46
-
- iOS universal link: Optional. Set to the universal link configured for your app. For more information on how to handle the login process using a universal link, see [Universal Links support](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/#universal-link-support).
45
+
### Android app settings
47
46
48
-
For Android:
49
-
50
-
- Android package name: Required. Application's package name used to launch the Google Play store.
51
-
- Android package signature: Optional. You can set multiple signatures by entering each one on a new line.
52
-
- Android scheme: Optional. Custom URL scheme used to launch your app.
47
+
| Setting | Description |
48
+
|-------|---------|
49
+
| Android package name|Required. Application's package name used to launch the Google Play store.|
50
+
| Android package signature|Optional. You can set multiple signatures by typing each one on a new line.|
51
+
| Android scheme|Optional. Custom URL scheme used to launch your app.|
53
52
54
53
## Installation
55
54
56
55
### Adding flutter_line_sdk package
57
56
58
-
Please just follow the common way to add this package to your Flutter app. You can find information on this topic in the [Using packages](https://flutter.dev/docs/development/packages-and-plugins/using-packages) page of Flutter documentation.
59
-
60
-
More specifically, you need to follow these steps:
57
+
Use the standard way of adding this package to your Flutter app, as described in the [Flutter documentation](https://flutter.dev/docs/development/packages-and-plugins/using-packages). The process consists of these steps:
61
58
62
-
1. Open the `pubspec.yaml` file located inside your app folder, and add `flutter_line_sdk:` under the `dependencies` section.
63
-
2. Install it. From a terminal, run `flutter pub get`.
59
+
1. Open the `pubspec.yaml` file in your app folder and, under `dependencies`, add `flutter_line_sdk:`.
60
+
2. Install it by running this in a terminal: `flutter pub get`
64
61
65
-
Now, the dart part of `flutter_line_sdk` should be installed. Following, you need to setup LINE SDK for iOS and Android project respectively.
62
+
Now, the Dart part of `flutter_line_sdk` should be installed. Next, you need to set up LINE SDK for iOS and Android projects, respectively.
66
63
67
-
### Setup LINE SDK
64
+
### Set up LINE SDK
68
65
69
66
#### iOS
70
67
71
-
Open the `ios/Runner/Info.plist`file in your app project with a text editor, insert the following snippet just before the last `</dict>` tag:
68
+
Open the file `ios/Runner/Info.plist` in a text editor and insert this snippet just before the last `</dict>` tag:
72
69
73
70
```xml
74
71
<key>CFBundleURLTypes</key>
@@ -90,7 +87,7 @@ Open the `ios/Runner/Info.plist` file in your app project with a text editor, in
90
87
</array>
91
88
```
92
89
93
-
Since LINE SDK now requires iOS 10.0 or above, and it uses Cocoa Framework to provide underlying native features, you need to add these lines in the `Runner` target in the`ios/Podfile`:
90
+
Because LINE SDK now requires iOS 10.0 or above and uses the iOS dynamic Framework to provide underlying native features, you must add these lines in the `Runner` target in `ios/Podfile`:
94
91
95
92
```diff
96
93
target 'Runner' do
@@ -100,19 +97,19 @@ target 'Runner' do
100
97
101
98
#### Android
102
99
103
-
No specific settings are required.
100
+
No specific settings required.
104
101
105
102
### Importing and using
106
103
107
104
#### Setup
108
105
109
-
Importing`flutter_line_sdk` to any place you want to use it in your project:
106
+
Import`flutter_line_sdk` to any place you want to use it in your project:
You need to setup your channel ID first. For example, you can call `setup` in the `main` function:
112
+
To use the package, you need to set up your channel ID. You can do this by calling the `setup` method, for example in the `main` function:
116
113
117
114
```diff
118
115
- void main() => runApp(MyApp());
@@ -124,14 +121,16 @@ You need to setup your channel ID first. For example, you can call `setup` in th
124
121
+ }
125
122
```
126
123
127
-
Or you can find any other place you'd like to call it. But remember it is required to be called once and only once before you use any other methods in LINE SDK.
124
+
This is merely an example. You can call `setup` any time you want, provided you call it exactly once, before calling any other LINE SDK methods.
128
125
129
-
To help you get started with this package quickly, we list some basic usage examples below. `flutter_line_sdk`is fully and well documented and you can find the details in our beautiful [dart style doc site](#).
126
+
To help you get started with this package, we list several basic usage examples below. All available `flutter_line_sdk`methods are documented on the [Dart Packages][API Definitions]site.
130
127
131
128
#### Login
132
129
133
-
Now you are ready to let your user login with LINE. To get the login result, assign the `Future<LoginResult>` value to a variable.
134
-
Keep in mind that wrap the invocation in a `try...on` statement and handle the error gracefully:
130
+
Now you are ready to let your user log in with LINE.
131
+
132
+
Get the login result by assigning the value of `Future<LoginResult>` to a variable.
133
+
To handle errors gracefully, wrap the invocation in a `try...on` statement:
135
134
136
135
```dart
137
136
void _signIn() async {
@@ -211,16 +210,26 @@ try {
211
210
}
212
211
```
213
212
214
-
> Normally, you do not need to refresh the access token manually because any API call in LINE SDK will attempt to
215
-
> refresh the access token automatically if necessary. It is **not recommended** to refresh the access tokens by yourself.
216
-
> Automatic access token management by the LINE SDK is usually easier and safer for future upgrading.
213
+
Normally, you don't need to refresh access tokens manually, because any API call in LINE SDK will try to refresh the access token automatically when necessary.
214
+
**We do not recommend refreshing access tokens yourself.**
215
+
It's generally easier, more secure, and more future-proof to let the LINE SDK manage access tokens automatically.
217
216
218
217
### Error handling
219
218
220
-
All APIs may throw a `PlatformException` with error `code` and a `message`. Use these information to identify an error happens inside the native SDK. Please note that the code and message of an error might varies on iOS and Android. We encourage you to read the error definition on [iOS](https://developers.line.biz/en/reference/ios-sdk-swift/Enums/LineSDKError.html) and [Android](https://developers.line.biz/en/reference/android-sdk/reference/com/linecorp/linesdk/LineApiError.html) to provide better error recovery and user experience on different platforms.
219
+
All APIs can throw a `PlatformException` with error `code` and a `message`. Use this information to identify when an error happens inside the native SDK.
220
+
221
+
Error codes and messages will vary between iOS and Android. Be sure to read the error definition on [iOS](https://developers.line.biz/en/reference/ios-sdk-swift/Enums/LineSDKError.html) and [Android](https://developers.line.biz/en/reference/android-sdk/reference/com/linecorp/linesdk/LineApiError.html) to provide better error recovery and user experience on different platforms.
221
222
222
223
## Contributing
223
224
224
-
If you believe you have discovered a vulnerability or have an issue related to security, please **DO NOT** open a public issue. Instead, send us a mail to [[email protected]](mailto:[email protected]).
225
+
If you believe you found a vulnerability or you have an issue related to security, please **DO NOT** open a public issue. Instead, email us at [[email protected]](mailto:[email protected]).
226
+
227
+
Before contributing to this project, please read [CONTRIBUTING.md].
225
228
226
-
For contributing to this project, please see [CONTRIBUTING.md](https://github.com/line/line-sdk-ios-swift/blob/master/CONTRIBUTING.md).
0 commit comments