SendingNetwork
  • OVERVIEW
    • Getting Started
    • FAQs
  • Network Instructional Articles
    • Basics
      • Introducing the Edge, WatchDog, and Guardian Nodes
      • Overview
      • Messaging Solution
      • Privacy Solution
      • Rich Communication Solution
      • Multi-Platform Solution
      • Decentralized Identity
      • Multiple Chat Modes
      • How It Works
      • Token Utility
      • The Team
    • Key Concepts
      • Decentralized Identity
      • Social Graphs
      • Edge Node
  • SDK Documentation
    • Glossary
    • JavaScript client SDK
      • DID
      • User
      • Message
      • Room
      • Contact
      • Social Graph
    • iOS client SDK
      • Push
      • DID
      • User
      • Message
      • Room
      • Contact
    • Android client SDK
      • User
      • Room
    • Java SDK
      • DID
      • Room
      • Message
    • Node.js SDK
      • DID
      • Room
      • Message
    • Unreal SDK
      • DID
      • User
      • Message
      • Room
    • Unity SDK
      • DID
      • Room
      • Message
    • Website chat widget SDK
      • Customization
      • DID
      • User
      • Room
      • Message
      • Other
    • Bot SDKs
      • Golang Bot SDK
        • DID
        • User
        • Room
        • Message
    • Extensible Message Interface
    • Push Notifications
    • Flutter SDK
      • DID
      • User
      • Message
      • Room
    • PHP SDK
      • DID
      • Room
      • User
    • Developer Key
  • Acquisition Kit
    • Social Boost Development Instructions
  • WatchDog Agent
    • WatchDog Agent Guide
    • WatchDog Agent Deployment Tutorial
      • Linux Deployment Tutorial
    • One-Click Deployment
  • Edge Node
    • Edge Node Deployment Tutorial
    • VPS Setup Guide
      • Google Cloud Platform (GCP)
      • Amazon Web Services (AWS)
      • Contabo
    • Check Node Stats with Auto-Reply Bot in SendingMe App
    • Alpha-3 Testnet FAQs
  • delegation node
    • Delegation Node Deployment Tutorial
  • Private Delegation Node
  • Use Cases
    • Wallet-to-Wallet Messaging
    • Dapp Notifications
    • Identity Verification
    • Gamer Acquisition
    • Cross-platform Trading
Powered by GitBook
On this page
  • DID Login Process
  • 1 Check if the address has a DID
  • 2 Log into a DID or register an address.
  • 3 Sign the message that was returned in step 2
  • 4 Log out
  1. SDK Documentation
  2. Flutter SDK

DID

DID Login Process

1 Check if the address has a DID

 final client = Provider.of<Client>(context, listen: false);
 SDNDIDListResponse response = await client.getDIDList(address: address);

Input Parameters:

Name
Type
Description
Required

address

String

wallet address

true

Output Parameters:

SDNDIDListResponse

Name
Type
Description
Required

data

String

List of DIDs

true

2 Log into a DID or register an address.

Choose DID or use the address to log in. If the interface array is empty, log in with the address. Otherwise, use the first element of the array as the 'did' parameter.

 final client = Provider.of<Client>(context, listen: false);
 String responseStr;
 if (response1.data.isNotEmpty) {
   responseStr = await client.postPreLoginDID(DID: response1.data[0]);
 } else {
   responseStr = await client.postPreLoginDID(address: address);
 }

Input Parameters:

Name
Type
Description
Required

DID

String

DID string, choose either DID or wallet address

False

address

String

wallet address, choose either DID or wallet address

False

Output Parameters: PreloginResponse

Name
Type
Description
Required

DID

String

user DID (existed or newly created)

true

message

String

message to be signed

true

updated

String

update time

true

random_server

string

nounce returned from the node

true

3 Sign the message that was returned in step 2

    String str = responsesdn.message; //responsesdn.message
    String signMessage = EthSigUtil.signPersonalMessage(
    privateKey: privKey, message: convertStringToUint8List(str));

Input Parameters: LoginRequest

Name
Type
Description
Required

type

String

Login type (current value: m.login.did.identity)

true

updated

String

update time returned by the pre_login

true

identifier

IdentifierModel

login information

true

device_id

String

device id, no need for new device

false

IdentifierModel Type:

Name
Type
Description

DID

String

User DID

token

String

To sign the message returned by pre_login, you can call the EthSigUtil.signPersonalMessage function from the DID class to perform the signature.

Output Parameters:

SDNDIDLoginResponse

Name
Type
Description
Required

access_token

String

access token

true

user_id

String

user ID

true

device_id

String

device id

true

4 Log out

 Future<void> logout() async {
  try {
    await super.logout();
  } catch (e, s) {
    Logs().e('Logout failed', e, s);
    rethrow;
  } finally {
    await clear();
  }
}

Input Parameters:

Name
Type
Description
Required

token

String

Login type (current value: m.login.did.identity)

true

PreviousFlutter SDKNextUser

Last updated 1 year ago