简体   繁体   中英

Is there a way to share text on facebook messenger without SDK?

Is there a way to share text on facebook messenger without SDK?

I found the following method.

-(void)shareAction:(NSString *)str param:(NSString *)strTitle
{
    NSString *title = strTitle;
    NSURL *url = [[NSURL alloc]initWithString:str];

    NSArray *postItems = @[title, url];
    UIActivityViewController *activityVC = [[UIActivityViewController alloc]
                                            initWithActivityItems:postItems
                                            applicationActivities:nil];

    activityVC.excludedActivityTypes = @[];    
    [self presentViewController:activityVC animated:YES completion:nil];
}

However, not just how to select Facebook Messenger among the various apps,

I want to send it directly to Facebook Messenger.

Is there a way without the SDK?

You can use UIActivityViewController to share the app using Facebook Messenger. Please check following sample URL which will display the App list which have implemented share extension.

http://pinkstone.co.uk/how-to-share-things-with-a-uiactivityviewcontroller/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM