floo::BMXPushService#
Public Types#
| Name | |
|---|---|
| enum class | PushSdkStatus { Starting = 1, Started, Stoped, Offline} push sdk state |
| enum class | PushDirection { Up, Down} Search direction of local push message |
Public Functions#
| Name | |
|---|---|
| virtual | ~BMXPushService() |
| virtual BMXErrorCode | start(const std::string & alias ="", const std::string & bmxToken ="") =0 Initialize push sdk. Use this interface to initialize the push sdk in the case of using push only. When using IM features at the same time, call login function directly in BMXClient. The config object initializes by passing in the platform type and device id. |
| virtual BMXErrorCode | stop() =0 Shut push feature interface. |
| virtual BMXErrorCode | resume() =0 Resume push function. |
| virtual BMXErrorCode | unbindAlias(const std::string & alias) =0 Unbind user alias. |
| virtual const std::string & | getToken() =0 Get user token to use after login. |
| virtual const std::string & | getCert() =0 Get push certificate returned by server after login. |
| virtual PushSdkStatus | status() =0 Push the current state of sdk. |
| virtual BMXErrorCode | bindDeviceToken(const std::string & token) =0 Push binding device token. |
| virtual BMXErrorCode | bindVoipToken(const std::string & token) =0 Bind voiptoken of push device |
| virtual BMXErrorCode | getPushProfile(BMXPushUserProfilePtr & pushProfile, bool forceRefresh) =0 Get push user details, force pull from server-side if forceRefresh == true |
| virtual BMXErrorCode | setTags(const std::vector< std::string > & tags, const std::string & operationId) =0 Set tags of push user. |
| virtual BMXErrorCode | getTags(std::vector< std::string > & tags, const std::string & operationId) =0 Get tags of the push user. |
| virtual BMXErrorCode | deleteTags(const std::vector< std::string > & tags, const std::string & operationId) =0 Delete tags of the push user. |
| virtual BMXErrorCode | clearTags(const std::string & operationId) =0 Clear tags of the push user. |
| virtual BMXErrorCode | setBadge(int count) =0 Set unread badge for push user. |
| virtual BMXErrorCode | setPushMode(bool enable =true) =0 Set push enabled state. Default enabled. |
| virtual BMXErrorCode | setPushTime(int startHour, int endHour) =0 Set allowed push time. |
| virtual BMXErrorCode | setSilenceTime(int startHour, int endHour) =0 Set the start and end time of silent push. |
| virtual BMXErrorCode | setRunBackgroundMode(bool enable =false) =0 Set whether to run push in background, default false. |
| virtual BMXErrorCode | setGeoFenceMode(bool enable =false, bool isAllow =false) =0 Set whether to run push geo-fencing feature. |
| virtual void | clearNotification(int64_t notificationId) =0 Clear notifications for the specified id. |
| virtual void | clearAllNotifications() =0 Empty the drop-down notification bar for all notifications. |
| virtual void | sendMessage(const std::string & content) =0 Send a push uplink message and notify the listener of a change in message status |
| virtual BMXErrorCode | loadLocalPushMessages(int64_t refMsgId, size_t size, BMXMessageList & result, PushDirection =PushDirection::Up) =0 Load push message stored in local database. Start with latest message if not specified |
| virtual void | addPushListener(BMXPushServiceListener * listener) =0 Add push listener |
| virtual void | removePushListener(BMXPushServiceListener * listener) =0 Remove push listener |
Public Types Documentation#
enum PushSdkStatus#
| Enumerator | Value | Description |
|---|---|---|
| Starting | 1 | Starting |
| Started | Started, online | |
| Stoped | Stop | |
| Offline | Offline |
Push SDK status
enum PushDirection#
| Enumerator | Value | Description |
|---|---|---|
| Up | Fetch older messages | |
| Down | Fetch newer message |
Local push message search direction
Public Functions Documentation#
function ~BMXPushService#
inline virtual ~BMXPushService()
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="~BMXPushService" %}{% endlanying_code_snippet %}
function start#
virtual BMXErrorCode start(
const std::string & alias ="",
const std::string & bmxToken =""
) =0
Initialize push sdk. Use this interface to initialize the push sdk in the case of using push only. When using IM features at the same time, call login function directly in BMXClient. The config object initializes by passing in the platform type and device id.
Parameters:
- alias Current user alias used for push initialization
- bmxToken User token to use that passed in by App when push initialization, and no passing in is OK without users.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="start" %}{% endlanying_code_snippet %}
function stop#
virtual BMXErrorCode stop() =0
Shut push feature interface.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="stop" %}{% endlanying_code_snippet %}
function resume#
virtual BMXErrorCode resume() =0
Resume push function.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="resume" %}{% endlanying_code_snippet %}
function unbindAlias#
virtual BMXErrorCode unbindAlias(
const std::string & alias
) =0
Unbind user alias.
Parameters:
- alias The user alias that needs to be unbound.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="unbindAlias" %}{% endlanying_code_snippet %}
function getToken#
virtual const std::string & getToken() =0
Get user token to use after login.
Return: std::stirng
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="getToken" %}{% endlanying_code_snippet %}
function getCert#
virtual const std::string & getCert() =0
Get push certificate returned by server after login.
Return: std::stirng
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="getCert" %}{% endlanying_code_snippet %}
function status#
virtual PushSdkStatus status() =0
Push the current state of sdk.
Return: PushSdkStatus
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="status" %}{% endlanying_code_snippet %}
function bindDeviceToken#
virtual BMXErrorCode bindDeviceToken(
const std::string & token
) =0
Push binding device token.
Parameters:
- token Device push token
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="bindDeviceToken" %}{% endlanying_code_snippet %}
function bindVoipToken#
virtual BMXErrorCode bindVoipToken(
const std::string & token
) =0
Bind voiptoken of push device
Parameters:
- token Device voip push token
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="bindVoipToken" %}{% endlanying_code_snippet %}
function getPushProfile#
virtual BMXErrorCode getPushProfile(
BMXPushUserProfilePtr & pushProfile,
bool forceRefresh
) =0
Get push user details, force pull from server-side if forceRefresh == true
Parameters:
- profile Push user profile information, initially passing in a pointing-to-empty shared_ptr object, fetch the user profile information here after function returned.
- forceRefresh Whether to force pull from server, automatically if local fetch failed
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="getPushProfile" %}{% endlanying_code_snippet %}
function setTags#
virtual BMXErrorCode setTags(
const std::vector< std::string > & tags,
const std::string & operationId
) =0
Set tags of push user.
Parameters:
- tags User tag
- operationId Operation id. Corresponding notification reminder in callback notification.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setTags" %}{% endlanying_code_snippet %}
function getTags#
virtual BMXErrorCode getTags(
std::vector< std::string > & tags,
const std::string & operationId
) =0
Get tags of the push user.
Parameters:
- tags User tag
- operationId Operation id. Corresponding notification reminder in callback notification.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="getTags" %}{% endlanying_code_snippet %}
function deleteTags#
virtual BMXErrorCode deleteTags(
const std::vector< std::string > & tags,
const std::string & operationId
) =0
Delete tags of the push user.
Parameters:
- tags User tag to delete
- operationId Operation id. Corresponding notification reminder in callback notification.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="deleteTags" %}{% endlanying_code_snippet %}
function clearTags#
virtual BMXErrorCode clearTags(
const std::string & operationId
) =0
Clear tags of the push user.
Parameters:
- operationId Operation id. Corresponding notification reminder in callback notification.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="clearTags" %}{% endlanying_code_snippet %}
function setBadge#
virtual BMXErrorCode setBadge(
int count
) =0
Set unread badge for push user.
Parameters:
- count Unread badge count of user
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setBadge" %}{% endlanying_code_snippet %}
function setPushMode#
virtual BMXErrorCode setPushMode(
bool enable =true
) =0
Set push enabled state. Default enabled.
Parameters:
- enable Enabled state of push
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setPushMode" %}{% endlanying_code_snippet %}
function setPushTime#
virtual BMXErrorCode setPushTime(
int startHour,
int endHour
) =0
Set allowed push time.
Parameters:
- startHour Start time for allowed silent push (hour)
- endHour End time for allowed silent push (hour)
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setPushTime" %}{% endlanying_code_snippet %}
function setSilenceTime#
virtual BMXErrorCode setSilenceTime(
int startHour,
int endHour
) =0
Set the start and end time of silent push.
Parameters:
- startHour Start time for silent push (hour)
- endHour End time for silent push (hour)
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setSilenceTime" %}{% endlanying_code_snippet %}
function setRunBackgroundMode#
virtual BMXErrorCode setRunBackgroundMode(
bool enable =false
) =0
Set whether to run push in background, default false.
Parameters:
- enable Running state of push background
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setRunBackgroundMode" %}{% endlanying_code_snippet %}
function setGeoFenceMode#
virtual BMXErrorCode setGeoFenceMode(
bool enable =false,
bool isAllow =false
) =0
Set whether to run push geo-fencing feature.
Parameters:
- enable Whether the geo-fencing function is running.
- isAllow Whether the user actively pops up a user location request.
Return: BMXErrorCode
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="setGeoFenceMode" %}{% endlanying_code_snippet %}
function clearNotification#
virtual void clearNotification(
int64_t notificationId
) =0
Clear notifications for the specified id.
Parameters:
- notificationId Notification id
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="clearNotification" %}{% endlanying_code_snippet %}
function clearAllNotifications#
virtual void clearAllNotifications() =0
Empty the drop-down notification bar for all notifications.
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="clearAllNotifications" %}{% endlanying_code_snippet %}
function sendMessage#
virtual void sendMessage(
const std::string & content
) =0
Send a push uplink message and notify the listener of a change in message status
Parameters:
- content Sent uplink push content
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="sendMessage" %}{% endlanying_code_snippet %}
function loadLocalPushMessages#
virtual BMXErrorCode loadLocalPushMessages(
int64_t refMsgId,
size_t size,
BMXMessageList & result,
PushDirection =PushDirection::Up
) =0
Load push message stored in local database. Start with latest message if not specified
Parameters:
- refMsgId Start id for loading pushes
- size Maximum number of searched messages
- result List of loaded local pushes returned by database
- Direction Direction of loading pushes, default to load earlier messages
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="loadLocalPushMessages" %}{% endlanying_code_snippet %}
function addPushListener#
virtual void addPushListener(
BMXPushServiceListener * listener
) =0
Add push listener
Parameters:
- listener Push listener
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="addPushListener" %}{% endlanying_code_snippet %}
function removePushListener#
virtual void removePushListener(
BMXPushServiceListener * listener
) =0
Remove push listener
Parameters:
- listener Push listener
Example:
{% lanying_code_snippet repo="lanying-im-embedded",class="BMXPushService",function="removePushListener" %}{% endlanying_code_snippet %}
Updated on 2022-01-26 at 17:20:40 +0800