API Description

Shake to Follow JS API is designed to provide Shake to Follow feature for merchants who have activated Shake Nearby with certain development capabilities. Merchants can directly call the Shake to Follow API on the page that is displayed after shaking to implement the feature of following the Official Account.

Notes:

  1. Merchants must not induce users to follow the Official Account when using Shake to Follow feature. Otherwise, the Official Account of the merchant will be disabled once verified.

  2. Shake to Follow only works on the H5 page of Shake Nearby. This API will not work if you open the webpage directly in the Weixin browser. When debugging, the developer must go through the complete process of Shake Nearby and enter the debugging page via Shake.

  3. Users can only follow the Official Account of the store within 1 km of the store.

Data example

The JS API for following is called in the same format as that for the Weixin JS API, as shown below:

Common functions invoke
Use Actively call the specified API
General form BeaconAddContactJsBridge.invoke("API name", {call parameters}, <callback function>)

Note: All codes in the documentation only work in the scenarios of Weixin Shake Nearby. BeaconAddContactJsBridge will not work if you open the webpage directly in the Weixin browser. When debugging, the developer must go through the complete process of Shake Nearby and enter the debugging page via Shake.

Example: