Inherits from NSObject
Declared in SCUserProfile.h

Overview

SCUserProfile class provides access to the current users profile.

Properties

callerid

The users callerid, if available or nil.

@property (nonatomic, readonly) NSString *callerid

Declared In

SCUserProfile.h

country

The users country.

@property (nonatomic, strong) NSString *country

Declared In

SCUserProfile.h

credit

The users current credit as readable string (e.g. $ 1.35 / 1,35 €).

@property (nonatomic, readonly) NSString *credit

Declared In

SCUserProfile.h

didnumber

Current active DID Number, if available or nil.

@property (nonatomic, readonly) NSString *didnumber

Declared In

SCUserProfile.h

displayname

The users first and last name if both are available, else the available name.

@property (nonatomic, readonly) NSString *displayname

Declared In

SCUserProfile.h

email

The users registered email address.

@property (nonatomic, readonly) NSString *email

Declared In

SCUserProfile.h

firstname

The users Firstname.

@property (nonatomic, strong) NSString *firstname

Declared In

SCUserProfile.h

isCalleridVerified

Verification status of the users callerid.

@property (nonatomic, readonly) BOOL isCalleridVerified

Discussion

The callerId needs to be verified in order to use it in a outbound call or SMS/Text message.

Declared In

SCUserProfile.h

lastname

The users Lastname.

@property (nonatomic, strong) NSString *lastname

Declared In

SCUserProfile.h

phoneHome

The users home phone number.

@property (nonatomic, strong) NSString *phoneHome

Declared In

SCUserProfile.h

phoneMobile

The users mobile phone number.

@property (nonatomic, strong) NSString *phoneMobile

Declared In

SCUserProfile.h

phoneOther

The users other phone number.

@property (nonatomic, strong) NSString *phoneOther

Declared In

SCUserProfile.h

phoneWork

The users work phone number.

@property (nonatomic, strong) NSString *phoneWork

Declared In

SCUserProfile.h

userImage

The users profile image.

@property (nonatomic, readonly) UIImage *userImage

Declared In

SCUserProfile.h

userStatus

The users status.

@property (nonatomic, strong) NSString *userStatus

Declared In

SCUserProfile.h

userStatusDate

The users status update time.

@property (nonatomic, readonly) NSDate *userStatusDate

Declared In

SCUserProfile.h

userid

C2Call userid of the user.

@property (nonatomic, readonly) NSString *userid

Declared In

SCUserProfile.h

Class Methods

currentUser

Accesses to the current SCUserProfile instance.

+ (SCUserProfile *)currentUser

Return Value

Current SCUserProfile instance

Declared In

SCUserProfile.h

defaultUserStatusTemplates

List of user status templates

+ (NSArray *)defaultUserStatusTemplates

Return Value

Array of NSString for default user status

Declared In

SCUserProfile.h

setUserStatusTemplates:

Save a list of user status templates

+ (void)setUserStatusTemplates:(id)templates

Parameters

items
  • Array of NSString for default user status

Declared In

SCUserProfile.h

Instance Methods

activeDIDs

Get available DIDs

- (NSArray *)activeDIDs

Return Value

Array of DIDs

Discussion

This mothod returns the list of avilable (active) DIDs for this user. The return value is an array of NSDictionary with the following keys:

DidNumber - The actual DID
Index - The actual DID index to reference the DID for cancellation or renewal

Declared In

SCUserProfile.h

didNumberExt:

Get extended DID Numer

- (NSString *)didNumberExt:(id)num

Parameters

num
  • Index of the requested did

Return Value

DID number or nil

Discussion

In case the users has subscribed for multiuple DIDs, access the DID with index (num) 0-5

Declared In

SCUserProfile.h

refreshUserCredits

Reload User Credit Data from Server (async operation)

- (void)refreshUserCredits

Declared In

SCUserProfile.h

refreshUserProfile

Reload User Profile Data from Server (async operation)

- (void)refreshUserProfile

Declared In

SCUserProfile.h

removeUserdataForKey:

Remove a user data specified by key

- (void)removeUserdataForKey:(id)key

Parameters

key
  • The access key

Declared In

SCUserProfile.h

saveUserProfile

Saves changes to the server.

- (void)saveUserProfile

Declared In

SCUserProfile.h

saveUserProfileWithCompletionHandler:

Saves changes to the server.

- (void)saveUserProfileWithCompletionHandler:(id)handler

Parameters

handler
  • Completion handler

Declared In

SCUserProfile.h

setUserImage:withCompletionHandler:

Change the user image and upload the image to the server

- (void)setUserImage:(id)userImage withCompletionHandler:(id)completionHandler

Parameters

userImage
  • The new profile image
completionHandler
  • completion handler to be called on completion

Discussion

The completion handler will be called when the transfer has been completed and the user profile has been updated

Declared In

SCUserProfile.h

setUserdata:forKey:public:

Set additional meta data for the user

- (void)setUserdata:(id)data forKey:(id)key public:(id)isPublic

Parameters

data
  • The actual metadata
key
  • The access key, must be unique
isPublic
  • Allow access this data by a friends

Discussion

This method adds any kind of meta data to the user profile. Declaring this meta data as public will allow to see this data by any friend added to this user. MOC2CallUser.userdata property will allo access to this data from the friend list. Any changes to the user data requires to call saveUserProfile or saveUserProfileWithCompletionHandler in order to make the changes permanent.

Declared In

SCUserProfile.h

useFacebook

Is facebook login

- (BOOL)useFacebook

Return Value

YES : User has logged-in via facebook / NO : Regular login

Declared In

SCUserProfile.h

userdataForKey:

Access meta data from the user profile

- (NSString *)userdataForKey:(id)key

Parameters

key
  • The access key

Return Value

The actual meta data

Declared In

SCUserProfile.h