Windows

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

Contents

Download Quickblox SDK

You can download QuickBlox UWP Sdk from Quickblox SDK v1.2.0. To install Quickblox Universal Windows Platform Sdk, run the following command in the Package Manager Console:

Install-Package Quickblox.Sdk

or just search for "Quickblox Sdk" in NuGet package manager.

Cross-platform Quciblox Sdk for Xamarin iOS/Android/Forms, Xamarin.Mac/MonoMac, Windows Phone 8/8.1, Windows Store and Windows Desktop.

Read how to add sdk with nuget package.

Code samples

Learn how to create a Chat room, add occupants - these code samples are simple enough that even novice developers will be able to understand them.

Title APIs used Description
Simple Xamarin Chat code sample Chat, Users The Chat sample connects and socializes your users with the chat module. Features include: Peer to Peer Chat; Group chat.


Chat-xamarin-1.PNG Chat-xamarin-2.PNG Chat-xamarin-3.PNG Chat-xamarin-4.PNG Chat-xamarin-5.PNG Chat-xamarin-6.PNG

Chat-xamarin-1(android).png Chat-xamarin-2(android).png Chat-xamarin-3(android).png Chat-xamarin-4(android).png Chat-xamarin-5(android).png Chat-xamarin-6(android).png

Wp ss 20160601 0001.png Wp ss 20160601 0002.png Wp ss 20160601 0006.png Wp ss 20160601 0003.png Wp ss 20160601 0004.png Wp ss 20160601 0007 (1).png


Getting started

Quickblox Sdk is really simple to use. In just a few minutes you can power up your mobile app with huge amount of awesome communication features & data services.

var quickbloxClient = new QuickbloxClient(applicationId, authKey, authSecret);

By default QuickbloxClient is configured to work with the shared server (https://api.quickblox.com). If you have a dedicated server you need to provide your API endpoint and Chat Endpoint to the QuickbloxClient constructor.

Preparing for use

Call Init() method for each platform before you use Quickblox Sdk

Quickblox.Sdk.Platform.QuickbloxPlatform.Init();

Authentication and Authorization

To be able to use QuickBlox API you have to create a session.

There are 2 types of session:

  • Application session. It provides only READ access to data.
  • User session. It provides CRUD(Create, Read, Update, Delete) access to data.

User sign up scenario

You can create an Application session with just the following code:

var sessionResponse = await quickbloxClient.AuthenticationClient.CreateSessionBaseAsync();

If session is successfully created sessionResponse.StatusCode is going to be equal HttpStatusCode.Created and quickbloxClient.Token will contain the token for current session.

Then you can sign up a new user:

var userSignUpRequest = new UserSignUpRequest
            {
                User = new UserRequest()
                {
                    Email = email,
                    FullName = fullName,
                    Password = password
                }
            };
 
var response = await QuickbloxClient.UsersClient.SignUpUserAsync(userSignUpRequest);

After this you can upgrade your session to User session:

var loginResponse = await QuickbloxClient.AuthenticationClient.ByEmailAsync(email, password);

User sign in scenario

To login an existing user use CreateSessionWithEmailAsync or CreateSessionWithLoginAsync methods.

var sessionResponse = await QuickbloxClient.AuthenticationClient.CreateSessionWithEmailAsync(email, password);

If session is successfully created sessionResponse.StatusCode is going to be equal HttpStatusCode.Created and quickbloxClient.Token will contain the token for current session.

XML documentation

Full reference on classes and interfaces used in QuickBlox UWP SDK (XML Documentation): http://sdk.quickblox.com/xamarin/documentation/