FBSDK ShareDialog 正在显示 "Invalid App ID: The provided app ID does not look like a valid app ID."
FBSDK ShareDialog is showing "Invalid App ID: The provided app ID does not look like a valid app ID."
我正在尝试在我的本机反应应用程序中使用 FBSDK ShareDialog(目前只有 IOS),当我打开 ShareDialog 时,我一直看到 'Invalid App ID' 消息。我将指定的代码添加到我的 info.plist 文件中,但我的 Facebook 应用程序未处于沙盒模式;我一直没能找到解决这个问题的方法。
我的 ShareDialog 代码:
const shareLinkContent = {
contentType: 'link',
contentUrl: "http://google.com",
contentDescription: "The world's most popular search engine"
};
ShareDialog.setMode("webview");
ShareDialog.canShow(shareLinkContent).then(function(canShow) {
if (canShow) {
return ShareDialog.show(shareLinkContent);
} else {
self.props.navigation.navigate('Notifications', { notifications: updatedNotifications });
}
}).then(function(result) {
if (result.isCancelled) {
console.log('Share cancelled');
} else {
console.log('Share success with postId: ' + result.postId);
}
},
function(error) {
console.log('Share fail with error: ' + error);
}
);
我的 info.plist 文件:
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>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{ My App's Facebook App ID }</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>{ My App's Facebook App ID }</string>
<key>FacebookDisplayName</key>
<string>{ My App's Display Name }</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>{ My App's Display Name }</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</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</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>UIAppFonts</key>
<array>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
</dict>
</plist>
This is how the error appears in my emulator
事实证明,Facebook 拒绝的部分不是我的应用程序 ID,而是从本机应用程序访问 'webview'。从我的实际设备上启动 运行 应用程序并删除 ShareDialog.setMode("webview");
- 非常有效!我想这是因为 Facebook 最近限制了 API / SDK 访问。
我正在尝试在我的本机反应应用程序中使用 FBSDK ShareDialog(目前只有 IOS),当我打开 ShareDialog 时,我一直看到 'Invalid App ID' 消息。我将指定的代码添加到我的 info.plist 文件中,但我的 Facebook 应用程序未处于沙盒模式;我一直没能找到解决这个问题的方法。
我的 ShareDialog 代码:
const shareLinkContent = {
contentType: 'link',
contentUrl: "http://google.com",
contentDescription: "The world's most popular search engine"
};
ShareDialog.setMode("webview");
ShareDialog.canShow(shareLinkContent).then(function(canShow) {
if (canShow) {
return ShareDialog.show(shareLinkContent);
} else {
self.props.navigation.navigate('Notifications', { notifications: updatedNotifications });
}
}).then(function(result) {
if (result.isCancelled) {
console.log('Share cancelled');
} else {
console.log('Share success with postId: ' + result.postId);
}
},
function(error) {
console.log('Share fail with error: ' + error);
}
);
我的 info.plist 文件:
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>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{ My App's Facebook App ID }</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>{ My App's Facebook App ID }</string>
<key>FacebookDisplayName</key>
<string>{ My App's Display Name }</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>{ My App's Display Name }</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</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</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>UIAppFonts</key>
<array>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
</dict>
</plist>
This is how the error appears in my emulator
事实证明,Facebook 拒绝的部分不是我的应用程序 ID,而是从本机应用程序访问 'webview'。从我的实际设备上启动 运行 应用程序并删除 ShareDialog.setMode("webview");
- 非常有效!我想这是因为 Facebook 最近限制了 API / SDK 访问。