This is the first in a series of posts on how to use the Jive iOS SDK to make your own native Jive community iOS app.


The Jive iOS SDK is designed as an Objective-C wrapper around the existing Jive REST api. The goal is to handle the process of communicating with the server while providing an object oriented interface to the app developer. You, as the developer, should then be able to focus your expensive talents on making amazing apps that the users of your Jive community will enjoy using.


The Jive iOS SDK can be used in 2 different ways: as a black box or as a source of operations that can be queued. In the following examples I will describe using the SDK from the black box perspective. Using it as a source of operations will follow the same structure but will require the use of NSOperationQueue.


Creating a Jive iOS app using the Jive iOS SDK begins with validating the server URL. This is trivially done using the getVersionForInstance method.

    NSURL *instanceURL = [NSURL URLWithString:@""];
    [Jive getVersionForInstance:instanceURL
                     onComplete:^(JivePlatformVersion *version) {[self instanceVerified:version];}
                        onError:^(NSError *error) {[self instanceError:error];}];

A word about blocks. You can see in the above example that we use blocks for completion and error handling. In the examples used here I will implement a block by calling a method on self to indicate that you are responsible for implementing the block. All SDK methods are designed to accept nil for any block.


You will need to create a class that implements the JiveAuthorizationDelegate protocol. This protocol is designed to let you control the caching policy for the users login credentials. The only method credentialsForJiveInstance: is used by the SDK to get a credentials object. Each method will call this method and use the returned object to sign the request.

We provide a simple authorization class for basic http credentials.

- (id<JiveCredentials>)credentialsForJiveInstance:(NSURL*) url {
    return [[JiveHTTPBasicAuthCredentials alloc] initWithUsername:self.username


The next step is to setup a Jive instance.

    MyAuthorizationDelegate *communityAuthorizationDelegate = [[MyAuthorizationDelegate alloc] initWithUserName:(NSString *)userName
                                                                                                       password:(NSString *)password];
    Jive *communityInstance = [[Jive alloc] initWithJiveInstance:instanceURL


A good place to start is to get the users JivePerson object.

    [communityInstance me:^(JivePerson *me) { [self handleMeObject:me]; }
                  onError:^(NSError *error) { [self handleMeError:error]; }];


From here you can get the list of custom streams the user has created.

This call takes a JiveReturnFieldsRequestOptions which can be used to specify that only certain fields should be returned. This can be used to limit the bandwidth consumed by a request, especially requests that return NSArrays. This could be used to get just the names of the available streams and then subsequent JiveStream calls could be made just for the specific streams that the user wants to look at.

    JiveReturnFieldsRequestOptions *streamFields = [JiveReturnFieldsRequestOptions new];
    [streamFields addField:@"name"];
    [communityInstance streams:me
                    onComplete:^(NSArray *streams) { [self handleStreams:streams]; }
                       onError:^(NSError *error) { [self handleStreamsError:error]; }];

This method returns an NSArray of JiveStream objects.


A word about Options. Most of the methods in the Jive iOS SDK take an options parameter. Providing nil in this parameter will select the default options for the method.

    [communityInstance stream:streams[0]
                   onComplete:^(JiveStream *stream) { [self handleStream:stream]; }
                      onError:^(NSError *error) { [self handleStreamError:error]; }];


This also demonstrates a fundamental behavior of the SDK, when in doubt reload the object. Most Jive classes have a method to reload an object that follows the pattern of the stream method above.


Finally a note about the class hierarchy. There are 3 primary classes: JiveContent, JivePerson, and JivePlace. JivePerson represents a Jive user. JiveContent is the base of a group of content classes the users can create and view. JivePlace is the base of a group of classes that allow users to organize and control content.


Next time, the Inbox.