Facebook not open page in app swift 3

后端 未结 2 1383
清酒与你
清酒与你 2021-01-07 11:24

I have a link to my facebook, on my website, which opens in the phone\'s browser.

I would like it to open in the facebook app by default, if the app is installed.

2条回答
  •  再見小時候
    2021-01-07 12:11

    I can confirm that the code you are using does work. I placed it in a new project, installed it on my phone, and set the Info.plist values as follows:

    My code is as follows:

    There are a few reasons that your code may not have worked.

    • You may need to clean and rebuild your project to make sure that your changes in Info.plist load.
    • You may need to verify that you added the LSApplicationQueriesSchemes to Info.plist and that that is the plist that the application is set up to load.
    • You must run this on a real device as your simulator should not have Facebook installed.
    • Verify that Facebook is installed and up-to-date.
    • Make sure that you are running the most up-to-date version of Xcode and iOS.
    • If all else fails, delete the app and rebuild and reinstall it.

    You can check that your Info.plist is correctly loading the Queries Schemes by going to the Project Editor's Info tab and looking to make sure that LSApplicationQueriesSchemes is there with the options specified:

提交回复
热议问题