gwonhyeok / ionic-plugin-naver Goto Github PK
View Code? Open in Web Editor NEWIonic 네이버 플러그인
License: MIT License
Ionic 네이버 플러그인
License: MIT License
url스킴도 정확하게 적고 ios AppDelegate.m파일에 필요한내용 복붙하고 실행결과
네이버 앱으로 이동하여 로그인은 하나, 다시 앱으로 돌아오지 않습니다.
왜이러는걸까요?ㅠ
private project로 개발해뒀던게 있어서 오픈소스가 없으면 공개할까 했는데 이미 이렇게 잘 만들어져있었군요 :)
잘 쓰겠습니다. :)
phonegap-plugin-push의 경우,
AppDelegate+notification.h, AppDelegate+notification.m를 구성하고 plugin.xml에 source file태그로 추가해줬던데,
이런 방법으로는 AppDelegate에 넣어줘야한다는 코드를 패키지 설치했을 때 자동으로 되게 할 수 없을까요?
네이버 아이디로 로그인시 아이디 비번 입력후 개인정보관련 동의를 클릭하면 앱이 종료됩니다.
개발환경
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.2.3
Cordova Platforms : android 8.0.0 ios 4.5.5
Ionic Framework : ionic-angular 3.9.3
System:
ios-deploy : 1.9.4
Node : v10.4.0
npm : 6.1.0
OS : macOS
Xcode : Xcode 10.2.1 Build version 10E1001
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
사용 플러그인
"cordova-plugin-naver": "^1.0.3"
"ionic-plugin-naver": "^1.0.3"
app crash 당시 로그캣 내용
--------- beginning of crash
2019-04-30 17:14:24.719 3721-5487/com.tokmom.testapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #5
Process: com.tokmom.testapp, PID: 3721
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/client/DefaultHttpClient;
at com.nhn.android.naverlogin.connection.CommonConnection.getDefaultHttpClient(CommonConnection.java:204)
at com.nhn.android.naverlogin.connection.CommonConnection.getDefaultHttpClient(CommonConnection.java:190)
at com.nhn.android.naverlogin.connection.CommonConnection.getDefaultHttpClient(CommonConnection.java:186)
at com.nhn.android.naverlogin.connection.CommonConnection.request(CommonConnection.java:106)
at com.nhn.android.naverlogin.connection.CommonConnection.request(CommonConnection.java:53)
at com.nhn.android.naverlogin.connection.CommonConnection.request(CommonConnection.java:44)
at com.nhn.android.naverlogin.connection.OAuthLoginConnection.request(OAuthLoginConnection.java:52)
at com.nhn.android.naverlogin.connection.OAuthLoginConnection.requestAccessToken(OAuthLoginConnection.java:34)
at com.nhn.android.naverlogin.ui.OAuthLoginActivity$GetAccessTokenTask.doInBackground(OAuthLoginActivity.java:310)
at com.nhn.android.naverlogin.ui.OAuthLoginActivity$GetAccessTokenTask.doInBackground(OAuthLoginActivity.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.impl.client.DefaultHttpClient" on path: DexPathList[[zip file "/data/app/com.tokmom.testapp-wNijitTxo3aADtpWBnHHew==/base.apk"],nativeLibraryDirectories=[/data/app/com.tokmom.testapp-wNijitTxo3aADtpWBnHHew==/lib/arm64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.nhn.android.naverlogin.connection.CommonConnection.getDefaultHttpClient(CommonConnection.java:204)
at com.nhn.android.naverlogin.connection.CommonConnection.getDefaultHttpClient(CommonConnection.java:190)
at com.nhn.android.naverlogin.connection.CommonConnection.getDefaultHttpClient(CommonConnection.java:186)
at com.nhn.android.naverlogin.connection.CommonConnection.request(CommonConnection.java:106)
at com.nhn.android.naverlogin.connection.CommonConnection.request(CommonConnection.java:53)
at com.nhn.android.naverlogin.connection.CommonConnection.request(CommonConnection.java:44)
at com.nhn.android.naverlogin.connection.OAuthLoginConnection.request(OAuthLoginConnection.java:52)
at com.nhn.android.naverlogin.connection.OAuthLoginConnection.requestAccessToken(OAuthLoginConnection.java:34)
at com.nhn.android.naverlogin.ui.OAuthLoginActivity$GetAccessTokenTask.doInBackground(OAuthLoginActivity.java:310)
at com.nhn.android.naverlogin.ui.OAuthLoginActivity$GetAccessTokenTask.doInBackground(OAuthLoginActivity.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
로그인 성공후, requestMe()를 바로 불러서 개인정보를 가져오려고하는데...거기서 catch로 넘어가면서
no value for name이라는 에러가 뜹니다. alert부분에서...
doLogin() {
this.naver.login()
.then(response => {
alert(response.accessToken);
this.naver.requestMe()
.then(response => {
alert(response)
alert(JSON.stringify(response));
}) // 성공
.catch(error => {alert("sss"+error)}); // 실패
})
.catch(error => console.error(error));
}
안녕하세요?
사용하기 편리한 라이브러리를 공개해 주셔서 감사합니다. 그런데 제 앱에 사용하려니 라이선스 (licence) 관련 조항이 없네요. 명시해 주시면 제 앱의 오픈소스 크레디트에 표시하려고 합니다.
plugin 설치시 오류가 나서 문의 드립니다.
3rdparty_login_library_android_4.1.4.jar가 존재하는 것은 확인했는데
android 프로젝트에서 인식을 못하는 것 같습니다.
cordova와 ionic plugin을 추가하면, 추가된 libs가 인식되나요?
어떻게 하면 인식할 수 있게 할 수 있나요?
안녕하세요.
ionic-plugin-naver getting-start 도중 아직까지 원인모를 no value for name 에러 때문에 진도가 안나가져서요..
this.naver.login().then(res => {
alert("로그인 - " + JSON.stringify(res));
this.naver.requestMe().then(res => {
alert("로그인 정보 - " + JSON.stringify(res));
}).catch(err => {alert(err);});
}).catch(err => {alert(err);});
이렇게 돌려본 결과
login 의 callback인
alert("로그인 - " + JSON.stringify(res));
만 돌고 그 다음인 requestMe의 결과는 애러인 catch로 돌아오고 그걸 alert로 확인해본 결과
no value for name 만... 나옵니다..
이유를 몰라서 해결도 안나오네요.. ㅠ
밑 이슈의 방법대로 따라해도 같은결과입니다.
에초에 requestMe 메소드에서 catch문으로 나가져서 아무 반응이 없어요..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.