Giter VIP home page Giter VIP logo

cordova-kakaotalk-plugin's Introduction

Cordova Plugin KakaoTalk

This plugin is modified by combining the two other plguins

Make sure you've registered your Kakao app with Kakao and have an KAKAO_APP_KEY

Cordova Install Note:

cordova plugin add https://github.com/taejaehan/cordova-kakaotalk.git --variable KAKAO_APP_KEY=YOUR_KAKAO_APP_KEY

[Android]

[iOS]

  • Add following code to appDelegate
#import <KakaoOpenSDK/KakaoOpenSDK.h>

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
                                       sourceApplication:(NSString *)sourceApplication
                                              annotation:(id)annotation {
    ...
    if ([KOSession isKakaoAccountLoginCallback:url]){return [KOSession handleOpenURL:url];}
    ...
}

- (void)applicationDidBecomeActive:(UIApplication *)application{[KOSession handleDidBecomeActive];}
  • Ohter Linker Flags

open platforms/ios/*.xcodeproj Build Settings > Linking > Other Linker Flags > add '-all_load'

How to use the plugin

Usage

This plugin adds an object to the window. Right now, you can login, logout and share.

Login

Login using the .login method:

KakaoTalk.login(
    function (result) {
      console.log('Successful login!');
      console.log(result);
    },
    function (message) {
      console.log('Error logging in');
      console.log(message);
    }
);

The login reponse object is defined as:

{
  id: '<KakaoTalk User Id>',
  nickname: '<KakaoTalk User Nickname>',
  profile_image: '<KakaoTalk User ProfileImage>'
}
Logout

Logout using the .logout method:

KakaoTalk.logout(
	function() {
		console.log('Successful logout!');
	}, function() {
		console.log('Error logging out');
	}
);
Share

Share using the .share method:

KakaoTalk.share({
    text : 'Share Message',
    image : {
      src : 'https://developers.kakao.com/assets/img/link_sample.jpg',
      width : 138, 
      height : 90,
    },
    weblink :{
      url : 'YOUR-WEBSITE URL',
      text : 'web사이트로 이동'
    },
    applink :{
      url : 'YOUR-WEBSITE URL', 
      text : '앱으로 이동',
    },
    params :{
      paramKey1 : 'paramVal',
      param1 : 'param1Value',
      cardId : '27',
      keyStr : 'hey'
    }
  },
  function (success) {
    console.log('kakao share success');
  },
  function (error) {
    console.log('kakao share error');
  });

cordova-kakaotalk-plugin's People

Contributors

no1steel avatar taejaehan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cordova-kakaotalk-plugin's Issues

ios 카카오톡 로그인 잘들되시나요...?

일단 플러그인 설치한후에..
cordova build ios 하면

#import <KakaoOpenSDK/KakaoOpenSDK.h>
not found 에러가 뜨네요...kakaoTalk.m에서요...

저 임포트를 지우면,
error: useof undeclared identifier 'KOSession'
입니다....build가 안되는거같아요 ㅜㅠ

ionic에서 plugin 설치가 안되고 있습니다.

안녕하세요.
좋은 자료를 만들어 주셔서 감사합니다.
아이오닉에서 plugin을 추가하면 에러가나서 추가를 못하고 있습니다.
Ionic Framework: 3.4.2
Ionic App Scripts: 1.3.4
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.11.0
OS Platform: Windows 10

오류 메세지 입니다.
Cordova encountered an error.
You may get more insight by running the Cordova command above directly.-com-taejaehan-cordova-kakaotalk-git-c29b

[ERROR] An error occurred while running cordova plugin add https://github.com/taejaehan/cordova-kakaotalk.git --save
(exit code 1):ng into
'C:\Users\고영배\AppData\Local\Temp\npm-2576-86b13f88\git-cache-247030d5\4cc055947e917150fe2d67821ec3988d0a6d2ed
Error: Failed to fetch plugin https://github.com/taejaehan/cordova-kakaotalk.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! git clone
C:\Users\고영배\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-taejaehan-cordova-kakaotalk-git-c29b4e46
C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0: npm ERR! Please include the following file with any support request:
Cloning into
'C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0'...
npm ERR! git clone
C:\Users\고영배\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-taejaehan-cordova-kakaotalk-git-c29b4e46rdova plugin add https://github.com/taejaehan/cordova-kakaotalk.git --save
C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0:
error: cannot spawn sh: No such file or directory
npm ERR! git clone
C:\Users\고영배\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-taejaehan-cordova-kakaotalk-git-c29b4e46
C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0:
fatal: unable to fork
npm ERR! git clone
C:\Users\고영배\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-taejaehan-cordova-kakaotalk-git-c29b4e46
C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0:

    npm ERR! Windows_NT 10.0.15063
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
    Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    "https://github.com/taejaehan/cordova-kakaotalk.git" "--save"
    npm ERR! node v6.11.0
    npm ERR! npm  v3.10.10
    npm ERR! code 128

    npm ERR! Command failed: git -c core.longpaths=true clone
    C:\Users\고영배\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-taejaehan-cordova-kakaotalk-git-c29b4e46
    C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0
    npm ERR! Cloning into
    'C:\Users\고영배\AppData\Local\Temp\npm-4008-455ae537\git-cache-e51f8de3\4cc055947e917150fe2d67821ec3988d0a6d2ed0'...
    npm ERR! error: cannot spawn sh: No such file or directory
    npm ERR! fatal: unable to fork
    npm ERR!
    npm ERR!
    npm ERR! If you need help, you may report this error at:
    npm ERR!     <https://github.com/npm/npm/issues>

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\apptest\ohmy\node_modules\npm-debug.log

고수님 도움 부탁드립니다.

XCODE 에서 컴파일 오류가 나네요

XCode에서 컴파일 시에 외부 프레임워크 해더파일등에 대해서 패스 찾는 방식이 달라졌나봐요. 공유해주신 카카오톡 프레임워크의 해더파일이 외부로 빠져 있지않아서 컴파일 오류가 발생하네요.
카카오톡 개발자에서 새로운 SDK를 다운 받아서 시도해보니, 버전이 맞지 않아서 더 많은 오류가 발생하네요.
가능하시다면 최신버전의 카카오톡 SDK에 맞춰서 업그레이드 가능할런지요..?

KakaoTalk.login success 콜백 함수가 실행되지 않습니다.

iOS에서 로그인을 실행하면 로그인 팝업이 뜨고 정상적으로 로그인이 되지만,
콜백 함수를 실행하지 않는 현상이 발생하고 있습니다.
fail이 된 경우 콜백 함수는 정상적으로 실행됩니다.

혹여 같은 오류가 발생하거나, 해결책을 알고 계신 분 없나요?

android 카카오톡 SDK 교차 앱 스크립팅 문제

안녕하세요
Cordova Android 수정 후 배포를 진행하였는데

교차 앱 스크립팅에 취약한 WebView가 앱에 포함되어 있습니다. 자세한 내용은 Google 고객센터 도움말을 확인하세요.
취약한 클래스:
com.kakao.auth.authorization.authcode.KakaoWebViewActivity->initUi

위 내용으로 배포 거절을 당했습니다

관련 내용을 찾아보니
https://devtalk.kakao.com/t/sdk/61319
에서 android SDK 버전을 업데이트 하라고 적혀있어서

SDK 업데이트를 진행해야하는데
검색결과
아래와 같이 수정 후 배포를 해보니 다시 배포거절이 나와서
여쭤보고자 글 남깁니다.

cordova 에서 어떤 것을 수정해야하는지
알 수 있을까요 ?

시도했던 것들

Projectname-kakao.gradle

dependencies {
	compile('com.kakao.sdk:kakaotalk:1.12.0@aar') {
		transitive = true
	}
	compile('com.kakao.sdk:kakaolink:1.12.0@aar') {
		transitive = true
	}	
}

위 내용을 발견하여
위에 kakaotalk 만 1.14.0 으로 변경

access_token을 받지 못합니다.

카카오톡으로 로그인을 하면, 요청한 정보는 모두 정상적으로 잘 받을 수 있는데요.
앱 서버에서 해당 사용자를 다시한번 인증하기 위해서 access_token을 얻을 수 있으면 정말 좋을 것 같습니다.

가능하다면 개선 부탁드립니다.

App 재시작시 Share 불가

안녕하세요. 해당 Plugin 을 잘 사용하고 있는 개발자 입니다.

다름이 아니라. Cordova 를 이용하여 KaKao Share 를 사용할 경우, 최초 한번은 잘 되는데 프로그램이 종료 (Process 가 종료 된것이 아니라, navigator.app.exitApp() Function 을 사용한 경우) 되었다가 다시 시작되는 경우는 KaKao Share 창이 뜨지 않습니다.

Button Event 를 Dynamic 하게도 줘보고 이것저것 해봤는데 해결이 되질 않네요.

혹시 KaKao.Share Function 을 Release 하지 못하거나 하는 경우인지. 혹시 동일한 경험이 있으시면 해결법을 알려주시면 감사하겠습니다.

Not supported format error.

I just shared only text and image. KakaoTalk opened and I selected my friend.
but I got Not supported format error.

my js code:

KakaoTalk.share({
    text: 'hi',
    image:{
        src: '/storage/emulated/0/temp_144065417.jpg',
        width: 300,
        height: 200
    }
},
function(success){
    console.log('kakao share success');
},
function(error){
    console.log('kakao share error');
});

카카오톡 미설치시 에러.

안녕하세요 현재 cordova 로 개발중인 초보개발자입니다.
카카오톡 설치시에는 로그인이 문제 없이 진행 됩니다만,
카카오톡 미설치시에는 에러가 납니다.

로그를 공유해드리면,
E/kakao.sdk: WebViewAuthHandler is failed
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.(Handler.java:200)
at android.os.Handler.(Handler.java:114)
at android.app.Dialog.(Dialog.java:120)
at android.app.Dialog.(Dialog.java:169)
at com.kakao.auth.authorization.authcode.KakaoWebViewDialog.(KakaoWebViewDialog.java:105)
at com.kakao.auth.authorization.authcode.GetterAuthCode.requestWebviewAuth(GetterAuthCode.java:197)
at com.kakao.auth.authorization.authcode.GetterAuthCode.request(GetterAuthCode.java:165)
at com.kakao.auth.authorization.authcode.GetterAuthCode.start(GetterAuthCode.java:96)
at com.kakao.auth.Session.requestAuthCode(Session.java:541)
at com.kakao.auth.Session.internalOpen(Session.java:513)
at com.kakao.auth.Session.open(Session.java:143)
at com.htj.plugin.kakao.KakaoTalk$2.run(KakaoTalk.java:201)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

입니다. 검색을 해보니 핸들러를 백그라운드 쓰레드에서 생성하고자 하는 경우 이런 현상이 생긴다고 하는것 같습니다.
https://devtalk.kakao.com/t/topic/18560/4
http://darksilber.tistory.com/entry/%EC%97%90%EB%9F%ACjavalangRuntimeException-Cant-create-handler-inside-thread-that-has-not-called-Looperprepare

등의 해결방법 링크등은 찾은것 같은데 어떻게 수정을 해야할지를 도무지 모르겠습니다.
또는 공유해주신 플러그인으로 카카오의 설치 여부등을 알수 있는 기능이 있을까요?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.