Other
offCustomEvent
offCustomEvent(callback)
Unlisten for the onCustomEvent event. When the callback is empty, clear all callbacks
Sample Code
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:
{
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
const callback = (res) => {
console.log(res)
}
pz.addCustomEventListener('someMethod', callback)removeCustomEventListener
removeCustomEventListener(eventName, callback)
Remove the listening of addCustomEventListener
example code
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
| attribute | type | Default values | Required | Introductions |
|---|---|---|---|---|
| success | function | no | Interface calls the successful callback function | |
| fail | function | no | Interface calls failed callback functions | |
| complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.success callback function
parameter
Object res
| attribute | type | Introductions |
|---|---|---|
| idfv | string | idfv |
| imei | string | imei |
| udid | string | Equipment unique identification |
| registerMobile | string | Registered mobile phone number |
| actualMobile | string | Actually use the phone number |
| publicIp | string | Public ip address |
| publicPort | string | Public network port number |
| macAddress | string | mac address |
| innerIp | string | Intranet ip |
| systemVersion | string | System version number |
| imsi | string | imsi |
| iccid | string | iccid |
| appName | string | Application name |
| appVersion | string | Application version number |
| bundleId | string | bundleId of the application |
sample code
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
pz.sendWebviewEvent({ data: '456' })reportEvent
Event reporting
pz.reportEvent(string eventId, object data)
parameter
| attribute | type | Introductions |
|---|---|---|
| eventId | string | Unique event name that is set |
| data | object | Be JSON.stringily Will be reported to the system together |