1

PhoneGap 2.2.0 / IOSアプリを開発していて、FaceBookプラグインを使用する必要があります。GITで説明されているインストールプロセスに従いました。サンプルフォルダーの「単純な」サンプルを使用すると、デバイスの準備ができたダイアログが表示されます。 appIDを配置するために、それを実行しました。次に、[OK]を押すと、このエラーでアプリがIOSによってスローされます。

'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: No AppID provided; either pass an AppID to init, or add a string valued key with the appropriate id named FacebookAppID to the bundle *.plist'

私のFB.initが聞こえます

    document.addEventListener('deviceready', function() {

                              try {
                              alert('Device is ready! Make sure you set your app_id below this alert.');
                              FB.init({ appId: "fb245065455620705", nativeInterface: CDV.FB, useCachedDialogs: false });
                              document.getElementById('data').innerHTML = "";
                              } catch (e) {
                              alert(e);
                              }
                              }, false);

これは私のplistファイルに追加されたエントリです

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.mdsitg.amisrael</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb245065455620705</string>
            </array>
        </dict>
    </array>

どんな助けでも大歓迎です!

4

3 に答える 3

3

あなたの問題はこの行にあります

FB.init({ appId: "fb245065455620705", nativeInterface: CDV.FB, useCachedDialogs: false });

そのはず:

FB.init({ appId: "245065455620705", nativeInterface: CDV.FB, useCachedDialogs: false });

「fb」はアプリIDの一部であってはならないことに注意してください。

于 2012-11-14T21:28:04.507 に答える
1

私は問題を見つけました、それは私のprojectname.plistにありました私は必要な要素の1つが欠けていました、私は指示を実装するときにそれをスキップしていました助けてくれてありがとう、私は今PhoneGap /Cordova2.2でベースIOSを持っています。 0 FaceBookプラグインが機能している場合、体に1つ必要な場合は、喜んで提供します

これは私の問題を解決した私のplistのソースコードです

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>עמישראל</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIconFile</key>
    <string>icon.png</string>
    <key>CFBundleIconFiles</key>
    <array>
        <string>icon-1.png</string>
        <string>icon-72@2x.png</string>
        <string>icon114.png</string>
    </array>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>icon-1.png</string>
                <string>icon-72@2x.png</string>
                <string>icon114.png</string>
            </array>
            <key>UIPrerenderedIcon</key>
            <false/>
        </dict>
    </dict>
    <key>CFBundleIdentifier</key>
    <string>com.mdsitg.amisrael</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.mdsitg.amisrael</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb245065455620705</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>FacebookAppID</key>
    <string>245065455620705</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string></string>
    <key>NSMainNibFile~ipad</key>
    <string></string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

さらにサポートが必要な場合は、私に聞いてください

于 2012-11-16T06:25:05.353 に答える
0

FacebookAppIDキー/値を*-info.plistに追加してみましたか?

https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/にアクセスし、次をクリックします。

5:新しいXCodeプロジェクトを構成します。

下にスクロールして「FacebookアプリIDを追加する」

基本的に、projectname-info.plistを見つけて、新しいキーと値のペアを追加する必要があります。キーはFacebookAppIDになり、値はアプリID 245065455620705になります(前面にFBはありません)。

于 2012-11-15T17:23:07.847 に答える