[英]Sending a GET request to the Facebook Graph API which contains the user’s latitude and longitude for iOS
有誰知道如何向Facebook Graph API發送GET請求,其中包含用戶的緯度和經度。
這適用於iOS
謝謝你的幫助。
您是指使用Facebook Graph Api獲取用戶當前位置嗎?
這是我從Facebook提供的示例應用程序中借用的示例代碼(適用於ios的Hackbook)鏈接: https : //github.com/facebook/facebook-ios-sdk/tree/master/sample/Hackbook
- (void)apiGraphSearchPlace:(CLLocation *)location {
currentAPICall = kAPIGraphSearchPlace;
NSString *centerLocation = [[NSString alloc] initWithFormat:@"%f,%f",
location.coordinate.latitude,
location.coordinate.longitude];
HackbookAppDelegate *delegate = (HackbookAppDelegate *)[[UIApplication sharedApplication] delegate];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"place", @"type",
centerLocation, @"center",
@"1000", @"distance",
nil];
[centerLocation release];
[[delegate facebook] requestWithGraphPath:@"search" andParams:params andDelegate:self];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.