我正在使用这个Facebook插件:
https://github.com/jeduan/cordova-plugin-facebook4
它需要将以下代码添加到 iOS 使用的info.plist
文件中。
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb45656565656561</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>45656565656561</string>
<key>FacebookDisplayName</key>
<string>APP-NAME</string>
和
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
我使用的是 Phonegap 构建,所以我只能使用config.xml
文件编辑info.plist
文件......
我确实搜索了如何通过 config.xml 在 phonegap 应用程序项目中编辑info.plist
文件并找到了一些,但它们都是关于相机插件的......
有人可以就此问题提供建议吗?
提前谢谢。
最后我找到了:
<platform name="ios">
<config-file target="*-Info.plist" parent="CFBundleURLTypes">
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>45656565656561</string>
<string>APP-NAME</string>
</array>
</dict>
</array>
</config-file>
</platform>
将其添加到您的config.xml
文件中。
我希望这将在未来帮助其他人,因为这似乎是这个特定 cordova 插件关于此主题的唯一问题/答案。