简体   繁体   中英

Unable to set initialtext in ios9 in native facebook share dialog

I am trying to set initial text to SLComposeViewController in iOS 9 , but it is displaying blank in dialog.

Here is my code.

 SLComposeViewController *composeController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];

                 NSString *initialText = @"Tesing text issue.";

                 if (initialText != Nil)
                 {
                     [composeController setInitialText:initialText];
                 }
 dispatch_async(dispatch_get_main_queue(), ^
                                {
                                    //show progress hud here
                                    [self presentViewController:composeController animated:YES completion:nil];
                            });

I have aslo check this in another sharing app, they have also same issue. Can anybody have any workaround here?

Facebook has deprecated the api to set initial text programmatically while sharing. Below are the references:

Hope this helps.

You can set the initial text using graph API and custom share dialogue. https://developers.facebook.com/docs/sharing/opengraph/ios#custom

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