I have read the docs and many forum posts regarding this, but I just cannot retrieve the username of the authorised user while using Sharekit. I am using oAuth.
The user can authenticate ok, and I can post status updates to Twitter. The docs for Sharekit say this about retrieving the username:
Accessing Stored Logins
If your web service uses basic auth, you'll likely need to send the username and password along with the shared item. After a user has been authenticated, the credentials are stored and easily accessible.
// To retrieve a stored value:
// self = your service class
// In this example, let's retrieve the username and password:
NSString *username = [self getAuthValueForKey:@"username"];
NSString *password = [self getAuthValueForKey:@"password"];
//The keys used to retrieve the data are the same keys you used
// when defining your login form:
- (NSArray *)authorizationFormFields
{
return [NSArray arrayWithObjects:
[SHKFormFieldSettings label:@"Username"
key:@"username" <---
type:SHKFormFieldTypeText
start:nil],
[SHKFormFieldSettings label:@"Password"
key:@"password" <---
type:SHKFormFieldTypePassword
start:nil],
nil];
}
I have tried using
NSString *username = [SHK getAuthValueForKey:@"username"];
and
NSString *username = [SHKTwitter getAuthValueForKey:@"username"];
but neither return the username.
Has anyone managed to retrieve this information? Any help is much appreciated.