Outros
addcustomeventListener
addCustomEventListener(eventName, callback)
Este evento é baseado no OnCustomevent, que pode efetivamente reduzir o teste com o Customevent
attention Ao usar este evento, para acioná -lo normalmente, o SDK deve ter um arquivo de nome, o corpo de dados ao ligar para o evento, indicando qual nome foi acionado.
Por exemplo:
{
name: 'someMethod', // required
data: {
a: 'data-1',
b: 'data-2',
c: 1001
},
errMsg: 'some error msg'
}Os dados do Overald serão transmitidos ao retorno de chamada
example code
const callback = (res) => {
console.log(res)
}
pz.addCustomEventListener('someMethod', callback)RemovecustomeventListener
removeCustomEventListener(eventName, callback)
Remova a escuta do addcustomeventListener
example code
const callback = (res) => {
console.log(res)
}
pz.removeCustomEventListener('someMethod', callback)getSuperviseInfo
Obtenha informações de monitoramento.
getSuperviseInfo(Object object)
Description
Ao invocar essa interface, verifique se a versão SDK integrada no aplicativo é posterior à seguinte versão:
Versão Android SDK: 2.8.55
Versão iOS SDK: 2.4.9
parameter
Object object
| attribute | type | Default values | Required | Introduções |
|---|---|---|---|---|
| success | function | no | Interface chama a função de retorno de chamada bem -sucedida | |
| fail | function | no | Chamadas de interface Funções de retorno de chamada falhas | |
| complete | function | no | Função de retorno de chamada no final de uma chamada de interface (as chamadas bem -sucedidas e pouco sucedidas são executadas) |
object.success callback function
parameter
Object res
| attribute | type | Introduções |
|---|---|---|
| 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)
O applet envia eventos para H5
sample code
pz.sendWebviewEvent({ data: '456' })Relatório
Relatório do evento
pz.reportEvent(string eventId, object data)
parameter
| attribute | type | Introduções |
|---|---|---|
| eventId | string | Unique event name that is set |
| data | object | Be JSON.stringily Will be reported to the system together |