Options
All
  • Public
  • Public/Protected
  • All
Menu
en

return the represents the message object class, Corresponding to huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_DISPLAY and huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_CLICK two callback types

zh

返回的 消息对象,对应 huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_DISPLAYhuawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_CLICK 两种回调值情况

Hierarchy

Index

Properties

code

Optional data

data: any

endTime

endTime: number

Optional errMsg

errMsg: string

frequencyType

frequencyType: number

frequencyValue

frequencyValue: number

id

id: number

messageType

originData

originData: Object

startTime

startTime: number

testFlag

testFlag: number

triggerEvens

triggerEvens: Array<string>

Methods

getEndTime

  • getEndTime(): number
  • en

    Obtains the display frequency of a message

    zh

    获取消息的结束时间戳

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_DISPLAY, (result) => {
        console.log('getEndTime: ', result.getEndTime());
    }, this);
    

    Returns number

    End timestamp of a message, accurate to milliseconds. long type from Java side.

getFrequencyType

  • getFrequencyType(): number
  • en

    Obtains the display frequency of a message

    zh

    获取消息的展示频率

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_CLICK, (result) => {
        console.log('getFrequencyType: ', result.getFrequencyType());
    }, this);
    

    Returns number

    Display frequency type of a message. The options are as follows:

    • 1: only once.
    • 2: once every X days. The value of X is the return value of getFrequencyValue.
    • 3: X days per day The value of X is the return value of getFrequencyValue.

getFrequencyValue

  • getFrequencyValue(): number
  • en

    Obtains the display frequency limit of an in-app message

    zh

    获取消息展示的频率

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_DISPLAY, (result) => {
        console.log('getFrequencyValue: ', result.getFrequencyValue());
    }, this);
    

    Returns number

    Display frequency limit of an in-app message. This parameter is valid only when getFrequencyType is set to 2 or 3. int type from Java side.

getId

  • getId(): number
  • en

    Obtains the ID of an in-app message

    zh

    获取消息 ID

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_CLICK, (result) => {
        console.log('getId: ', result.getId());
    }, this);
    

    Returns number

    Message ID, long type from Java side.

getMessageType

  • en

    Obtains the message type

    zh

    获取消息类型

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_DISPLAY, (result) => {
        console.log('getMessageType: ', result.getMessageType());
    }, this);
    

    Returns AppMessagingMessageType

    Message type. The options are huawei.agc.appmessaging.AppMessagingMessageType.BANNER, huawei.agc.appmessaging.AppMessagingMessageType.CARD, and huawei.agc.appmessaging.AppMessagingMessageType.PICTURE.

getStartTime

  • getStartTime(): number
  • en

    Obtains the start timestamp of a message

    zh

    获取消息的开始时间戳

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_CLICK, (result) => {
        console.log('getStartTime: ', result.getStartTime());
    }, this);
    

    Returns number

    Start timestamp of a message, accurate to milliseconds. long type from Java side.

getTestFlag

  • getTestFlag(): number
  • en

    Checks whether an in-app message is a test message.

    zh

    获取是否是测试消息

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_CLICK, (result) => {
        console.log('getTestFlag: ', result.getTestFlag());
    }, this);
    

    Returns number

    Checks whether an in-app message is a test message. The options are as follows: 1: test message 0: non-test message

getTriggerEvents

  • getTriggerEvents(): Array<string>
  • en

    A collection of in-app message trigger event types, which are selected by you in AppGallery Connect

    zh

    消息被触发的事件类型的集合,即开发者在 AGC 后台勾选的消息触发事件的集合

    example
    huawei.agc.appmessaging.appMessagingService.on(huawei.agc.appmessaging.AGC_APP_MESSAGING_LISTENER_NAME.ON_MESSAGE_DISPLAY, (result) => {
        console.log('getTriggerEvents: ', result.getTriggerEvents());
    }, this);
    

    Returns Array<string>

    A collection of in-app message trigger event types. The App Messaging SDK matches an event ID with the trigger event types of an in-app message. If the ID is in TriggerEvent, the message will be displayed.

Generated using TypeDoc