Inherits from NSObject
Declared in C2CallPhone.h

Overview

C2CallPhone - Base class for low-level C2Call phone and messaging API.

This class provides the low-level API methods for major C2Call communications features: - Phone calls to PSTN and mobile phone networks, - VoIP and video calls, - Group calls (voIP and Video) - Instant Messaging, - SMS / Text Messages - Rich Media Messages like photo, video, voicemail, location, etc.

This class also provides the core functionality to start and stop the C2CallPhone and handle the background behavior. The C2CallAppDelegate uses this Class in order to initialize the connection to the C2Call service and to handle the background status of the app.

Example call functionality:

// Call the C2Call TestCall
[[C2CallPhone currentPhone] callVoIP:@"9bc2858f1194dc1c107"];

Example messaging functionality:

// Send an SMS / Text message
[[C2CallPhone currentPhone] submitMessage:@"Hi, this is an SMS" toNumber:@"+1408234123456"];

Example Rich Messaging Functionality: #import <SocialCommunication/UIViewController+SCCustomViewController.h> …skip… [self captureImageFromCameraWithQuality:UIImagePickerControllerQualityTypeMedium andCompleteAction:^(NSString *key) { [[C2CallPhone currentPhone] submitRichMessage:key message:@“Hi, see my photo…” toTarget:@“max@gmail.com”]; }];

Tasks

Properties

C2CallPhone lifecycle handling

Other Methods

SIPPhone wrapper methods

Call Status Information Methods

User / Group Management

Message Functions

Rich Media Message Functions

Rich Media Object Functions

Friend Finder

Manage User Credits

Enterprise Project Methods

Static Methods

Properties

affiliateId

AffiliateId available in C2Call SDK Developer Area.

@property (nonatomic, readonly) NSString *affiliateId

Declared In

C2CallPhone.h

delegate

C2CallPhone delegate.

@property (weak, nonatomic) id<C2CallPhoneDelegate> delegate

Declared In

C2CallPhone.h

hangupOnConnectionTimeout

Automatically hang up on connection timeout

@property (nonatomic) BOOL hangupOnConnectionTimeout

Declared In

C2CallPhone.h

loginCompleted

Is login completed after start-up.

@property (nonatomic) BOOL loginCompleted

Declared In

C2CallPhone.h

loginSession

Auto-Login Session (Enterprise Customers only)

@property (nonatomic, strong) NSString *loginSession

Declared In

C2CallPhone.h

loginToken

Auto-Login Token (Enterprise Customers only)

@property (nonatomic, strong) NSString *loginToken

Declared In

C2CallPhone.h

preferMessageEncryption

Automatically uses public key encryption for instant messages if available for the receiver

@property (nonatomic) BOOL preferMessageEncryption

Discussion

In case the receiver provides a public key in his user record, automatically force end-to-end encryption for instant messages

Declared In

C2CallPhone.h

processingFacebookLogin

Facebook Login in progress.

@property (nonatomic, readonly) BOOL processingFacebookLogin

Declared In

C2CallPhone.h

properties

Start-up properties.

@property (nonatomic, strong) NSDictionary *properties

Declared In

C2CallPhone.h

secret

Application Secret available in C2Call SDK Developer Area.

@property (nonatomic, readonly) NSString *secret

Declared In

C2CallPhone.h

sessionId

Current SessionId

@property (nonatomic, readonly) NSString *sessionId

Declared In

C2CallPhone.h

sipphone

SIPPhone instantiated by C2CallPhone.

@property (nonatomic, strong) SIPPhone *sipphone

Declared In

C2CallPhone.h

useApplicationBadge

Automatically sets the Application Badge to the number of missed events

@property (nonatomic) BOOL useApplicationBadge

Declared In

C2CallPhone.h

useSandboxMode

Set the Sandbox Mode.

@property (nonatomic) BOOL useSandboxMode

Discussion

If set to YES, Push Notifications will use the Developer Push Certificate.

If set to NO, Push Notification will use the Production Push Ceterificate.

Also, in Sandbox Mode all type of rewarded offers are available.

Declared In

C2CallPhone.h

Class Methods

currentPhone

Gets the current C2CallPhone instance.

+ (C2CallPhone *)currentPhone

Discussion

Only one C2CallPhone instance is allowed.

Declared In

C2CallPhone.h

setDefaultAreaCode:

Set the default area code The default area code will be used to convert a local number into international number format

+ (void)setDefaultAreaCode:(id)ac

Parameters

ac
  • The Area Code (e.g. “408”)

Declared In

C2CallPhone.h

setDefaultCountryCode:

Set the default country code The default country code will be used to convert a local number into international number format

+ (void)setDefaultCountryCode:(id)cc

Parameters

cc
  • The Country Code (e.g. “+1”)

Declared In

C2CallPhone.h

Instance Methods

activeCallerId

Returns the active callerId as phone number

- (NSString *)activeCallerId

Return Value

Active CallerId

Declared In

C2CallPhone.h

activeCallerIdType

Returns the type of the active callerId

- (SCCallerId)activeCallerIdType

Return Value

Active CallerId

Declared In

C2CallPhone.h

activeMembersInCallForGroup:

Provides a list of Userid’s for the current active members in a Group Call.

- (NSArray *)activeMembersInCallForGroup:(id)groupid

Parameters

groupid
  • groupid of the group

Return Value

List of userids

Declared In

C2CallPhone.h

activeMembersInGroupCall

Provides a list of Userid’s for the current active members in a Group Call.

- (NSArray *)activeMembersInGroupCall

Return Value

List of userids

Declared In

C2CallPhone.h

activeVideoCallForGroup:

Return the video status of an active group call

- (BOOL)activeVideoCallForGroup:(id)groupid

Parameters

groupid
  • groupid of the group

Return Value

YES: Video call / NO: Audio call

Declared In

C2CallPhone.h

addBrainTreeCredit:currency:nonce:channel:

Add Credit using Braintree Payment

- (NSDictionary *)addBrainTreeCredit:(id)value currency:(id)currency nonce:(id)nonce channel:(id)channel

Parameters

value
  • Payment Amount as decimal value (10.00)
currency
  • Currency
nonce
  • Payment Nonce created by Braintree
channel
  • Purchase Channel

Return Value

NSDictionary with transaction result

Discussion

Support for Braintree Payment. Enterprise Customer only.

Declared In

C2CallPhone.h

addCredit:currency:transactionid:receipt:

Adds Credit to the users account to use paid services like PSTN calls or SMS/Text messages.

- (BOOL)addCredit:(id)valueInCent currency:(id)currency transactionid:(id)tid receipt:(id)receipt

Parameters

valueInCent
  • Cent value to add to the users pre-paid account
currency
  • EUR / USD
tid
  • Unique Transaction id, either from Apple InApp purchase or from other payment mothods
receipt
  • Receipt from Apple InApp Purchase or nil

Discussion

For all paid services inside C2Call SDK, the application user is required having credit on his account, as all paid transactions will be directly charged to the App user account. The App developer might implement Apple InApp Purchase or other payment methods in his application. Once the payment is done by the App user, this method addCredit:currency:transactionid:receipt: can be used to top up the App users account with the requested credit.

The App developer requires having enough credit on his developer account in order to process the transaction, as the amount of credit will be deducted from the developer account and added to the user account. In case of an InApp Purchase transaction, the receipt from that transaction can be provided as parameter and will be automatically validated with the Apple payment servers in order to prevent any InApp Purchase fraud.

Declared In

C2CallPhone.h

callNumber:

Call a phone number.

- (void)callNumber:(id)number

Parameters

number
  • Phone number in international format

Discussion

Calling a phone number, the number should typically start with the + and the international country code followed by the area code without leading “0” and then the number (e.g. +14081234567). If the submitted number is not in international format the function automatically tries to convert the number into international format.

Declared In

C2CallPhone.h

callVideo:

Call another C2Call Service user or group via Video call.

- (void)callVideo:(id)callee

Parameters

callee
  • C2Call Userid or Email Address of a registered user

Discussion

Every C2Call user can be addressed by his email address or his C2Call UserId. In order to call a user by his email address, simply do:

[[C2CallPhone currentPhone] callVideo:@"max.muster@registeredemail.com"];

To access user data, please see also SCDataManager class.

Declared In

C2CallPhone.h

callVideo:groupCall:

Call another C2Call Service user or group via Video call.

- (void)callVideo:(id)callee groupCall:(id)isGroupCall

Parameters

callee
  • C2Call Userid or Email Address of a registered user
isGroupCall
  • Specify whether it’s a group call.

Discussion

Every C2Call user can be addressed by his email address or his C2Call UserId. In order to call a user by his email address, simply do:

[[C2CallPhone currentPhone] callVideo:@“max.muster@registeredemail.com”];

To access user data, please see also SCDataManager class.

Declared In

C2CallPhone.h

callVoIP:

Call another C2Call Service user or group via VoIP call.

- (void)callVoIP:(id)callee

Parameters

callee
  • C2Call Userid or Email Address of a registered user

Discussion

Every C2Call user can be addressed by his email address or his C2Call UserId. For example, the userid of the C2Call Test Call is “9bc2858f1194dc1c107”. In order to call the Test Call simply do:

[[C2CallPhone currentPhone] callVoIP:@"9bc2858f1194dc1c107"];

In order to call a user by his email address, simply do:

[[C2CallPhone currentPhone] callVoIP:@"max.muster@registeredemail.com"];

To access user data, please see also SCDataManager class.

Declared In

C2CallPhone.h

canEncryptMessageForTarget:

Is encryption enabled for target user

- (BOOL)canEncryptMessageForTarget:(id)targetUserid

Return Value

YES encryption is enabled, NO else.

Discussion

This method checks whether a message can be encrypted for a specific target user.

Declared In

C2CallPhone.h

canSubmitEncryptedToUser:

Is secure messaging available for target user

- (BOOL)canSubmitEncryptedToUser:(id)userid

Parameters

userid
  • userid of the target user

Return Value

YES - message can be sent encrypted, NO otherwise

Discussion

This method checks whether the public key for the target user is available for encryption of text messages or attachments to that user.

Declared In

C2CallPhone.h

cancelWebCallback:

Cancel a Web Callback Service

- (BOOL)cancelWebCallback:(id)callbackId

Parameters

callbackId
  • Id of the WebCall to cancel

Return Value

YES - succes / NO - error

Discussion

GencomAPI Web Callback Service

Declared In

C2CallPhone.h

chargeApplicationCredit:forTransactionId:

Charge the user for a service provided by the Application

- (BOOL)chargeApplicationCredit:(id)value forTransactionId:(id)tid

Parameters

value
  • Amount to charge the user, 0.03 will charge 3 cents
tid
  • Application definable transactionid, should be unique

Return Value

YES - success / NO - failure

Discussion

The amount will be deducted from the users application credit.

Declared In

C2CallPhone.h

contentTypeForKey:

Return the mime type for a given mediakey

- (NSString *)contentTypeForKey:(id)mediaKey

Parameters

key
  • rich message key of the media file

Return Value

mimetype

Declared In

C2CallPhone.h

createGroup:withMembers:withCompletionHandler:

Create a new VoIP, Video, Text Chat Group

This method creates a new group with a group name, and array of userids of group members. It calls the complete handler when the creation has been completed.

- (void)createGroup:(id)groupName withMembers:(id)members withCompletionHandler:(id)handler

Parameters

groupName
  • Name of the Group
members
  • Array of userids of group members. The current active user will be automatically added.
handler
  • The completion handler. Will be called with a success parameter the groupid and a result string.

Discussion

SampleCode:

#import <SocialCommunication/UIViewController+SCCustomViewController.h>
-(IBAction)createGroup:(id)sender
{
    [[C2CallPhone currentPhone] createGroup:@"That's my Simple Group" 
                                withMembers:[NSArray arrayWithObjects:@"ebb4fe4a13fe7c0fd51", @"56489fa913fe7c49497", nil] 
                                withCompletionHandler:^(BOOL success, NSString *groupId, NSString *result) {

        if (success) {
            [self showGroupDetailForGroupid:groupId];
        }
    }];
}

Declared In

C2CallPhone.h

createGroupLinkForGroup:

Create a CallMe Link for the specified group

- (NSDictionary *)createGroupLinkForGroup:(id)groupid

Parameters

groupid
  • groupid for the group

Return Value

NSDictionary

Discussion

This allows Anonymous Users to participate on a group call via browser based CallMe Link

A dictionary with the following keys will be returned:

LinkId - The Link Id for the CallMe Link
CallLink - The URL for the Link

Declared In

C2CallPhone.h

didBecomeActive

Handles the Application Status didBecomeActive.

- (void)didBecomeActive

Discussion

The actual C2CallPhone didBecomeActive is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

didEnterBackground

Handles the Application Status didEnterBackground.

- (void)didEnterBackground

Discussion

The actual C2CallPhone didEnterBackground is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

disableEncryptionForGroup:withCompletionHandler:

Dis-able group encryption

- (BOOL)disableEncryptionForGroup:(id)groupid withCompletionHandler:(id)handler

Parameters

groupid
  • The group
handler
  • completion handler, will be called after public/private key-pair has been removed.

Return Value

YES - remove key-pair, completion handler will be called. NO - error, the completion handler will not be called.

Discussion

The public/private key-pair will be removed.

Declared In

C2CallPhone.h

disableEncryptionWithCompletionHandler:

Disable encrytion and removed public/private key-pair.

- (BOOL)disableEncryptionWithCompletionHandler:(id)handler

Parameters

handler
  • completion handler, will be called after user profile has been updated.

Return Value

YES - encrytion will be dis-abled, completion handler will be called. NO - encryption cannot be disabled or is already disabled, the completion handler will not be called.

Declared In

C2CallPhone.h

displayNameForRemotePartyInActiveCall

Provides the Display Name of the remote party in the current active call

- (NSString *)displayNameForRemotePartyInActiveCall

Return Value

Display Name of Remote Party

Declared In

C2CallPhone.h

downloadStatusForKey:

Check whether a rich media file for a given rich media key is currently downloading.

- (BOOL)downloadStatusForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

YES - Download in progress / NO - No Download

Declared In

C2CallPhone.h

durationForKey:

Return the duration for a media object if available.

- (NSString *)durationForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

duration as string

Discussion

Duration is available for video and audio files

Declared In

C2CallPhone.h

enableEncryptionForGroup:withCompletionHandler:

Enable Group Encryption

- (BOOL)enableEncryptionForGroup:(id)groupid withCompletionHandler:(id)handler

Parameters

groupid
  • Group which is supposed to be enabled for encryption
handler
  • completion handler, will be called after public/private key-pair has been created and distributed to the members. encryptedMembers contains a list of members ready for encrypted communication.

Return Value

YES - encrytion will be enabled, completion handler will be called. NO - group encryption cannot be enabled, the completion handler will not be called.

Discussion

This is a restricted API for Enterprise Developers only. End-to-End Group Encryption uses 2048-Bit Public/Private Key encryption in order to privately share messages and attachemens between group members. Only the group members are able to decrypt messages and attachements. Attachments and messages are stored encrypted on the servers and will be automatically decrypted on the group members device. Group encrytion requires every group member to enable encryption for his account, as group private key information will be distributed individually encrypted with the group members personal public key.

enableEncyptionForGroup generates the public/private key pair for the group and distribute the keys to the group members who have encryption enabled. As result, a list of encryptedMembers userids will be returned, so that the group admin can check whether all members can participate on encrypted communication and may notifiy the remaining group members to enable encryption for their account.

In case, some group members will enable their encryption after group encrytion has been enabled, refreshKeysForGroup must be called in order to re-distribute the public/private key-pair to the remaining group members.

Declared In

C2CallPhone.h

enableEncryptionWithCompletionHandler:

Enable Public/Private Key Encryption for message communication

- (BOOL)enableEncryptionWithCompletionHandler:(id)handler

Parameters

handler
  • completion handler, will be called after public/private key-pair has been created and the public key has been distributed.

Return Value

YES - encrytion will be enabled, completion handler will be called. NO - encryption cannot be enabled or is already enabled, the completion handler will not be called.

Discussion

This is a restricted API for Enterprise Developers only. End-to-End Group Encryption uses 2048-Bit Public/Private Key encryption in order to privately share messages and attachemens between users. With enable encryption, messages and attachements will be automatically encrypted with the public key of the receiver, so that only the receiver will be able to decrypt messages and attachements using his private key, stored only on his device. Attachments and messages are stored on the servers are not longer readable to any 3rd party. Public/Private Key encrytion requires every communication partnerto enable encryption for his account.

Declared In

C2CallPhone.h

encryptedGroup:

Encryption Status of a Group

- (BOOL)encryptedGroup:(id)groupid

Parameters

groupid
  • The group

Return Value

YES - Encryption enabled for Group / NO - Encrytion dis-abled for group

Declared In

C2CallPhone.h

encryptionEnabled

Is encryption enabled for this account on this device

- (BOOL)encryptionEnabled

Return Value

YES encryption is enabled, NO else.

Discussion

This method checks whether encryption is enable for this account and whether the certificates are installed correctly. Returning YES means, the user is ready for encryption on this device.

Declared In

C2CallPhone.h

encryptionEnabledForAccount

Is encryption enabled for this account

- (BOOL)encryptionEnabledForAccount

Return Value

YES encryption is enabled, NO else.

Discussion

This method checks whether encryption is generally enabled for this user. This might have been done on a different device. In case encryptionEnabledForAccount returns YES and encryptionEnabled return NO, the keypair has to be transferred from the remote device.

Declared In

C2CallPhone.h

encryptionEnabledGroupMembersForGroup:

List of encryption enabled group members

- (NSSet *)encryptionEnabledGroupMembersForGroup:(id)groupid

Parameters

groupid
  • The group

Return Value

List of userids

Discussion

List of group members, ready to received encrypted group messages.

Declared In

C2CallPhone.h

exportQRCodeFromKeyPairWithDimensions:

Get a QR-Code Image from the current public/private key-pair.

- (UIImage *)exportQRCodeFromKeyPairWithDimensions:(id)dimensions

Parameters

dimensions
  • Size of the QR-Code image

Return Value

The QR-Code image or nil if no key are available.

Declared In

C2CallPhone.h

failedDownloadStatusForKey:

Check whether a download of a rich media file for a given rich media key has failed.

- (BOOL)failedDownloadStatusForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

YES - Last download failed / NO

Declared In

C2CallPhone.h

findFriend:

Find a friend and add the friend to the users friendlist.

- (void)findFriend:(id)numberOrEMailAddress

Parameters

numberOrEMailAddress
  • phone number (international format) or email address

Discussion

The C2Call SDK provides different visibility levels for users inside the C2Call user database.

1. Global (All FriendCaller users)
2. Affiliate (All users from apps of the same developer account)
3. App local (Only users registered by this App)

Based on the visibility level chosen by the app (in the developer portal), this method tries to find the given phone number or email address in the user database and add the user to the friend list. The friend finder operates in the background asynchronously. The App will be notified if new friends are added.

Declared In

C2CallPhone.h

findFriends:

Find a list of friends and add found friends to the users friendlist.

- (void)findFriends:(id)listOfNumberOrEMailAddresses

Parameters

listOfNumberOrEMailAddresses
  • an array of phone numbers (international format) or email addresses

Discussion

The C2Call SDK provides different visibility levels for users inside the C2Call user database.

  1. Global (All FriendCaller users)
  2. Affiliate (All users from apps of the same developer account)
  3. App local (Only users registered by this App)

Based on the visibility level chosen by the app (in the developer portal), this method tries to find the given phone number or email address in the user database and add the user to the friend list. The friend finder operates in the background asynchronously. The App will be notified if new friends are added.

Declared In

C2CallPhone.h

getApplicationCredits

Get application credits for the current user

- (NSDictionary *)getApplicationCredits

Return Value

The credit dictionary or nil if no application credit is available.

Discussion

C2Call SDK supports different types of credits for users. - C2Call credits to charge the user for calls and SMS into mobile phone and pstn networks - Application credits - to charge the user for application internal services.

The Application credits are completely under control of the application developer and be freely added to the users account and charge accordingly for internal application services.

getApplicationCredits returns a dictionary with the following keys:

CreditValue - NSNumber with the actual credit value (double)
Currency - The currency for the credit value
CreditString - The localized string representation of the credit value and currency

Declared In

C2CallPhone.h

getCallingPlans

List of Calling Plans available for User

- (NSArray *)getCallingPlans

Return Value

Array of Dictionaries

Discussion

GencomAPI Calling Plans It returns an array of dictionaries for the available calling plans. The dictionary keys are:

Name - CallingPlan Name
MinutesLeft - Minutes left on this calling plan
Status - Active / Not Active

Declared In

C2CallPhone.h

getCountriesForAccessNumbers

List of Countries for Smart Dial Access Numbers

- (NSArray *)getCountriesForAccessNumbers

Return Value

Array of Countries

Discussion

GencomAPI Countries for Access Numbers

Declared In

C2CallPhone.h

getSmartDialNumber:number:description:

Return a smart dial number

- (NSString *)getSmartDialNumber:(id)country number:(id)number description:(id)description

Parameters

country
  • Country for Smart Dial Number
number
  • Destination Number
description
  • Description

Return Value

Number for Smart Dial Service

Discussion

GencomAPI Smart Dial Number Service

Declared In

C2CallPhone.h

getTollfreeAccessNumbers

List of Tollfree AccessNumbers

- (NSDictionary *)getTollfreeAccessNumbers

Return Value

Dictionary of Country (key) / Access Number (value)

Discussion

GencomAPI List of Tollfree AccessNumbers

Declared In

C2CallPhone.h

getUserCredits:

Get C2Call credits for the current user

- (NSDictionary *)getUserCredits:(id)forceRefresh

Parameters

forceRefresh
  • Force requesting the current credits from the server

Return Value

The credit dictionary or nil if no application credit is available.

Discussion

C2Call SDK supports different types of credits for users. - C2Call (user) credits to charge the user for calls and SMS into mobile phone and pstn networks - Application credits - to charge the user for application internal services.

getUserCredits returns a dictionary with the following keys:

CreditValue - NSNumber with the actual credit value (double) Currency - The currency for the credit value CreditString - The localized string representation of the credit value and currency

User credits are typically updated automatically in the background during a call or when sending an SMS. Use force to retrieve the current value from the server.

Declared In

C2CallPhone.h

getUserInfoForUserid:

Get public user information for non-friend users.

- (NSDictionary *)getUserInfoForUserid:(id)userid

Parameters

userid
  • The userid of the user

Return Value

The user information as dictionary

Discussion

Some applications may not maintain explicit friend connections between communication partners However, additional user information beyond email address and userid might be necessary. getUserInfoForUserid will query those information from the server without being connected as friends

The information will be returned as dictionary with the following elements:

Firstname       - The users firstname
Lastname        - The users name
Email           - The users email address
Userid          - The users userid
Status          - The status of the user
Language        - The users language setting
ImageLarge      - The user image as large image (as media key)
ImageSamll      - The user image as small image (as media key)
Country         - The users country

Declared In

C2CallPhone.h

hangUp

Hang up a call.

- (void)hangUp

Discussion

Hang up an active call.

Declared In

C2CallPhone.h

hasObjectForKey:

Check whether a rich media file for a given rich media key is locally available on the device.

- (BOOL)hasObjectForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

YES - Available / NO - Not available (use retrieveObjectForKey:completion:)

Declared In

C2CallPhone.h

imageForKey:

UIImage for a given rich media key.

- (UIImage *)imageForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

Referenced Image

Declared In

C2CallPhone.h

importKeyPairFromQRCode:

Import Public/Private Keypair from QR-Code Scan

- (BOOL)importKeyPairFromQRCode:(id)keypair

Parameters

keypair
  • resulting QR-Code String to import

Return Value

YES - Key-Pair successfully imported

Discussion

SCQRCertExportController presents a QR Code from the Public/Private Key-Pair, which can be imported using this method.

Declared In

C2CallPhone.h

initAffiliate

Initializes Affiliate Data.

- (void)initAffiliate

Discussion

The actual C2CallPhone start is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

initWithProperties:

Class Initialization with a dictionary of properties.

- (id)initWithProperties:(id)properties

Parameters

properties

A dictionary of properties

Return Value

C2CallPhone instance

Discussion

The actual C2CallPhone initialization is actually done by the C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

isGroupUser:

Check whether a given userid is actually a group.

- (BOOL)isGroupUser:(id)userid

Return Value

YES / NO

Declared In

C2CallPhone.h

keepAliveHandler

keepAliveHandler for maintaining background connections.

- (void)keepAliveHandler

Discussion

This Method will be called automatically every 10 minutes while in background. It maintains the session and remote data updates once every hour.

Declared In

C2CallPhone.h

largeUserImageForUserid:

Gets the larger user image for a given userId.

- (UIImage *)largeUserImageForUserid:(id)userid

Parameters

userid

of the user (friend)

Return Value

Referenced Image

Discussion

To get a user image, the user must be a confirmed friend. Returns the larger image if available.

Declared In

C2CallPhone.h

lastTimeOnlineForUser:

Get the last time the user was active in the app

- (NSDate *)lastTimeOnlineForUser:(id)userid

Parameters

userid
  • Userid of the user

Return Value

The last online timestamp as date

Discussion

This method returns the date when the user was active in the App (using in foreground)

Declared In

C2CallPhone.h

lastTimeOnlineForUserAsString:

Get the last time the user was active in the app

- (NSString *)lastTimeOnlineForUserAsString:(id)userid

Parameters

userid
  • Userid of the user

Return Value

The last online timestamp as date

Discussion

This method returns the date when the user was active in the App (using in foreground) The last online time is provided as time ago string (like 1h ago).

Declared In

C2CallPhone.h

loadGroupHistory:

Load the Group History from Server

- (void)loadGroupHistory:(id)groupid

Parameters

groupid
  • Groupid of the group

Discussion

If a user joins a group, he will not automatically receive the group message history for that group, only new messages after he joined will be presented. Older messages needs to be explicitely retrieved. This method retrieves the messages of the past 7 days.

Declared In

C2CallPhone.h

loadGroupHistory:forDays:

Load the Group History from Server for days

- (void)loadGroupHistory:(id)groupid forDays:(id)days

Parameters

groupid
  • Groupid of the group
days
  • Number of days to retrieve the group messages for.

Discussion

If a user joins a group, he will not automatically receive the group message history for that group, only new messages after he joined will be presented. Older messages needs to be explicitely retrieved. This method retrieves the messages of the past “number of days” days.

Declared In

C2CallPhone.h

loginWithSession:andCompletionHandler:

Login existing user with sessionid

- (BOOL)loginWithSession:(id)session andCompletionHandler:(id)handler

Parameters

handler
  • the completion handler
token
  • auto login token

Return Value

YES - Login initiated, completion handler will be called, NO - error in parameters

Discussion

Login an existing user with sessionid create by Affiliate API call This API is only available to enterprise users using the server side affiliate API user sessions. This can be used for conferencing systems, to create invite links with automatic login. The completion handler will be called on success or on failure

Available result codes are as follows:

0: successful login 2: invalid password 14: error - please see error message

Declared In

C2CallPhone.h

loginWithToken:andCompletionHandler:

Login existing user with temporary loginToken

- (BOOL)loginWithToken:(id)token andCompletionHandler:(id)handler

Parameters

token
  • auto login token
handler
  • the completion handler

Return Value

YES - Login initiated, completion handler will be called, NO - error in parameters

Discussion

Login an existing user with temporary autologin token This API is only available to enterprise users using the server side affiliate API to create autologin tokens. This can be used for conferencing systems, to create invite links with automatic login. The completion handler will be called on success or on failure

Available result codes are as follows:

0: successful login 2: invalid password 14: error - please see error message

Declared In

C2CallPhone.h

loginWithUser:andPassword:withCompletionHandler:

Login existing user

- (BOOL)loginWithUser:(id)email andPassword:(id)password withCompletionHandler:(id)handler

Parameters

email
  • email address
password
  • password
handler
  • the completion handler

Return Value

YES - Login initiated, completion handler will be called, NO - error in parameters

Discussion

Login an existing user with email address and password. The completion handler will be called on success or on failure

Available result codes are as follows:

0: successful login 2: invalid password 14: error - please see error message

Declared In

C2CallPhone.h

logoutUser

Logout the current active user.

- (void)logoutUser

Discussion

The actual C2CallPhone logoutUser is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

mediaTypeForKey:

Helper Function to discover the media type of an incoming message.

- (SCRichMediaType)mediaTypeForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

SCRichMediaType

Discussion

A message can always be a regular text message or a rich media key. This method can help to differentiate between the following media types:

- SCMEDIATYPE_TEXT
- SCMEDIATYPE_IMAGE
- SCMEDIATYPE_USERIMAGE
- SCMEDIATYPE_VIDEO
- SCMEDIATYPE_VOICEMAIL
- SCMEDIATYPE_FILE
- SCMEDIATYPE_VCARD
- SCMEDIATYPE_FRIEND
- SCMEDIATYPE_LOCATION

Declared In

C2CallPhone.h

mediaUrlForKey:

NSURL for a given rich media key.

- (NSURL *)mediaUrlForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

Referenced Url

Declared In

C2CallPhone.h

metaInfoForKey:

Return the meta data for a media object if available

- (NSDictionary *)metaInfoForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

duration as string

Discussion

Meta data is available for documents and contains the original file name and possibly further information.

Declared In

C2CallPhone.h

nameForKey:

Return the file name for a given media key

- (NSString *)nameForKey:(id)mediaKey

Parameters

key
  • rich message key of the media file

Return Value

filename

Declared In

C2CallPhone.h

nameForUserid:

Get the name for a given userid.

- (NSString *)nameForUserid:(id)userid

Parameters

userid

C2Call Userid of registered user.

Return Value

Name of the user

Discussion

This method returns the Firstname / Lastname or Email address for a given user ID. Typically “Firstname Lastname” if both are available. Alternative Firstname or Lastname if one is available or the email address if both are not available.

Declared In

C2CallPhone.h

numberVerificationForRegister:withPinMessage:forcePinCall:withCompletionHandler:

Submit a phone number verification PIN for register user with phone number

- (void)numberVerificationForRegister:(id)number withPinMessage:(id)pinMessage forcePinCall:(id)force withCompletionHandler:(id)handler

Parameters

number
  • phone number in international format (e.g. +1408123456)
pinMessage
  • The PIN Message sent to the user or nil (default message is : PIN: )
forcePinCall
  • YES / Use a pin call instead of SMS. NO / Use SMS if possible else use PIN call

Discussion

If you want to implement a WhatsApp style user registration with phone number, use this method to submit a verification PIN to the users phone. Typically the PIN will be submitted as SMS, however for landline phone numbers or some mobile networks, SMS will not be received by the user. In this case, use forcePinCall, the user will be then called on his phone and the PIN code will be read to the user. This method requires to master credit in your developer account, as the costs for the SMS or the PIN Call will be charged from your master credit.

In case of SMS, a PIN message can be specified. Please use %PIN as placeholder where the actual PIN will be set in your message text.

Declared In

C2CallPhone.h

pathForKey:

Local file system path for rich media key

- (NSString *)pathForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

Referenced Path

Declared In

C2CallPhone.h

queryPriceForNumber:isSMS:

Query Price Information for a specific number

- (void)queryPriceForNumber:(id)number isSMS:(id)isSMS

Discussion

The price information will be queried ansychronously Please register an NSNofication observer for @“PriceInfoEvent”

@number - Phone number in international format @isSMS - YES : Query the prices for sending SMS / NO : query the price for phone calls

Declared In

C2CallPhone.h

redeemApplicationVoucher:

Redeem a voucher for Application Credit

- (BOOL)redeemApplicationVoucher:(id)voucher

Parameters

voucher
  • Voucher Code to redeem

Return Value

YES - success / NO - failure

Discussion

Voucher Codes for different credit values can be provided by C2Call.

Declared In

C2CallPhone.h

redeemVoucher:

Redeem a voucher for C2Call Credit

- (BOOL)redeemVoucher:(id)voucher

Parameters

voucher
  • Voucher Code to redeem

Return Value

YES - success / NO - failure

Discussion

Voucher Codes for different credit values can be provided by C2Call.

Declared In

C2CallPhone.h

refreshApplicationBadgeNumber

Set the Application Badge Number with current number of missed events.

- (void)refreshApplicationBadgeNumber

Discussion

This Method will be called automatically on Application will resign active.

Declared In

C2CallPhone.h

refreshKeysForGroup:withCompletionHandler:

Re-distribute public/private key-pair to the group members

- (BOOL)refreshKeysForGroup:(id)groupid withCompletionHandler:(id)handler

Parameters

groupid
  • The group
handler
  • completion handler, will be called after public/private key-pair has been cre-distributed to the members. encryptedMembers contains a list of members ready for encrypted communication.

Return Value

YES - keys will be re-distributed, completion handler will be called. NO - error, the completion handler will not be called.

Discussion

In case new members have been added to an encrypted group or some group members have just enabled their encrytion, the key-pair must be re-distributed. The completion handler will be called on success with a new list of encryption ready group members.

Declared In

C2CallPhone.h

registerAPS:

Register Apple Push Notification Token.

- (void)registerAPS:(id)token

Discussion

The C2Call Backend Service needs the push notification token in order to sumit push notifications to your app. This method is called by C2CallAppDelegate on didRegisterForRemoteNotificationsWithDeviceToken. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

registerUser:withCompletionHandler:

Register a new User

- (void)registerUser:(id)registration withCompletionHandler:(id)handler

Parameters

registration
  • The registration dictionary
handler
  • The completion handler. Will be called with a success parameter and a result string.

Discussion

This method takes a dictionary of the following Key/Value pairs to register a user:

Firstname   : Firstname of the User
Lastname    : Lastname of the User
EMail       : EMail address of the user (must have a valid email domain)
Password    : The user password. If nil, the user will be created with a generated password.
Phone       : Phone number of the user in international format (e.g. +14081234567)
NumberPIN   : Verification PIN for phone number (see numberVerificationForRegister Method)
Country     : Country of the User. If nil, will be determined automatically.
CountryCode : Default country code. If nil, will be determined automatically.

The Country and CountryCode parameter is very important to differentiate between local and international phone numbers. Typically users have phone number in local format in their phone book. In order to convert those numbers correctly in international format which is required by the service, the the SDK needs to know the users home country and country code. For user registration with phone number (like WhatsApp or other apps doing it) please use numberVerificationForRegister method first to request a PIN. Fill the Phone and NumberPIN fields then. As email address you may use a generic address like phonenumber@domain (domain must be a valid email domain) or nickname@domain. The NumberPIN must be valid, otherwise registration fails.

SampleCode:

NSDictionary *itsme = [NSDictionary dictionaryWithObjectsAndKeys:@"Georg", @"Firstname", @"Simple", @"Lastname", @"Georg.Simple@gmail.com", @"EMail", nil];

[[C2CallPhone currentPhone] registerUser:itsme 
                            withCompletionHandler:^(BOOL success, NSString *result) {
    NSLog(@"Success : %d / %@", success, result);

    if (success) {
        [[C2CallPhone currentPhone] startC2CallPhone];
    }
}];

Declared In

C2CallPhone.h

rejectCall

Reject an incoming call.

- (void)rejectCall

Declared In

C2CallPhone.h

reloadCallHistory

Reload the Call History from Server

- (void)reloadCallHistory

Declared In

C2CallPhone.h

reloadFriendList

Reload the friendlist from server

- (void)reloadFriendList

Declared In

C2CallPhone.h

reloadMessageHistory

Reload the Message History from Server

- (void)reloadMessageHistory

Declared In

C2CallPhone.h

remotePartyInActiveCall

Provides Userid or Phone Number of the remote party in the current active call.

- (NSString *)remotePartyInActiveCall

Return Value

Userid or Phone Number

Declared In

C2CallPhone.h

requestBTClientToken

Request Braintree Client Token

Support for Braintree Payment. Enterprise Customer only.
- (NSString *)requestBTClientToken

Return Value

client token

Declared In

C2CallPhone.h

requestWebCallbackForNumber:number2:

Request a Web Callback Service

- (NSString *)requestWebCallbackForNumber:(id)number1 number2:(id)number2

Parameters

number1
  • First Number
number2
  • Second Number

Return Value

CallbackId of the WebCall. Use this to cancel a request

Discussion

GencomAPI Web Callback Service

Declared In

C2CallPhone.h

retrieveObjectForKey:completion:

Downloads a rich media object from the server.

- (BOOL)retrieveObjectForKey:(id)key completion:(id)completion

Parameters

key
  • rich message key of the media file
completion
  • Completion Handler, once the file download is completed.

Return Value

success / failure

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. While the app typically receives messages via SIP Instant Message or Apple Push Notification, the actual media file has to be downloaded asynchronusly from the server. The method retrieveObjectForKey:completion: will download the actual media file and calls the completion handler after downloading the object. The download progress will be additionally posted as NSNotification in the following form:

[NSNotificationCenter defaultCenter] postNotificationName:richMessageKey object:nil userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:percent] forKey:@"progress"]];

So, in case you want to show the download progress to the user, just register for the notification event and show the progress accordingly.

Declared In

C2CallPhone.h

saveToAlbum:withCompletionHandler:

Save an image or video to photo album.

- (BOOL)saveToAlbum:(id)mediaKey withCompletionHandler:(id)handler

Parameters

mediaKey
  • rich message key of the media file
handler
  • completion handler which will be called after the media object has been stored.

Return Value

YES: OK / NO: Invalid Media Object

Declared In

C2CallPhone.h

setActiveCallerId:

Set the active callerid for the call or SMS

- (BOOL)setActiveCallerId:(id)cid

Parameters

cid
  • The callerid to use

Discussion

The C2Call SDK support a number verification for your own phone number and up to 5 C2Call numbers. If the user has a verified number and one or more DIDs (C2Call numbers), this method can be used to choose the phone number which will be used for outbound calls or SMS. The active number can be changed on the fly before the actuall call or SMS.

The following options are available:

SCCALLERID_USE_VERIFIEDNUMBER   - Use your own verified number
SCCALLERID_USE_DID              - Use the 1st DID
SCCALLERID_USE_DID1             - Use the 2nd DID
SCCALLERID_USE_DID2             - Use the 3rd DID
SCCALLERID_USE_DID3             - Use the 4th DID
SCCALLERID_USE_DID4             - Use the 5th DID

In case the choosen caller id is not available, use own verified number will be the default

Declared In

C2CallPhone.h

setConnectionStallingTimeout:

connection stalling timeout sets the timeout intervall for a notification, when packets are not longer received.

- (void)setConnectionStallingTimeout:(id)timeout

Parameters

timeout
  • Timeout when the ConnectionStalling notification will be sent

Discussion

In case of a network intterupt, it may happen that no packet are received for a couple of seconds. The system will send a notification when this issues is detected.

The default timeout is 3s.

It will send the following NSNotification: C2Call:ConnectionStalling - No packet received for the last timeout seconds C2Call:ConnectionResume - No packet received for the last timeout seconds

Declared In

C2CallPhone.h

setConnectionTimeout:

connectionTimeout set the timeout in seconds, when the connection will be dropped, because no packets are received any longer.

- (void)setConnectionTimeout:(id)connectionTimeout

Parameters

connectionTimeout
  • Timeout when the connection will be dropped.

Declared In

C2CallPhone.h

setVideoStallingTimeout:

videoPacketTimeout sets the timeout intervall for a notification, when video packets are not longer received.

- (void)setVideoStallingTimeout:(id)timeout

Parameters

timeout
  • Timeout when the VideoStalling notification will be sent

Discussion

In case the remote party send the app in background, video stops but audio continues. Set the timeout intervall when to receive an NSNotification on that issue, for example to present an avatar image to the user .

The default timeout is 3s.

It will send the following NSNotification: C2Call:VideoStalling - No video packet received for the last timeout seconds C2Call:VideoResume - No video packet received for the last timeout seconds

Declared In

C2CallPhone.h

shareMessageOnFacebook:usingAttachment:

Share a Rich Media Message on facebook.

- (BOOL)shareMessageOnFacebook:(id)message usingAttachment:(id)mediaKey

Parameters

message
  • The message text
richMediaKey
  • The rich media attachment

Return Value

YES - Message has been shared / NO - No facebook login or wrong attachment

Discussion

In case the user has logged in via facebook, a rich media message of type text, image, video and location can be shared on facebook.

Declared In

C2CallPhone.h

startC2CallPhone

Starts the C2CallPhone, connect to the C2Call Service and launch the SIPPhone.

- (void)startC2CallPhone

Discussion

The actual C2CallPhone start is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

startC2CallPhoneInBackground

Starts the C2CallPhone from background launch, connect to the C2Call Service and launch the SIPPhone.

- (void)startC2CallPhoneInBackground

Discussion

The actual C2CallPhone startC2CallPhoneInBackground is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

stopC2CallPhone

Stops the C2CallPhone and disconnect from C2Call Service.

- (void)stopC2CallPhone

Discussion

The actual C2CallPhone stop is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

submitAudio:withMessage:toTarget:withCompletionHandler:

Submits an audio file to a registered user.

- (void)submitAudio:(id)mediaUrl withMessage:(id)message toTarget:(id)target withCompletionHandler:(id)handler

Parameters

mediaUrl
  • An NSURL to the actual audio file.
message
  • An additional text message (may be nil)
target
  • An email address, userid or phone numer
handler
  • The completion handler called after submitting the message.

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current methods submitAudio:withMessage:toTarget:withCompletionHandler uses an existing audio file referenced by an NSURL and stores it in the internal media store. No audio file conversion will be done. Support Audio Formats are the same as for the AVAudioPlayer. After this steps are completed, it will call submitRichMessage:message:toTarget with the generated rich media key , the given message and target and finally calls the completionHandler with the rich media key, success or error status. NOTE: Audio messages can be also send as SMS/Text message to a mobile phone number. In this case, the receiver will get a text message with an embedded short URL to see the rich media item in the mobile browser.

Declared In

C2CallPhone.h

submitFile:withMessage:toTarget:withCompletionHandler:

Submits an file to a registered user.

- (void)submitFile:(id)fileUrl withMessage:(id)message toTarget:(id)target withCompletionHandler:(id)handler

Parameters

message
  • An additional text message (may be nil)
target
  • An email address, userid or phone numer
handler
  • The completion handler called after submitting the message.
mediaUrl
  • An NSURL to the actual audio file.

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current methods submitAudio:withMessage:toTarget:withCompletionHandler uses an existing audio file referenced by an NSURL and stores it into the internal media store. No audio file conversion will be done. Support Audio Formats are the same as for the AVAudioPlayer. After this steps are completed, it will call submitRichMessage:message:toTarget with the generated rich media key , the given message and target and finally calls the completionHandler with the rich media key, success or error status. NOTE: Audio messages can be also send as SMS/Text message to a mobile phone number. In this case, the receiver will get a text message with an embedded short URL to see the rich media item in the mobile browser.

Declared In

C2CallPhone.h

submitFriend:withMessage:toTarget:withCompletionHandler:

Submits a Friend Contact to a registered user.

- (void)submitFriend:(id)useridOrEMail withMessage:(id)message toTarget:(id)target withCompletionHandler:(id)handler

Parameters

useridOrEMail
  • The userid or email address of a connected Friend
message
  • An additional text message (may be nil)
target
  • An email address, userid or phone numer
handler
  • The completion handler called after submitting the message.

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current method submitFriend:withMessage:toTarget:withCompletionHandler can be used to submit an existing and connected Friend Contact to another registered user, in order to connect each other. The method will check whether the given userid or email is existing in the current users friendlist and create a rich media key from the Friend Contact. After this steps are completed, it will call submitRichMessage:message:toTarget with the generated rich media key , the given message and target and finally calls the completionHandler with the rich media key, success or error status. NOTE: Friends Contacts are not supported as SMS/Text message

Declared In

C2CallPhone.h

submitImage:withQuality:andMessage:toTarget:withCompletionHandler:

Submits an image to a registered user.

- (void)submitImage:(id)originalImage withQuality:(id)imageQuality andMessage:(id)message toTarget:(id)target withCompletionHandler:(id)handler

Parameters

originalImage
  • The UIImage to be submitted.
imageQuality
  • The imageQuality (UIImagePickerControllerQualityType is supported here). Images with higher resolutions will be scaled down.
message
  • An additional text message (may be nil)
target
  • An email address, userid or phone numer
handler
  • The completion handler called after submitting the message.

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current methods submitImage:withQuality:andMessage:toTarget:withCompletionHandler uses an existing image referenced by an UIImage, converts it into the internally supported media format and stores it into the internal media store. After this steps are completed, it will call submitRichMessage:message:toTarget with the generated rich media key , the given message and target and finally calls the completionHandler with the rich media key, success or error status. NOTE: Image messages can be also send as SMS/Text message to a mobile phone number. In this case, the receiver will get a text message with an embedded short URL to see the rich media item in the mobile browser.

Declared In

C2CallPhone.h

submitMessage:toNumber:

Submits an SMS/Text message.

- (void)submitMessage:(id)message toNumber:(id)number

Parameters

message
  • The message
number
  • Receiver number in international format

Discussion

Sending an SMS/Text message will be charged to the user credit according to our pricelist. SMS/Text messages are 160 characters or 70 2-Byte characters. Longer messages will be automatically split into multiple SMS and charged accordingly. In of mixing 1-Byte character and 2-Bytes character in a message, you have only 70 characters per messages even it contains only one 2-Byte character. Sending SMS/Text messages into the USA requires a C2Call DID-Number.

[[C2CallPhone currentPhone] submitMessage:@“This is a message” toNumber:@“+14081234567”];

The number should typically start with the + and the international country code followed by the area code without leading “0” and then the number (e.g. +14081234567). If the submitted number is not in international format, the function automatically tries to convert the number into international format automatically, based on the users country settings. To access user data, please see also SCDataManager class.

Declared In

C2CallPhone.h

submitMessage:toUser:

Submits an instant message.

- (void)submitMessage:(id)message toUser:(id)target

Parameters

message
  • The message
target
  • C2Call Userid or email address

Discussion

Every C2Call user can be addressed by his email address or his C2Call UserId. An instant message will be either delivered via SIP message to the receiver while the application is in foregound or via Push Notification while the app is in background.

[[C2CallPhone currentPhone] submitMessage:@"This is a message" toUser:@"max.muster@registeredemail.com"];

To access user data, please see also SCDataManager class.

Declared In

C2CallPhone.h

submitPasswordEMail:

Send Password Email

- (void)submitPasswordEMail:(id)email

Parameters

email
  • email address

Discussion

Send a password email to reset the user password This method is only available to customers with dedicated SDK server.

Declared In

C2CallPhone.h

submitRichMessage:message:toTarget:

Submits a Rich Media Message to a registered user.

- (BOOL)submitRichMessage:(id)richMessageKey message:(id)messageText toTarget:(id)target

Parameters

richMessageKey
  • rich message key of the media file
target
  • An email address, userid or phone numer
message
  • An additional text message (may be nil)

Return Value

success / failure

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current method submitRichMessage:withMessage:toTarget:withCompletionHandler can be used to submit an existing and connected Friend Contact to another registered user, in order to connect each other. The method will check whether the given userid or email is existing in the current users friendlist and create a rich media key from the Friend Contact. After this steps are completed, it will call submitRichMessage:message:toTarget will transfer the rich media file, refrenced by the rich media key to the server and the sends an instant message or SMS/Text message with the given message and rich message key refrence to the target address. NOTE: Not all types of rich media messages are supported for SMS/Text Messages.

Declared In

C2CallPhone.h

submitRichMessage:message:toTarget:preferEncrytion:

Submits a Rich Media Message to a registered user.

- (BOOL)submitRichMessage:(id)richMessageKey message:(id)messageText toTarget:(id)target preferEncrytion:(id)sendEncrypted

Parameters

richMessageKey
  • rich message key of the media file
target
  • An email address, userid or phone numer
sendEncrypted
  • If the target user has encrytion enabled and a public key is available, the message will be encrypted with the public key on YES
message
  • An additional text message (may be nil)

Return Value

success / failure

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current method submitRichMessage:withMessage:toTarget:withCompletionHandler can be used to submit an existing and connected Friend Contact to another registered user, in order to connect each other. The method will check whether the given userid or email is existing in the current users friendlist and create a rich media key from the Friend Contact. After this steps are completed, it will call submitRichMessage:message:toTarget will transfer the rich media file, refrenced by the rich media key to the server and the sends an instant message or SMS/Text message with the given message and rich message key refrence to the target address. NOTE: Not all types of rich media messages are supported for SMS/Text Messages.

Declared In

C2CallPhone.h

submitVCard:withMessage:toTarget:withCompletionHandler:

Submits a VCARD file to a registered user.

- (void)submitVCard:(id)person withMessage:(id)message toTarget:(id)target withCompletionHandler:(id)handler

Parameters

person
  • A person record from ABAddressbook
message
  • An additional text message (may be nil)
target
  • An email address, userid or phone numer
handler
  • The completion handler called after submitting the message.

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userid or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current method submitVCard:withMessage:toTarget:withCompletionHandler uses an ABRecordRef contact from ABAddressbook, generate the VCARD File from that contact stores it into the internal media store. After this steps are completed, it will call submitRichMessage:message:toTarget with the generated rich media key , the given message and target and finally calls the completionHandler with the rich media key, success or error status. NOTE: VCARDs are not supported as SMS/Text message

Declared In

C2CallPhone.h

submitVideo:withMessage:toTarget:withCompletionHandler:

Submits a video to a registered user.

- (void)submitVideo:(id)mediaUrl withMessage:(id)message toTarget:(id)target withCompletionHandler:(id)handler

Parameters

mediaUrl
  • An NSURL to the actual video file
message
  • An additional text message (may be nil)
target
  • An email address, userid or phone numer
handler
  • The completion handler called after submitting the message.

Discussion

The Rich Media Message methods are submitting rich media files like photos, videos, voicemails, vcards or other files to a registered userId or email address. Rich Media Messages will be internally referenced as rich media key, which is an URL like reference to the actual rich media file. The current methods submitVideo:withMessage:toTarget:withCompletionHandler uses an existing video referenced by an NSURL, convert it into the internally supported media format and stores it into the internal media store. After this steps are completed, it will call submitRichMessage:message:toTarget with the generated rich media key , the given message and target and finally calls the completionHandler with the rich media key, success or error status. NOTE: Video messages can also be send as SMS/Text message to a mobile phone number. In this case, the receiver will get a text message with an embedded short URL to see the rich media item in the mobile browser.

Declared In

C2CallPhone.h

takeCall:

Accept an incoming call.

- (void)takeCall:(id)useVideo

Parameters

useVideo
  • Allow video for this call

Declared In

C2CallPhone.h

thumbnailForKey:

Thumbnail Image for a given rich media key.

- (UIImage *)thumbnailForKey:(id)key

Parameters

key
  • rich message key of the media file

Return Value

Thumbnail Image

Discussion

The system automatically creates thumbnails from video and picture messages.

Declared In

C2CallPhone.h

transferAddressBook:

Transfers the iOS address book to automatically find friends.

- (void)transferAddressBook:(id)force

Parameters

force
  • NO means the address book will be only transferred in case of changes since last transfer / YES - force the address book transfer

Discussion

The C2Call SDK provides different visibility levels for users inside the C2Call user database.

  1. Global (All FriendCaller users)
  2. Affiliate (All users from apps of the same developer account)
  3. App local (Only users registered by this App)

Based on the visibility level chosen by the App (in the developer portal), this method tries to find friends by automatically transferring email address and phone numbers from the iOS address book in a hashed format (no real phone number and email addressed will be transferred). The friend finder operates in the background asynchronously. The App will be notified if new friends are found and added to the friend list.

Declared In

C2CallPhone.h

urlForC2CallNumber

Return the URL for C2Call Phone Number Service

- (NSString *)urlForC2CallNumber

Return Value

URL for C2Call Number service

Discussion

Get an US Phone number as virtual number

Declared In

C2CallPhone.h

userimageForUserid:

Gets the user image for a given userId.

- (UIImage *)userimageForUserid:(id)userid

Parameters

userid

of the user (friend)

Return Value

Referenced Image

Discussion

To get a user image, the user must be a confirmed friend.

Declared In

C2CallPhone.h

validateCertificateForAccount

Is the local certificate valid for this account

- (BOOL)validateCertificateForAccount

Return Value

YES valid, NO else.

Discussion

The Public/Private Key-Pair might have been changed on another device for this account

Declared In

C2CallPhone.h

willEnterForeground

Handles the Application Status willEnterForeground.

- (void)willEnterForeground

Discussion

The actual C2CallPhone willEnterForeground is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

willResignActive

Handles the Application Status willResignActive.

- (void)willResignActive

Discussion

The actual C2CallPhone willResignActive is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h

willTerminate

Handles the Application Status willTerminate.

- (void)willTerminate

Discussion

The actual C2CallPhone willTerminate is handled automatically by C2CallAppDelegate. It’s not recommended to call this method manually.

Declared In

C2CallPhone.h