简体   繁体   English

swift4的facebook ios url方案

[英]facebook ios url scheme for swift4

Does anyone know the scheme of facebook for swift4?有谁知道 swift4 的 facebook 计划?
I have tried many ways and also these:我尝试了很多方法,还有这些:

fb://profile/\(Username)! ,  
fb://profile?id=[username|user_id] , 

but redirects me to the wall of my facebook page但将我重定向到我的 facebook 页面的墙上

Ok guys i solved it using find my facebook id: https://findmyfbid.com and replace the companyName with id for the appURL好的,我使用查找我的 facebook id 解决了这个问题: https ://findmyfbid.com 并将 companyName 替换为 appURL 的 id

let appURL = NSURL(string: "fb://profile/1381815961922424")!让 appURL = NSURL(string: "fb://profile/1381815961922424")!

First you should create app in facebook developers then get the app id and in info.plist replace YYYYYYYYYYYYYY with id of your app首先,您应该在 facebook 开发人员中创建应用程序,然后获取应用程序 ID 并在 info.plist 中将 YYYYYYYYYYYYYY 替换为您的应用程序 ID

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fbYYYYYYYYYYYYYY</string>

            </array>
        </dict>
    </array>

I could only redirect to user profile using facebook user id.我只能使用 Facebook 用户 ID 重定向到用户个人资料。 So the URL like http://facebook.com/816657065103305 goes to user profile所以像http://facebook.com/816657065103305这样的 URL 转到用户个人资料

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM