2

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

我的目标是使用 iPhone 应用程序在 Facebook 上分享。

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

任何帮助将不胜感激。

谢谢

[项目名称]-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>
4

1 回答 1

4

您的[PROJECTNAME]-Info.plist. 你错过了“ CFBundleURLName ”。试试下面的代码,它会对你有所帮助。

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.facebook.phonegap.myscheme</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fbxxxxxxxxxxxxxxx</string>
            </array>
        </dict>
    </array>
于 2012-11-29T08:47:12.917 回答