2017-02-10 14 views
1

我试图通过branch.io份额片分享东西:使者没有出现在共享表(UIActivityViewController)branch.io

let shareText = "Some Share Text" 

let linkProperties = BranchLinkProperties() 
linkProperties.feature = "Some" 
linkProperties.addControlParam("$desktop_url", withValue: desktopURLString) 
linkProperties.addControlParam("$android_url", withValue: androidURLString) 

let object = BranchUniversalObject(canonicalIdentifier: "some.cannonical.identifier") 
object.title = "Some Title" 
object.imageUrl = someImageURL 
object.contentDescription = "Some Content Description" 
object.addMetadataKey("some_id", value: identifier) 

object.showShareSheet(with: linkProperties, 
       andShareText: shareText, 
         from: self, 
       completion: completion) 

所有的伟大工程,但Facebook的Messenger应用不显示作为份额表中的选项。无论是在建议的选项还是在“更多”下。实现这一目标需要什么?

对于默认的UIActivityViewController,我发现了以下问题/答案。那如何与branch.io一起工作? Facebook Messenger not showing up with UIActivityViewController

+0

为什么你不使用UIActivityViewController? Facebook和Facebook Messenger也不允许你发送文本。根据Facebook的政策,任何人都不能在分享表中发送预先文字....只需在活动中发送图像,Messenger就会自动出现 –

+0

但是Facebook应用出现。我希望Facebook Messenger也能出现,分别知道是什么导致它不会出现。我需要分支机构为共享/跟踪提供的额外支持。 – helkarli

回答

0

我又钻进了这个问题,我终于找到了麻烦制造者。如果我将分支链接属性的feature设置为包含一个空格的字符串值,Messenger将在共享表中消失。的例子:

let properties = BranchLinkProperties() 
    properties.feature = "Share News" //does not work, messenger does not appear in the share sheet 
    //properties.feature = "Share_News" //works, messenger appears in share sheet 
    object.showShareSheet(with: properties, andShareText: "Some Share Text", from: viewController, anchor: UIBarButtonItem()) { (activityType, completed) in 
     if (completed) { 
      print(String(format: "Branch TestBed: Completed sharing to %@", activityType!)) 
     } else { 
      print("Branch TestBed: Link Sharing Cancelled\n") 
     } 
    } 

feature用作分公司网址中的参数,然后将其提供给共享扩展。虽然我认为这是Branch中的一个编码问题,但似乎Messenger共享扩展并不像其他应用那样处理URL。 “破损的网址”可以与其他共享附加信息一起使用。希望这可以帮助别人!现在我将把我的功能的名称改为没有空间的名称。

2

当您通过iOS上的分享表共享时 - 无论您使用Branch分享表还是UIActivityViewController - 共享选项的选择都不是您自己定义的,它是由用户定义的。

用于设置哪些应用程序出现在列表中的界面可以通过打开共享表,然后滚动显示的应用程序列表直到看到“...”(更多)选项。点击这个按钮,你将与应用程序的列表,可以共享到手机上呈现:

enter image description here

每个应用程序都将有一个滑块 - 如果滑块为特定的应用程序启用,应用程序将出现在列表中。

enter image description here

启用的Facebook Messenger的共享用户的手机上是不是你可以从做你的应用程序的开发中。

您提到当点击更多按钮时,Messenger应用程序甚至不可用。这让我觉得很奇怪。如果安装了我检查的每台设备都有Facebook Messenger作为选项。也许尝试删除并重新安装Facebook Messenger。

+0

谢谢@dwestgate。上述我知道。我正在使用分支。所以我认为这实际上是一个分支问题。 – helkarli

+0

对不起,但我不明白。你表明你有某种问题,但是你描述了预期的行为 - – dwestgate

+0

另外,要清楚的是:Branch使用与你自己显示分享表相同的Apple功能,因此无论你使用分支还是不分支,行为是一样的。 – dwestgate

相关问题