" [应用] QUOT;想要访问Twitter帐户警报不会显示在iOS 6中 [英] "[App]" Would Like Access to Twitter Accounts alert is not shown in iOS 6

查看:163
本文介绍了" [应用] QUOT;想要访问Twitter帐户警报不会显示在iOS 6中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用TWTweetComposeViewController访问用户的Twitter帐户,他/她已在设置 - >Twitter中添加了该帐户。当应用程序尝试访问Twitter帐户时,它应该使用类似以下的消息来提示警报:

I am using TWTweetComposeViewController to access a user's twitter account(s), which he/she has added in Settings -> Twitter. When the app attempts to access a twitter account, it should presente an alert with a message similar to this:

"[AppName] Would Like Access to Twitter Accounts"

您可以点击不允许或好。我想这是操作系统本身显示的警报,因为点击确定实际上可以访问推特。

To which you can tap either "Don't allow" or "OK". I suppose this is an alert displayed by the OS itself, since tapping "OK" actually enables access to twitter.

当我在iOS上测试时,会显示上面的警报5.x设备,但是当我在iOS 6设备上测试时,情况并非如此。我希望在发送以下消息时显示警报,并且我还没有在设置中获得我对Twitter的应用访问权限:

The above alert is displayed when I test it on an iOS 5.x device, but that is not the case when I test it on an iOS 6 device. I expect the alert to be presented when I send the following message, and I have not yet gained my app access to Twitter in settings:

[TWTweetComposeViewController canSendTweet]

如上所述,它不会发生。有谁知道这是iOS 6中的已知错误吗?我一直无法在SO上找到任何帖子,因为我发现不同的行为我没有其他理由我认为这是一个错误。

As described, it does not happen. Does anyone know if this is a known bug in iOS 6? I have been unable to find any posts on SO and since I can find no other reason to the different behavior I believe it's a bug.

仅供参考,我正在测试这个以下两个设备:

FYI, I am testing this on the following two devices:


  • 带有iOS 5.1的iPhone 4

  • 带有iOS 6.0的iPhone 4

更新

我使用DETweetComposeViewController ,它按以下方式检查iOS 5:

I use DETweetComposeViewController, which checks for iOS 5 in the following way:

+ (BOOL)de_isIOS5
{
    return (NSClassFromString(@"NSJSONSerialization") != nil);
}

但是因为NSJSONSerialization类也在iOS 6中表示,所以不应该'是原因。

But since the NSJSONSerialization class is represented in iOS 6 as well, this shouldn't be the reason.

推荐答案

我一直在iOS 5.1和iOS 6.0上整理同样的事情。

I have been sorting this same thing out on iOS 5.1 vs iOS 6.0 all day.

只要在设置中配置了Twitter帐户,我的应用程序就不再要求iOS 6.0中的Twitter访问权限,只显​​示 TWTweetComposeViewController 。我已通过在设置>中手动关闭我的应用的Twitter访问权限验证了这一点。隐私>微博。关闭访问权限,我被正确拒绝使用TWRequest创建友谊的能力,但仍然可以弹出 TWTweetComposeViewController 。我每次都会在iOS 5.1中收到提示,直到我授予它访问权限。

As long as there is a Twitter account configured in Settings, my app no longer asks for Twitter access permission in iOS 6.0 just to display a TWTweetComposeViewController. I have verified this by manually turning off Twitter access for my app in Settings > Privacy > Twitter. With access off, I am properly denied the ability to create a friendship using TWRequest, but can still pop up the TWTweetComposeViewController. I get a prompt in iOS 5.1 every time until I grant it access.

这对我来说很有意义。所有 TWTweetComposeViewController 都会启动推文,因此如果用户已经配置了设备范围的Twitter帐户,那么该权限应该足以从任何地方发送推文。这是一个不必要的额外步骤,必须基于每个应用程序授予访问权限。

This makes sense to me. All TWTweetComposeViewController does is initiate the tweet, so if the user already has a device-wide Twitter account configured, that should be permission enough to send tweets from anywhere. It really is an unnecessary extra step to have to grant access on a per-app basis.

如果尚未配置Twitter帐户, TWTweetComposeViewController 将提示此消息:

If no Twitter accounts are configured yet, TWTweetComposeViewController will prompt with this message tho:

No Twitter Accounts
There are no Twitter accounts
configured. You can add or create
a Twitter account in Settings.

带有便利按钮设置和取消。

with handy buttons "Settings" and "Cancel".

对此的旁注:iOS 6也只在应用首次请求访问时提示[AppName]想要访问Twitter帐户消息。

A sidenote to this: iOS 6 also only prompts with the "[AppName] Would Like Access to Twitter Accounts" message the first time an app requests access.

之后你必须重置设置>一般>重置>重置位置&隐私以获得提示回复。即使您删除并重新安装/重建应用程序,已经被要求一次设置仍然存在。您可以在设置>中手动启用访问权限。隐私,但重置是获得重新显示提示的唯一方法(如果这对您的测试很重要)。

After that you must reset Settings > General > Reset > Reset Location & Privacy to get the ask prompt back. Even if you delete and reinstall/rebuild an app, the "already asked once" setting persists. You can manually enable access in Settings > Privacy, but that reset is the only way to get the prompt to redisplay (if that is important to your testing).

另外两件事我发现。在 [ACAccountStore requestAccessToAccountsWithType:options:completion:] 的完成块中,如果已授予==否

Two extra things I found out. In the completion block of [ACAccountStore requestAccessToAccountsWithType:options:completion:], if granted == NO:


  1. 如果 [错误代码] == 6 ,您的用户没有定义帐户。

  2. 如果错误== nil ,您的用户将暂时或之前拒绝访问您的应用。如果以前发生过,则会默默忽略该请求,屏幕上不会显示任何警告,也不会点击不允许按钮。

  1. If [error code] == 6, your user has no accounts defined.
  2. If error == nil, your user denied access for your app, either just now or previously. If it happened previously, the request is silently ignored with no alert displayed on the screen, no "Don't Allow" button to tap.

这篇关于" [应用] QUOT;想要访问Twitter帐户警报不会显示在iOS 6中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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