Когда я использую FBSDKShareKit для обмена определенной строкой с Facebook Messenger, все в порядке, однако, если я нажимаю кнопку «Назад» в исходном приложении, например,

В следующий раз, когда я захочу использовать Facebook Messenger для обмена определенной строкой, Facebook Messenger ничего не отобразит.

FBSDKShareMessengerURLActionButton *urlButton = [[FBSDKShareMessengerURLActionButton alloc] init];
urlButton.title = @"Free AD WiFi";
urlButton.url = [NSURL URLWithString:@"http://www.adwifi.com.tw/"];
FBSDKShareMessengerGenericTemplateElement *element = [[FBSDKShareMessengerGenericTemplateElement alloc] init];
NSString *userShareCodeString = [[NSUserDefaults standardUserDefaults] objectForKey:@"userInviteNum"];
if ([userShareCodeString isEqualToString:@""] | (userShareCodeString == nil)) {
element.title = [NSString stringWithFormat:@"12673"];
}else {
element.title = [NSString stringWithFormat:@"%@", userShareCodeString];
}
element.subtitle = @"FreeADWiFi, Amazing!";
element.imageURL = [NSURL URLWithString:@"http://www.adwifi.com.tw/wp-content/uploads/2017/12/%E8%AA%A0%E5%93%81-01-1.png"];
element.button = urlButton;
FBSDKShareMessengerGenericTemplateContent *content = [[FBSDKShareMessengerGenericTemplateContent alloc] init];
content.pageID = @"";
content.element = element;
FBSDKMessageDialog *messageDialog = [[FBSDKMessageDialog alloc] init];
messageDialog.delegate = self;
messageDialog.shareContent = content;
if ([messageDialog canShow]) {
[messageDialog show];
}
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<NSString *, id> *)options {
return [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]] | [[FBSDKApplicationDelegate sharedInstance] application:app
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
];;
}