Skip to content

Commit 07163fd

Browse files
authored
Merge pull request #133 from xmartlabs/chore/readme
[Chore] Update Readme
2 parents 99a421c + 45d357a commit 07163fd

File tree

1 file changed

+51
-86
lines changed

1 file changed

+51
-86
lines changed

README.md

+51-86
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,63 @@
1-
# ![React Native LINE](/assets/github-banner.png)
2-
3-
<p align="center">
4-
Line SDK wrapper for React Native 🚀
5-
</p>
6-
7-
This library includes:
8-
9-
- [LINE SDK v5 for iOS Swift](https://developers.line.biz/en/docs/ios-sdk/swift/overview/), wrapped with [Swift](https://developer.apple.com/swift/).
10-
- [LINE SDK v5 for Android](https://developers.line.biz/en/docs/android-sdk/overview/), wrapped with [Kotlin](https://kotlinlang.org/).
11-
121
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
132
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors)
143
[![NPM Version](https://img.shields.io/npm/v/@xmartlabs/react-native-line.svg?style=flat-square)](https://www.npmjs.com/package/@xmartlabs/react-native-line)
154

16-
## Requirements
5+
# ![React Native LINE](/assets/github-banner.png)
176

18-
- React native `>=0.61.1`
19-
- iOS 10.0 or later as the development target
20-
- Android `minSdkVersion` set to 17 or higher
21-
- [LINE developer account](https://developers.line.biz/console/) with a channel created.
7+
Line SDK wrapper for React Native 🚀
228

23-
## Migration from v1.x.x
9+
- [LINE SDK v5 for iOS Swift](https://developers.line.biz/en/reference/ios-sdk-swift/), wrapped with [Swift](https://developer.apple.com/swift/).
10+
- [LINE SDK v5 for Android](https://developers.line.biz/en/reference/android-sdk/), wrapped with [Kotlin](https://kotlinlang.org/).
2411

25-
If you are currently using `react-native-line-sdk` (v1.x.x):
12+
## Requirements
2613

27-
1. Unlink the old library:
14+
- Android `minSdkVersion` 24 or higher
15+
- iOS minimum development target 13.0 or higher
16+
- [LINE developer account](https://developers.line.biz/console/) with a channel created.
2817

29-
```
30-
react-native unlink react-native-line-sdk
31-
```
18+
## Installation
3219

33-
2. Remove it from the `package.json`
34-
3. Remove any line sdk's `*.aar` from `android/libs`
35-
4. Remove from `android/app/build.gradle`:
20+
```bash
21+
$ npm install --save @xmartlabs/react-native-line
3622

37-
```
38-
repositories {
39-
flatDir {
40-
dirs 'libs'
41-
}
42-
}
43-
```
23+
# --- or ---
4424

45-
Finally, follow the installation steps for the new version.
25+
$ yarn add @xmartlabs/react-native-line
26+
```
4627

47-
## Installation
28+
## Expo Support
4829

49-
First, install the npm package with yarn. _Autolink_ is automatic.
30+
If you're using Expo you need to add this plugins
5031

51-
```bash
52-
yarn add @xmartlabs/react-native-line
32+
```json
33+
"plugins": [
34+
...
35+
[
36+
"expo-build-properties", // This is required
37+
{
38+
"ios": {
39+
"useFrameworks": "static"
40+
}
41+
}
42+
],
43+
[
44+
"@xmartlabs/react-native-line",
45+
{
46+
"channelId": "YOUR_CHANNEL_ID"
47+
}
48+
]
49+
],
5350
```
5451

55-
### iOS Setup
52+
⚠️ [iOS] if you're using other plugins it might cause conflict on `appDelegate.mm` file, please implement your own appDelegate mod if conflict occur
53+
54+
### Setup
5655

57-
#### Using Objective-C
56+
#### iOS using Objective-C
5857

5958
Inside your `AppDelegate.m`, setup the line sdk by passing the channel id obtained.
6059

61-
1. Add `platform :ios, '11.0'` in `Podfile` line:1
60+
1. Add `platform :ios, '13.0'` in `Podfile` line:1
6261
2. Modify your info.plist like it says here [Configuring the Info.plist file](https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/setting-up-project/#config-infoplist-file)
6362
3. Change your `AppDelegate.m` to match the following:
6463

@@ -93,7 +92,7 @@ Inside your `AppDelegate.m`, setup the line sdk by passing the channel id obtain
9392
}
9493
```
9594

96-
#### Using Swift
95+
#### iOS using Swift
9796

9897
1. Follow instructions in [Integrating LINE Login with your iOS app](https://developers.line.biz/en/docs/ios-sdk/swift/integrate-line-login/).
9998
2. Change your `AppDelegate.m` to match the following:
@@ -125,7 +124,7 @@ func application(_ app: UIApplication, open url: URL, options: [UIApplication.Op
125124

126125
Don't forget to add `application` function, as line's instructions indicate.
127126

128-
### Android Setup
127+
#### Android
129128

130129
1. Follow all the configuration steps in [Line's Android integration guide](https://developers.line.biz/en/docs/android-sdk/integrate-line-login/)
131130
2. Add the string `line_channel_id` to your strings file with the the channel id that you have on your line console.
@@ -134,8 +133,7 @@ Don't forget to add `application` function, as line's instructions indicate.
134133
<string name="line_channel_id" translatable="false">Your channel id here</string>
135134
```
136135

137-
3. Add `minSdkVersion = 17` in `android/build.gradle`
138-
4. In your manifest add `xmlns:tools="http://schemas.android.com/tools"` in your `manifest` tag and also `tools:replace="android:allowBackup"` in your `application` tag
136+
3. In your manifest add `xmlns:tools="http://schemas.android.com/tools"` in your `manifest` tag and also `tools:replace="android:allowBackup"` in your `application` tag
139137

140138
## API
141139

@@ -166,15 +164,12 @@ The following objects are returned on the methods described above:
166164
```typescript
167165
{
168166
/// The user ID of the current authorized user.
169-
userID: String
170-
167+
userID: string
171168
/// The display name of the current authorized user.
172169
displayName: string
173-
174170
/// The profile image URL of the current authorized user. `null` if the user has not set a profile
175171
/// image.
176172
pictureURL?: string
177-
178173
/// The status message of the current authorized user. `null` if the user has not set a status message.
179174
statusMessage?: string
180175
}
@@ -185,14 +180,14 @@ The following objects are returned on the methods described above:
185180
```typescript
186181
{
187182
/// The value of the access token.
188-
access_token: String
183+
access_token: string
189184
/// The expiration time of the access token. It is calculated using `createdAt` and the validity period
190185
/// of the access token. This value might not be the actual expiration time because this value depends
191186
/// on the system time of the device when `createdAt` is determined.
192-
expires_in: String
187+
expires_in: string
193188
/// The raw string value of the ID token bound to the access token. The value exists only if the access token
194189
/// is obtained with the `.openID` permission.
195-
id_token?: String
190+
id_token?: string
196191
}
197192
```
198193

@@ -201,13 +196,11 @@ The following objects are returned on the methods described above:
201196
```typescript
202197
{
203198
// The channel ID bound to the access token.
204-
client_id: String
205-
199+
client_id: string
206200
/// The amount of time until the access token expires.
207-
expires_in: String
208-
201+
expires_in: string
209202
/// Valid permissions of the access token separated by spaces
210-
scope: String
203+
scope: string
211204
}
212205
```
213206

@@ -218,7 +211,7 @@ The following objects are returned on the methods described above:
218211
/// The access token obtained by the login process.
219212
accessToken: AccessToken
220213
/// The permissions bound to the `accessToken` object by the authorization process. Scope has them separated by spaces
221-
scope: String
214+
scope: string
222215
/// Contains the user profile including the user ID, display name, and so on. The value exists only when the
223216
/// `.profile` permission is set in the authorization request.
224217
userProfile?: UserProfile
@@ -229,7 +222,7 @@ The following objects are returned on the methods described above:
229222
friendshipStatusChanged?: boolean
230223
/// The `nonce` value when requesting ID Token during login process. Use this value as a parameter when you
231224
/// verify the ID Token against the LINE server. This value is `null` if `.openID` permission is not requested.
232-
IDTokenNonce?: String
225+
IDTokenNonce?: string
233226
}
234227
```
235228

@@ -260,7 +253,6 @@ The following objects are returned on the methods described above:
260253
EMAIL = 'email',
261254
/// The permission to get an ID token in the login response.
262255
OPEN_ID = 'openid',
263-
264256
/// The permission to get the user's profile including the user ID, display name, and the profile image
265257
/// URL in the login response.
266258
PROFILE = 'profile',
@@ -329,33 +321,6 @@ The following objects are returned on the methods described above:
329321
}
330322
```
331323

332-
## Expo Support
333-
334-
If you're using expo you can add this plugins
335-
336-
```
337-
"plugins": [
338-
...
339-
// This is required, please add `expo-build-properties` to your project
340-
[
341-
"expo-build-properties",
342-
{
343-
"ios": {
344-
"useFrameworks": "static"
345-
}
346-
}
347-
],
348-
[
349-
"@xmartlabs/react-native-line",
350-
{
351-
"channelId": "YOUR_CHANNEL_ID"
352-
}
353-
]
354-
],
355-
```
356-
357-
⚠️ [iOS] if you're using other plugins it might cause conflict on `appDelegate.mm` file, please implement your own appDelegate mod if conflict occur
358-
359324
## Example
360325

361326
If you want to see `@xmartlabs/react-native-line` in action, just move into the [example](/example) folder and run `yarn ios`/`yarn android`. By seeing its source code, you will have a better understanding of the library usage.

0 commit comments

Comments
 (0)