millo-l / react-native-kakao-share-link Goto Github PK
View Code? Open in Web Editor NEW리액트 네이티브 카카오 링크 오픈 소스
License: MIT License
리액트 네이티브 카카오 링크 오픈 소스
License: MIT License
안드로이드에서 오류 발생하면서 앱이 Shut down 됩니다.
해결 방법 아시는 분 계신가요? ㅠㅠ
D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.reselloapp, PID: 28956 android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? at android.app.ContextImpl.startActivity(ContextImpl.java:1080) at android.app.ContextImpl.startActivity(ContextImpl.java:1056) at android.content.ContextWrapper.startActivity(ContextWrapper.java:411) at android.content.ContextWrapper.startActivity(ContextWrapper.java:411) at com.kakao.sdk.common.util.KakaoCustomTabsClient$openWithDefault$connection$1.onCustomTabsServiceConnected(KakaoCustomTabsClient.kt:48) at androidx.browser.customtabs.CustomTabsServiceConnection.onServiceConnected(CustomTabsServiceConnection.java:33) at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2077) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2110) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
[버전 정보]
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-kakao-share-link": "^1.0.6"
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
kotlinVersion = "1.7.20"
안녕하세요 개발자님
카카오 SDK 업데이트 후 사용할 마땅한 카카오 링크 라이브러리를 찾고 있는 찰나에 해당 라이브러리를 발견하여 유용하게 사용 중에 있습니다.
유용한 라이브러리 제작 감사드립니다!
공유드리고 싶은 이슈는 현재 라이브러리에서는 카카오톡 설치가 안 되어있는 경우 카카오톡 설치가 안 되어있다는 에러를 반환하고 있는데요, 카카오 링크는 웹을 통한 공유 역시 지원하고 있어서 그 부분에 맞춰 수정을 하면 어떨까 건의 드립니다.
다음과 같이 설치되어있지 않은 경우에 대한 예제가 기술되어있습니다. 링크 참고 부탁드립니다.
// 카카오톡 설치여부 확인
if LinkApi.isKakaoLinkAvailable() {
// 카카오톡으로 카카오링크 공유 가능
// templatable은 메시지 만들기 항목 참고
LinkApi.shared.defaultLink(templatable: templatable) {(linkResult, error) in
if let error = error {
print(error)
}
else {
print("defaultLink() success.")
if let linkResult = linkResult {
UIApplication.shared.open(linkResult.url,
options: [:], completionHandler: nil)
}
}
}
else {
// 카카오톡 미설치: 웹 공유 사용 권장
// Custom WebView 또는 디폴트 브라우져 사용 가능
// 웹 공유 예시 코드
if let url = LinkApi.shared.makeSharerUrlforDefaultLink(templatable: templatable) {
self.safariViewController = SFSafariViewController(url: url)
self.safariViewController?.modalTransitionStyle = .crossDissolve
self.safariViewController?.modalPresentationStyle = .overCurrentContext
self.present(self.safariViewController!, animated: true) {
print("웹 present success")
}
}
}
I have React Native Kakao Login library installed before getting this lib to install but the app will crash whenever I call the share function.
I cannot get the full log anymore but I still have this:
Error log: Crashed:: Dispatch queue: com.facebook.react.KakaoShareLinkQueue
Platform iOS 15, run on iPhone 13 Simulator (Also crashed on physical device)
Test function:
try {
const response = await KakaoShareLink.sendFeed({
content: {
title: `Evermay`,
imageUrl: '',
link: {},
description: `Referral link: ${referralLink}`,
},
});
console.log(response, referralLink);
} catch (e) {
console.error(e);
console.error(e.message);
}
안녕하세요
카카오톡이 설치되어 있지 않으면 웹으로 링크공유는 기능이 없는건지 궁금합니다 :)
안녕하세요.
IOS 로 정상적인 빌드가 작동하는 것을 확인한 프로젝트에서
npm install react-native-kakao-share-link 이후
ios 폴더 내에서 pod install 후 run-ios 시 빌드가 crash나는 현상이 있습니다.
제 개발환경은 맥 M1의 13.3 OS에
Ruby: 2.7.5
React native: 0.71.6 입니다.
자세한 크래시 내용은 본문에 추가하였습니다.
카카오 문서에 기술 되어 있는 (아래) 카카오톡 공유 전송 성공 알림 callback을 위해서
serverCallbackArg 을 넘겨줘야 하는 것으로 되어 있는데, 해당 기능이 구현이 되어 있을까요?
혹시 서버 callback 받아서 처리하고 계시는 분 있으신가요?
https://developers.kakao.com/docs/latest/ko/reference/callback#kakaotalk-sharing-callback
@react-native-seoul/kakao-login
패키지와 함께 사용하게 되면 xcode 14 버전에서, 빌드가 되지 않는 문제가 발생합니다.
이러한 부분에서 kakaoSDK 는 해결이 되었지만,
https://developers.kakao.com/docs/latest/ko/sdk-download/ios#changelog
이 패키지에는 적용이 되어 있지 않은 것 같습니다.
kakaoSDK를 2.11.1 로 업데이트 해야할 뿐 아니라, 2.11.0 의 내용인 패키지 이름 및 메서드 이름 변경에 대해서도 업데이트가 필요한 상황입니다. kakaoSDK 관련 dependency 버전들을 '~> 2.4.0' 에서 일단 '2.11.1' 로 변경하였고, (react-native-kakao-share-link.podspec)
.swift 파일의 전체적인 메서드 및 패키지 이름을 변경하였습니다.
import KakaoSDKLink
-> import KakaoSDKShare
LinkApi -> ShareApi
isKakaoTalkSharingAvailable(), shareCustom(), shareDefault()
등등
등등의 메서드 이름의 변경은 링크를 참고해주시면 될 것 같습니다. 일단 갑작스럽게 동작을 위해 변경한 것이니, 확인 부탁드립니다.
https://developers.kakao.com/docs/latest/ko/message/ios-link#custom-template-msg
카카오 앱이 설치 되어있지 않은 경우 앱 크래시가 나는데 오류를 보니 KakaoCustomTabsClient에 문제가 있는 것 같습니다.
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:974)
at android.app.ContextImpl.startActivity(ContextImpl.java:950)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:384)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:384)
at com.kakao.sdk.common.util.KakaoCustomTabsClient$openWithDefault$connection$1.onCustomTabsServiceConnected(KakaoCustomTabsClient.kt:48)
at androidx.browser.customtabs.CustomTabsServiceConnection.onServiceConnected(CustomTabsServiceConnection.java:57)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1839)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1871)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
[이슈]
Could not invoke KakaoShareLink.sendFeed
null
공유 진행 시 위와 같은 에러가 발생합니다. 설정은 제공해주신 내용에 맞춰서 다 적용하였으며 ios동작은 원활하게 동작합니다.
(디버그모드에 카톡이 설치되지 않은 환경입니다)
seoul/kakao-login도 사용 중입니다.
혹시 의심되는 부분이 있을까요 ?
[환경]
react": "17.0.2",
react-native": "0.67.3",
react-native-kakao-share-link: "1.0.6"
이런 현상 있으신분 있나요? 해결하신 분 있을까요?
안드로이드에서는 문제가 없습니다.
const response = await KakaoShareLink.sendCommerce({
content: {
title: 'title',
imageUrl:
'http://t1.daumcdn.net/friends/prod/editor/dc8b3d02-a15a-4afa-a88b-989cf2a50476.jpg',
link: {
webUrl: 'https://developers.kakao.com/',
mobileWebUrl: 'https://developers.kakao.com/',
},
description: 'description',
},
commerce: {
regularPrice: 100000,
discountPrice: 80000,
discountRate: 20,
},
buttons: [
{
title: '웹에서 보기',
link: {
webUrl: 'https://developers.kakao.com/',
mobileWebUrl: 'https://developers.kakao.com/',
},
},
],
});
이렇게 아예 앱부분이 없이 webUrl 만 넣어서 구현해도 앱으로만 routing 됩니다.
앱이 없는 경우는 아예 아무 동작도 없습니다...
제가 뭔가를 잘못 구현한건지는 모르겠지만 혹시 다른 분들은 잘 되시나요?
안녕하세요. 카카오 링크 기능을 덕분에 잘 사용중입니다.
추가적으로 제가 원하는 상황은 카카오톡으로 링크를 공유한 뒤
바로 앱으로 다시 돌아오게 하는 것인데
혹시 아시는 부분이 있으시면 조언 부탁드립니다
React Native에서 앱을 실행하여 카카오 공유 시 카카오 앱이 빠르게 켜졌다면,
Android Studio나 Xcode로 앱을 실행하여 카카오 공유 시 반응이 없다가 5~10초 후에 카카오 앱이 켜집니다.
Android의 minSdkVersion 는 21, gradle 4.0.0 이며,
iOS는 11이상 입니다.
기존
maven { url ‘http://devrepo.kakao.com:8088/nexus/content/groups/public/’ }
변경 후
maven { url 'https://devrepo.kakao.com/nexus/content/groups/public/' }
안녕하세요!
"react": "17.0.2",
"react-native": "0.68.2",
"@react-native-seoul/kakao-login": "^4.0.0"
환경에서 IOS pod install 시 아래와 같이 에러가 나며 진행이 안되네요 ㅠㅠ
해결법이 있을까요??
[!] CocoaPods could not find compatible versions for pod "KakaoSDKTemplate":
In Podfile:
kakao-login (from ../node_modules/@react-native-seoul/kakao-login
) was resolved to 4.0.0, which depends on
KakaoSDKTalk (~> 2.9.0) was resolved to 2.9.0, which depends on
KakaoSDKTemplate (= 2.9.0)
react-native-kakao-share-link (from ../node_modules/react-native-kakao-share-link
) was resolved to 1.0.6, which depends on
KakaoSDKTemplate (~> 2.4.0)
iOS, 그리고 Android에서 필요한 것 전부 세팅 했는데, Android에서만 카카오톡 공유 하기 했을 때, 무반응입니다...
혹시 무엇을 살펴보면 좋을지 아시는 분 있으신가요...?
sendFeed 예제 코드를 그대로 적용했는데
자세히보기에서 앱에서 보기로 바뀌지 않습니다.
Document에서 제시하는
태그를 넣고 (카카오 APP 키 넣음) 빌드 할 시
Starting: Intent { cmp=com.rnwebview/.MainActivity }
Error type 3
Error: Activity class {com.rnwebview/com.rnwebview.MainActivity} does not exist.
이렇게 에러가 발생합니다.
해당 태그를 제거할 경우 정상적으로 빌드가 됩니다.
프로젝트는 CRA를 이용하여 만들었습니다.
안드로이드에서는 이미지 없이 공유가 되는데 iOS에서는 아래 부분에서 예외가 발생합니다.
let imageUrl = dict["imageUrl"] != nil ? createURL(dict: dict, key: "imageUrl")! : URL(string: "http://monthly.chosun.com/up_fd/Mdaily/2017-09/bimg_thumb/2017042000056_0.jpg")!
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.