Implementing the Livestream Event Notification feature

    Implementing the Livestream Event Notification feature


    Article summary

    By setting the ON_CLICK_REMIND_CAMPAIGN callback using the Remind Me button in the upcoming broadcast list, you can implement the live broadcast reminder feature using the campaign information provided.

    Turning on this feature

    Please contact Shoplive at ask@shoplive.cloud to enable this feature.


    ON_CLICK_REMIND_CAMPAIGN

    The messageCallback called on clicking the notification button. You can define the event for notification.

    Action

    Payload

    Description

    ON_CLICK_REMIND_CAMPAIGN

    json object

    Called on clicking the notification button

    <script>
          let messageCallback = {
            ON_CLICK_REMIND_CAMPAIGN: (payload) => {
              console.log("ON_CLICK_REMIND_CAMPAIGN", payload);
              if (payload.isReminded) {
                alert("Remind Enabled");
                // Enable notification with internal logic
              } else {
                alert("Remined Disabled");
                // Disable notification with internal logic
              }
            },
          };
          cloud.shoplive.init({
            accessKey: ACCESSKEY,
            messageCallback: messageCallback,
          });
    </script>

    Payload object

    Property name

    Type

    Example

    Description

    campaign

    json object

    json object

    Campaign data object (Refer to the following campaign object)

    isReminded

    boolean

    true

    true on clicking the remind button / false on clicking the reminded button

    Campaign object

    Property name

    Type

    Example

    Description

    campaignKey

    string

    'abcd1234'

    Campaign data

    title

    string

    'Test campaign'

    Campaign title

    campaignStatus

    string

    'READY'

    Campaign status ('READY' | 'ONAIR' | 'CLOSED' | null )

    scheduledAt

    number

    1601373600000

    Scheduled start time

    startedAt

    number

    1601373605000

    Actual started time

    endedAt

    number

    null

    Actual ended time