설치
Wepin Compose Multiplatform Widget SDK를 설치하는 방법을 설명합니다.
요구사항
Android: API 버전 21 이상
iOS: 버전 13.0 이상
Flutter 프로젝트의
ios/Podfile
에서platform :ios
버전을 13.0 으로 업데이트하고, 필요에 따라ios/Podfile
을 확인하고 수정해야 합니다.
설치하기
Wepin Compose Multiplatform Login Library 는 Maven Central 에 배포되어 있으며, build.gradle 에 dependency를 추가하여 설치할 수 있습니다.
build.gradle.kt 의 commonMain dependency에 wepin-compose-sdk-widget-v1
추가
val commonMain by getting {
api("io.wepin:wepin-compose-sdk-widget-v1:0.0.4")
}
iOS
iOS 종속 라이브러리를 cocoapods 으로 설치해야 합니다.
build.gradle 파일에 cocoapods plugin 을 추가하고
AppAuth
,secp256k1
,JFBCrypt
라이브러리 정보를 입력한 후 "Synk Project with Gradle Files" 를 클릭하면shared.podspec
파일이 생성됩니다.iosApp
폴더 내에Podfile
을 추가합니다.Podfile
에 최소 iOS 버전을 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
설정하기
Deep Link 설정
OAuth 로그인 기능(loginWithOauthProvider
)을 활성화하려면 Deep Link 스킴을 설정해야 합니다.
Deep Link scheme format :
wepin. + Wepin 앱 ID
Android
build.gradle (app)
파일에서manifestPlaceholders
를 추가하여 Wepin Widget SDK가 이 커스텀 스킴을 통한 모든 리디렉션을 쉽게 캡처할 수 있도록 설정합니다.
// Deep Link 설정 => 리디렉션 스킴 형식: wepin. + Wepin 앱 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
인증 프로세스 후 앱으로 다시 리디렉션하기 위해 앱의 URL 스킴을
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>
Last updated
Was this helpful?