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 state

enum PushDirection

Enumerator Value Description
Up Fetch older message
Down Fetch newer message

Search direction of local push message

Public Functions Documentation

function ~BMXPushService

inline virtual ~BMXPushService()

Example:

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:

function stop

virtual BMXErrorCode stop() =0

Shut push feature interface.

Return: BMXErrorCode

Example:

function resume

virtual BMXErrorCode resume() =0

Resume push function.

Return: BMXErrorCode

Example:

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:

function getToken

virtual const std::string & getToken() =0

Get user token to use after login.

Return: std::stirng

Example:

function getCert

virtual const std::string & getCert() =0

Get push certificate returned by server after login.

Return: std::stirng

Example:

function status

virtual PushSdkStatus status() =0

Push the current state of sdk.

Return: PushSdkStatus

Example:

function bindDeviceToken

virtual BMXErrorCode bindDeviceToken(
    const std::string & token
) =0

Push binding device token.

Parameters:

  • token Device push token

Return: BMXErrorCode

Example:

function bindVoipToken

virtual BMXErrorCode bindVoipToken(
    const std::string & token
) =0

Bind voiptoken of push device

Parameters:

  • token Device voip push token

Return: BMXErrorCode

Example:

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:

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:

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:

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:

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:

function setBadge

virtual BMXErrorCode setBadge(
    int count
) =0

Set unread badge for push user.

Parameters:

  • count Unread badge count of user

Return: BMXErrorCode

Example:

function setPushMode

virtual BMXErrorCode setPushMode(
    bool enable =true
) =0

Set push enabled state. Default enabled.

Parameters:

  • enable Enabled state of push

Return: BMXErrorCode

Example:

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:

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:

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:

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:

function clearNotification

virtual void clearNotification(
    int64_t notificationId
) =0

Clear notifications for the specified id.

Parameters:

  • notificationId Notification id

Example:

function clearAllNotifications

virtual void clearAllNotifications() =0

Empty the drop-down notification bar for all notifications.

Example:

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:

client->sendMessage(msg);

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:

function addPushListener

virtual void addPushListener(
    BMXPushServiceListener * listener
) =0

Add push listener

Parameters:

  • listener Push listener

Example:

function removePushListener

virtual void removePushListener(
    BMXPushServiceListener * listener
) =0

Remove push listener

Parameters:

  • listener Push listener

Example:


Updated on 2022-01-26 at 17:20:40 +0800

© 2019-2023 MaximTop | Homepage Last modified time: 2023-08-09 14:48:15

results matching ""

    No results matching ""