Event Provider

Event Provider Callback

DappPortalSDK.getEventProvider()

Event Provider Callback for Unifi Apps Mission Completion

  • The purpose of this callback method is to verify mission completion on Unifi side and automatically display a success banner when verification is successful.

Parameters

Parameter
Type
Description

eventId

string

The unique identifier provided by Unifi

subMissionIndex

string

The index of the sub-mission provided by Unifi. Indexing starts from 0. For example: - Event item purchase Misson -> use subMissionIndex = "0" - Lv4 achievement Misson -> use subMissionIndex = "1"

Responses

N/A

  • If verification is successful, a banner will be displayed.

Unifi Apps Server REST API Implementation

Unifi Apps Server REST API Implementation Guide

To enable mission completion on the Unifi charts, the Unifi Apps server must provide an API endpoint that allows the Unifi to verify whether a mission has been completed.

  • Information Required

    • API URL (required)

    • Custom Header (optional)

  • API Overview

    • Method: GET

    • Scheme: https

    • Read Timeout: 1s

      • If the Unifi server does not receive a response within 1 second, the mission will be treated as failed.

  • Custom Header (optional)

    • You may include a custom header when the API is called.

    • There are no restrictions on header key/value format.

    • Only one custom header can be used, and it is optional.

    • ex) x-dapp-custom-key: gq8g0Ah1MD98

  • URL Format

    • Base URL: Unifi Apps server URL

    • The $identifier as query parameter must be included.

    • $identifier is a placeholder that will be replaced by the user’s wallet address (in lowercase) by the Unifi server.

    • ex) https://example.dapp.io/api/mission/1111?param=zzzz&identifier=$identifier

  • Response Body

    • Content Type: JSON

    • If the Unifi server receives a successful response, the user is considered to have completed the mission.

      • Mission Complete

      • Mission Fail

Last updated