问题描述
我需要使用 UIActivityViewController 在我的应用程序中添加共享功能,但我做了很多研究,发现例如在 IOS7 和 IOS8 中,如果用户尚未登录或在设置中添加帐户,则 UIActivityViewController 将不会加载 twitter 的图标和Facebook 等.我见过一个名为 MusiXMatch 的应用程序,他们使用了歌曲共享模块上的共享功能.他们显示 Facebook 和 twitter 图标,而没有在设置中添加帐户.我想知道这是怎么发生的.看起来它看起来像默认的 UIActivityViewController 但是我在研究中发现我的 UIActivityViewController 除了登录帐户之外没有得到图标.这个应用程序给了我很多惊喜.我必须这样做.我已经通过使用 OWActivityViewController 完成了这个想法,但它是 IOS6 布局.我需要将其设为默认的 IOS7 和 IOS8.需要尽快解决.非常感谢.
I need to add share functionality in my app with UIActivityViewController but I have done a lot of research and found that e.g in IOS7 and IOS8 if user has not logined or added account in settings then UIActivityViewController will not load the icons of twitter and Facebook etc. I have seen an app named MusiXMatch they have used the sharing on there songs share module.They are showing Facebook and twitter icons without adding the accounts in settings. I am wondering how this is happening. It seems that it looks likes the default UIActivityViewController but what I have found in my research my UIActivityViewController did not get the icons except login into accounts. This app surprise me a lot. I have to make like this. I have done this think by using OWActivityViewController but it is IOS6 layout. I need to make it as default IOS7 and IOS8. Need solution asap. Thanks a lot.
推荐答案
您可以实现自己的 UIActivityType 并要求用户在发布给他们之前登录到所需的应用程序(Facebook、Twitter 等),但您需要构建整个活动来处理通信.您或许可以从 OWAActivityViewController 中提取代码并重新使用它.
You can implement your own UIActivityType and ask the user to login to the desired app (Facebook, Twitter, etc.) before posting to them but you would need to build the whole activity to handle the communication. You might be able to extract the code from OWAActivityViewController and re-use it.
这篇关于UIActivityView 控制器行为很奇怪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!