Phonegap Facebook登录没有返回我的iPhone应用程序

时间:2012-11-28 18:30:51

标签: iphone facebook cordova

我正在尝试将FacebookSDK-3.1.1集成到我的iPhone应用程序中(使用Phonegap 2.1.0)。登录后我无法返回我的应用程序。

我的目标是使用iPhone App分享facebook。

下面我提供 [PROJECTNAME] -Info.plist 文件和 Cordova.plist 文件。

非常感谢任何帮助。

由于

[PROJECTNAME] -Info.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>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIconFile</key>
    <string>icon.png</string>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>icon.png</string>
                <string>icon@2x.png</string>
                <string>icon-72.png</string>
                <string>icon-72@2x.png</string>
            </array>
            <key>UIPrerenderedIcon</key>
            <false/>
        </dict>
    </dict>
    <key>CFBundleIdentifier</key>
    <string>com.Kwazzi.phonegap</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>CFBundleVersion</key>
    <string>1.0</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>
    <key>FacebookAppID</key>
    <string>xxxxxxxxxxxxxxx</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fbxxxxxxxxxxxxxxx</string>
            </array>
        </dict>
    </array>
</dict>
</plist>

Cordova.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>UIWebViewBounce</key>
    <true/>
    <key>TopActivityIndicator</key>
    <string>gray</string>
    <key>EnableLocation</key>
    <false/>
    <key>EnableViewportScale</key>
    <false/>
    <key>AutoHideSplashScreen</key>
    <true/>
    <key>ShowSplashScreenSpinner</key>
    <true/>
    <key>MediaPlaybackRequiresUserAction</key>
    <false/>
    <key>AllowInlineMediaPlayback</key>
    <false/>
    <key>OpenAllWhitelistURLsInWebView</key>
    <false/>
    <key>BackupWebStorage</key>
    <true/>
    <key>ExternalHosts</key>
    <array>
        <string>*</string>
    </array>
    <key>Plugins</key>
    <dict>
        <key>org.apache.cordova.facebook.Connect</key>
        <string>FacebookConnectPlugin</string>
        <key>Device</key>
        <string>CDVDevice</string>
        <key>Logger</key>
        <string>CDVLogger</string>
        <key>Compass</key>
        <string>CDVLocation</string>
        <key>Accelerometer</key>
        <string>CDVAccelerometer</string>
        <key>Camera</key>
        <string>CDVCamera</string>
        <key>NetworkStatus</key>
        <string>CDVConnection</string>
        <key>Contacts</key>
        <string>CDVContacts</string>
        <key>Debug Console</key>
        <string>CDVDebugConsole</string>
        <key>Echo</key>
        <string>CDVEcho</string>
        <key>File</key>
        <string>CDVFile</string>
        <key>FileTransfer</key>
        <string>CDVFileTransfer</string>
        <key>Geolocation</key>
        <string>CDVLocation</string>
        <key>Notification</key>
        <string>CDVNotification</string>
        <key>Media</key>
        <string>CDVSound</string>
        <key>Capture</key>
        <string>CDVCapture</string>
        <key>SplashScreen</key>
        <string>CDVSplashScreen</string>
        <key>Battery</key>
        <string>CDVBattery</string>
    </dict>
</dict>
</plist>

1 个答案:

答案 0 :(得分:4)

您的[PROJECTNAME]-Info.plist中没有正确的配置。您错过&#34; CFBundleURLName &#34;。试试下面的代码,它会对你有帮助。

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.facebook.phonegap.myscheme</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fbxxxxxxxxxxxxxxx</string>
            </array>
        </dict>
    </array>