public class CSClient
extends java.lang.Object
CSEvents
Constructor and Description |
---|
CSClient() |
Modifier and Type | Method and Description |
---|---|
boolean |
activate(java.lang.String loginid,
java.lang.String otp)
Activate the user with or without otp.
|
boolean |
addContacts(java.util.ArrayList<CSContact> CScontacts)
addContact.
|
boolean |
blockUser(java.lang.String remoteid)
blockUser
|
boolean |
deleteContact(java.lang.String uniqueidentifier)
deleteContact.Contacts other than of type
CONTACTTYPE_MOBILE can only be deleted. |
void |
deleteProfilePhoto()
delete Profile Photo
|
boolean |
enablecallLogActivityinChat(boolean enable)
enablecallLogActivityinChat.If true call log will be logged into chat.
|
boolean |
enableGroupActivityinChat(boolean enable)
enableGroupActivityinChat.If true Group activity will be logged into chat.
|
boolean |
enableNativeContacts(boolean read,
int defaultregioncode)
enableNativeContacts.
|
boolean |
enablePublicReadOfProfileandChatFiles(boolean read)
enablePublicReadOfProfileandChatFiles.
|
boolean |
enableUserActivityinChat(boolean enable)
enableUserActivityinChat.If true user activity will be logged into chat.
|
java.lang.String |
getInternationalFormatNumber(java.lang.String loginid,
java.lang.String countryCode)
getInternationFormatNumber
|
static boolean |
getLoginstatus()
getLoginstatus
|
boolean |
getProfile(java.lang.String remoteid)
gets UserProfile.
|
boolean |
getPublicReadOfProfileandChatFilesStatus()
getPublicReadOfProfileandChatFilesStatus
|
boolean |
getRecentLogcat(java.lang.String filepath)
writes recent logcat to given filepath
|
CSExplicitEventReceivers |
getRegisteredExplicitEventReceivers()
getRegisteredExplicitEventReceivers
|
boolean |
getSelfProfile()
gets SelfProfile.
|
long |
getTime()
getTime
|
static java.lang.String |
getVersion()
getVersion of sdk
|
void |
initialize(java.lang.String server,
int port,
CSAppDetails csAppDetails)
initializes sdk.
|
boolean |
iscallLogActivityinChatEnabled()
isGroupActivityinChatEnabled
|
boolean |
isGroupActivityinChatEnabled()
isGroupActivityinChatEnabled
|
boolean |
isnativeContactsCanbeRead()
isnativeContactsCanbeRead.
|
boolean |
isUserActivityinChatEnabled()
isUserActivityinChatEnabled
|
boolean |
login(java.lang.String loginid,
java.lang.String password)
Login the user
|
void |
processInstanceID(android.content.Context context,
java.lang.String token)
processInstanceID.
|
void |
processPushMessage(android.content.Context context,
com.google.firebase.messaging.RemoteMessage remoteMessage)
processPushMessage.
|
boolean |
registerExplicitEventReceivers(CSExplicitEventReceivers ExplicitEventReceivers)
registerExplicitEventReceivers.
|
boolean |
registerForPSTNCalls()
register For PSTN Calls.App should call this api atleast once to enable pstn calling after initialization.
|
boolean |
reSendActivationCode(boolean throughcall)
reSendActivationCode
|
boolean |
reset()
resets Db and network module.Once reset is done App must do initialization followed by signup and activation or login.
|
boolean |
setContactasFavourite(java.lang.String contact,
boolean set)
setContactasFavourite.
|
void |
setProfile(java.lang.String displayname,
java.lang.String statusmessage,
java.lang.String profilephotopath)
sets UserProfile.Passing profilephotopath null or empty will remove profile image if any.
|
boolean |
signUp(java.lang.String loginid,
java.lang.String password,
boolean autoactivate)
signUp the user
|
boolean |
startFileLogging(java.lang.String file,
java.lang.String loglevel,
boolean append)
startFileLogging.All the log will be written to given file until
stopFileLogging is called or upto 30 minutes |
boolean |
startwritingLogcatToFile(java.lang.String file,
boolean append)
start writing Logcat To the given File.
|
boolean |
stopFileLogging()
stopFileLogging
|
boolean |
stopwritingLogcatToFile()
stop writing Logcat To File
|
boolean |
syncNativeContacts(int defaultregioncode)
sync native Contacts.If sdk is not in logged in state,Contacts will be auto synced once successful login made.
|
boolean |
unBlockUser(java.lang.String remoteid)
unBlockUser
|
boolean |
updateAppDetails(CSAppDetails csAppDetails)
update App details.
|
boolean |
updatePassword(java.lang.String oldpassword,
java.lang.String newpassword)
updates Password
|
boolean |
updateServerDetails(java.lang.String server,
int port)
update Server details.
|
public void initialize(java.lang.String server, int port, CSAppDetails csAppDetails)
server
- server ipport
- server portcsAppDetails
- dao object with app details like appname,appid.CSCLIENT_NETWORKERROR
CSCLIENT_INITILIZATION_RESPONSE
CSCLIENT_LOGIN_RESPONSE
public boolean updateAppDetails(CSAppDetails csAppDetails)
csAppDetails
- dao object with app details like appname,customerid,appid,appsecrete.public boolean reset()
public static java.lang.String getVersion()
public long getTime()
public boolean startFileLogging(java.lang.String file, java.lang.String loglevel, boolean append)
stopFileLogging
is called or upto 30 minutespublic boolean stopFileLogging()
public boolean startwritingLogcatToFile(java.lang.String file, boolean append)
stopwritingLogcatToFile
api.file
- filepath to write the log.Make sure file path don't have any spaces.append
- true to append the log if file already exists or false to create fresh log file.public boolean stopwritingLogcatToFile()
public boolean getRecentLogcat(java.lang.String filepath)
filepath
- filepath to write the log.public boolean updatePassword(java.lang.String oldpassword, java.lang.String newpassword)
oldpassword
- oldpasswordnewpassword
- newpasswordCSCLIENT_NETWORKERROR
CSCLIENT_UPDATEPASSWORD_RESPONSE
public void setProfile(java.lang.String displayname, java.lang.String statusmessage, java.lang.String profilephotopath)
displayname
- display namestatusmessage
- descriptionprofilephotopath
- user image pathCSCLIENT_NETWORKERROR
CSCLIENT_SETPROFILE_RESPONSE
public boolean getProfile(java.lang.String remoteid)
remoteid
- loginid of user profile to getCSCLIENT_NETWORKERROR
CSCLIENT_GETPROFILE_RESPONSE
public boolean getSelfProfile()
CSCLIENT_NETWORKERROR
CSCLIENT_GETSELFPROFILE_RESPONSE
public void deleteProfilePhoto()
CSCLIENT_NETWORKERROR
CSCLIENT_SETPROFILE_RESPONSE
public static boolean getLoginstatus()
public boolean addContacts(java.util.ArrayList<CSContact> CScontacts)
CScontacts
- Array List of type CSContact
CSCLIENT_ADDCONTACT_RESPONSE
CSCONTACTS_CONTACTSUPDATED
public boolean deleteContact(java.lang.String uniqueidentifier)
CONTACTTYPE_MOBILE
can only be deleted.uniqueidentifier
- to be deleted. This can be a contact id or any uniqueidentifier given in addContacts(ArrayList)
} addContact} apiCSCLIENT_DELETECONTACT_RESPONSE
CSCONTACTS_CONTACTSUPDATED
public boolean isnativeContactsCanbeRead()
public boolean setContactasFavourite(java.lang.String contact, boolean set)
set
- true to mark contact as favourite.false to mark contact as normal.contact
- contactpublic boolean enableNativeContacts(boolean read, int defaultregioncode)
read
- true or falsedefaultregioncode
- default region code to validate a number in case of number without country codepublic boolean syncNativeContacts(int defaultregioncode)
defaultregioncode
- default region code to validate a number in case of number without country codepublic boolean signUp(java.lang.String loginid, java.lang.String password, boolean autoactivate)
loginid
- phoneNumber which should be a valid phone number if otp authentication required. getInternationalFormatNumber(String, String)
api can be used to get valid International Format Numberpassword
- passwordautoactivate
- autoactivate. Pass this value as true in case otp authentication is disabled.CSCLIENT_NETWORKERROR
CSCLIENT_SIGNUP_RESPONSE
CSCLIENT_ACTIVATION_RESPONSE
public java.lang.String getInternationalFormatNumber(java.lang.String loginid, java.lang.String countryCode)
loginid
- phoneNumbercountryCode
- countryCodepublic boolean login(java.lang.String loginid, java.lang.String password)
loginid
- loginidpassword
- passwordCSCLIENT_NETWORKERROR
CSCLIENT_LOGIN_RESPONSE
public boolean activate(java.lang.String loginid, java.lang.String otp)
loginid
- loginidotp
- activationcodeCSCLIENT_NETWORKERROR
CSCLIENT_ACTIVATION_RESPONSE
public boolean updateServerDetails(java.lang.String server, int port)
server
- serverport
- portCSCLIENT_NETWORKERROR
CSCLIENT_LOGIN_RESPONSE
public boolean reSendActivationCode(boolean throughcall)
throughcall
- true to get activation code by call, false to get activation code by SMSCSCLIENT_NETWORKERROR
CSCLIENT_RESEND_ACTIVATION_CODE_RESPONSE
public boolean registerForPSTNCalls()
CSCLIENT_NETWORKERROR
CSCLIENT_PSTN_REGISTRATION_RESPONSE
public boolean registerExplicitEventReceivers(CSExplicitEventReceivers ExplicitEventReceivers)
CSExplicitEvents
events by this api.ExplicitEventReceivers
- CSExplicitEventRceivers
public CSExplicitEventReceivers getRegisteredExplicitEventReceivers()
CSExplicitEventRceivers
public void processPushMessage(android.content.Context context, com.google.firebase.messaging.RemoteMessage remoteMessage)
context
- ApplicationContextpublic void processInstanceID(android.content.Context context, java.lang.String token)
context
- ApplicationContexttoken
- push tokenpublic boolean blockUser(java.lang.String remoteid)
remoteid
- remoteid of userCSCLIENT_NETWORKERROR
CSCLIENT_BLOCK_USER_RESPONSE
public boolean unBlockUser(java.lang.String remoteid)
remoteid
- remoteid of userCSCLIENT_NETWORKERROR
CSCLIENT_UNBLOCK_USER_RESPONSE
public boolean enablePublicReadOfProfileandChatFiles(boolean read)
read
- true or falsepublic boolean getPublicReadOfProfileandChatFilesStatus()
public boolean enableGroupActivityinChat(boolean enable)
enable
- true or falsepublic boolean isGroupActivityinChatEnabled()
public boolean enablecallLogActivityinChat(boolean enable)
enable
- true or falsepublic boolean iscallLogActivityinChatEnabled()
public boolean enableUserActivityinChat(boolean enable)
enable
- true or falsepublic boolean isUserActivityinChatEnabled()