【问题标题】:How to remove google plus button from activity view controller?如何从活动视图控制器中删除 google plus 按钮?
【发布时间】:2015-02-23 21:41:36
【问题描述】:

如果用户安装了 Google plus,那么他将能够使用更多按钮选择 Google plus 应用并在活动视图控制器上显示 google plus 图标。有没有办法删除 google plus 按钮?

我添加了以下代码,但仍然没有帮助:

avc.excludedActivityTypes = @[@"com.google.GooglePlus.ShareExtension"];
        //-- show the activity view controller
        [self presentViewController:avc
                           animated:YES completion:nil];

【问题讨论】:

  • 你的问题不够清楚
  • 已编辑问题。希望这是有道理的!

标签: ios google-plus uiactivityviewcontroller


【解决方案1】:

首先,您需要知道 Google Plus 扩展程序使用的活动类型。您可以通过添加:

[(UIActivityViewController *)controller setCompletionHandler:^(NSString *activityType, BOOL completed){
  NSLog(@"type: %@", activityType);
}];

选择 Google Plus 操作并分享内容;控制台将为您记录类型标识符。

然后您需要将其添加到您的excludedActivityTypes

((UIActivityViewController *)controller).excludedActivityTypes = @[@"<whatever the type was>"];

【讨论】:

  • 那么您是否成功删除了 Google Plus 按钮?
  • 因此,当您排除类型并且 Google Plus 按钮仍然存在时,您的 NSLog 在您的 UIActivityViewController 的完成处理程序中表示活动类型是什么?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多