While I think I've added and set up the FacebookMessengerSDK correctly I keep getting this error when I click the share button, which at the moment would just present the messenger, it doesn't actually do anything yet.
LaunchServices: ERROR: There is no registered handler for URL scheme fb-messenger-
Here is part of my Plist source code which the Facebook developer website told me to include.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string><RemovedForSecurityPurposes></string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string><RemovedForSecurityPurposes></string>
<key>FacebookDisplayName</key>
<string><FBAppNameHere></string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
Here is my app delegate
import UIKit import FBSDKCoreKit import FBSDKMessengerShareKit
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, FBSDKMessengerURLHandlerDelegate {
var window: UIWindow?
var composerContext = FBSDKMessengerURLHandlerOpenFromComposerContext()
var replyContext = FBSDKMessengerURLHandlerReplyContext()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
let messengerURLHandler = FBSDKMessengerURLHandler()
messengerURLHandler.delegate = self
return true
}
//Other stuff was here but I removed it
func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
let urlHandler = FBSDKMessengerURLHandler()
if urlHandler.canOpenURL(url, sourceApplication: sourceApplication) {
urlHandler.openURL(url, sourceApplication: sourceApplication)
}
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
//Messenger
func messengerURLHandler(messengerURLHandler: FBSDKMessengerURLHandler!, didHandleOpenFromComposerWithContext context: FBSDKMessengerURLHandlerOpenFromComposerContext!) {
composerContext = context
}
func messengerURLHandler(messengerURLHandler: FBSDKMessengerURLHandler!, didHandleReplyWithContext context: FBSDKMessengerURLHandlerReplyContext!) {
replyContext = context
}
}
Any help? Thank you!