无法使用UIActivityViewController将文本共享给fb Messenger [英] Can't share text to fb messenger using UIActivityViewController

查看:162
本文介绍了无法使用UIActivityViewController将文本共享给fb Messenger的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用以下方式将文本共享至whatsapp/message应用

I can share text to whatsapp/message app using

NSString* text=@"I am sharing this text";
NSArray* sharedArray=@[text];
UIActivityViewController * activityVC=[[UIActivityViewController alloc]initWithActivityItems:sharedArray applicationActivities:nil];
dispatch_async(dispatch_get_main_queue(), ^{
    // code here
    [self presentViewController:activityVC animated:YES completion:nil];//:activityVC animated:YES];

});

当我使用这段代码时,缺少"facebook Messenger"选项.

BUt the facebook messenger option is missing when I use this piece of code.

我必须将NSURL添加到数组中,以使facebook Messenger选项在UIActivityController视图中可见:

I have to add NSURL to the array, to make the facebook messenger option visible in the UIActivityController view:

NSString* text=@"I am sharing this text";
NSURL *myWebsite = [NSURL URLWithString:@"http://www.google.com"];
NSArray* sharedArray=@[text,myWebsite];
UIActivityViewController * activityVC=[[UIActivityViewController alloc]initWithActivityItems:sharedArray applicationActivities:nil];
dispatch_async(dispatch_get_main_queue(), ^{
    // code here
    [self presentViewController:activityVC animated:YES completion:nil];//:activityVC animated:YES];

});

但是问题是,该文本未在Facebook Messenger中共享,只有链接被共享至fb-messenger.

But the issue is, the text is not shared in the facebook messenger, only the link gets shared to fb-messenger.

是否可以通过我们的应用程序与fb-messenger共享文本?

Is there a way to share text to fb-messenger from our app ?

推荐答案

根据 Facebook平台不幸的是,您无法再提供政策.这就是为什么与文本的共享默默失败的原因.谁知道,如果有足够多的人抱怨他们可能会改变这一点,但我不会屏住呼吸!

According to Facebook's Platform Policy you unfortunately can no longer provide pre-fill text for sharing. This is why sharing with text silently fails. Who knows, if enough people complain they might change this, but I wouldn't hold your breath!

这篇关于无法使用UIActivityViewController将文本共享给fb Messenger的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆