yandex_login_sdk 1.0.1
yandex_login_sdk: ^1.0.1 copied to clipboard
Native Yandex LoginSDK wrapper for Flutter — SSO via installed Yandex apps with browser fallback (iOS + Android).
1.0.1 #
- Flutter 3.47 compatibility — the example's Android toolchain is aligned
with the current Flutter template: Kotlin Gradle plugin 2.4.0 is now
pinned explicitly in
settings.gradle.kts(Flutter 3.47 requires KGP ≥ 2.2.20 and no longer wires a usable fallback), AGP 9.1.0, Gradle 9.3.1.analysis_options.yamlpicked up the new build/platform-directory excludes thatflutter pub getmigrates in automatically. - No changes to the plugin code or the Dart API.
1.0.0 #
- Web support 🎉 —
signInnow works on Flutter Web via OAuth 2.0 Authorization Code + PKCE in a popup againstoauth.yandex.ru. No client secret is involved and the access token never appears in a URL (safer than the classic implicit flow). Setup: enable the web platform for your OAuth app, register the redirect URI and drop a tinyyandex_auth_callback.htmlintoweb/— see the README's Web setup section.getUserInfo/getJwtwork in the browser unchanged —login.yandex.ruserves CORS headers (verified).expiresIn/expiresAtare populated on web (the token endpoint returns the TTL);YandexLoginResult.jwtstaysnull— usegetJwt.- User closing the popup / denying consent →
YandexAuthCancelledException; blocked popup → codePOPUP_BLOCKED(callsignInfrom a user gesture); CSRF-mismatched callbacks are discarded with codeSTATE_MISMATCH. strategyis ignored on web (there is only the web flow);signOut()is a documented no-op (the plugin holds no session state).YandexAuthUnsupportedExceptionnow only applies to desktop platforms.
- First stable release: the Dart API of 0.3.0 is carried over unchanged and is now covered by semantic-versioning guarantees.
- 113 Dart tests, coverage stays at 100%.
0.3.0 #
clientIdis now real on Android — the Android dependency is bumped tocom.yandex.android:authsdk:3.2.1, whose login options accept a runtimeclientIdthat overrides the manifest value. TheclientIdyou pass tosignInis now used on both platforms (theYANDEX_CLIENT_ID/YANDEX_OAUTH_HOSTmanifest placeholders are still required for SDK initialization). This also enables switching between multiple OAuth clients at runtime.strategyargument forsignIn— newYandexLoginStrategyenum:auto(default; installed Yandex apps first, then browser fallback) orwebOnly(skip the apps and go straight to the browser flow —CHROME_TAB → WEBVIEWon Android,ASWebAuthenticationSessionon iOS). Closes the "authorizationStrategy not exposed" limitation. AnativeOnlyvalue is deliberately absent: neither native SDK can require the app-only flow — both fall back to web when no Yandex app is installed.- Native logs flow into
onLog— while aYandexLoginSdk.onLoghandler is installed, the Kotlin/Swift plugin layers mirror their diagnostics (launch, success, cancellation, failures) into the same hook, prefixed with[native]. On Android this also enables theauthsdk's own logcat output. No handler — no traffic, exactly as before. YandexAuthInProgressException— callingsignInwhile another sign-in is running now throws a typed exception (codeBUSY) instead of a genericYandexAuthException.YandexLoginResult.issuedAt/expiresAt— the plugin stamps the moment the native response arrives and derives the absolute expiry (issuedAt + expiresIn); both arenullon iOS, which reports no TTL.timeoutparameter forgetUserInfo/getJwt— bounds the whole HTTP request; on expiry throwsYandexAuthExceptionwith codeTIMEOUT.- Rotation no longer kills an in-flight sign-in (Android) — on a
configuration change the plugin now keeps the pending Dart result and
re-registers its
ActivityResultLauncher, so the auth result started before the rotation is delivered instead of erroring withDETACHED. - Locale-safe cancellation detection (iOS) — user cancellation is now
recognized by error domain + code (
ASWebAuthenticationSessionError,SFAuthenticationError,NSUserCancelledError) and by the SDK's own web-view-closed error, instead of matching the word "cancel" insidelocalizedDescription(which the system localizes — cancels on non-English devices used to surface asSDK_ERROR). - Privacy manifest actually ships (iOS) —
PrivacyInfo.xcprivacywas in the repo but referenced by neither CocoaPods nor SwiftPM; it is now bundled vias.resource_bundlesand SwiftPMresources. - Re-activation on clientId change (iOS) — calling
signInwith a differentclientIdre-activates the native SDK instead of silently reusing the first one. - Removed the deprecated
packageattribute from the plugin'sAndroidManifest.xml(breaks builds with newer AGP). - Replaced the stale template Kotlin unit test with real dispatch tests; CI
now also runs them and validates packaging with
flutter pub publish --dry-run. - 95 Dart tests, coverage stays at 100%.
0.2.0 #
- User profile fetch (pure Dart) — new
YandexLoginSdk.getUserInfo(token:)callslogin.yandex.ru/infoand returns a typedYandexUserInfo(id,login,displayName,defaultEmail,defaultPhone,birthday, avatar viaavatarUrl(), …). Works identically on every platform — no native code involved. AddsYandexPhone, theYandexAvatarSizeenum, and aYandexAuthInvalidTokenExceptionthrown on HTTP 401. - Cross-platform JWT — new
YandexLoginSdk.getJwt(token:)fetches the signed JWT fromlogin.yandex.ru/info?format=jwt, giving an identical result on Android and iOS (the native iOSYandexLoginResult.jwtstays best-effort). YandexLoginSdk.signOut()— clears local sign-in state. On iOS it calls the nativeYandexLoginSDK.logout()(clears the cached token/JWT, PKCE verifier and CSRF state from the Keychain). On Android theauthsdkis stateless and exposes no logout, so it is a documented no-op. Local-only on both platforms: it does not revoke the token server-side or clear the Yandex-app / browser cookie session.YandexScopeconstants (login:info,login:email, …) for reference. The native Yandex SDKs 3.x do not support per-login scope selection — permissions are fixed when you register the app at oauth.yandex.ru — so this release deliberately does not add a runtimescopesargument.- Honest
expiresIndocs —YandexLoginResult.expiresInis a relative TTL in seconds (Android) and is alwaysnullon iOS (the iOS SDK discards the OAuthexpires_in). - Adds an
httpdependency. Dart test coverage remains 100% (78 tests).
0.1.6 #
- Built-in Kotlin migration — the Android plugin no longer applies the
Kotlin Gradle Plugin (KGP) itself. Flutter 3.44+ wires KGP in via its
Built-in Kotlin support; on older Flutter / AGP < 9 setups the plugin
conditionally applies
org.jetbrains.kotlin.androidfor you. This silences the "applies the Kotlin Gradle Plugin, which will cause build failures in future versions of Flutter" warning emitted by Flutter 3.44. kotlinOptionsreplaced by the top-levelkotlin.compilerOptionsblock, still pinned to JVM target 17.
0.1.5 #
- Coverage reporting moved to Coveralls — CI now uploads
coverage/lcov.infoto coveralls.io viacoverallsapp/github-action@v2. The README badge points there. - Removed the self-hosted SVG coverage badge/donut and the
tool/generate_coverage.dartgenerator — Coveralls owns those artefacts now. No more auto-commits ofassets/coverage_*.svgtomainon every push.
0.1.4 #
- FIX Lowered minimum Dart SDK constraint from
^3.11.5to>=3.5.0 <4.0.0— the plugin doesn't rely on any Dart 3.11-specific features, so apps on older Flutter/Dart toolchains can now consume it.
0.1.3 #
- Lowered minimum Dart SDK constraint from
^3.11.5to>=3.5.0 <4.0.0— the plugin doesn't rely on any Dart 3.11-specific features, so apps on older Flutter/Dart toolchains can now consume it. - Relaxed
flutter_lintsdev dependency from^6.0.0to^4.0.0to match the lowered SDK floor.
0.1.2 #
- Logging hook — new
YandexLoginSdk.onLogcallback emitsinfo/debug/warning/errorevents for sign-in start, fallbacks, cancellation, and mapped error codes. Defaults tonull(silent), opt-in via setter. - Swift Package Manager support — iOS plugin now ships a
Package.swiftalongside the existing.podspec, so apps using SwiftPM can consume the plugin without CocoaPods. - CHANGELOG and README updated; raised pub.dev "Follow Dart file conventions" score to 30/30.
0.1.1 #
- Re-publish to refresh package metadata; no behavioural changes.
0.1.0 #
Initial release.
- Native Yandex SSO on Android (
com.yandex.android:authsdk:3.1.0) with automaticNATIVE → CHROME_TAB → WEBVIEWfallback chain handled by the SDK. - Native Yandex SSO on iOS (
YandexLoginSDK ~> 3.1) with installed-app detection andASWebAuthenticationSession/SFSafariViewControllerfallback. YandexLoginSdk.signIn(clientId:)returns aYandexLoginResultwithtoken, optionaljwt, optionalexpiresIn.- Typed exceptions:
YandexAuthCancelledException,YandexAuthUnsupportedException,YandexAuthException.