
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
react-native-naver-login
Advanced tools
Deprecated!
해당 모듈은 @react-native-seoul/naver-login으로 이전 되었습니다.
React Native 네이버 로그인 라이브러리 입니다. 세부 예제는 NaverLoginExample 폴더 안의 Example 프로젝트를 확인해주시면 감사하겠습니다.Repository 주소: https://github.com/react-native-seoul/react-native-naver-login
$ npm install react-native-naver-login --save
$ react-native link react-native-naver-login
프로젝트 링크(Xcode project 와 Build Phase에 libRNNaverLogin.a 파일 링크)는 react-native link 명령어를 통하여 세팅이 되며 추가적인 세팅, 주의사항은 아래와 같습니다.
bannerMessage.text = kNaverAuthBannerMessage;
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:kNaverAuthBannerDownloadLink];
android/app/src/main/java/[...]/MainActivity.javaimport com.dooboolab.naverlogin.RNNaverLoginPackage; to the imports at the top of the filenew RNNaverLoginPackage() to the list returned by the getPackages() methodandroid/settings.gradle:
include ':react-native-naver-login'
project(':react-native-naver-login').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-naver-login/android')
android/app/build.gradle:
compile project(':react-native-naver-login')
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
...
defaultConfig {
applicationId "com.my.app.name"
...
}
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
<activity
android:name="com.nhn.android.naverlogin.ui.OAuthLoginActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.nhn.android.naverlogin.ui.OAuthLoginInAppBrowserActivity"
android:label="OAuth2.0 In-app"
android:screenOrientation="portrait" />
-keep public class com.nhn.android.naverlogin.** {
public protected *;
}
| Func | Param | Return | Description |
|---|---|---|---|
| login | Object | Promise | 로그인. |
| getProfile | String | Promise | 프로필 불러오기. |
| logout | 로그아웃. |
import { NaverLogin, getProfile } from 'react-native-naver-login';
// 현재 라이브러리는 3가지의 브릿지 함수로 구현되어 있습니다.
// 1. login
// 2. getProfile
// 3. naverLogin
// NaverLoginExample에 보시면 어떻게 쓰는지 확인할 수 있습니다. 간략한 코드는 아래 기재하겠습니다.
// 우선 네이버 로그인에 필요한 값들을 설정합니다.
console.log('Naver Login');
const initials = {
kConsumerKey: 'VN6WKGFQ3pJ0xBXRtlN9',
kConsumerSecret: 'AHBgzH9ZkM',
kServiceAppName: 'dooboolab',
kServiceAppUrlScheme: 'dooboolaburlscheme', // only for iOS
};
const naverLogin = (props) => {
return new Promise(function(resolve, reject) {
console.log(props);
NaverLogin.login(props, (err, token) => {
console.log(`\n\n Token is fetched :: ${token} \n\n`);
if (err) {
reject(err);
return;
}
resolve(token);
});
});
};
const naverLogout = () => {
NaverLogin.logout();
};
const getNaverProfile = async (token) => {
let result = null;
try {
result = await getProfile(token);
} catch (err) {
console.log('err');
console.log(err);
}
return result;
};
// 위와 같이 함수를 짜주고 아래서 사용한다.
onNaverLogin = async () => {
try {
const result = await naverLogin(initials);
console.log('token: ' + result);
if (result) {
console.log('yes result');
const profileResult = await getNaverProfile(result);
console.log('profile');
console.log(profileResult);
if (profileResult.resultcode === '024') {
Alert.alert('로그인 실패', profileResult.message);
return;
}
result.profile = profileResult;
// 성공시 다음 페이지로 넘어간다.
this.props.navigation.navigate('Second', {
result,
profileResult,
});
} else {
console.log('no result');
}
} catch (err) {
console.log('error');
console.log(err);
}
};
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.