WEPIN Developer Documentation
WepinBlogContact
English
English
  • Get Started
    • Introduction
  • Wepin
    • Features
    • Architecture
      • Key Generation
      • Signing
      • Key Backup
    • Workspace
      • App Registration and Key Issuance
      • Networks and Assets Addition
      • Widget Design
    • Supported blockchains
    • Account Abstraction
  • login
    • Overview
    • Social Login Auth Providers
      • Email/Password
      • Google
      • Apple
      • Discord
      • Naver
      • Facebook
      • Line
      • Kakao
    • User Interface
    • Simplified Login
    • Resource
  • Widget Integration
    • Prerequisites
    • Web: JavaScript SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
      • Widget
        • Installation
        • Initialization
        • Methods
        • Final Review
      • Provider
        • Ethereum Provider
        • Kaia Provider
        • Solana Provider
        • Wagmi Connector
      • Wallet Adapter
        • Solana Wallet Adapter
    • Android: Java & Kotlin SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
      • Widget Library
        • Installation
        • Initialization
        • Methods
    • iOS: Swift SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
      • Widget Library
        • installation
        • initialization
        • Methods
    • Flutter SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • Widget
        • Installation
        • Initialization
        • Methods
        • Final Review
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
    • React Native SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
    • Unity SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • Compose Multiplatform SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • Widget
        • Installation
        • Initialization
        • Methods
        • Final Review
  • API
    • Overview
    • Registration
    • Login
    • Wallet
    • Token and NFT
    • Transaction
  • Deprecated
    • Web: JavaScript SDK
      • SDK
        • Installation
        • Initialization
        • Methods
        • Final Review
      • Provider
        • EVM-Compatible Networks
      • Wagmi Connector
    • Android: Java & Kotlin SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • iOS: Swift SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • Flutter SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • React Native SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
      • Providers
        • Ethereum Providers
  • MISC
    • Logo & Brand
Powered by GitBook
On this page
  • openWidget
  • Example
  • closeWidget
  • Example
  • getAccounts
  • Account

Was this helpful?

  1. Deprecated
  2. iOS: Swift SDK

Methods

The following shows the methods provided by the Wepin widget iOS SDK.

openWidget

The openWidget method shows the widget window. The screen displayed in the widget window varies depending on the user's login status. If a user is not logged in, the login screen is displayed.

Example

let wepin = Wepin.instance()
wepin.openWidget(){ (result, error) -> Void in
    if let _ = error {
        // Do error handling
        return 
    }
}

closeWidget

The closeWidget method closes the widget window. Closing the window does not log users out.

Example

let wepin = Wepin.instance()
wepin.closeWidget(){ (result, error) -> Void in
    if let _ = error {
        // Do error handling
        return 
    }
}

getAccounts

The getAccounts method returns user accounts of the networks available in the app. The returned value is an array of Account object. getAccounts is a method available after widget login.

let wepin = Wepin.instance()
wepin.getAccounts() { (accounts, error) -> Void in
    if let _ = error {
        // Do error handling
        return
    }
    // Do something with accounts 
}

Account

The interface of the class returned by the getAccounts function is as follows.

public struct Account {
    var address: String;  // The account address
    var network: String;  // The blockchain network of the account
}
  • address: string The account address

  • network: string The blockchain network of the account. The name of each network can be found below.

PreviousInitializationNextFinal Review

Last updated 8 months ago

Was this helpful?

Supported blockchains