--- title: "LIINE連携" slug: "game-gamepot3-line-integration" updated: 2026-09-17T09:23:32Z published: 2026-09-17T09:23:32Z canonical: "guide.ncloud-docs.com/game-gamepot3-line-integration" --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # LIINE連携 Classic/VPC環境で利用できます。 LINEログイン機能を使用するためのご利用ガイドです。 LINEの詳細は、[LINE Developers](https://developers.line.biz/)をご参照ください。 ## iOS ### Info.plistの設定 1. プロジェクトの TARGETS > Info > URL Typesに「line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)」を追加します。 2. プロジェクトの TARGETS > Info > Custom iOS Target Properties > 「Queried URL Schemes」に「lineauth2」を追加します。 Info.plistに直接追加する場合のサンプルコードは次の通りです。 | Key | Value | | --- | --- | | CFBundleURLSchemes | line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER) | | LSApplicationQueriesSchemes | lineauth2 | ``` // Info.plist CFBundleURLTypes CFBundleTypeRole Editor CFBundleURLSchemes line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER) LSApplicationQueriesSchemes lineauth2 ``` ### Swift 次のコードを使用して AppDelegate.swiftメソッドのコードを置き換えてください。 ``` // AppDelegate.swift class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { ApplicationDelegate.shared.application( application, didFinishLaunchingWithOptions: launchOptions ) } func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { let sceneConfiguration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role) sceneConfiguration.delegateClass = SceneDelegate.self return sceneConfiguration } func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { ... // LINEログインコールバック NotificationCenter.default.post(name: Notification.Name("LineLoginURL"), object: nil, userInfo: ["application": application, "url": url, "options": options, "type": "AppDelegate"]) ... return true } } class SceneDelegate: UIResponder, UIWindowSceneDelegate { func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { guard let url = URLContexts.first?.url else { return } ... // LINEログインコールバック NotificationCenter.default.post(name: Notification.Name("LineLoginURL"), object: nil, userInfo: ["url": url, "type": "SceneDelegate"]) ... } ``` ### Objective-C 次のコードを使って AppDelegate.mメソッドのコードを置換して追加してください。 ``` // AppDelegate.m #import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... return YES; } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { ... // LINEログインコールバック NSDictionary *userInfo = @{@"application": app, @"url": url, @"options": options, @"type": @"AppDelegate"}; [[NSNotificationCenter defaultCenter] postNotificationName:@"LineLoginURL" object:nil userInfo:userInfo]; ... return YES; } ``` 次のコードを使って SceneDelegate.mメソッドのコードを置換して追加してください。 ``` // SceneDelegate.m #import "SceneDelegate.h" @interface SceneDelegate () @end @implementation SceneDelegate - (void)scene:(UIScene *)scene openURLContexts:(NSSet *)URLContexts { NSURL *url = URLContexts.allObjects.firstObject.URL; if (!url) return; // LINEログインコールバック NSDictionary *userInfo = @{@"url": url, @"type": @"SceneDelegate"}; [[NSNotificationCenter defaultCenter] postNotificationName:@"LineLoginURL" object:nil userInfo:userInfo]; } ```