Still can't get email address after whitelisted and setting

ios
objective-c
email

#1

My app have whitelist by twitter .Privacy Policy URL and Terms of Service URL has set ,“Request email addresses from users” checkbox also set ,and regenerate the user access tokens But i also can,t get email address.The code as below:

   TWTRAPIClient *client = [TWTRAPIClient  clientWithCurrentUser];
                                       
    [client requestEmailForCurrentUser:^(NSString * _Nullable email, NSError * _Nullable error) {
                    DBLog(@"the email is %@ %@",email,error);
                }];
                
                NSURLRequest *request = [client URLRequestWithMethod:@"GET"
                                                                 URL:@"https://api.twitter.com/1.1/account/verify_credentials.json"
                                                          parameters:@{@"include_email": @"true"}
                                                               error:nil];
                
                [client sendTwitterRequest:request completion:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
                    
                    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];

                    
                }];

And this no email feed back ,if i use

                [client requestEmailForCurrentUser:^(NSString * _Nullable email, NSError * _Nullable error) {
                    DBLog(@"the email is %@ %@",email,error);
                }]

i will get

Error Domain=TWTRErrorDomain Code=3 "This user does not have an email address"

But my twitter account is created by my email.

so please help help help!!!


#2

Has the email address been validated? i.e. when the account was created, did you click on the link in the email you were sent to confirm that address?


#3

yes i do


#4

Are you using Twitter Kit in Fabric, or is this using the Social framework?


#5

using Twitter Kit in Fabric


#6

so how i can do ?


#7

using Twitter Kit in Fabric


#8

(moving to the Twitter Kit category)


#9

@anhuijhy I’m happy to dig into this more. Can you share your Twitter Consumer key over email to support(at)fabric(dot)io and reference this thread?


#11

ok wait few moments


#12

dear bonnell
i have sent email to you.Please help !It’s middle night now in China. hahahah.


#13

Hi Michael,

I’m running against this exact problem: getting a “This user does not have an email address” error when using requestEmailForCurrentUser with TwitterKit on iOS. I’ve also already been whitelisted (though I did change an OAuth redirect URL…not sure if that’s relevant. Has there been any resolution to this?

Colin


#14

Hey @colinmcd94,

Is this happening for all users or only a select few?

-Mike


#15

Thanks for following up. I’ve since trying this on a couple of my friends’ devices and it seems to work fine. I’m still having trouble with my own account – I definitely signed up with an email address and I’ve verified the email and everything, but it’s still not working. Though if it works most of the time I suppose that’s good enough :stuck_out_tongue:


#16

Interestingly enough I had the exact same problem with the Facebook API when trying to retrieve emails…I might be cursed.


#17

It is a bit strange @colinmcd94, but if you see this happen more often please let me know.


#18

Hi @bonnell,
I’m struggling currently with similar problem. I’m using requestEmailForCurrentUser: method as well. The user account I’m testing on has an approved email address.
I’ve also noticed, that when I log in to twitter user account I’m testing on and go to settings -> apps, multiple instances of my app are created. One of them says “Has access to your email address”, but I haven’t managed to retrieve user’s email address even one time.
We also have Android app and it works there, but each time they get web view with request for user’s email.


#19

Hey @LukaszKasperek,

Unfortunately, due to the acquisition of Fabric from Google, I’m no longer able to help on Twitter specific questions.


#20

@bonnell Sure. I understand. Thanks for the answer.
Is there any place I could direct such issues right now?


#21

You’re in the correct spot!