This project contains QuickBlox iOS SDK, that includes
- framework
- snippets (shows main use cases of using this one)
- samples (separated samples for each QuickBlox module)
To start work you should just put framework into your project and call desired methods.
Latest framework file you can download from downloads page.
iOS SDK is really simple to use. Just in few minutes you can power your mobile app with huge amount of awesome functions to store, pass and represent your data.
3. Add framework to project, see this tutorial
The common way to interact with QuickBlox can be presented with following sequence of actions:
- Initialize framework with application credentials
- Create session
- Login with existing user or register new one
- Perform actions with any QuickBlox data entities (users, locations, files, custom objects, pushes etc.)
#initialize-framework-with-application-credentials
[QBSettings setApplicationID:92];
[QBSettings setAuthorizationKey:@"wJHdOcQSxXQGWx5"];
[QBSettings setAuthorizationSecret:@"BTFsj7Rtt27DAmT"];
#create-session
[QBAuth createSessionWithDelegate:self];
- (void)completedWithResult:(Result *)result{
if(result.success && [result isKindOfClass:QBAAuthSessionCreationResult.class]){
// Success, do something
}
}
#register-login
First create (register) new user
QBUUser *user = [QBUUser user];
user.login = @"garry";
user.password = @"garry5santos";
[QBUsers signUp:user delegate:self];
- (void)completedWithResult:(Result *)result{
if(result.success && [result isKindOfClass:QBUUserResult.class]){
// Success, do something
QBUUserResult *userResult = (QBUUserResult *)result;
NSLog(@"New user=%@", userResult.user);
}
}
then authorize user
[QBUsers logInWithUserLogin:@"garry" password:@"garry5santos" delegate:self];
- (void)completedWithResult:(Result *)result{
if(result.success && [result isKindOfClass:QBUUserLogInResult.class]){
// Success, do something
QBUUserLogInResult *userResult = (QBUUserLogInResult *)result;
NSLog(@"Logged In user=%@", userResult.user);
}
}
#perform-actions
Create new location for Indiana Jones
QBLGeoData *location = [QBLGeoData geoData];
location.latitude = 23.2344;
location.longitude = -12.23523;
location.status = @"Hello, world, I'm Indiana Jones, I'm at London right now!";
[QBLocation createGeoData:location delegate:self];
- (void)completedWithResult:(Result *)result{
if(result.success && [result isKindOfClass:QBLGeoDataResult.class]){
// Success, do something
QBLGeoDataResult *locationResult = (QBLGeoDataResult *)result;
NSLog(@"New location=%@", locationResult.geoData);
}
}
or put Image into storage
NSData *file = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"YellowStar" ofType:@"png"]];
[QBContent TUploadFile:file fileName:@"Great Image" contentType:@"image/png" isPublic:YES delegate:self];
- (void)completedWithResult:(Result *)result{
if(result.success && [result isKindOfClass:QBCFileUploadTaskResult.class]){
// Success, do something
}
}
iOS Framework provides following services to interact with QuickBlox functions (each service is represented by model with suite of static methods):
- QBAuth
- QBUsers
- QBCustomObjects
- QBLocation
- QBContent
- QBRatings
- QBMessages
- QBChat