LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXPushService#

Public Types#

Name
enum classPushSdkStatus { Starting = 1, Started, Stoped, Offline}
push sdk state
enum classPushDirection { Up, Down}
Search direction of local push message

Public Functions#

Name
virtual~BMXPushService()
virtual BMXErrorCodestart(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 BMXErrorCodestop() =0
Shut push feature interface.
virtual BMXErrorCoderesume() =0
Resume push function.
virtual BMXErrorCodeunbindAlias(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 PushSdkStatusstatus() =0
Push the current state of sdk.
virtual BMXErrorCodebindDeviceToken(const std::string & token) =0
Push binding device token.
virtual BMXErrorCodebindVoipToken(const std::string & token) =0
Bind voiptoken of push device
virtual BMXErrorCodegetPushProfile(BMXPushUserProfilePtr & pushProfile, bool forceRefresh) =0
Get push user details, force pull from server-side if forceRefresh == true
virtual BMXErrorCodesetTags(const std::vector< std::string > & tags, const std::string & operationId) =0
Set tags of push user.
virtual BMXErrorCodegetTags(std::vector< std::string > & tags, const std::string & operationId) =0
Get tags of the push user.
virtual BMXErrorCodedeleteTags(const std::vector< std::string > & tags, const std::string & operationId) =0
Delete tags of the push user.
virtual BMXErrorCodeclearTags(const std::string & operationId) =0
Clear tags of the push user.
virtual BMXErrorCodesetBadge(int count) =0
Set unread badge for push user.
virtual BMXErrorCodesetPushMode(bool enable =true) =0
Set push enabled state. Default enabled.
virtual BMXErrorCodesetPushTime(int startHour, int endHour) =0
Set allowed push time.
virtual BMXErrorCodesetSilenceTime(int startHour, int endHour) =0
Set the start and end time of silent push.
virtual BMXErrorCodesetRunBackgroundMode(bool enable =false) =0
Set whether to run push in background, default false.
virtual BMXErrorCodesetGeoFenceMode(bool enable =false, bool isAllow =false) =0
Set whether to run push geo-fencing feature.
virtual voidclearNotification(int64_t notificationId) =0
Clear notifications for the specified id.
virtual voidclearAllNotifications() =0
Empty the drop-down notification bar for all notifications.
virtual voidsendMessage(const std::string & content) =0
Send a push uplink message and notify the listener of a change in message status
virtual BMXErrorCodeloadLocalPushMessages(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 voidaddPushListener(BMXPushServiceListener * listener) =0
Add push listener
virtual voidremovePushListener(BMXPushServiceListener * listener) =0
Remove push listener

Public Types Documentation#

enum PushSdkStatus#

EnumeratorValueDescription
Starting1Starting
StartedStarted, online
StopedStop
OfflineOffline

Push SDK status

enum PushDirection#

EnumeratorValueDescription
UpFetch older messages
DownFetch 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

Generated API content with concise AI notes where context helps.