开发者

How to Register Google APis project?

开发者 https://www.devze.com 2023-03-08 15:36 出处:网络
I am trying to integrate google latitute in iphone, 1. I created a projected with google latitude service and created a client secret.

I am trying to integrate google latitute in iphone,

1. I created a projected with google latitude service and created a client secret.

2. I am using oAuthConsumer to get Access Key as follows

    OAConsumer *consumer = [[OAConsumer alloc] initWithKey:@"App key goes here"
                                                    secret:@"client secret goes here"]; 
    OAMutableURLRequest *request = [[[OAMutableURLRequest alloc] initWithURL:url consumer: consumer token:token realm:nil signatureProvider: nil] autorelease];
    if (!request) return;
    [request setOAuthParameterName:@"scope" withValue:@"https://www.googleapis.com/auth/latitude"];
    [request setOAuthParameterName:@"oauth_callback" withValue:@"http://someURL"];
    [request setHTTPMethod: @"POST"];
    OADataFetcher *fetcher = [[[OADataFetcher alloc] init] autorelease];    
    [fetcher fetchDataWithRequest: request delegate: self didFinishSelector: success didFailSelector: fail];

The problem is in the success delegate instead of oauth token i'm getting the respose as

Consumer is not registered: App-key

So is there a mistake in the above request, if not how to register the google api applic开发者_如何转开发ation

Thanks in advance


We should add a domain and register to programmatically access Google data on behalf of your users. And in the above code the scope and oauth_callback parameter should be in the URl instead of request Header

0

精彩评论

暂无评论...
验证码 换一张
取 消