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
  • Example
  • isInitialized
  • changeLanguage
  • Return value
  • Example

Was this helpful?

  1. Widget Integration
  2. iOS: Swift SDK
  3. Widget Library

initialization

The method for initializing the Wepin iOS Widget Library is as follows.

Before creating an instance of WepinWidget, please pass the App ID and App Key to the WepinWidgetParams object as shown below.

let initWidgetParam = WepinWidgetParams(viewController: UIViewController, appId: appId, appKey: appKey)

Please create a WepinWidget instance by passing the previously created WepinPinParams.

var wepinWidget = WepinWidget(initWidgetParam);

After creating the WepinWidget instance, call the initialize method to complete the initialization.

await wepinWidget?.initialize(attributes: attributes)

parameters

attributes <WepinWidgetAttributes>

  • defaultLanguage <String> The default language setting for the widget screen is 'en'. Currently supported languages are 'ko', 'en', and 'ja'.

  • defaultCurrency <String> The default language setting for the widget screen is 'USD'. Currently supported languages are 'KRW', 'USD', and 'JPY'.

Return value

<Bool> Returns true if successful, and false if it fails.

Example

let appKey: String = "Wepin-App-Key"
let appId: String = "Wepin-App-ID"
var wepinWidget: WepinWidget? = nil
let initWidgetParam = WepinWidgetParams(appId: appId, appKey: appKey)
wepinWidget = WepinWidget(initWidgetParam)
// Call initialize function
let attributes = WepinWidgetAttributes(defaultLanguage: "en", defaultCurrency: "USD")
if let res = try await wepinWidget?.initialize(attributes: attributes) {
    self.tvResult.text = "Successed: \(res)"
} else {
    self.tvResult.text = "Failed: No result returned from initialization"
}

isInitialized

You can use the isInitialized method to check if the WepinWidget instance has been successfully initialized.

  • <Bool> Returns true if initialization was successful and false if it failed.

let result = wepinWidget!.isInitialized()

changeLanguage

wepinWidget!.changeLanguage("ko", currency: "KRW")

Changes the language displayed on the widget screen. Currently, only 'ko', 'en', and 'ja' are supported.

Parameters

  • _ language <String>

  • currency <String> optional

Return value

  • <Void>

Example

wepinWidget!.changeLanguage("ko", currency: "KRW")
PreviousinstallationNextMethods

Last updated 25 days ago

Was this helpful?