Last active
April 10, 2018 06:29
-
-
Save yycking/0e8abd5073b7b9fe67dd80d4b2d1524e to your computer and use it in GitHub Desktop.
FB no longer allows pre-fill.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>LSApplicationQueriesSchemes</key> | |
<array> | |
<string>fb</string> | |
</array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSString:UIActivityItemSource { | |
public func activityViewControllerPlaceholderItem(_ activityViewController: UIActivityViewController) -> Any { | |
return "" | |
} | |
public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType) -> Any? { | |
let installedFB = UIApplication.shared.canOpenURL(URL(string: "fb://")!) | |
let isFB = activityType == UIActivityType.postToFacebook | |
if installedFB && isFB { | |
return nil | |
} | |
return self | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment