A Flutter plugin for using the native Naver Login SDKs on Android and iOS.
This repository is a dedicated fork of yoonjaepark/flutter_naver_login. The package has been renamed to naver_login_flutter to mark its independence and major structural improvements.
- 2026 CocoaPods Deprecation Response: Apple and the Flutter ecosystem are phasing out CocoaPods (switching to read-only mode by the end of 2026). This plugin is refactored to fully support Swift Package Manager (SPM) native dependency mapping on iOS.
- Xcode Build Speed Optimization: Mixing CocoaPods and SPM in large projects invalidates the Xcode incremental build cache, causing significant compilation bottlenecks (often over 170 seconds). By transitioning this package to SPM, we restore build caching functionality.
- Active Community Maintenance: As the original repository lacks frequent updates, this fork ensures compatibility with the latest Flutter stable versions and native SDK revisions.
This repository contains specialized documentation for developers and AI agents:
- ONBOARDING.md: Step-by-step local setup, Naver Console setup, and local example project configuration.
- AI_RULES.md: Strict development rules, Xcode build cache safety guidelines, and self-verification flows for AI agents (Gemini, Claude, GPT, etc.).
- SPM_INTEGRATION_STANDARDS.md: Technical specifications of the Swift Package Manager (SPM) bridge architecture and clean-up guides.
Add the following to your pubspec.yaml file:
dependencies:
naver_login_flutter: ^3.0.5naver_login_flutter provides an automated configuration tool that safely injects your API keys into the correct iOS and Android configuration files while properly isolating your Client Secret into gitignored local files.
Run the interactive setup tool from the root of your Flutter project:
dart run naver_login_flutter:configureYou can also pass arguments directly:
dart run naver_login_flutter:configure --app-name="Your App" --client-id="xxx" --client-secret="yyy" --url-scheme="zzz"Note: If you prefer not to use the CLI and need to configure your projects manually, you must still follow our secure secret management approach. Do not hardcode your client secret directly into public configuration files. See the Manual Configuration Guide for step-by-step instructions.
Since this package is a fork that transitioned to Swift Package Manager (SPM) and separated from the original flutter_naver_login, you must perform the following steps to migrate:
Remove the old package and add the new one:
dependencies:
# Remove: flutter_naver_login: ^2.x.x
naver_login_flutter: ^3.0.0Find and replace all your import statements:
// Before
import 'package:flutter_naver_login/flutter_naver_login.dart';
// After
import 'package:naver_login_flutter/naver_login_flutter.dart';Because the old package used CocoaPods and the new one uses SPM natively, you must clean your iOS build cache to prevent conflicts:
cd ios
pod deintegrate
rm -rf Podfile.lock Pods/
cd ..
flutter clean
flutter pub getYou only need to import a single file to access all public classes, enums, and methods:
import 'package:naver_login_flutter/naver_login_flutter.dart';class NaverLoginResult {
final NaverLoginStatus status;
final NaverAccountResult? account;
final NaverToken? accessToken; // token info, included on successful logIn()
final String? errorMessage; // set when status is error
}class NaverToken {
final String accessToken;
final String refreshToken;
final String tokenType;
final String expiresAt;
bool isValid();
}class NaverAccountResult {
final String id;
final String nickname;
final String name;
final String email;
final String gender;
final String age;
final String birthday;
final String birthyear;
final String profileImage;
final String mobile;
final String mobileE164;
}enum NaverLoginStatus {
loggedIn,
loggedOut,
error
}try {
final NaverLoginResult res = await FlutterNaverLogin.logIn();
if (res.status == NaverLoginStatus.loggedIn) {
// Login successful
final account = res.account;
print('User name: ${account?.name}');
final token = res.accessToken;
print('Access token: ${token?.accessToken}');
}
} catch (error) {
print('Login failed: $error');
}try {
final NaverToken token = await FlutterNaverLogin.getCurrentAccessToken();
if (token.isValid()) {
print('Access Token: ${token.accessToken}');
print('Refresh Token: ${token.refreshToken}');
print('Token Type: ${token.tokenType}');
print('Expires At: ${token.expiresAt}');
}
} catch (error) {
print('Failed to get token: $error');
}try {
final NaverAccountResult account = await FlutterNaverLogin.getCurrentAccount();
print('User name: ${account.name}');
print('User email: ${account.email}');
print('User profile: ${account.profileImage}');
} catch (error) {
print('Failed to get account: $error');
}try {
final NaverLoginResult res = await FlutterNaverLogin.logOut();
if (res.status == NaverLoginStatus.loggedOut) {
// Logout successful
}
} catch (error) {
print('Logout failed: $error');
}try {
final NaverLoginResult res = await FlutterNaverLogin.logOutAndDeleteToken();
if (res.status == NaverLoginStatus.loggedOut) {
// Logout and token deletion successful
}
} catch (error) {
print('Logout and token deletion failed: $error');
}// Turn the plugin's debug logs on or off at runtime.
await FlutterNaverLogin.setLogEnabled(false);Logging is off by default in release builds and on in debug builds.
On Android you can also set the initial value in AndroidManifest.xml:
<meta-data android:name="com.naver.sdk.logEnabled" android:value="false"/>If the meta-data is absent, the plugin follows your app's debuggable flag.
Note The client secret is never printed in full. It appears masked (
abc******* (10 chars)) so you can confirm the value was injected without exposing it.On iOS the Naver SDK provides no log on/off API, so
setLogEnabledcontrols the plugin's own logs only; the SDK's internal logs are not affected.
-
SPM Cache / Xcode Build Errors
- Since this package uses Swift Package Manager (SPM) natively, you may occasionally encounter Xcode caching issues (e.g., missing module errors).
- Solution: Clear Xcode's DerivedData and the Flutter build cache:
rm -rf ~/Library/Developer/Xcode/DerivedData flutter clean flutter pub get cd ios && pod install && cd ..
-
Minimum iOS Version
- The Naver Login SDK (5.2.x) requires iOS 15.0 or higher.
- Solution: Ensure your
ios/Podfile(if you have one for other plugins) is set toplatform :ios, '15.0'or higher.
- Missing Configuration Crashes
- If the app crashes on launch or when attempting to log in, it is usually because the Naver API keys are missing from your
AndroidManifest.xmlorbuild.gradle.kts. - Solution: Re-run the automated tool
dart run naver_login_flutter:configureand verify thatandroid/local.propertiescontains yournaver.client_secret.
- If the app crashes on launch or when attempting to log in, it is usually because the Naver API keys are missing from your
For package maintainers: When preparing a new release, update the following files to keep version information synchronized:
pubspec.yaml- main version fieldios/naver_login_flutter.podspec- iOS CocoaPods metadataREADME.md- dependency example in Installation sectionCHANGELOG.md- release notes (in Korean)
For detailed release preparation checklist and validation steps, see AI_RULES.md (applies to all contributors, including AI agents).
This project is open-source and actively welcomes contributions from both human developers and AI agents (Gemini, Claude, GPT, etc.).
Please refer to our CONTRIBUTING.md for detailed instructions on:
- Environment setup and self-verification flows.
- Specialized build warnings and constraints for AI agents.
- Automated testing and GitHub Actions CI pipelines.
- Code review and pull request approval workflows.
This project is licensed under the BSD 2-Clause License - see the LICENSE file for details.