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 :iosversion to 13.0 in your Compose Multiplatform project'sios/Podfile, and verify and modify theios/Podfileas needed.
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.
After adding the CocoaPods plugin to the
build.gradlefile and entering the information for theAppAuth,secp256k1, andJFBCryptlibraries, click "Sync Project with Gradle Files," and ashared.podspecfile will be generated.You should add a
Podfilein theiosAppfolder.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
endConfiguration
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
manifestPlaceholdersto thebuild.gradle (app)file to easily capture all redirects using this custom scheme with the Wepin Widget SDK
// 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.plistfile to redirect back to the app after the authentication process.
<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>Last updated
Was this helpful?