Is it possible to generate a 'share on Facebook' link that opens the native Facebook App on Android/iOS/mobile instead of the web share dialog?

后端 未结 3 1057
遥遥无期
遥遥无期 2020-12-04 17:37

Is it possible to have a share on Facebook link on a website that opens the share dialog in the native App?

Current behavio

3条回答
  •  执笔经年
    2020-12-04 18:01

    I know it has been a couple of years, but for whom it may concern:
    Have a look at this answer; Xcode : sharing content via Action Sheet.

    Let me copy that answer overhere as well:

    Swift

    let shareText = "Hello, world!"
    if let image = UIImage(named: "myImage") {
        let vc = UIActivityViewController(activityItems: [shareText, image], applicationActivities: [])
        presentViewController(vc, animated: true, completion: nil)
    }
    

    Try links for tutorials

    • http://nshipster.com/uiactivityviewcontroller/
    • http://www.codingexplorer.com/add-sharing-to-your-app-via-uiactivityviewcontroller/
    • http://roadfiresoftware.com/2014/02/how-to-add-facebook-and-twitter-sharing-to-an-ios-app/

提交回复
热议问题