Skip to content

Commit 46e5982

Browse files
authored
Merge pull request #161 from xmartlabs/v5.0.0
[Chore] Bump the version number to 5.0.0
2 parents 36f693b + 05577a5 commit 46e5982

File tree

5 files changed

+47
-17
lines changed

5 files changed

+47
-17
lines changed

README.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Line SDK wrapper for React Native 🚀
113113
</details>
114114

115115
<details>
116-
<summary>@xmartlabs/react-native-line v4</summary>
116+
<summary>@xmartlabs/react-native-line v5</summary>
117117

118118
```objectivec
119119
#import "react_native_line-Swift.h"
@@ -148,39 +148,69 @@ Line SDK wrapper for React Native 🚀
148148
</array>
149149
```
150150

151+
## Migration guides
152+
153+
### v3 → v4
154+
155+
1. A `setup` function has been added and needs to be called before using the library.
156+
```typescript
157+
Line.setup({ channelId: 'YOUR_CHANNEL_ID' })
158+
```
159+
160+
2. The `getBotFriendshipStatus` function is now called `getFriendshipStatus`.
161+
162+
3. The `refreshToken` function is now called `refreshAccessToken`.
163+
164+
### v4 → v5
165+
166+
1. The file name in the `AppDelegate` import has changed.
167+
```objectivec
168+
- #import "RNLine-Swift.h"
169+
170+
+ #import "react_native_line-Swift.h"
171+
```
172+
173+
2. The `login` function now expects an empty object as a default value.
174+
```typescript
175+
- Line.login()
176+
177+
+ Line.login({})
178+
```
179+
151180
## Usage
152181

153-
1. Import the `LineLogin` module:
182+
1. Import the `Line` module:
154183

155184
```typescript
156-
import LineLogin from '@xmartlabs/react-native-line'
185+
import Line from '@xmartlabs/react-native-line'
157186
```
158187

159188
2. Initialize the module with the `setup` method:
160189

161190
```typescript
162191
useEffect(() => {
163-
LineLogin.setup({ channelId: 'YOUR_CHANNEL_ID' })
192+
Line.setup({ channelId: 'YOUR_CHANNEL_ID' })
164193
}, [])
165194
```
166195

167196
3. Login with the `login` method:
168197

169198
```typescript
170-
LineLogin.login({})
199+
Line.login({})
171200
```
172201

173202
## API
174203

175204
| Function | Description |
176205
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
177-
| `login(args?: LoginArguments): Promise<LoginResult>` | Starts the login flow of Line's SDK (Opens the apps if it's installed and defaults to the browser otherwise). It accepts the same argumements as the LineSDK, in an object `{ key: value }`, defaults the same way as LineSDK too. |
178-
| `getCurrentAccessToken(): Promise<AccessToken>` | Returns the current access token for the currently logged in user. |
179-
| `getProfile(): Promise<UserProfile>` | Returns the profile of the currently logged in user. |
180-
| `logout(): Promise<void>` | Logs out the currently logged in user. |
181-
| `refreshToken(): Promise<AccessToken>` | Refreshes the access token and returns it. |
182-
| `verifyAccessToken(): Promise<AccessTokenVerifyResult>` | Verifies the access token and returns it. |
183-
| `getBotFriendshipStatus(): Promise<BotFriendshipStatus>` | Gets bot friendship status if [configured](https://developers.line.biz/en/docs/ios-sdk/swift/link-a-bot/). |
206+
| `login(params: LoginParams): Promise<LoginResult>` | Starts the login flow of Line's SDK (Opens the apps if it's installed and defaults to the browser otherwise). It accepts the same argumements as the LineSDK, in an object `{ key: value }`, defaults the same way as LineSDK too. |
207+
| `getCurrentAccessToken(): Promise<AccessToken>` | Returns the access token of the current user. |
208+
| `getProfile(): Promise<UserProfile>` | Returns the current user profile information. |
209+
| `logout(): Promise<void>` | Revokes the access token of the current user. |
210+
| `refreshAccessToken(): Promise<AccessToken>` | Refreshes the access token of the current user. |
211+
| `setup(params: SetupParams): Promise<void>` | Initializes the Line SDK. |
212+
| `verifyAccessToken(): Promise<VerifyResult>` | Checks whether the access token of the current user is valid. |
213+
| `getFriendshipStatus(): Promise<FriendshipStatus>` | Gets the friendship status between the LINE Official Account (which is linked to the current channel) and the user if [configured](https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/link-a-bot/). |
184214
185215
## Example
186216

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
minSdkVersion safeExtGet("minSdkVersion", 24)
3333
targetSdkVersion safeExtGet("targetSdkVersion", 35)
3434
versionCode 1
35-
versionName "4.1.0"
35+
versionName "5.0.0"
3636
}
3737

3838
sourceSets {

example/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Xmartlabs <[email protected]>",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
7-
"version": "4.1.0",
7+
"version": "5.0.0",
88
"homepage": "https://github.com/xmartlabs/react-native-line#readme",
99
"keywords": [
1010
"auth",

0 commit comments

Comments
 (0)