Skip to content

Other

offCustomEvent

offCustomEvent(callback)

Unlisten for the onCustomEvent event. When the callback is empty, clear all callbacks

Sample Code

javascript
const callback = (res) => {}
pz. onCustomEvent(callback)

Clears the specified callback
pz. offCustomEvent(callback)
Clear all callbacks
pz. offCustomEvent()

addCustomEventListener

addCustomEventListener(eventName, callback)

This event is based of onCustomEvent, which can effectively reduce template code within onCustomEvent

attention When using this event, to trigger it normally, the SDK must have a name field in the data body when calling the event, indicating which eventName was triggered.

For example:

javascript
{
  name: 'someMethod', // required
  data: {
    a: 'data-1',
    b: 'data-2',
    c: 1001
  },
  errMsg: 'some error msg'
}

The overall data will be transmitted to the callback

example code

javascript
const callback = (res) => {
    console.log(res)
}
pz.addCustomEventListener('someMethod', callback)

removeCustomEventListener

removeCustomEventListener(eventName, callback)

Remove the listening of addCustomEventListener

example code

javascript
const callback = (res) => {
    console.log(res)
}
pz.removeCustomEventListener('someMethod', callback)

getSuperviseInfo

Obtain monitoring information.

getSuperviseInfo(Object object)

Description

When invoking this interface, ensure that the SDK version integrated in the App is later than the following version:

Android SDK version: 2.8.55

iOS SDK version: 2.4.9

parameter

Object object

attributetypeDefault valuesRequiredIntroductions
successfunctionnoInterface calls the successful callback function
failfunctionnoInterface calls failed callback functions
completefunctionnoCallback function at the end of an interface call (both successful and unsuccessful calls are executed)

object.success callback function

parameter

Object res

attributetypeIntroductions
idfvstringidfv
imeistringimei
udidstringEquipment unique identification
registerMobilestringRegistered mobile phone number
actualMobilestringActually use the phone number
publicIpstringPublic ip address
publicPortstringPublic network port number
macAddressstringmac address
innerIpstringIntranet ip
systemVersionstringSystem version number
imsistringimsi
iccidstringiccid
appNamestringApplication name
appVersionstringApplication version number
bundleIdstringbundleId of the application

sample code

javascript
 pz.getSuperviseInfo({
  success(res) {
    console.log(res.idfv)
    console.log(res.imei)
    console.log(res.appName)
    console.log(res.appVersion)
  }
})

sendWebviewEvent

pz.sendWebviewEvent(Object object)

The applet sends events to H5

sample code

javascript
 pz.sendWebviewEvent({ data: '456' })

reportEvent

Event reporting

pz.reportEvent(string eventId, object data)

parameter

attributetypeIntroductions
eventIdstringUnique event name that is set
dataobjectBe JSON.stringily Will be reported to the system together