-
setup()is now required-
SDK initialization has moved from native code to JavaScript. Add a
setup()call when your app starts:useEffect(() => { Line.setup({ channelId: 'YOUR_CHANNEL_ID' }) }, [])
Then remove the native setup code:
-
iOS β remove the setup call from
AppDelegate:// Swift β remove these lines func application(_ application: UIApplication, didFinishLaunchingWithOptions ...) -> Bool { LineLogin.setup(channelID: "YOUR_CHANNEL_ID", universalLinkURL: nil) ... }
// Objective-C β remove these lines - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [LineLogin setupWithChannelID:@"YOUR_CHANNEL_ID" universalLinkURL:nil]; ... }
-
Android β remove the channel ID string from your resources:
<!-- remove this line --> <string name="line_channel_id" translatable="false">YOUR_CHANNEL_ID</string>
-
-
Renamed methods
Before After getBotFriendshipStatus()getFriendshipStatus()refreshToken()refreshAccessToken()
Important
v5 is a TurboModule and requires the new architecture. Enable it in your app before upgrading β see how to enable the new architecture. If you cannot enable the new architecture yet, stay on v4.
-
iOS header rename
Update the import in your
AppDelegate:- #import "RNLine-Swift.h" + #import "react_native_line-Swift.h"
-
login()requires an argumentPass an empty object when using default options:
- Line.login() + Line.login({})
Note
v6 continues to require the new architecture. No changes needed if you already enabled it for v5.
-
LoginPermissionrenamed toScopeThe
LoginPermissionenum has been renamed toScopeto align with OAuth 2.0 terminology.- import { LoginPermission } from '@xmartlabs/react-native-line' + import { Scope } from '@xmartlabs/react-native-line' - Line.login({ scopes: [LoginPermission.Profile, LoginPermission.OpenId] }) + Line.login({ scopes: [Scope.Profile, Scope.OpenId] })
The underlying string values are unchanged (
'profile','openid','email'), so any code that passes raw strings is unaffected. -
expiresInis now anumberAccessToken.expiresInandVerifyResult.expiresInare now typed asnumber(seconds until expiry) instead ofstring.- const secondsLeft = parseInt(token.expiresIn, 10) + const secondsLeft = token.expiresIn