2012-10-03 67 views

回答

0

是的,你可以登錄使用FaceBook帳戶。教程Facebook的整合Link

0

是的,這是可能的:

的iOS:

1)通過Facebook

登錄
[QBUsers logInWithSocialProvider:@"facebook" delegate:self]; 

... 

// QuickBlox queries delegate 
- (void)completedWithResult:(Result *)result{ 

    // success result 
    if(result.success){ 

     // User Login 
     if([result isKindOfClass:QBUUserLogInResult.class]){ 
      QBUUserLogInResult *res = (QBUUserLogInResult *)result; 

      // Your Facebook access token 
      NSString *accessToken = res.socialProviderToken; 
      NSString *expiresAt = res.socialProviderTokenExpiresAt; 

    }else{ 
     NSLog(@"Errors=%@", result.errors); 
    } 
} 

2)獲取您的Facebook個人資料

NSString *meQuery = [NSString stringWithFormat:@"https://graph.facebook.com/me?access_token=%@", accessToken]; 

NSURL *url = [NSURL URLWithString:[meQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 
NSURLRequest *request = [NSURLRequest requestWithURL:url]; 


// perform request 
NSURLResponse **response = nil; 
NSError **error = nil; 
NSData *resultData = [NSURLConnection sendSynchronousRequest:request returningResponse:response error:error]; 

// set body 
NSString *bodyAsString = [[NSString alloc] initWithData:resultData encoding:NSUTF8StringEncoding]; 
SBJsonParser *parser = [[SBJsonParser alloc] init]; 

// This is your Facebook profile as dictionary 
NSDictionary *me = [parser objectWithString:bodyAsString]; 

[bodyAsString release]; 
[parser release]; 

3)基於位置的聊天 - 看位置樣本http://quickblox.com/developers/SimpleSample-location_users-ios - 它是基於簡單的位置聊天,就是它登錄後

Android

您是否看到

MapChat sample

此示例包含您需要

+0

我已標記了這個問題,「Android」的所有功能。我不想Objective C的代碼.. – Ritesh

+0

更新我的回答 –

+0

亞我已經看到了超採樣(地圖聊天代碼示例)的Android ,但問題是它不是免費的(只有高達5 GB免費),我正在製作商業應用程序,所以我打算部署我的服務器。 – Ritesh

相關問題