# Setting up your project
This topic explains how to integrate the LINE SDK for iOS Swift into your iOS project and apply necessary configurations.
To make your app compatible with the latest iOS versions and make full use of its features, we strongly recommend you follow this installation guide and use the latest version of the LINE SDK for iOS Swift.
To build and use the LINE SDK for iOS Swift, you need:
- A provider and a LINE Login channel. You can create both in the LINE Developers Console.
- iOS 13.0 or later as the deployment target
- Xcode 14.1 or later
If you want to support earlier than iOS 13.0 as the deploy target, use an earlier version of the LINE SDK for iOS Swift. For more information, see Releases (opens new window).
You can use the LINE SDK for iOS Swift with either Swift or Objective-C code. This guide assumes that you use Swift code to implement the LINE SDK for iOS Swift. To use Objective-C code to integrate the LINE SDK for iOS Swift, see Using the SDK with Objective-C.
The LINE SDK for iOS Swift is not compatible with previous LINE SDK for iOS Objective-C versions. If you are upgrading the version of the LINE SDK, see Upgrading the SDK before proceeding with the upgrade.
If you aren't familiar with CocoaPods, see CocoaPods Getting Started Guide (opens new window). You will need the CocoaPods gem installed on your machine before integrating the LINE SDK for iOS Swift into your app through CocoaPods.
Once your Podfile is prepared, add the pod command below to your target:
platform :ios, '13.0' use_frameworks! target '<Your App Target Name>' do pod 'LineSDKSwift', '~> 5.0' end
Run the following command:
$ pod install
The LINE SDK for iOS Swift will be downloaded and integrated into your Xcode workspace.
Carthage (opens new window) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
To install the Carthage tool, use Homebrew (opens new window).
$ brew update $ brew install carthage
To integrate the LINE SDK for iOS Swift into your Xcode project using Carthage, specify the GitHub repository of the SDK in your Cartfile as below:
github "line/line-sdk-ios-swift" ~> 5.0
Run the following command to build the LINE SDK for iOS Swift:
$ carthage update line-sdk-ios-swift
Now you can add the built
LineSDK.framework file to your Xcode project by following the steps described in the following sections.
# Linking the
LineSDK.framework file to your Xcode project
Drag and drop the
LineSDK.framework file from the
Carthage/Build/iOS folder to the "Linked Frameworks and Libraries" section on your application target’s "General" settings tab.
# Copying the
LineSDK.framework file during the build phase
Click the "+" icon on your application target's "Build Phases" settings tab and choose "New Run Script Phase". Create a run script with the following content:
Add the path to the
LineSDK.frameworkfile under the "Input Files" section:
Add the path to the
LineSDK.frameworkfile under the "Output Files" section:
The run script should look like this:
# Linking your app to your channel
Linking your app to a LINE Login channel requires some configuration. On the LINE Developers Console, go to your LINE Login channel settings and complete the following fields on the LINE Login tab:
- iOS bundle ID: Bundle identifier of your app found in the "General" tab in your Xcode project settings. Must be lowercase. For example,
com.example.app. You can specify multiple bundle identifiers by entering each one on a new line.
- iOS universal link: Enter the universal link configured for your app. For more information on how to handle the login process using a universal link, see Using universal links.
# Configuring the
In Xcode, right-click your app's
Info.plist file and select "Open As" > "Source Code". Insert the following snippet just before the last
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <!-- Specify URL scheme to use when returning from LINE to your app. --> <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string> </array> </dict> </array> <key>LSApplicationQueriesSchemes</key> <array> <!-- Specify URL scheme to use when launching LINE from your app. --> <string>lineauth2</string> </array>
This snippet adds the following settings:
Note: The URL scheme