Skip to content

Commit 87936eb

Browse files
author
pera
authored
Update README.md
1 parent 325ab50 commit 87936eb

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,27 @@ Inside your `AppDelegate.m`, setup the line sdk by passing the channel id obtain
6262
2. Enable `use_frameworks!` in `Podfile` line:3
6363
3. Comment the code related to flipper, flipper doesn't support `use_frameworks!` !
6464
4. Modify your info.plist like it says here [Configuring the Info.plist file](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/#configuring-the-info-plist-file)
65-
5. Add this code to your `AppDelegate.m`
65+
5. Change your `AppDelegate.m` to match the following:
6666

6767
```objc
68+
// AppDelegate.m
69+
70+
//
71+
// Import the Library
72+
//
73+
#import "RNLine-Swift.h"
74+
75+
//
76+
// Setup the plugin using your CHANNEL_ID when the app finishes launching
77+
//
6878
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
69-
...
70-
[LineLogin setupWithChannelID:@"YOUR_CHANNELL_ID" universalLinkURL:nil];
79+
{
80+
[LineLogin setupWithChannelID:@"YOUR_CHANNEL_ID" universalLinkURL:nil];
81+
}
7182

83+
//
84+
// Handle redirection back to the app from Line
85+
//
7286
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
7387
{
7488
return [LineLogin application:app open:url options:options];
@@ -84,18 +98,31 @@ Inside your `AppDelegate.m`, setup the line sdk by passing the channel id obtain
8498
#### Using Swift
8599

86100
1. Follow instructions in [Integrating LINE Login with your iOS app](https://developers.line.biz/en/docs/ios-sdk/swift/integrate-line-login/).
87-
2. At the top of the `AppDelegate.swift` file, import the LineSDK framework as this: `import LineLogin`.
88-
3. Substitute `LoginManager.shared` to `LineLogin`.
89-
90-
As this:
101+
2. Change your `AppDelegate.m` to match the following:
91102

92103
```swift
104+
// AppDelegate.swift
105+
106+
//
107+
// Import the Library
108+
//
109+
import LineLogin
110+
111+
//
112+
// Setup the plugin using your CHANNEL_ID when the app finishes launching
113+
//
93114
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
94-
// Add this to your "didFinishLaunching" delegate method.
95115
LineLogin.setup(channelID: "YOUR_CHANNEL_ID", universalLinkURL: nil)
96116

97117
return true
98118
}
119+
120+
//
121+
// Handle redirection back to the app from Line
122+
//
123+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
124+
return LineLogin.application(app, open: url, options: options)
125+
}
99126
```
100127

101128
Don't forget to add `application` function, as line's instructions indicate.

0 commit comments

Comments
 (0)