BuiltApplication Class Reference

Inherits from NSObject
Declared in BuiltApplication.h

Overview

Represents an Application

Other Methods

  apiKey

Returns the api-key of application

@property (nullable, nonatomic, copy, readonly) NSString *apiKey

Discussion

Warning: This property is readonly i.e you can just read the value but can’t set its value

//'blt5d4sample2633b' is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSString *apiKeyString = builtApplication.apiKey;

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
var apiKeyString:NSString = builtApplication.apiKey

Declared In

BuiltApplication.h

  accountName

Returns the account name of application

@property (nullable, nonatomic, copy, readonly) NSString *accountName

Discussion

Warning: This property is readonly i.e you can just read the value but can’t set its value

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 NSString *accountNameString = builtApplication.accountName;

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var accountNameString:NSString = builtApplication.accountName

Declared In

BuiltApplication.h

  applicationName

Returns the name of application

@property (nullable, nonatomic, copy, readonly) NSString *applicationName

Discussion

Warning: This property is readonly i.e you can just read the value but can’t set its value

//'blt5d4sample2633b' is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSString *applicationNameString = builtApplication.applicationName;

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
var applicationNameString:NSString = builtApplication.applicationName

Declared In

BuiltApplication.h

  currentUser

Returns the current built user [User Session]

@property (nullable, nonatomic, strong, readonly) BuiltUser *currentUser

Discussion

Warning: This property is readonly i.e you can just read the value but can’t set its value

//'blt5d4sample2633b' is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
BuiltUser *currentLoggedInUser = builtApplication.currentUser;

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
var currentLoggedInUser:BuiltUser = builtApplication.currentUser

Declared In

BuiltApplication.h

  currentInstallation

Returns the current installation object that is saved on the disk.

@property (nullable, nonatomic, strong, readonly) BuiltInstallation *currentInstallation

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltInstallation *savedInstallationObject = builtApplication.currentInstallation;

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var savedInstallationObject:BuiltInstallation = builtApplication.currentInstallation

Warning: This property is readonly i.e you can just read the value but can’t set its value.

Warning: Not supported in watchOS

Declared In

BuiltApplication.h

  cachePolicy

Cache Policy for application

@property (nonatomic, assign) BuiltNetworkCachePolicy cachePolicy

Discussion

A set of cache policies are avaliable for use which are listed below.

ONLY_NETWORK (Default) This is the default cache policy which will always get the data from an network call.

CACHE_ONLY This policy which will always get the data from an cache.

CACHE_ELSE_NETWORK This policy will try to first get the data from cache, on failure would make a network call.

NETWORK_ELSE_CACHE It will try to make a network call, on failure would fetch it from cache.

CACHE_THEN_NETWORK This policy would first get the data from cache as well would make a network call to get the updated copy.

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];

 //Setting CachePolicy
 builtApplication.cachePolicy = NETWORK_ONLY;

 //Getting CachePolicy
 builtApplication.cachePolicy;


 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")

 //Setting CachePolicy
 builtApplication.cachePolicy = CachePolicy.NETWORK_ONLY

 //Getting CachePolicy
 builtApplication.cachePolicy

Declared In

BuiltApplication.h

  trackAnonymously

If FALSE then loggedin user id will be attached with the event for user base analytics if set TRUE user info is not been tracked by analytics. By default its FALSE. Value is passsed to BuiltAnalytics’s trackAnonymously property when analytics instance is created.

@property (nonatomic, assign, getter=isAnonymousTrackingEnabled) BOOL trackAnonymously

Discussion

 // 'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 if ([builtApplication isAnonymousTrackingEnabled]) {
    builtApplication.trackAnonymously = YES;
 } else {
    builtApplication.trackAnonymously = NO;
 }

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 if (builtApplication.isAnonymousTrackingEnabled) {
    // Anonymously tracking events
 } else {
    // User based tracking
 }

Declared In

BuiltApplication.h

  showNetworkIndicator

To show or hide the network indicator while making any network calls.

@property (nonatomic, assign, getter=isShowingNetworkIndicator) BOOL showNetworkIndicator

Discussion

// 'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 builtApplication.showNetworkIndicator = YES;

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.showNetworkIndicator = true;

Warning: Not supported in watchOS

Declared In

BuiltApplication.h

  keystore

To get KeyStore value for the application. KeyStore is mantained locally doesn’t sync with server. // ‘blt5d4sample2633b’ is a dummy Application API key

@property (nullable, nonatomic, readonly) BuiltKeyStore *keystore

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltKeyStore *keyStore = builtApplication.keystore;

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var keyStore:BuiltKeyStore = builtApplication.keystore;

Declared In

BuiltApplication.h

  extensionKey

To set extensionKey for the application. // ‘blt5d4sample2633b’ is a dummy Application API key

@property (nonnull, nonatomic, strong) NSString *extensionKey

Discussion

//Obj-C BuiltApplication *builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; builtApplication.extensionKey = @“new_extension”;

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) builtApplication.extensionKey = “new_extension”;

Declared In

BuiltApplication.h

Headers

– setHeader:forKey:

Set a header for an application

- (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey

Parameters

headerValue

The header key

headerKey

The header value

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication setHeader:@"MyValue" forKey:@"My-Custom-Header"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.setHeader("MyValue", forKey: "My-Custom-Header")

Declared In

BuiltApplication.h

– addHeadersWithDictionary:

Set a header for an application

- (void)addHeadersWithDictionary:(NSDictionary *)headers

Parameters

headers

The headers as dictionary which needs to be added to the application

Discussion

//'blt5d4sample2633b' is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication addHeadersWithDictionary:@{@"My-Custom-Header": @"MyValue"}];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.addHeadersWithDictionary(["My-Custom-Header":"MyValue"])

Declared In

BuiltApplication.h

– removeHeaderForKey:

Removes a header from this application.

- (void)removeHeaderForKey:(NSString *)headerKey

Parameters

headerKey

The header key that needs to be removed

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication removeHeaderForKey:@"My-Custom-Header"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.removeHeaderForKey("My-Custom-Header")

Declared In

BuiltApplication.h

Tenant

– setTenant:

Sets the current tenant for this application

- (void)setTenant:(NSString *)tenantUID

Parameters

tenantUID

The tenant uid value

Discussion

//'blt5d4sample2633b' is a dummy Application API key
//'xyz' is bummy tenant name

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication setTenant:@"xyz"];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.setTenant("xyz")

Declared In

BuiltApplication.h

– removeTenant

Removes the tenant from application

- (void)removeTenant

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication removeTenant];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.removeTenant()

Declared In

BuiltApplication.h

BuiltClass Instance

– classWithUID:

Represents a class in this application

- (BuiltClass *)classWithUID:(NSString *)classUID

Parameters

classUID

The uid of class

Return Value

Returns an instance of Class

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")

Declared In

BuiltApplication.h

BuiltAnalytics Instance

– analytics

Represents a analytics in this application.

- (BuiltAnalytics *)analytics

Return Value

Returns an instance of a BuiltAnalytics.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltAnalytics *analytics = [builtApplication analytics];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var analytics:BuiltAnalytics = builtApplication.analytics()

Declared In

BuiltApplication.h

BuiltExtension Instance

– extension

Represents extension in this application

- (BuiltExtension *)extension

Return Value

Returns an instance of a BuiltExtension.

Discussion

//‘blt5d4sample2633b’ is a dummy Application API key

//Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltExtension extensionObject = [builtApplication extension];

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) var extensionObject:BuiltExtension = builtApplication.extension()

Declared In

BuiltApplication.h

– extensionWithKey:

Represents extension in this application

- (BuiltExtension *)extensionWithKey:(NSString *)extensionKey

Parameters

extensionKey

key of extension

Return Value

Returns an instance of a BuiltExtension.

Discussion

//‘blt5d4sample2633b’ is a dummy Application API key

//Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltExtension extensionObject = [builtApplication extensionWithKey:@“new_extensionKey”];

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) var extensionObject:BuiltExtension = builtApplication.extensionWithKey(“new_extensionKey”)

Declared In

BuiltApplication.h

BuiltInstallation Instance

– installation

Class for creating new installation and for subscribing/unsubscribing for push notifications against a channel.

- (BuiltInstallation *)installation

Return Value

Returns an instance of BuiltInstallation.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltInstallation *installation = [builtApplication installation];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var installation:BuiltInstallation = builtApplication.installation()

Warning: Not supported in watchOS

Declared In

BuiltApplication.h

– installationWithUID:

Class for updating installation and for subscribing/unsubscribing for push notifications against a channel.

- (BuiltInstallation *)installationWithUID:(NSString *)installationUID

Parameters

installationUID

uid of installation needed.

Return Value

Returns an instance of BuiltInstallation.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltInstallation *installation = [builtApplication installationWithUID:@"install_uid"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var installation:BuiltInstallation = builtApplication.installationWithUID("install_uid")

Warning: Not supported in watchOS

Declared In

BuiltApplication.h

BuiltUserRoleMapper Instance

– userRoleMapper

Represents a new role mapper to create on Built.io Backend.

- (BuiltUserRoleMapper *)userRoleMapper

Return Value

Returns an instance of BuiltUserRoleMapper.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapperObject = [builtApplication userRoleMapper];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapperObject:BuiltUserRoleMapper = builtApplication.userRoleMapper()

Declared In

BuiltApplication.h

– userRoleMapperWithUID:

Represents a role mapper on Built.io Backend

- (BuiltUserRoleMapper *)userRoleMapperWithUID:(NSString *)mapperUID

Parameters

mapperUID

uid of BuiltUserRoleMapper.

Return Value

Returns an instance of BuiltUserRoleMapper.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key
 //'blt9a1sample5584k' is a dummy mapperUID

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUserRoleMapper *mapperObject = [builtApplication userRoleMapperWithUID:@"blt9a1sample5564k"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var mapperObject:BuiltUserRoleMapper = builtApplication.userRoleMapperWithUID("blt9a1sample5584k")

Declared In

BuiltApplication.h

BuiltRole Instance

– roleWithName:

Represents a new role with speficied name to create on Built.io Backend.

- (BuiltRole *)roleWithName:(NSString *)roleName

Parameters

roleName

name of the role to create.

Return Value

Returns an instance of BuiltRole.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltRole *managerRole = [builtApplication roleWithName:"Managers"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var managerRole:BuiltRole = builtApplication.roleWithName("Managers")

Declared In

BuiltApplication.h

– roleWithUID:

Represents a role on Built.io Backend

- (BuiltRole *)roleWithUID:(NSString *)roleUID

Parameters

roleUID

uid if role which is needed.

Return Value

Returns an instance of BuiltRole.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key
 //'blt9a1sample5476j' is a dummy role UID

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltRole *builtRole = [builtApplication roleWithUID:@"blt9a1sample5476j"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var builtRole:BuiltRole = builtApplication.roleWithUID("blt9a1sample5476j")

Declared In

BuiltApplication.h

BuiltUser Instance

– user

Represents a new user of this application

- (BuiltUser *)user

Return Value

Returns an instance of BuiltUser.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUser *person = [builtApplication user];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var person:BuiltUser = builtApplication.user()

Declared In

BuiltApplication.h

– userWithUID:

Represents a user of this application

- (BuiltUser *)userWithUID:(NSString *)userUID

Parameters

userUID

uid of user needed.

Return Value

Returns an instance of BuiltUser.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key
 //'bltba9a44506dd9e741' is a uid of an object of inbuilt Application User class

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUser *person = [builtApplication userWithUID:@"bltba9a44506dd9e741"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var person:BuiltUser = builtApplication.userWithUID("bltba9a44506dd9e741")

Declared In

BuiltApplication.h

BuiltUpload Instance

– upload

Represents a new file to-upload on Built.io Backend

- (BuiltUpload *)upload

Return Value

Returns an instance of BuiltUpload.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUpload *uploadObject = [builtApplication upload];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var uploadObject:BuiltUpload = builtApplication.upload()

Declared In

BuiltApplication.h

– uploadWithUID:

Represents a file uploaded on Built.io Backend

- (BuiltUpload *)uploadWithUID:(NSString *)uploadUID

Parameters

uploadUID

uid of file.

Return Value

Returns an instance of BuiltUpload.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key
 //'blt111sample2655c' is a uid of an upload

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltUpload *uploadObject = [builtApplication uploadWithUID:@"blt111sample2655c"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var uploadObject:BuiltUpload = builtApplication.uploadWithUID("blt111sample2655c")

Declared In

BuiltApplication.h

BuiltUser's Query Instance

– userQuery

Provides BuiltQuery object.

- (BuiltQuery *)userQuery

Return Value

Query object for user class

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltQuery *userQuery = [builtApplication userQuery];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var userQuery:BuiltQuery = builtApplication.userQuery()

Declared In

BuiltApplication.h

BuiltRole's Query Instance

– userRoleQuery

Provides BuiltQuery object.

- (BuiltQuery *)userRoleQuery

Return Value

Query object for Role class

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltQuery *userRoleQuery = [builtApplication userRoleQuery];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var userRoleQuery:BuiltQuery = builtApplication.userRoleQuery()

Declared In

BuiltApplication.h

BuiltACL Instance

– acl

Returns new ACL object with empty setting

- (BuiltACL *)acl

Return Value

new BuiltACL object

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltACL *acl = [builtApplication acl];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var acl:BuiltACL = builtApplication.acl()

Declared In

BuiltApplication.h

BuiltApplication variable

– variableForKey:

Gets the application variables.

- (BUILT_NULLABLE NSString *)variableForKey:(NSString *)key

Parameters

key

application variable key of which value needed.

Return Value

value of the specified key

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication variableForKey:@"key"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.variableForKey("key")

Declared In

BuiltApplication.h

Application Info

– fetchApplicationInfo:

Asynchronously fetches the application info.

- (void)fetchApplicationInfo:(void ( ^ ) ( BuiltResponseType responseType , NSDictionary *BUILT_NULLABLE_P info , NSError *BUILT_NULLABLE_P error ))completionBlock

Parameters

completionBlock

Completion block with params responseType (cache or network), dictionary of application information and error object in any.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication fetchApplicationInfo:^(BuiltResponseType responseType, NSDictionary *info, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.fetchApplicationInfo { (responseType, info!, error!) -> Void in

 }

Declared In

BuiltApplication.h

Last Activity

– fetchLastActivityOfClasses:

Asynchronously fetches last activity of all classes of application.

- (void)fetchLastActivityOfClasses:(void ( ^ ) ( BuiltResponseType responseType , NSDictionary *BUILT_NULLABLE_P lastActivityDictionary , NSError *BUILT_NULLABLE_P error ))completionBlock

Parameters

completionBlock

invoked when request is finished. lastActivityDictionary in block will contain list of class uid as key and its respective last updated time.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication fetchLastActivityOfClasses:^(BuiltResponseType responseType, NSDictionary *lastActivityDictionary, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.fetchLastActivityOfClasses { (responseType, lastActivityDictionary!, NSError!) -> Void in

 }

Declared In

BuiltApplication.h

All Class Schema

– fetchClassesSchema:

Gets the schema of all class in application asynchronously

- (void)fetchClassesSchema:(void ( ^ ) ( BuiltResponseType responseType , NSArray *BUILT_NULLABLE_P schema , NSError *BUILT_NULLABLE_P error ))completionBlock

Parameters

completionBlock

Completion block with params responseType (cache or network), array of schemas and error object in any.

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication fetchClassesSchema:^(BuiltResponseType responseType, NSArray *schema, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.fetchClassesSchema { (responseType, schema, error) -> Void in

 }

Declared In

BuiltApplication.h

Cancel Network calls

– cancelRequests

Advises the operation object that it should stop executing its task.

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 [builtApplication cancelRequests];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 builtApplication.cancelRequests()
- (void)cancelRequests

Discussion

This method does not force your operation code to stop. Instead, it updates the object’s internal flags to reflect the change in state. If the operation has already finished executing, this method has no effect. Canceling an operation that is currently in an operation queue, but not yet executing, makes it possible to remove the operation from the queue sooner than usual.

Declared In

BuiltApplication.h

Realtime Methods

– enableRealtimeWithDelegate:

Enable realtime for current BuiltApplication instance.

- (void)enableRealtimeWithDelegate:(id<BuiltRealtimeDelegate>)delegate

Parameters

delegate

objects confirms to BuiltRealtimeDelegate.

Discussion

// 'blt5d4sample2633b' is dummy Application API key
//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication enableRealtimeWithDelegate:self];

//Swift
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication enableRealtimeWithDelegate:self];

Warning: Not supported in watchOS

Declared In

BuiltApplication+Realtime.h

– disableRealtime

Disable realtime for current BuiltApplication instance.

- (void)disableRealtime

Declared In

BuiltApplication+Realtime.h

– on:callback:

Registers a event listener on notifications.class channel.

- (void)on:(BuiltRealtimeEventType)eventType callback:(EventCallback)callback

Parameters

eventType

event types i.e Create/Upate/Delete/Broadcast explained above

callback

response object if success or error object

Discussion

For list of supported events, check BuiltRealtimeEventType

    //ObjC
    BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
    //just for example we are using BuiltRealtimeEventTypeCreate.
    [builtApplication on:BuiltRealtimeEventTypeCreate callback:^(id response, NSError *error) {
        if (error) {
            //some error occured while listening
        }else {
            //Class schema type NSDictionary instance in response which is recently created
        }
    }];

    //Swift
    var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
    //just for example we are using BuiltRealtimeEventType.Create.
    builtApplication.on(BuiltRealtimeEventType.Create, callback: { (response, error) -> Void in
        if (error != nil) {
            //some error occured while listening
        }else {
            //Class schema type NSDictionary instance in response which is recently created
        }
    })

Warning: Not supported in watchOS

Declared In

BuiltApplication+Realtime.h

– off:callback:

Unregisters a event listener from notifications.class channel.

- (void)off:(BuiltRealtimeEventType)eventType callback:(EventCallback)callback

Parameters

eventType

Create/Update/Delete/Broadcast

callback

response object if success or error object

Discussion

For list of supported events, check BuiltRealtimeEventType

 //ObjC
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 //just for example we are using BuiltRealtimeEventTypeCreate.
 [builtApplication off:BuiltRealtimeEventTypeCreate callback:^(id response, NSError *error) {
     if (error) {
        //some error occured while listening
     }
 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 //just for example we are using BuiltRealtimeEventType.Create.
 builtApplication.off(BuiltRealtimeEventType.Create, callback: { (response, error) -> Void in
     if (error != nil) {
        //some error occured while listening
     }
 })

Warning: Not supported in watchOS

Declared In

BuiltApplication+Realtime.h

– broadcastWithMessage:callback:

Sending a broadcast message to notifications.class channel.

- (void)broadcastWithMessage:(NSString *)message callback:(EventCallback)callback

Parameters

message

message to broadcast

callback

callback called once broadcast message is send if error occurs error object will be received.

Discussion

// 'blt5d4sample2633b' is dummy Application API key

//ObjC
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication broadcastWithMessage:@"Hello world" callback:^(id response, NSError *error) {
    if (error) {
        // error while sending message
    }else {
        // sent broadcast message successfully
    }
}];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.broadcastWithMessage("Hello World", callback: { (response, error) -> Void in
    if (error != nil) {
        // error while sending message
    }else {
        // sent broadcast message successfully
    }
})

Warning: Not supported in watchOS

Declared In

BuiltApplication+Realtime.h

LocalStore Methods

– clearOfflineData

Removes all the records from offline DB. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)clearOfflineData

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication clearOfflineData];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.clearOfflineData()

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– clearOfflineDataOfOnly:

Removes all the records from offline DB for the specified classes. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)clearOfflineDataOfOnly:(NSArray *)onlyClasses

Parameters

onlyClasses

Array of class name which need to be removed.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication clearOfflineDataOfOnly:@[@"task"]];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.clearOfflineData(ofOnly: ["task"])

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– clearOfflineDataExcept:

Removes all the records from offline DB except the specified classes. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)clearOfflineDataExcept:(NSArray *)exceptClasses

Parameters

exceptClasses

Array of class name which need not to be removed.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication clearOfflineDataExcept:@[@"task"]];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.clearOfflineData(ofExcept: ["task"])

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– sync

Sync all classes with the server. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)sync

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication sync];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.sync()

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– sync:

Sync all classes with the server from the specified date. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)sync:(NSDate *)date

Parameters

date

Date from which sync need to be performed.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:10000];
[builtApplication sync:date];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
let date:Date = Date.init(timeIntervalSince1970: 10000)
builtApplication.sync(date)

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncOnly:

Sync only classes specified with the server. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)syncOnly:(NSArray *)onlyClasses

Parameters

onlyClasses

Array of class name which should to be synced.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:10000];
[builtApplication syncOnly:@[@"task"]];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
let date:Date = Date.init(timeIntervalSince1970: 10000)
builtApplication.syncOnly(["task"])

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncOnly:date:

Sync only classes specified with the server from the specified date. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)syncOnly:(NSArray *)onlyClasses date:(NSDate *)date

Parameters

onlyClasses

Array of class name which should to be synced.

date

Date from which sync need to be performed.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:10000];
[application syncOnly:@[@"task"] date:date];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
let date:Date = Date.init(timeIntervalSince1970: 10000)
builtApplication.syncOnly(["task"], date: date)

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncExcept:

Sync all classes except the specified list with the server. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)syncExcept:(NSArray *)exceptClasses

Parameters

exceptClasses

Array of class name which should not be synced.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:10000];
[builtApplication syncExcept:@[@"project"]];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
let date:Date = Date.init(timeIntervalSince1970: 10000)
builtApplication.syncExcept(["project"])

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncExcept:date:

Sync all classes except the specified list with the server from the specified date. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

- (void)syncExcept:(NSArray *)exceptClasses date:(NSDate *)date

Parameters

exceptClasses

Array of class name which should not be synced.

date

Date from which sync need to be performed.

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:10000];
[application syncExcept:@[@"project"] date:date];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
let date:Date = Date.init(timeIntervalSince1970: 10000)
builtApplication.syncExcept(["project"], date: date)

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncWithPagination

Note: If objects are more than 1000 in a class, then this method will be recommended instead of sync.

- (void)syncWithPagination

Discussion

Sync all classes with the server with pagination. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication syncWithPagination];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.syncWithPagination()

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncOnlyWithPagination:

Note: If objects are more than 1000 in a class, then this method will be recommended instead of syncOnly.

- (void)syncOnlyWithPagination:(NSArray *)onlyClasses

Parameters

onlyClasses

Array of class name which should to be synced.

Discussion

Sync only classes specified with the server with pagination. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication syncOnlyWithPagination:@[@"task"]];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.syncOnly(withPagination: ["task"])

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h

– syncExceptWithPagination:

Note: If objects are more than 1000 in a class, then this method will be recommended instead of syncExcept.

- (void)syncExceptWithPagination:(NSArray *)exceptClasses

Parameters

exceptClasses

Array of class name which should not be synced.

Discussion

Sync all classes except the specified list with the server with pagination. If offline is enabled in BuiltConfig it will save all records. //‘blt5d4sample2633b’ is a dummy Application API key

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
[builtApplication syncExceptWithPagination:@[@"project"]];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
builtApplication.syncExcept(withPagination: ["project"])

Warning: Not supported in watchOS

Declared In

BuiltApplication+LocalStore.h