0

I'm trying to get access token from Google,Yahoo.But I'm getting an error like WACloudAccessControlClient may not respond to setToken.How to declare setToken method here.

-(BOOL)webView:(UIWebView *)webView
     shouldStartLoadWithRequest:(NSURLRequest *)request
                 navigationType:(UIWebViewNavigationType)navigationType

{

if(_url)
{
    /* make the call re-entrant when we re-load the content ourselves */
    if([_url isEqual:[request URL]])
    {
        return YES;
    }

    [_url release];
}

_url = [[request URL] retain];
NSString* scheme = [_url scheme];

if([scheme isEqualToString:@"acs"])
{
    // parse the JSON URL parameter into a dictionary
    NSDictionary* pairs = [self parsePairs:[_url absoluteString]];
    if(pairs)
    {
        WACloudAccessToken* accessToken;
        accessToken = [[WACloudAccessToken alloc] initWithDictionary:pairs];
        [WACloudAccessControlClient setToken:accessToken];

        [self dismissModalViewControllerAnimated:YES];
    }

    return NO;
}

[NSURLConnection connectionWithRequest:request delegate:self];

return NO;
}

Any ideas? Thanks in advance.

Baby Groot
  • 4,637
  • 39
  • 52
  • 71

1 Answers1

0

You need to pass the message to an object not a class name so first get a reference to an object.

I'm not sure what is your usecase, just look at WACloudAccessControlClient api it will have some init or ...with... methods to create or get a reference to an object of the class.

This:

[WACloudAccessControlClient setToken:accessToken];

Should be something like (the init... method is made up, please replace with actual one):

[[WACloudAccessControlClient initSomethingSomehow] setToken:accessToken];

Are you after something like this?:

[[WACloudAccessControlClient accessControlClientForNamespace:@“namespace-name”
                                                       realm:@“realm-name”]
                             setToken:accessToken];

Edit:

Have a look at this example of how to interact with wa toolkit for iOS I've just skimmed through but it seems to have answers you are looking for.

stefanB
  • 77,323
  • 27
  • 116
  • 141
  • Thanks for your valuable reply.I'm getting that from this link http://www.stevesaxon.me/posts/2011/window-external-notify-in-ios-uiwebview/ Can you please go through it and tell the exact one? – Nagarajan Karthikeyan May 03 '13 at 08:27
  • there's a detail omitted in the example code, I'm guessing the post left out one call with details, same question here http://stackoverflow.com/questions/16231636/ios-wacloudaccesscontrolclient-may-not-respond-to-settoken – stefanB May 03 '13 at 13:41
  • and see here http://stackoverflow.com/questions/8165778/connecting-ios-with-azure-cloud/11304825#11304825 – stefanB May 03 '13 at 13:45