Ontology Developer Center
DISCOVERCOMMUNITYSUPPORT
  • Introduction
  • Discover Ontology
  • Getting Started
  • Glossary
  • Decentralized Identity and Data
    • ONT ID
      • Decentralized Identifiers
        • Method Specification for Ontology
        • Method Specification for Ethereum
        • Method Specification for BSC
      • Verifiable Credentials
        • Anonymous Credentials
      • ONT Login
        • Scenarios
        • Protocol Specification
        • Front-end JavaScript SDK
          • Integration and Usage
          • API Reference
        • Front-end UI SDK
          • Integration and Usage
          • API Reference
        • Back-end Go SDK
          • Integration and Usage
          • API Reference
        • Back-end Java SDK
          • Integration and Usage
          • API Reference
      • ONT TAG
        • Workflow
        • API Reference
      • Mercury
      • OScore
    • DDXF
      • Components and Interfaces
      • GREP
      • Overall Scheme
      • Solutions
        • Marketplace
          • Deployment
          • Scenarios
          • SaaS Tenant
          • Java SDK
        • Data Storage
          • Deployment
          • Java SDK
        • Resource Auditor
        • Offline Judge
      • Use Cases
        • E-Shops
  • ONTOLOGY ELEMENTS
    • Smart Contracts
      • Types of smart contracts
    • Token Protocols
    • Consensus Mechanism
    • Ontology Oracle
      • Oracle Process Flow
  • GUIDES & TUTORIALS
    • Development Guides
      • dApp Development
        • Using the dAPI
        • Data Synchronization
      • Smart Contract Development
        • EVM Contract
          • Development Environment and Tools
          • Wallet Setup
          • Contract Development
          • How to Deploy a Smart Contract with GetBlock
        • NeoVM Contract
          • Development tools and environment
          • Launching the IDE
          • Writing and editing program logic
          • Deploying and testing on private net
        • WASM Contract
          • Development Environment
          • Project Initiation - Hello World
          • Creating your own project
          • Development using SmartX
          • Runtime API
          • Contract Fundamentals
          • Inter-contract Interaction
          • Developing Contracts in C++
        • Publish Contract Source Code
    • Integration Guides
      • dApp Integration
        • dAPI Integration
          • Chrome Plugin
          • Mobile wallet dApp
          • QR code mechanism
          • Wake call mechanism
        • Cocos 2D-x
        • Unity 3D applications
      • Mobile Wallet Integration
        • SDK integration
        • dAPI Integration
          • In-wallet applications
          • QR code mechanism
          • Wake call mechanism
        • Stake
      • Using ONT ID
      • Exchange Integration
        • Exchange Docking Guide
        • Exchange API
      • Ontology for dApp Stores
    • EVM & Token Decimals Upgrade
  • ONTOLOGY NODE
    • Abstract
    • Node Deployment
      • Standard Node
      • Rosetta Node
    • Interacting with a Public Node
  • DEVELOPER TOOLS
    • dApp Development Framework
      • Punica CLI
      • Punica boxes
      • Solo Chain
    • IDE
    • APIs
      • HTTP API
        • Restful
        • WebSocket
        • Remote Procedure Call (RPC)
      • Explorer v2 API
        • Block
        • Address
        • Contract
        • Token
        • Transactions
        • ONT ID
        • Summary
        • Node
      • Native Token API
        • ONT Contract API
        • ONG Contract API
      • ONT ID Contract API
      • Web3 API
      • OScore Open API
      • Rosetta Node API
        • Data API
        • Construction API
      • DToken Contract API
      • DDXF
        • Marketplace Contract API
        • Storage API
      • Governance API
    • Digital Wallet
      • Chrome Plugin provider
      • Chrome Plugin dAPI
      • Mobile version provider
      • Mobile version dAPI
    • SDKs
    • Signing Server
      • Installation
      • API reference
  • COMMUNITY
    • Ecosystem Programs
    • Community Libraries
    • Community Events
    • Community Channels
    • Core Contributors
  • SUPPORT
    • FAQ
      • Basic blockchain concepts
      • Ontology Nodes
      • Ontology token protocols
      • Smart contracts
      • SDKs and APIs
    • Contact Us
Powered by GitBook
On this page
  • dAPI usage scenarios
  • dApps open in the wallet
  • Wallet scans a QR code
  • dApp wakes the wallet
  • Demonstration
  • 1. Open a dApp in the wallet
  • 2. Fetch Account or Identity Information
  • 3. Login into the dApp
  • 4. dApp Contract Deployment

Was this helpful?

  1. GUIDES & TUTORIALS
  2. Integration Guides
  3. Mobile Wallet Integration

dAPI Integration

Integrating a mobile wallet using the dAPI

PreviousSDK integrationNextIn-wallet applications

Last updated 5 years ago

Was this helpful?

Integrating the dAPI is practically equivalent to integrating the Provider SDK. The Provider SDK encapsulates methods for iOS/Android webview, and supports communication between web based dApps and iOS/Android webview.

For the dAPI method handbook for both Android and iOS operating systems, please follow this .

dAPI usage scenarios

Mobile version of dAPI can allow the wallet to perform the following features based on dApp scenarios-

  • dApps are launched in the wallet

  • Wallet scans QR codes

  • Applications wake the wallet

dApps open in the wallet

The execution process is as follows:

  1. The dApp is opened in the wallet

  2. Account or identity information is fetched

  3. dApp logs in

  4. dApp invokes smart contract

Wallet scans a QR code

Login Process

The execution process is as follows:

  1. Wallet scans the QR code provided by the dApp

  2. Provider receives the callback URL and verification message, user authenticates and signs the message, the message is sent to the callback URL provided.

  3. dApp back end carries out the verification process for the message.

Invoking a smart contract

The execution process is as follows:

  1. Wallet scans the QR code provided by the dApp

  2. Wallet initiates the transaction, the user authenticates and signs, the contract is pre-executed, user confirms, transaction is transmitted to the blockchain, transaction hash is returned to the callback address

  3. dApp back end queries transaction event

dApp wakes the wallet

dApp sends a login request

  1. dApp sends the wake call to the wallet

  2. Wallet fetches the callback URL and the verification message, user enter authenticates and signs the message, wallet returns the signature to the callback address

  3. dApp back end verifies the message

dApp sends an invocation request

  1. dApp sends the wake call to the wallet

  2. Wallet initiates the transaction, the user authenticates and signs, wallet pre-executes the transaction, the transaction is transmitted to the blockchain, the transaction hash is returned to the callback address

  3. dApp back end queries the transaction event on the blockchain using the transaction hash

Demonstration

Here is a basic demonstration of some of the basic functions that the wallet can perform. A demo wallet which can be downloaded using the link below has been used to mimic a second party.

After completing the installation of Cyano wallet and the demo app, features of both the wallets can be tested along with the source code as reference.

Transactions can be performed to test smart contract logic and confirming whether or not the platform has been integrated successfully.

1. Open a dApp in the wallet

2. Fetch Account or Identity Information

Clicking on the Get Identity button will directly fetch the ONT ID of the account. Enter the password when prompted and the ID will appear in the blank field below. You can carry out the authorization/KYC by uploading your document information, for e.g, passport number, picture of the first page, etc.

3. Login into the dApp

In case there is a need to verify the user's identity, dApp sends a message to the wallet to carry out the signature process, and then verifies the signature.

As illustrated above, the wallet prompts the user to enter the password. Once confirmed, the contract related details can be accessed.

4. dApp Contract Deployment

The contract deployment process involves the following steps:

  1. After the signature verification is completed successfully, the contract is pre-processed.

  2. The user confirms and transmits the transaction via the wallet.

  3. The hash value of the transaction is returned to the dApp.

H5 demo dApp source code:

H5 demo dApp link:

Cyano wallet mobile version (Android):

Cyano wallet source code(Android):

Cyano wallet source code(iOS):

Launch Cyano wallet and access the "DApp" section. Open the "PRIVATE APPS" tab and input this address to access the demo dApp:

https://github.com/ontio-cyano/mobile-dapp-demo
http://101.132.193.149:5000/#/
http://101.132.193.149/files/app-debug.apk
https://github.com/ontio-cyano/cyano-android
https://github.com/ontio-cyano/cyano-ios
http://101.132.193.149:5000/#/
link