1.1.2 • Published 2 years ago

subscribe-msg-svelte v1.1.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

International subscription message component, Supports HTML pages, including Vue, React, Angular, etc.

Install

npm install subscribe-msg-svelte --save

Usage

step 1:

import SubscribeMsg from "subscribe-msg-svelte";

step 2:

const subscribeMsg = new SubscribeMsg({
    target: document.body,
    props: {
        appId: '${appId}',
        authCode: '${authCode}',
        templateIds: ${templateIds},
        callback: this.handleCallback,
    }
});

step 3:

subscribeMsg.requestSubscribeMessage();

Component API

attribute namedefault valuetypedescription
requestSubscribeMessageFunctionrequest subscribe message.
authCodeStringauth token
templateIdsArraytemplateIds
animationfalseBooleanWhether to enable animation effects.
callbacknullFunctioncallback method will get the return result.

Return value Description

success

  • indicates whether the subscription action is successful.
  • the user clicks Cancel to return false.(Click mask to cancel subscription process, and return errorCode)
  • The user clicks Reject to return true.(Click Reject actually performs the subscription process, but the submission type is unsubscribe, so it returns true).
  • Other exceptions also return false.

type

  • 'AGREE': Agree to subscribe.
  • 'REJECT': reject to subscribe.

errorCode

Codedescription
CANCELLEDUser cancelled
NETWORKnetwork error
SYSTEMsystem error
INCONSISTENT_TEMPLATE_TYPETemplates type must be same.
INVALID_TEMPLATE_CODEInvalid template code.
EXCEEDING_SUBSCRIPTION_LIMITTemplates count out of max bounds.
INCOMING_EXCEEDED_THE_UPPER_LIMITThe number of incoming templates exceeded the upper limit.

Changelog

Detailed changes for each release are documented in the release notes.

v1.0.0

add subscribe message component.

v1.1.0

Dynamically acquire subscription channels.

v1.1.1

delete hylid-bridge for BurgerKing.

v1.1.2

revert hylid-bridge.

1.1.1

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago