Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raccoondev85/naver-sdk
Naver Cordova SDK Plugin Wrapper
https://github.com/raccoondev85/naver-sdk
angular4 cordova cordova-android cordova-ios cordova-plugin ionic3 naver naver-login naver-sdk
Last synced: about 2 months ago
JSON representation
Naver Cordova SDK Plugin Wrapper
- Host: GitHub
- URL: https://github.com/raccoondev85/naver-sdk
- Owner: raccoondev85
- License: mit
- Created: 2018-04-25T02:40:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T07:03:39.000Z (over 4 years ago)
- Last Synced: 2024-04-29T21:10:19.874Z (9 months ago)
- Topics: angular4, cordova, cordova-android, cordova-ios, cordova-plugin, ionic3, naver, naver-login, naver-sdk
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# naver-sdk
Naver Cordova SDK Plugin Wrapper (네이버 계정 연동 플러그인 Wrapper)
link: https://github.com/raccoondev85/cordova-plugin-naver-sdk## Development Environment and ETC
|type|version
|---|---
|ionic (Ionic CLI)|5.4.16
|cordova (Cordova CLI)|9.0.0
|Cordova Platforms Android|8.1.0
|Cordova Platforms IOS|5.1.1
|NaverThirdPartyLogin.framework(ios)|4.1.2
|naveridlogin-android-sdk(android)|4.2.6## How to install
install cordova plugin
```
// OAUTH_CLIENT_ID: client id that you got assigned from naver development application you created
// OAUTH_CLIENT_SECRET: client secret that you got assigned from naver development application you created
// OAUTH_CLIENT_NAME: naver development application name
// OAUTH_CLIENT_APP_SCHEME: app scheme that you registered in naver development application for ios
$ cordova plugin add cordova-plugin-naver-sdk --variable OAUTH_CLIENT_ID=YOUR_CLIENT_ID --variable OAUTH_CLIENT_SECRET=YOUR_CLIENT_SECRET --variable OAUTH_CLIENT_NAME=YOUR_CLIENT_NAME --variable OAUTH_CLIENT_APP_SCHEME=YOUR_CLIENT_APP_SCHEME
```install wrapper for naver cordova sdk plugin to interface
```
$ npm install --save naver-sdk
```then import __NaverCordovaSDK__ module into app.module.ts
```
import { NaverCordovaSDK } from 'naver-sdk';@NgModule({
providers: [
NaverCordovaSDK
]
})
```## Methods
### `login()`
If Naver app is installed in the device, will open the app and the login will be proceeded through the app, and return the values that are related to the token info and the user profile info, otherwise in case the app is not installed, just an webview will be popped up to sign in.
```
constructor(public _naverCordovaSDK: NaverCordovaSDK) {
this._naverCordovaSDK.login().then((res) => {
console.log(res);
}
);
}
```
beside token info(accessToken, refreshToken, expiresAt, and tokenType), other return values depend on what you set on the naver development console.### `logout()`
```
constructor(public _naverCordovaSDK: NaverCordovaSDK) {
this._naverCordovaSDK.logout().then(() => {
//do your logout proccess for your app
}
);
}
```
return null### `unlinkApp()`
Unregister app for your app service.
```
constructor(public _naverCordovaSDK: NaverCordovaSDK) {
this._naverCordovaSDK.unlinkApp().then(() => {
//do your unregister proccess for your app
}
);
}
```### `refreshAccessToken()`
Refresh access token if you need.
```
constructor(public _naverCordovaSDK: NaverCordovaSDK) {
this._naverCordovaSDK.refreshAccessToken().then((res) => {
console.log(res);
}
);
}
```
it returns a new access token.### `getAccessToken()`
Get current access token.
```
constructor(public _naverCordovaSDK: NaverCordovaSDK) {
this._naverCordovaSDK.getAccessToken().then((res) => {
console.log(res);
}
);
}
```
it returns the current access token.