-
Notifications
You must be signed in to change notification settings - Fork 1
(OLD, v1.0.0.47) Editing SDK methods
Main class, used for initialization
class PushSDK(
context: Context,
platform_branch: UrlsPlatformList = PushSdkParametersPublic.branchMasterValue,
log_level: String = "error",
basePushURL: String
){
...
}Params:
-
context- the context you would like to use -
platform_branch- -
log_level- -
basePushURL- base URL path to the API
Usage example:
val pushSDK = PushSDK(
context = this,
basePushURL = "https://yourapilink.com/version/"
)Each method would return an answer upon finishing execution
The answer structure is as follows:
- Answer structure returned by registration methods:
public data class PushKFunAnswerRegister(
val code: Int,
val result: String,
val description: String,
val deviceId: String,
val token: String,
val userId: String,
val userPhone: String,
val createdAt: String
)- Answer structure returned by other methods:
public data class PushKFunAnswerGeneral(
val code: Int,
val result: String,
val description: String,
val body: String
)
Register the device
Params:
-
X_Push_Client_API_Key- API key that you would be provided with -
X_Push_App_Fingerprint- APP fingerprint that you would be provided with -
user_msisdn- Device's phone number -
user_password- password, associated with Device's phone number -
X_FCM_token- your firebase cloud messaging token
Usage examples:
pushSDK.push_register_new(
"Client_API_Key", //API key that you would be provided with
"App_Fingerprint", //APP fingerprint that you would be provided with
"88002000600", //Device's phone number
"UserPassword" //password, associated with Device's phone number
)pushSDK.push_register_new(
"Client_API_Key", //API key that you would be provided with
"App_Fingerprint", //APP fingerprint that you would be provided with
"UserMsisdn", //Device's phone number
"UserPassword", //password, associated with Device's phone number
"FCM token" //your firebase cloud messaging token
)Update registration
Params:
Usage example:
pushSDK.push_update_registration()Unregister the current device from database (if registered)
Params:
Usage example:
pushSDK.push_clear_current_device()Unregister all devices registered with the current phone number from database
Params:
Usage example:
pushSDK.push_clear_all_device()Get a list of all devices registered with the current phone number
Params:
Usage example:
pushSDK.push_get_device_all_from_server()Get message history
Params:
-
period- amount of time to get message history for
Usage example:
pushSDK.push_get_message_history(3600)Checks undelivered message queue and sends delivery report for the messages
Params:
Usage example:
pushSDK.push_check_queue()Send a message to the server and receive a callback
Params:
-
message_id- id of the message -
message_text- text of the message
Usage example:
pushSDK.push_send_message_callback("message_id", "message_text")Send a delivery report for a specific message
Params:
-
message_id- message id to get the delivery report for
Usage example:
pushSDK.push_message_delivery_report("message_id")Change phone number
Params:
-
newmsisdn- new phone number
Usage example:
pushSDK.rewrite_msisdn(88002000600)Change password
Params:
-
newPassword- new password
Usage example:
pushSDK.rewrite_password(newpassword)