From d5b1b8d4dab0b37107351fde0ba047c946b0064d Mon Sep 17 00:00:00 2001 From: Joaquin Aguirre Date: Thu, 27 Mar 2025 00:03:56 -0300 Subject: [PATCH 1/4] chore: bump the version number to 5.0.0 --- android/build.gradle | 2 +- example/package-lock.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index ae52e72..cefcc57 100755 --- a/android/build.gradle +++ b/android/build.gradle @@ -27,7 +27,7 @@ android { minSdkVersion safeExtGet("minSdkVersion", 24) targetSdkVersion safeExtGet("targetSdkVersion", 35) versionCode 1 - versionName "4.1.0" + versionName "5.0.0" } } diff --git a/example/package-lock.json b/example/package-lock.json index b637451..5278ffb 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -43,7 +43,7 @@ }, "..": { "name": "@xmartlabs/react-native-line", - "version": "4.1.0", + "version": "5.0.0", "license": "MIT", "devDependencies": { "@expo/config-plugins": "^9.0.17", diff --git a/package-lock.json b/package-lock.json index d43c47c..6a06989 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@xmartlabs/react-native-line", - "version": "4.1.0", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@xmartlabs/react-native-line", - "version": "4.1.0", + "version": "5.0.0", "license": "MIT", "devDependencies": { "@expo/config-plugins": "^9.0.17", diff --git a/package.json b/package.json index 32b48fc..132fd3c 100755 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "author": "Xmartlabs ", "main": "dist/index.js", "types": "dist/index.d.ts", - "version": "4.1.0", + "version": "5.0.0", "homepage": "https://github.com/xmartlabs/react-native-line#readme", "keywords": [ "auth", From 660045f10a49f9b811debefa01c87e6c99e886a2 Mon Sep 17 00:00:00 2001 From: Joaquin Aguirre Date: Thu, 27 Mar 2025 17:13:54 -0300 Subject: [PATCH 2/4] chore: update Readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 763f04e..8971e6d 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Line SDK wrapper for React Native 🚀
- @xmartlabs/react-native-line v4 + @xmartlabs/react-native-line v5 ```objectivec #import "react_native_line-Swift.h" @@ -150,24 +150,24 @@ Line SDK wrapper for React Native 🚀 ## Usage -1. Import the `LineLogin` module: +1. Import the `Line` module: ```typescript - import LineLogin from '@xmartlabs/react-native-line' + import Line from '@xmartlabs/react-native-line' ``` 2. Initialize the module with the `setup` method: ```typescript useEffect(() => { - LineLogin.setup({ channelId: 'YOUR_CHANNEL_ID' }) + Line.setup({ channelId: 'YOUR_CHANNEL_ID' }) }, []) ``` 3. Login with the `login` method: ```typescript - LineLogin.login({}) + Line.login({}) ``` ## API From ba9646c9753f37eb86e1ca8f536021d612634281 Mon Sep 17 00:00:00 2001 From: Joaquin Aguirre Date: Thu, 27 Mar 2025 17:34:52 -0300 Subject: [PATCH 3/4] chore: update Readme --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8971e6d..287dae8 100644 --- a/README.md +++ b/README.md @@ -174,13 +174,14 @@ Line SDK wrapper for React Native 🚀 | Function | Description | | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `login(args?: LoginArguments): Promise` | 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. | -| `getCurrentAccessToken(): Promise` | Returns the current access token for the currently logged in user. | -| `getProfile(): Promise` | Returns the profile of the currently logged in user. | -| `logout(): Promise` | Logs out the currently logged in user. | -| `refreshToken(): Promise` | Refreshes the access token and returns it. | -| `verifyAccessToken(): Promise` | Verifies the access token and returns it. | -| `getBotFriendshipStatus(): Promise` | Gets bot friendship status if [configured](https://developers.line.biz/en/docs/ios-sdk/swift/link-a-bot/). | +| `login(params: LoginParams): Promise` | 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. | +| `getCurrentAccessToken(): Promise` | Returns the access token of the current user. | +| `getProfile(): Promise` | Returns the current user profile information. | +| `logout(): Promise` | Revokes the access token of the current user. | +| `refreshAccessToken(): Promise` | Refreshes the access token of the current user. | +| `setup(params: SetupParams): Promise` | Initializes the Line SDK. | +| `verifyAccessToken(): Promise` | Checks whether the access token of the current user is valid. | +| `getFriendshipStatus(): Promise` | 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/). | ## Example From 05577a5939c9a6f07201174486531ee9df1aa411 Mon Sep 17 00:00:00 2001 From: Joaquin Aguirre Date: Thu, 27 Mar 2025 18:08:03 -0300 Subject: [PATCH 4/4] chore: add migration guides --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 287dae8..b58f940 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,35 @@ Line SDK wrapper for React Native 🚀 ``` +## Migration guides + +### v3 → v4 + +1. A `setup` function has been added and needs to be called before using the library. + ```typescript + Line.setup({ channelId: 'YOUR_CHANNEL_ID' }) + ``` + +2. The `getBotFriendshipStatus` function is now called `getFriendshipStatus`. + +3. The `refreshToken` function is now called `refreshAccessToken`. + +### v4 → v5 + +1. The file name in the `AppDelegate` import has changed. + ```objectivec + - #import "RNLine-Swift.h" + + + #import "react_native_line-Swift.h" + ``` + +2. The `login` function now expects an empty object as a default value. + ```typescript + - Line.login() + + + Line.login({}) + ``` + ## Usage 1. Import the `Line` module: