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
  • Requirements
  • Installation
  • Configuration
  • Deep Link Configuration

Was this helpful?

  1. Widget Integration
  2. Compose Multiplatform SDK
  3. Widget

Installation

This guide explains how to install the Wepin Compose Multiplatform Widget SDK.

Requirements

  • Android: API version 21 or higher

  • iOS: version 13.0 or higher

    • Update the platform :ios version to 13.0 in your Compose Multiplatform project's ios/Podfile, and verify and modify the ios/Podfile as needed.

This package is only available for Android and iOS environments. It is not supported on Web, macOS, Windows, or Linux environments.

Installation

The Wepin Compose Multiplatform Login Library is published on Maven Central, and you can install it by adding the following dependency in your app's build.gradle.kt

  • Add to dependencies in build.gradle.kt:

val commonMain by getting { 
    api("io.wepin:wepin-compose-sdk-widget-v1:0.0.2") 
}

iOS

You need to install iOS-dependent libraries using CocoaPods.

  1. After adding the CocoaPods plugin to the build.gradle file and entering the information for the AppAuth, secp256k1, and JFBCrypt libraries, click "Sync Project with Gradle Files," and a shared.podspec file will be generated.

  2. You should add a Podfile in the iosApp folder.

    1. In the Podfile, make sure to set the minimum iOS version to 13.0.

//build.gradle.kt(shared)
plugins {
    kotlin("native.cocoapods")
}

kotlin {
    cocoapods {
        summary = "Some description for a Kotlin/Native module"
        homepage = "Link to a Kotlin/Native module homepage"
        ios.deploymentTarget = "13.0"
        version = "0.0.1"

        pod("AppAuth") {
            version = "~> 1.7.5"
        }

        pod("secp256k1") {
            version = "~> 0.1.0"
        }

        pod("JFBCrypt") {
            version = "~> 0.1"
        }
    }
}
// Podfile
post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
            end
        end
    end
end

Configuration

Deep Link Configuration

To enable OAuth login functionality (loginWithOauthProvider), you need to configure the Deep Link scheme.

  • Deep Link scheme format: wepin. + Wepin App ID

Android

  • Add manifestPlaceholders to the build.gradle (app) file to easily capture all redirects using this custom scheme with the Wepin Widget SDK

build.gradle(app)
// Deep Link configuration => Redirect scheme format: wepin. + Wepin App ID
android.defaultConfig.manifestPlaceholders = [
  'appAuthRedirectScheme': 'wepin.{{YOUR_WEPIN_APPID}}'
]
AndroidManifest.xml
<activity
      android:name="com.wepin.android.loginlib.RedirectUriReceiverActivity"
      android:exported="true">
      <intent-filter>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.DEFAULT" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data
              android:host="oauth2redirect"
              android:scheme="${appAuthRedirectScheme}" />
      </intent-filter>
</activity>

iOS

  • Add the app’s URL scheme to the Info.plist file to redirect back to the app after the authentication process.

Info.plist
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>unique name</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>wepin.{{YOUR_WEPIN_APPID}}</string>
        </array>
    </dict>
</array>
PreviousWidgetNextInitialization

Last updated 8 months ago

Was this helpful?