Upgrading the SDK
Upgrading to the latest SDK
5.0.0 is the first version of the LINE SDK for iOS Swift. This version is not compatible with the legacy Objective-C versions. You need to change some of your code if you are upgrading to the LINE SDK for iOS Swift.
The new LINE SDK for iOS Swift is designed for Swift projects. However, you can still use the new SDK with Objective-C code. To learn how to use the SDK with Objective-C code, see Using the SDK with Objective-C code.
To upgrade the SDK, it is recommended to remove all code lines related to the old SDK and perform a clean installation by following the steps in Setting up your project, whether you are using a legacy version in either language. However, if you want to make changes based on your current implementation, here are some general steps:
- Remove the old
LineSDK.frameworkfile from your code base.- If you used a package manager such as CocoaPods and Carthage, remove the "LineSDK" entry from your package definition file (Podfile or Cartfile). Then perform a clean installation to remove the reference to the
LineSDK.frameworkfile from your project. - If you used a downloaded binary, just remove it from your project.
- If you used a package manager such as CocoaPods and Carthage, remove the "LineSDK" entry from your package definition file (Podfile or Cartfile). Then perform a clean installation to remove the reference to the
- Clean up your
Info.plistfile. You can safely remove theLineSDKConfigentry from the file as the entry is not needed anymore. - Install the LINE SDK for iOS Swift. For detailed steps, see Setting up your project.
- Set up the channel ID and callback handling in the
AppDelegatefile.
Call theLoginManager.setupmethod just after your app launches as below:
Update the open URL handling as below:
Updating your code to use the latest SDK
You are ready to update all the other lines of code so that you can use the latest LINE SDK. The following sections describe some common examples.
This section doesn't cover all of the SDK functionality. However, you can easily find the corresponding types in the LINE SDK as they follow similar conventions. Update your code to use the latest LINE SDK to make your project compile.
We provide a sample app which is compatible with the latest LINE SDK for iOS Swift. See our open-source repository to find out the basic integration methods and usage.
Access tokens issued by the LINE SDK version 4.x are not usable with version 5.x. If you upgrade the LINE SDK, all users need to log in again before your app can access the LINE Platform.