nrikiji / cordova-line-login-plugin

A cordova plugin for easy implementation of LINE login using LineSDK.
Apache License 2.0
21 stars 23 forks source link

Hi #1

Closed fab971 closed 6 years ago

fab971 commented 6 years ago

Thank you for writing this plugin.

I have an error when I try to login in iOS simulator: Error Domain=LineSDKInternalErrorDomain Code=2 "Cannot open the return URL. (line3rdp.com.xxxx://authorize/).

Line setup: iOS bundle ID : com.xxxx iOS scheme : line3rdp.com.xxxx

I'm my missing something?

nrikiji commented 6 years ago

以下を確認いただけないでしょうか。

info.plistにLINE SDKに必要な情報が登録されているかどうか

その1

    <array>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        </array>
      </dict>
・・・

その2

    <key>CFBundleURLTypes</key>
    <array>
・・・
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        </array>
      </dict>
    </array>

その3

    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>lineauth</string>
      <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    </array>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>LineSDKConfig</key>
    <dict>
      <key>ChannelID</key>
      <string>xxxxxxxxxxxx</string>
    </dict>

自分はコレやったら解決しました

1度、xcodeのBundle Identifierを適当なものに変更して、ビルド。 再度元に戻してビルドしたらなぜかうまくいきました。

例) 本来は、com.example.myLineApp のところを、com.example.myLinApp2 として、ビルド。

当然、myLinApp2はLINE側にも登録していないので、LINEログインエラーとなる。 ここで com.example.myLineApp と正規のものにしてビルド

で、成功しました。