Cannot Open Messenger from iOS using Facebook 4.37.0

324 views Asked by At

I am trying to open Facebook Messenger to send a message from my iOS app. I am currently running FaceBook SDK version 4.37.0. According to iOS - Sharing, this should be possible. It says

People can also share content from your app to Facebook Messenger with Messenger Expression Platform or from Sharing's Message Dialog in iOS SDK.

If you click on the link for Message Dialog, it provides you with the following example:

        FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
        content.contentURL = [NSURL URLWithString:myFacebookURL];
        content.quote = @"My message";
        [FBSDKMessageDialog showWithContent:content delegate:self];

I have implemented this as well as the FBSDKSharingDelegate delegate methods of:

- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results
{
    NSLog(@"complete");
}

- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error
{
    NSLog(@"Sharer Error");
}

- (void)sharerDidCancel:(id<FBSDKSharing>)sharer
{
    NSLog(@"Cancelled");
}

The delegate methods never get called. What I would expect is that a Facebook Messenger dialog would open allowing me to select a friend to message. But nothing opens. And there are no errors being logged.

I do know that facebook is receiving something because I get the following:

FBSDKLog: param { 

"advertiser_id" = "xxxxxxxxx";
"advertiser_tracking_enabled" = 1;
"anon_id" = "xxxxxxxx";
"application_
tracking_enabled" = 1;
"custom_events" = "[{\"_eventName\":\"fb_mobile_content_view\",\"_logTime\":1541721304,\"fb_description\":\"MY FEATURE Sent\",\"_ui\":\"no_ui\"},{\"_ui\":\"no_ui\",\"_eventName\":\"fb_messenger_dialog_share_show\",\"_logTime\":1541721310,\"_implicitlyLogged\":\"1\",\"fb_dialog_share_content_type\":\"Status\"}]";
event = "CUSTOM_APP_EVENTS";
extinfo = "[\"i2\",\"com.myApp\",\"1\",\"8.3.6\",\"12.0.1\",\"iPhone10,6\",\"en_US\",\"CST\",\"AT&T\",375,812,\"3.00\",6,60,8,\"America\\/Chicago\"]";
"url_schemes" = "[\"myappID\",\"myscheme1\",\"myscheme2\",\"myscheme3\"]";
}

Any help or pointers would be appreciated.

1

There are 1 answers

0
wxmarek On
FBSDKMessageDialog.show(with: FBSDKShareLinkContent(), delegate: nil)

I have the same issue but experimentally I only pass FBSDKShareLinkContent() as a content param and messenger app start

You should also add fb-messenger-share-api key in Info.plist under LSApplicationQueriesSchemes