SimpleSample-users-ios

Ask tech team
From QuickBlox Developers (API docs, code samples, SDK)
Jump to: navigation, search

Contents

Sources

Project homepage on GIT — https://github.com/QuickBlox/quickblox-ios-sdk/tree/master/sample-users

Download ZIP - https://github.com/QuickBlox/quickblox-ios-sdk/archive/master.zip

Overview

This sample demonstrates how to work with Users QuickBlox module.
It allows you to see all users, their details, create user, search user, edit current user, sign in, sign out, use social networks (Facebook, Twitter)

It shows you how to:

  1. Retrieve all users
  2. Get users' details
  3. Edit user's parameters
  4. Search users
  5. Sign Up, Sign In/Sign out
  6. How to use QuickBlox through social networks (Facebook, Twitter)




Guide: Getting Started with Users API

Getting a QuickBlox account

http://admin.quickblox.com/register

Creating an application on the Admin panel

http://admin.quickblox.com/apps/new

For further reading, there is also this 5 minute guide.

Connecting QuickBlox to your application

To get the information on how to connect to the QuickBlox.framework, please, refer to the IOS-how-to-connect-Quickblox-framework page.

Adding a User Base to your application

In order to use QuickBlox Users APIs (any QuickBlox API) you must create session. Then you will have READ access in QuickBlox environment:

Creating a session

[QBAuth createSessionWithDelegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
// QuickBlox result delegate
- (void)completedWithResult:(Result *)result{
 
    // Create session result
    if(result.success && [result isKindOfClass:QBAAuthSessionCreationResult.class]){
       // You have successfully created the session
       //
       // Now you can use QuickBlox API!
    }
}

Next, you can work with the Users API.

Let's register a new user:

Signing Up

Creating a new User (registration)

Only login/email and password fields are required

QBUUser *user = [QBUUser user];      
user.login = @"Javck";
user.password = @"javckpassword";
user.externalUserID = 1234;
user.facebookID = @"124343453463463";
user.twitterID = @"142345256";
user.fullName = @"Javck Bold";
user.email = @"Javck@mail.com";
user.phone = @"0947773823";
user.tags = [NSArray arrayWithObjects:@"man", @"travel", nil];
user.website = @"www.mysite.com";
 
[QBUsers signUp:user delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
-(void)completedWithResult:(Result*)result{
        // Create User result
	if(result.success && [result isKindOfClass:[QBUUserResult class]]){
            QBUUserResult *userResult = (QBUUserResult *)result;
	    NSLog(@"Registration was successful, user=%@", userResult.user);
	}else{
	    NSLog(@"errors=%@", result.errors);
	}	
}

If registration was successful - you can sign in using you login/email and password.

Signing In & Social authorization

There are 4 methods that you can use to sign in to QuickBlox:

  • Signing In with a login & password
  • Signing In with an email & password
  • *Signing In using the Facebook/Twitter dialog form
  • Signing In using a Facebook/Twitter access token

*If you want to sign in through Social networks (Facebook/Twitter) using a dialog form - please refer to Social Networks Integration Manual

Signing In with a login & password

[QBUsers logInWithUserLogin:@"garry" password:@"garry2892"  delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
-(void)completedWithResult:(Result*)result{
    if(result.success && [result isKindOfClass:[QBUUserLogInResult class]]){
	QBUUserLogInResult *loginResult = (QBUUserLogInResult *)result;
            NSLog(@"LogIn was successful, user=%@", loginResult.user);
    }else {
        NSLog(@"errors=%@", result.errors);
    }
}

Signing In with an email & password

[QBUsers logInWithUserEmail:@"cptjack@portroyal.com" password:@"iostest2" delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    if(result.success && [result isKindOfClass:[QBUUserLogInResult class]]){
        QBUUserLogInResult *loginResult = (QBUUserLogInResult *)result;
        NSLog(@"LogIn was successful, user=%@", loginResult.user);
    }else{
	NSLog(@"errors=%@", result.errors);
    }
}

Signing In using a Facebook/Twitter dialog form

[QBUsers logInWithSocialProvider:@"facebook" scope:@[@"publish_stream"] delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    if(result.success && [result isKindOfClass:[QBUUserLogInResult class]]){
        QBUUserLogInResult *loginResult = (QBUUserLogInResult *)result;
        NSLog(@"LogIn was successful, user=%@, \n socialProviderToken=%@, \n socialProviderTokenExpiresAt=%@", loginResult.user, loginResult.socialProviderToken, loginResult.socialProviderTokenExpiresAt);
    }else{
	NSLog(@"errors=%@", result.errors);
    }
}

Dialog with the login & password fields will then appear:

IOS SocialDialog1.png IOS SocialDialog2.png

If you need to handle close button interaction - you can add observer and listen QuickbloxSocialDialogDidCloseNotification notification.

Signing In using a Facebook/Twitter access token

There are lots of use cases where this API will be helpful. For example, Twitter framework (iOS5) or Social Framework (iOS6).

For example, you can set the Twitter account in your device Settings, and use it for tweets like this:

TwitteriOS5-6.jpeg

And if you want to use this account to login to QuickBlox, you need to retrieve access token & access the token secret. There is one Twitter official solution: Using Reverse Auth. Just use it to retrieve your credentials and then you will be able to sign in to QuickBlox using your Twitter system account.

[QBUsers logInWithSocialProvider:@"facebook" accessToken:@"AAAGmLYiu1lcBADxROiXg4okE80FQO1dJHglsbNT3amxmABnmBmhN6ACbgDqNC3H4Y9GmZAdoSfPUkI9O7ZBJvKQCewNZAp3SoxKCNIMwQZDZD" accessTokenSecret:nil delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    if(result.success && [result isKindOfClass:[QBUUserLogInResult class]]){
        QBUUserLogInResult *loginResult = (QBUUserLogInResult *)result;
        NSLog(@"LogIn was successful, user=%@", loginResult.user);
    }else{
	NSLog(@"errors=%@", result.errors);
    }
}

Online\Offline status

Each user has the lastRequestAt field - the last user activity time (last query time). You can use it to determine if user online or offline now. For example:

 
NSInteger currentTimeInterval = [[NSDate date] timeIntervalSince1970];
NSInteger userLastRequestAtTimeInterval   = [[user lastRequestAt] timeIntervalSince1970];
 
// if user didn't do anything last 5 minutes (5*60 seconds)    
if((currentTimeInterval - userLastRequestAtTimeInterval) > 5*60){ 
     // user is offline now
}

Updating your own profile

If you want to update your profile - just use the method below. You can update only your own user, just put your User's ID:

Editing User

// Update User by ID
QBUUser *user = [QBUUser user];
user.ID = 292; // you currently signed in user ID
user.tags = [NSArray arrayWithObjects:@"man", @"travel", nil];
user.website = @"www.mysite.com";
 
[QBUsers updateUser:user delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result*)result{
    // Update User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult* res = (QBUUserResult*)result;
        NSLog(@"User was edited successful, user=%@", res.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }
}

Updating a profile picture (avatar)

To update a user profile picture you must:

  1. Upload new picture to Content module
  2. Connect picture to user through user's blobID field
// Upload new avatar to Content module
NSData *avatar = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"myAvatar" ofType:@"png"]];
//
[QBContent TUploadFile:file fileName:@"MyAvatar" contentType:@"image/png" isPublic:NO delegate:self];
 
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
 
    // success result
    if(result.success){
        // Upload file result
        if([result isKindOfClass:QBCFileUploadTaskResult.class]){
 
            // get uploaded file 
            QBCFileUploadTaskResult *res = (QBCFileUploadTaskResult *)result;
            NSUInteger uploadedFileID = res.uploadedBlob.ID;
 
            // Connect image to user
            QBUUser *user = [QBUUser user];
            user.ID = 300;
            user.blobID = uploadedFileID;
 
            [QBUsers updateUser:user delegate:self];
 
        // Update user result
        }else if([result isKindOfClass:QBUUserResult.class]){
             // Profile picture has changed!
        }
    }else{
        NSLog(@"Errors=%@", result.errors);
    }
}

Now other users will be able to see your avatar.

NSUInteger userProfilePictureID = user.blobID; // user - an instance of QBUUser class
 
// download user profile picture
[QBContent TDownloadFileWithBlobID:userProfilePictureID delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Download file result
    if(result.success && [result isKindOfClass:QBCFileDownloadTaskResult.class]){
        // extract image
        QBCFileDownloadTaskResult *res = (QBCFileDownloadTaskResult *)result;
        UIImage *profilePicture = [UIImage imageWithData:res.file];
    }else{
        NSLog(@"Errors=%@", result.errors);
    }
}

Resetting a password

If your forgot your password - you can reset it using the method below. An email with instructions will be sent to your email address.

Resetting a User's password.

// Reset User's password with email
[QBUsers resetUserPasswordWithEmail:@"khig@gmail.com" delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    if(result.success && [result isKindOfClass:Result.class]){
        NSLog(@"Reset password OK");
    }else{
        NSLog(@"Errors=%@", result.errors);
    }
}

Signing Out

If you want to sign out - just use the method below:

Removing a User's session (logout)

[QBUsers logOutWithDelegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result*)result{
    // Sign Out User result
    if(result.success && [result isKindOfClass:[QBUUserLogOutResult class]]){
        NSLog(@"User was logged out successful");
    }
}

Retrieving users

There are lots of methods for retrieving users:

  • Retrieve all Users
  • Retrieve Users by IDs
  • Retrieve Users by Logins
  • Retrieve Users by Emails
  • Retrieve Users by Phone numbers
  • Retrieve Users by Twitter IDs
  • Retrieve Users by Facebook IDs
  • Retrieve Users by Tags. Tags like groups, in which we can group users
  • Retrieve Users with full name
  • Retrieve User by ID
  • Retrieve User by login
  • Retrieve User by Facebook ID
  • Retrieve User by Twitter ID
  • Retrieve User by email
  • Retrieve User by external ID. You can connect a user from a 3d party system to a QuickBlox user through an external ID.

Retrieving all Users

You can use page parameters such as:

  • perPage - how many users each page will contain (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithPagedRequest:pagedRequest delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Sometimes you need to retrieve all your QuickBlox users. But there is one restriction: you can retrieve a maximum of 100 users per query.

Here is an example how to retrieve all users:

- (void)retrieveAllUsersFromPage:(int)page{
 
    PagedRequest *pagedRequest = [PagedRequest request];
    pagedRequest.perPage = 100;
    pagedRequest.page = page;
 
    [QBUsers usersWithPagedRequest:pagedRequest delegate:self];
}
 
 
// Start
[self retrieveAllUsersFromPage:1];
 
 
#pragma mark - 
#pragma mark QBActionStatusDelegate
- (void)completedWithResult:(Result *)result{ 
 
    // Get User result 
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result; 
 
        static int userNumber = 1;
        for(QBUUser *user in usersResult.users){
            NSLog(@"User N%d is: %@", userNumber, user);
            ++userNumber;
        }
 
        if(usersResult.currentPage < usersResult.totalPages){
            [self retrieveAllUsersFromPage:usersResult.currentPage + 1];
        }
    }
}

Retrieve Users by IDs

You can use page parameters like:

  • perPage - how many users will be displayed per page (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithIDs:@"300,298" pagedRequest:pagedRequest delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users through their Logins

You can use page parameters like:

  • perPage - how many users will contain each page (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithLogins:@[@"emma", @"Javck"] pagedRequest:pagedRequest delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users through their Emails

You can use page parameters like:

  • perPage - how many users will be displayed on each page (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithEmails:@[@"Javck@mail.com", @"abc@gmail.com"] pagedRequest:pagedRequest delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users by their Phone numbers

You can use page parameters like:

  • perPage - how many users will be displayed on each page (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithPhoneNumbers:@[@0995673456, @784893332] pagedRequest:pagedRequest delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users through their Twitter IDs

You can use page parameters like:

  • perPage - how many users will be displayed on each page (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithTwitterIDs:@[@"2342355245346",@"789789789789"] delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users through their Facebook IDs

You can use page parameters like:

  • perPage - how many users will be displayed on each page (max 100)
  • page - current returned page
PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 50;
pagedRequest.page = 1;
 
[QBUsers usersWithFacebookIDs:@[@"424353563564544ffd",@"100000773956777"] delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get Users result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users by tags

[QBUsers usersWithTags:[NSArray arrayWithObjects:@"man", @"travel", nil] delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users through their full names

PagedRequest *pagedRequest = [PagedRequest request];
pagedRequest.perPage = 1;
pagedRequest.page = 1;
 
[QBUsers usersWithFullName:@"Javck Bold" pagedRequest:pagedRequest delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserPagedResult class]]){
        QBUUserPagedResult *usersResult = (QBUUserPagedResult *)result;
        NSLog(@"Users=%@", usersResult.users);
        //
        NSLog(@"Page parameters: currentPage %d, totalPages %d, perPage %d, totalEntries %d",
                  usersResult.currentPage,
                  usersResult.totalPages,
                  usersResult.perPage,
                  usersResult.totalEntries);
    }else{
        NSLog("errors=%@", result.errors);
    }
}

Retrieving Users through their IDs

[QBUsers userWithID:292 delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult *userResult = (QBUUserResult *)result;
        NSLog(@"User=%@", userResult.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }	
}

Retrieving User by login

[QBUsers userWithLogin:@"Javck" delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult *userResult = (QBUUserResult *)result;
        NSLog(@"User=%@", userResult.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }	
}

Retrieving Users through their facebook IDs

[QBUsers userWithFacebookID:@"124343453463463" delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult *userResult = (QBUUserResult *)result;
        NSLog(@"User=%@", userResult.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }	
}

Retrieving Users through their twitter IDs

[QBUsers userWithFacebookID:@"124343453463463" delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult *userResult = (QBUUserResult *)result;
        NSLog(@"User=%@", userResult.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }	
}

Retrieving Users through their email

[QBUsers userWithEmail:@"Javck@mail.com" delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult *userResult = (QBUUserResult *)result;
        NSLog(@"User=%@", userResult.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }	
}

Retrieving Users through an external ID

[QBUsers userWithExternalID:555 delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result *)result{
    // Get User result
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        QBUUserResult *userResult = (QBUUserResult *)result;
        NSLog(@"User=%@", userResult.user);
    }else{
        NSLog(@"errors=%@", result.errors);
    }	
}

Deleting a user

If you need, you can delete a user using methods below:

Deleting a User through ID

[QBUsers deleteUserWithID:4845 delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result*)result{
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        // OK, do something
    }else{
        NSLog(@"errors=%@", result.errors);
    }
}

Delete User by external ID

[QBUsers deleteUserWithExternalID:555 delegate:self];
 
#pragma mark -
#pragma mark QBActionStatusDelegate
 
- (void)completedWithResult:(Result*)result{
    if(result.success && [result isKindOfClass:[QBUUserResult class]]){
        // OK, do something
    }else{
        NSLog(@"errors=%@", result.errors);
    }
}

Integrating QuickBlox with your existing User Base

If you want to integrate QuickBlox, but you have already your User Base, you can use the externalUserID field. Just set it during the QuickBlox user registration:

QBUUser *user = [QBUUser user];      
user.login = @"Javck";
user.password = @"javckpassword";
user.externalUserID = 758902384; // ID of user from your own user base
 
[QBUsers signUp:user delegate:self];

Next you can retrieve QuickBlox user by external ID by user ID from your user base and use QuickBlox platform features.

Comments

Feel free to comment on this page using the form below.

blog comments powered by Disqus