1

I'm wondering how are permission granted? Is there a popup that asks for permission when a tweet is about to occur or is signing in with your twitter account in your settings page permission already?

I created a game where I want to do automatic tweet for the user, and i'm wondering how will I get the user's permission to do so?

I am using iOS 5's built in Twitter Framework, any help is much appreciated.

Thanks in advance.

unwise guy
  • 1,048
  • 8
  • 18
  • 27

4 Answers4

2

If you're using the Twitter framework, then permissions are all handled by iOS itself so you don't have to do anything.

If a user hasn't yet authorized a Twitter account with their device, iOS will prompt it for you once you attempt to use the API, and it'll handle signing in and authorizing with your application for you. Once that is done you will have access to the account from the framework. See Single Sign-On for details.

Of course, you'll still need to handle a user rejecting the prompt and opting not to post a tweet from your application as well, and not just authorizing.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • Thanks for the reply. So before I post a tweet, I always have to let the user know and get permission.. even though the user already has their twitter account logged in? – unwise guy Nov 28 '12 at 20:56
  • When the user is using your application with Twitter for the first time, it'll ask for permission once. After the user grants permission, it won't ask again. – BoltClock Nov 29 '12 at 02:24
1

If you are using the native api, then the permission is granted automatically. For this the user need to login to the twitter account from the settings APP.

Twiiter login in the settings App:

Twitter Account

Midhun MP
  • 103,496
  • 31
  • 153
  • 200
  • Thanks for your reply. If the permission is granted automatically after they login to their twitter account, am I free to post tweets on their twitter page? Or what is the flow of this process? – unwise guy Nov 28 '12 at 20:57
0

Permission is granted by default if you use native sharing dialog provided by iOS.

Paramasivan Samuttiram
  • 3,728
  • 1
  • 24
  • 28
0
    ACAccountStore *accountStore = [[ACAccountStore alloc] init];

        ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
        [accountStore requestAccessToAccountsWithType:accountType options:nil completion:^(BOOL granted, NSError *error) {
            if(granted) {
//Now you can do everything with your twitter account.
            }}];
GameLoading
  • 6,688
  • 2
  • 33
  • 57