Q&A

Line Login SDKs(iOS)で常にuserCancelledと応答します。

前提・実現したいこと

正常なログイン

発生している問題・エラーメッセージ

  1. [Log in with LINE] ボタンをタップするとLINEアプリが実行されますが、直ちに「エラー、正常に処理できませんでした」という警告が表示されます。 その後、SafariでLINEログインが開きます。 IDとパスワードを入力すると、"400 Bad Request, Invalid redirect_uri value. Checkifit is registered in a LINE developers site."と表示されます。

  2. ログイン画面でSafari URLは以下の通りです。(decoded URL) https://access.line.me/oauth2/v2.1/login ?loginChannelId={my channel ID} &returnUri=/oauth2/v2.1/authorize/consent ?code_challenge=7UuB3RkJ9njyQLmFIXFZLCkLnznyW0OubOCCxE4KT04&code_challenge_method=S256 &redirect_uri=line3rdp.{my app package name}://authorize/ &state=cX1lUt98cff8kqN57zUaEwIvNLPqqb9d3Tbni1qpAIY &client_id={my channel ID} &scope=profile &response_type=code &optional_redirect_uri={my universal link} &sdk_ver=5.9.0 &fromDomain=access-auto.line.me&line_auto_login_error=universal_link_error#/

  3. アプリのユニバーサル リンクは正常に動作しています。

  4. 同じサービスのAndroidアプリは正常にログインします。

  5. iOSアプリのサービスエリアは日本で、私は韓国にいます。

  6. ユニバーサル リンクと同じアドレスのウェブ ページはありません。 このような場合、問題になる可能性がありますか?

該当のソースコード

-------------- AppDelegate -------------- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let link = URL(string: "{my universal link}") LoginManager.shared.setup(channelID: "{my channel ID}", universalLinkURL: link) return true }

------------- ViewController -------------- import UIKit import LineSDK

class ViewController: UIViewController, LoginButtonDelegate {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    
    // Create Login Button.
    let loginButton = LoginButton()
    loginButton.delegate = self
    
    // Configuration for permissions and presenting.
    loginButton.permissions = [.profile]
    loginButton.presentingViewController = self
    
    // Add button to view and layout it.
    view.addSubview(loginButton)
    loginButton.translatesAutoresizingMaskIntoConstraints = false
    loginButton.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
    loginButton.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
}

func loginButton(_ button: LoginButton, didSucceedLogin loginResult: LoginResult) {
    print("Login Succeeded.")
    print(loginResult)
}

func loginButton(_ button: LoginButton, didFailLogin error: LineSDKError) {
    print("Error: \(error)")
}

func loginButtonDidStartLogin(_ button: LoginButton) {
    print("Login Started.")
}

}

試したこと

info.plistの様々な設定変更

補足情報(FW/ツールのバージョンなど)

iOS 16.5 / LINE SDK v5 for iOS Swift / Xcode 14.3

  • 0
  • 0
  • 282
  • X(旧Twitter) facebook

Similar posts

    No similar posts

Are you sure? question.vm