Webview Callback Schema

Handling the interaction between webview programs and the app

Example use case: Webview wants to redirect user to cart page on a button click.

{
  "user_id":"xyz",
  "eventName": "OPEN_DEEPLINK",
  "data": {
    "deepLink": string,
    [key: string]: string
  }
}

Close

Example use case: User wants to close the webview by clicking on close button.

{
  "user_id":"xyz",
  "eventName": "CLOSE",
  "data": null
}

Share

Example use case: User might want to use social share for referral or sharing reward the user won.

{
  "user_id":"xyz",
  "eventName": "SHARE"
  "data": {
    "channelName": "WHATSAPP" | "OTHERS",
    "text": "string",
    "image": "string"
  }
}

Invalid Campaign Id

Example use case: In case of providing an invalid campaignId in the open campaign method, the wallet opens up by default. The following event is also triggered and can be consumed to handle the case in a custom manner.

{
  "user_id":"xyz",
  "eventName": "CG_INVALID_CAMPAIGN_ID"
  "data": {
    "campaignId":"xyz-abc-123"
    "message":"Invalid campaignId, opening Wallet"
   }
}

Analytics

Example use case: Capture Webview interaction events like page loads, clicks directly on the app

{
   "user_id":"xyz",
   "eventName":"ANALYTICS",
   "data":{
      "timestamp":"2022-07-11T09:16:48.917Z",
      "event_name":"xyz",
      "event_properties":{
         "lorem":"ipsum"
      }
   }
}

Check all analytics events schema here

Last updated