[英]How to avoid the throttle limit for a particular call of LinkedIn API in iPhone?
[英]Parse Linkedin API call
這是Mainviewcontroller中的外觀。
我有兩個單獨的類,LinkedInUser和_User。 accessToken存儲在LinkedInUser中,而不存儲在_User中。 LinkedInUser類中有一個名為“ user”的指針,該指針指向_User中的“ objectID”。 我想從LinkedInUser檢索accessToken,但是超時我嘗試查詢不返回任何結果,當我運行下面的代碼時,結果為null。 我在做什么錯,我該如何解決?
[PFLinkedInUtils logInWithBlock:^(PFUser *user, NSError *error) {
NSLog(@"User: %@, Error: %@", user, error);
PFObject *linkedin = [PFObject objectWithClassName:@"LinkedInUser"];
NSString *accessToken = linkedin[@"accessToken"];
[PFLinkedInUtils.linkedInHttpClient GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~:(blahblahblah)?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, id result)
這行:
PFObject *linkedin = [PFObject objectWithClassName:@"LinkedInUser"];
正在創建LinkedInUser
對象的新實例。 它沒有accessToken
屬性的值。 相反,您應該向Parse查詢與用戶關聯的現有對象。
另外,如果您能夠稍微更改數據模型,則在_User
具有引用LinkedInUser
的指針可能會更好。 這樣,您可以直接獲取該對象,而不必進行其他查詢。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.