From 6ac36ae6eb69cc87a7314133f630003def79f4ba Mon Sep 17 00:00:00 2001 From: mym0404 Date: Sat, 27 Apr 2024 19:24:10 +0900 Subject: [PATCH 1/6] chore: wip --- packages/share/src/spec/NativeKakaoShare.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/share/src/spec/NativeKakaoShare.ts b/packages/share/src/spec/NativeKakaoShare.ts index 36ac63e..824090c 100644 --- a/packages/share/src/spec/NativeKakaoShare.ts +++ b/packages/share/src/spec/NativeKakaoShare.ts @@ -217,6 +217,22 @@ export interface KakaoCalendarTemplate { } export interface Spec extends TurboModule { + // shareOrSendMeOrSendFriendOrBlahBlahBlahBlah( + // /* share, send-me, send-friend */ + // sendType: string, + // /* custom, feed, list, location, commerce, text, calendar */ + // messageType: string, + // /* only for custom */ + // templateId: Int32, + // /* only for default templates */ + // templateJson: UnsafeObject, + // /* only for pass friend uuid directly */ + // receiverUuids: ReadonlyArray, + // useWebBrowserIfKakaoTalkNotAvailable: boolean, + // templateArgs: Readonly<{ [key: string]: string }>, + // serverCallbackArgs: Readonly<{ [key: string]: string }>, + // ): Promise; + shareCustom( templateId: Int32, useWebBrowserIfKakaoTalkNotAvailable: boolean, From d05d2fecec2c4b65af50eb11139c8d89b3c6b1ae Mon Sep 17 00:00:00 2001 From: mym0404 Date: Sun, 28 Apr 2024 00:20:56 +0900 Subject: [PATCH 2/6] feat(share): send message ios impl --- docs/docs/error-handling.mdx | 2 + docs/docs/navi/navigate-destination.mdx | 9 +- docs/docs/navi/share-destination.mdx | 9 +- docs/docs/share/share-custom.mdx | 6 +- example/src/app/share.tsx | 319 ++++++++++++++---- packages/core/ios/Util/RNCKakaoError.swift | 8 + packages/navi/src/index.tsx | 4 +- packages/share/RNCKakaoShare.podspec | 1 + packages/share/ios/RNCKakaoShare.mm | 53 ++- packages/share/ios/RNCKakaoShareManager.swift | 196 ++++++++++- packages/share/src/index.tsx | 293 +++++++++++++++- packages/share/src/spec/NativeKakaoShare.ts | 65 +--- 12 files changed, 776 insertions(+), 189 deletions(-) diff --git a/docs/docs/error-handling.mdx b/docs/docs/error-handling.mdx index 1095e8a..7eeb2fc 100644 --- a/docs/docs/error-handling.mdx +++ b/docs/docs/error-handling.mdx @@ -171,6 +171,8 @@ Kakao Native SDK들에서의 에러뿐 아닌 `react-native-kakao`자체의 에 - `Package-APIResponseNotFound`: Kakao Native SDK의 API들의 콜백 함수에서 결과로 반환해야 할 값이 `error`가 존재하지 않는데도 존재하지 않는 경우입니다. - `Package-SDKNotInitialized`: Kakao API를 사용하려는데 SDK가 초기화되지 않았을 때 입니다. 모든 API가 이 에러를 반환하지 않습니다. SDK를 초기화하지 않은 시점에서 API를 호출할 시 앱이 크래시가 나버리는 API에서 종종 미리 검사되는 용도로 사용됩니다. +- `Package-KakaoAppNotAvailable`: 예를 들어, 카카오톡이 설치되어야 정상 동작을 하는 API인데 카카오 관련 앱 접근이 불가능해 실패한 경우입니다. +카카오 관련 앱 접근이 불가능한 경우는 카카오 관련 앱이 설치가 되어있지만 앱에서 카카오 관련 앱을 열 수 있는 권한이 제대로 설정되지 않은 경우도 포함됩니다. ## Android의 ActivityNotFoundException diff --git a/docs/docs/navi/navigate-destination.mdx b/docs/docs/navi/navigate-destination.mdx index bca19a0..868e9a8 100644 --- a/docs/docs/navi/navigate-destination.mdx +++ b/docs/docs/navi/navigate-destination.mdx @@ -19,7 +19,7 @@ export function navigateTo(params: { option?: KakaoNaviOption; viaList?: KakaoNaviLocation[]; openWebInstallUrlIfNaviAppNotAvailable?: boolean; -}) +}): Promise ``` - `destination`: 목적지 정보입니다. 필수값입니다. @@ -29,3 +29,10 @@ export function navigateTo(params: { 기본값은 `true`입니다. 옵션에 대한 자세한 설명은 [공식 문서](https://developers.kakao.com/docs/latest/ko/kakaonavi/android#set-parameter)를 참고해주세요. + +:::info +Navi는 특별히 설치 과정을 유도하는 옵션이 있기 때문에 앱 실행에 실패해도 `Package-KakaoAppNotAvailable` 에러 코드가 +`Promise`로 reject되지 않습니다. + +대신, resolve되는 결과로 앱이 문제없이 실행이 되었는 지 판단할 수 있습니다. +::: diff --git a/docs/docs/navi/share-destination.mdx b/docs/docs/navi/share-destination.mdx index ac60238..5a2651b 100644 --- a/docs/docs/navi/share-destination.mdx +++ b/docs/docs/navi/share-destination.mdx @@ -19,7 +19,7 @@ export function shareTo(params: { option?: KakaoNaviOption; viaList?: KakaoNaviLocation[]; openWebInstallUrlIfNaviAppNotAvailable?: boolean; -}) +}): Promise ``` - `destination`: 목적지 정보입니다. 필수값입니다. @@ -29,3 +29,10 @@ export function shareTo(params: { 기본값은 `true`입니다. 옵션에 대한 자세한 설명은 [공식 문서](https://developers.kakao.com/docs/latest/ko/kakaonavi/android#set-parameter)를 참고해주세요. + +:::info +Navi는 특별히 설치 과정을 유도하는 옵션이 있기 때문에 앱 실행에 실패해도 `Package-KakaoAppNotAvailable` 에러 코드가 +`Promise`로 reject되지 않습니다. + +대신, resolve되는 결과로 앱이 문제없이 실행이 되었는 지 판단할 수 있습니다. +::: diff --git a/docs/docs/share/share-custom.mdx b/docs/docs/share/share-custom.mdx index b643f43..f345516 100644 --- a/docs/docs/share/share-custom.mdx +++ b/docs/docs/share/share-custom.mdx @@ -11,12 +11,12 @@ sidebar_position: 5 ## Usage -`shareCustom()` 함수를 이용해 메세지를 보낼 수 있습니다. +`shareCustomTemplate()` 함수를 이용해 메세지를 보낼 수 있습니다. 이 함수는 다음과 같이 정의됩니다. ```tsx -export function shareCustom(params: { +export function shareCustomTemplate(params: { templateId: number; useWebBrowserIfKakaoTalkNotAvailable?: boolean; templateArgs?: Record; @@ -34,4 +34,4 @@ export function shareCustom(params: { 자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. 사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +::: diff --git a/example/src/app/share.tsx b/example/src/app/share.tsx index 01bb03e..148e2ce 100644 --- a/example/src/app/share.tsx +++ b/example/src/app/share.tsx @@ -1,18 +1,40 @@ import { + type KakaoCommerceTemplate, + type KakaoFeedTemplate, + type KakaoListTemplate, + type KakaoLocationTemplate, type KakaoTemplateContent, type KakaoTemplateLink, type KakaoTemplateSocial, + type KakaoTextTemplate, + sendCalendarTemplateToFriends, + sendCalendarTemplateToMe, + sendCommerceTemplateToFriends, + sendCommerceTemplateToMe, + sendCustomTemplateToFriends, + sendCustomTemplateToMe, + sendFeedTemplateToFriends, + sendFeedTemplateToMe, + sendListTemplateToFriends, + sendListTemplateToMe, + sendLocationTemplateToFriends, + sendLocationTemplateToMe, + sendTextTemplateToFriends, + sendTextTemplateToMe, shareCalendarTemplate, shareCommerceTemplate, - shareCustom, + shareCustomTemplate, shareFeedTemplate, shareListTemplate, shareLocationTemplate, shareTextTemplate, } from '@react-native-kakao/share'; +import type { KakaoCalendarTemplate } from '@react-native-kakao/share/lib/typescript/src/spec/NativeKakaoShare'; +import { selectMultipleFriends } from '@react-native-kakao/social'; import { Btn } from '../component/Btn'; import { StyledScrollView } from '../component/StyledScrollView'; +import { Txt } from '../component/Txt'; const link: KakaoTemplateLink = { webUrl: 'https://mjstudio.net', @@ -45,17 +67,94 @@ const content2: KakaoTemplateContent = { imageWidth: 256, }; +const feed: KakaoFeedTemplate = { + content, + social, + buttons: [ + { + title: '앱에서 보기', + link, + }, + ], +}; + +const list: KakaoListTemplate = { + contents: [content, content2], + headerLink: link, + headerTitle: 'Header', + buttons: [ + { + title: '앱에서 보기', + link, + }, + ], +}; + +const location: KakaoLocationTemplate = { + address: 'address', + addressTitle: 'Title', + content, + social, + buttons: [ + { + title: '앱에서 보기', + link, + }, + ], +}; + +const commerce: KakaoCommerceTemplate = { + content, + commerce: { + productName: 'Product', + currencyUnit: '원', + discountPrice: 40, + discountRate: 40, + regularPrice: 10000, + }, + buttons: [ + { + title: '앱에서 보기', + link, + }, + ], +}; + +const text: KakaoTextTemplate = { + text: 'text', + link, + buttons: [ + { + title: '앱에서 보기', + link, + }, + ], +}; + +const calendar: KakaoCalendarTemplate = { + id: 'id', + content, + idType: 'event', + buttons: [ + { + title: '앱에서 보기', + link, + }, + ], +}; + export default function Page() { return ( + {'Custom'} { - shareCustom({ - templateId: 107179, + shareCustomTemplate({ + templateId: 107429, templateArgs: { price: '20000', }, @@ -63,124 +162,198 @@ export default function Page() { }); }} /> + { + sendCustomTemplateToMe({ + templateId: 107430, + templateArgs: { + price: '20000', + }, + }).then(console.log); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendCustomTemplateToFriends({ + templateId: 107430, + templateArgs: { + price: '20000', + }, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> + {'Feed'} { shareFeedTemplate({ - template: { - content, - social, - buttons: [ - { - title: '앱에서 보기', - link, - }, - ], - }, + template: feed, serverCallbackArgs: {}, }); }} /> + { + sendFeedTemplateToMe({ + template: feed, + }); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendFeedTemplateToFriends({ + template: feed, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> + {'List'} { shareListTemplate({ - template: { - contents: [content, content2], - headerLink: link, - headerTitle: 'Header', - buttons: [ - { - title: '앱에서 보기', - link, - }, - ], - }, + template: list, serverCallbackArgs: {}, }); }} /> + { + sendListTemplateToMe({ + template: list, + }); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendListTemplateToFriends({ + template: list, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> + {'Location'} { shareLocationTemplate({ - template: { - address: 'address', - addressTitle: 'Title', - content, - social, - buttons: [ - { - title: '앱에서 보기', - link, - }, - ], - }, + template: location, serverCallbackArgs: {}, }); }} /> + { + sendLocationTemplateToMe({ + template: location, + }); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendLocationTemplateToFriends({ + template: location, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> + {'Commerce'} { shareCommerceTemplate({ - template: { - content, - commerce: { - productName: 'Product', - currencyUnit: '원', - discountPrice: 40, - discountRate: 40, - regularPrice: 10000, - }, - buttons: [ - { - title: '앱에서 보기', - link, - }, - ], - }, + template: commerce, serverCallbackArgs: {}, }); }} /> + { + sendCommerceTemplateToMe({ + template: commerce, + }); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendCommerceTemplateToFriends({ + template: commerce, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> + {'Text'} { shareTextTemplate({ - template: { - text: 'text', - link, - buttons: [ - { - title: '앱에서 보기', - link, - }, - ], - }, + template: text, serverCallbackArgs: {}, }); }} /> + { + sendTextTemplateToMe({ + template: text, + }); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendTextTemplateToFriends({ + template: text, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> + {'Calendar'} { shareCalendarTemplate({ - template: { - id: 'id', - content, - idType: 'event', - buttons: [ - { - title: '앱에서 보기', - link, - }, - ], - }, + template: calendar, serverCallbackArgs: {}, }); }} /> + { + sendCalendarTemplateToMe({ + template: calendar, + }); + }} + /> + { + const { users } = await selectMultipleFriends({ mode: 'popup' }); + await sendCalendarTemplateToFriends({ + template: calendar, + receiverUuids: users.map((u) => u.uuid), + }); + }} + /> ); } diff --git a/packages/core/ios/Util/RNCKakaoError.swift b/packages/core/ios/Util/RNCKakaoError.swift index 5f4aaf3..ad50545 100644 --- a/packages/core/ios/Util/RNCKakaoError.swift +++ b/packages/core/ios/Util/RNCKakaoError.swift @@ -1,15 +1,22 @@ import Foundation +public enum KakaoApp: String { + case talk + case navi +} + public enum RNCKakaoError: Error, CustomStringConvertible { case unknown(_ message: String? = nil) case responseNotFound(name: String) case sdkNotInitialized + case kakaoAppNotAvailable(app: KakaoApp) public var code: String { switch self { case .unknown: "Package-Unknown" case .responseNotFound: "Package-APIResponseNotFound" case .sdkNotInitialized: "Package-SDKNotInitialized" + case .kakaoAppNotAvailable: "Package-KakaoAppNotAvailable" } } @@ -18,6 +25,7 @@ public enum RNCKakaoError: Error, CustomStringConvertible { case let .unknown(message): "Unknown error from package. This can be a bug of react-native-kakao package. message: \(message ?? "None")" case let .responseNotFound(name): "The API response from Kakao Native SDK missing. name: \(name)" case .sdkNotInitialized: "The SDK is not initialized from react-native-kakao" + case let .kakaoAppNotAvailable(app): "Kakao application is not available. app: \(app.rawValue)" } } } diff --git a/packages/navi/src/index.tsx b/packages/navi/src/index.tsx index 86f2e16..3693c22 100644 --- a/packages/navi/src/index.tsx +++ b/packages/navi/src/index.tsx @@ -38,7 +38,7 @@ export function navigateTo({ option?: KakaoNaviOption; viaList?: KakaoNaviLocation[]; openWebInstallUrlIfNaviAppNotAvailable?: boolean; -}) { +}): Promise { return Native.navigateOrShareTo( destination, option, @@ -58,7 +58,7 @@ export function shareTo({ option?: KakaoNaviOption; viaList?: KakaoNaviLocation[]; openWebInstallUrlIfNaviAppNotAvailable?: boolean; -}) { +}): Promise { return Native.navigateOrShareTo( destination, option, diff --git a/packages/share/RNCKakaoShare.podspec b/packages/share/RNCKakaoShare.podspec index c4b67fd..ba89fad 100644 --- a/packages/share/RNCKakaoShare.podspec +++ b/packages/share/RNCKakaoShare.podspec @@ -49,6 +49,7 @@ Pod::Spec.new do |s| end s.dependency 'RNCKakaoCore' + s.dependency 'RNCKakaoSocial' # Kakao dependencies s.dependency 'KakaoSDKShare', sdk_version diff --git a/packages/share/ios/RNCKakaoShare.mm b/packages/share/ios/RNCKakaoShare.mm index bb35cb1..52d9fe0 100644 --- a/packages/share/ios/RNCKakaoShare.mm +++ b/packages/share/ios/RNCKakaoShare.mm @@ -1,21 +1,6 @@ #import "RNCKakaoShare.h" #import "RNCKakaoShare-Swift.h" -#define RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(name, type_name) \ - RCT_EXPORT_METHOD(name \ - : (NSDictionary*)value useWebBrowserIfKakaoTalkNotAvailable \ - : (BOOL)useWebBrowserIfKakaoTalkNotAvailable serverCallbackArgs \ - : (NSDictionary*)serverCallbackArgs resolve \ - : (RCTPromiseResolveBlock)resolve reject \ - : (RCTPromiseRejectBlock)reject) { \ - [[self manager] shareDefaultTemplate:value \ - type:@ #type_name \ - useWebBrowserIfKakaoTalkNotAvailable:useWebBrowserIfKakaoTalkNotAvailable \ - serverCallbackArgs:serverCallbackArgs \ - resolve:resolve \ - reject:reject]; \ - } - @implementation RNCKakaoShare - (RNCKakaoShareManager*)manager { @@ -24,28 +9,36 @@ - (RNCKakaoShareManager*)manager { RCT_EXPORT_MODULE() -RCT_EXPORT_METHOD(shareCustom - : (double)templateId useWebBrowserIfKakaoTalkNotAvailable +// RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareFeedTemplate, feed) +// RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareListTemplate, list) +// RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareLocationTemplate, location) +// RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareCommerceTemplate, commerce) +// RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareTextTemplate, text) +// RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareCalendarTemplate, calendar) + +RCT_EXPORT_METHOD(shareOrSendMeOrSendFriendOrWhatever + : (NSString*)sendType templateType + : (NSString*)templateType templateId + : (double)templateId templateJson + : (NSDictionary*)templateJson receiverUuids + : (NSArray*)receiverUuids useWebBrowserIfKakaoTalkNotAvailable : (BOOL)useWebBrowserIfKakaoTalkNotAvailable templateArgs : (NSDictionary*)templateArgs serverCallbackArgs : (NSDictionary*)serverCallbackArgs resolve : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) { - [[self manager] shareCustom:(NSInteger)templateId - useWebBrowserIfKakaoTalkNotAvailable:useWebBrowserIfKakaoTalkNotAvailable - templateArgs:templateArgs - serverCallbackArgs:serverCallbackArgs - resolve:resolve - reject:reject]; + [[self manager] shareOrSendMeOrSendFriendOrWhatever:sendType + templateType:templateType + templateId:templateId + templateJson:templateJson + receiverUuids:receiverUuids + useWebBrowserIfKakaoTalkNotAvailable:useWebBrowserIfKakaoTalkNotAvailable + templateArgs:templateArgs + serverCallbackArgs:serverCallbackArgs + resolve:resolve + reject:reject]; } -RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareFeedTemplate, feed) -RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareListTemplate, list) -RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareLocationTemplate, location) -RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareCommerceTemplate, commerce) -RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareTextTemplate, text) -RNC_KAKAO_SHARE_EXPORT_DEFAULT_TEMPLATE(shareCalendarTemplate, calendar) - // Don't compile this code when we build for the old architecture. #ifdef RCT_NEW_ARCH_ENABLED - (std::shared_ptr)getTurboModule: diff --git a/packages/share/ios/RNCKakaoShareManager.swift b/packages/share/ios/RNCKakaoShareManager.swift index 74dad9a..50f2108 100644 --- a/packages/share/ios/RNCKakaoShareManager.swift +++ b/packages/share/ios/RNCKakaoShareManager.swift @@ -1,6 +1,7 @@ import Foundation import KakaoSDKCommon import KakaoSDKShare +import KakaoSDKTalk import KakaoSDKTemplate import React import RNCKakaoCore @@ -9,8 +10,12 @@ import SafariServices @objc public class RNCKakaoShareManager: NSObject { @objc public static let shared = RNCKakaoShareManager() - @objc public func shareCustom( - _ templateId: Int64, + @objc public func shareOrSendMeOrSendFriendOrWhatever( + _ sendType: String, + templateType: String, + templateId: Int64, + templateJson: [String: Any], + receiverUuids: [String], useWebBrowserIfKakaoTalkNotAvailable: Bool, templateArgs: [String: String]?, serverCallbackArgs: [String: String]?, @@ -18,7 +23,48 @@ import SafariServices reject: @escaping RCTPromiseRejectBlock ) { onMain { - self.runShare( + if templateType == "custom" { + self.shareOrSendCustom( + sendType: sendType, + templateType: templateType, + templateId: templateId, + receiverUuids: receiverUuids, + useWebBrowserIfKakaoTalkNotAvailable: useWebBrowserIfKakaoTalkNotAvailable, + templateArgs: templateArgs, + serverCallbackArgs: serverCallbackArgs, + resolve: resolve, + reject: reject + ) + } else { + self.shareOrSendDefaultTemplate( + sendType: sendType, + templateType: templateType, + dict: templateJson, + type: templateType, + receiverUuids: receiverUuids, + useWebBrowserIfKakaoTalkNotAvailable: useWebBrowserIfKakaoTalkNotAvailable, + serverCallbackArgs: serverCallbackArgs, + resolve: resolve, + reject: reject + ) + } + } + } + + private func shareOrSendCustom( + sendType: String, + templateType: String, + templateId: Int64, + receiverUuids: [String], + useWebBrowserIfKakaoTalkNotAvailable: Bool, + templateArgs: [String: String]?, + serverCallbackArgs: [String: String]?, + resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock + ) { + if sendType == "share" { + runShare( + templateType: templateType, templateId: templateId, useWebBrowserIfKakaoTalkNotAvailable: useWebBrowserIfKakaoTalkNotAvailable, templateArgs: templateArgs, @@ -26,40 +72,156 @@ import SafariServices resolve: resolve, reject: reject ) + } else if sendType == "send-me" { + runSendMe( + templateType: templateType, + templateId: templateId, + templateArgs: templateArgs, + resolve: resolve, + reject: reject + ) + } else if sendType == "send-friend" { + runSendFriend( + templateType: templateType, + templateId: templateId, + receiverUuids: receiverUuids, + resolve: resolve, + reject: reject + ) + } else { + RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("Unknown sendType: \(sendType)")) } } - @objc public func shareDefaultTemplate( - _ dict: [String: Any], + private func shareOrSendDefaultTemplate( + sendType: String, + templateType: String, + dict: [String: Any], type: String, + receiverUuids: [String], useWebBrowserIfKakaoTalkNotAvailable: Bool, serverCallbackArgs: [String: String]?, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock ) { - onMain { - self.runShare( + if sendType == "share" { + runShare( + templateType: templateType, defaultTemplate: dict, - templateType: type, useWebBrowserIfKakaoTalkNotAvailable: useWebBrowserIfKakaoTalkNotAvailable, + templateArgs: serverCallbackArgs, serverCallbackArgs: serverCallbackArgs, resolve: resolve, reject: reject ) + } else if sendType == "send-me" { + runSendMe(templateType: templateType, defaultTemplate: dict, resolve: resolve, reject: reject) + } else if sendType == "send-friend" { + runSendFriend( + templateType: templateType, + defaultTemplate: dict, + receiverUuids: receiverUuids, + resolve: resolve, + reject: reject + ) + } else { + RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("Unknown sendType: \(sendType)")) + } + } + + private func runSendMe( + templateType: String, + templateId: Int64? = nil, + defaultTemplate: [String: Any?]? = nil, + templateArgs: [String: String]? = nil, + resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock + ) { + let sendCompletion = { (error: Error?) in + if let error { + RNCKakaoUtil.reject(reject, error) + } else { + resolve(42) + } + } + + if let templateId { + TalkApi.shared.sendCustomMemo( + templateId: templateId, + templateArgs: templateArgs, + completion: sendCompletion + ) + } else if var defaultTemplate { + do { + let templatable = try generateTemplatable(templateType, &defaultTemplate) + TalkApi.shared.sendDefaultMemo(templatable: templatable, completion: sendCompletion) + } catch { + RNCKakaoUtil.reject(reject, error) + } + } else { + RNCKakaoUtil.reject( + reject, + RNCKakaoError.unknown("templateId or defaultTemplate not passed") + ) + } + } + + private func runSendFriend( + templateType: String, + templateId: Int64? = nil, + defaultTemplate: [String: Any?]? = nil, + receiverUuids: [String], + templateArgs: [String: String]? = nil, + resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock + ) { + let sendCompletion = { (messageSendResult: MessageSendResult?, error: Error?) in + if let error { + RNCKakaoUtil.reject(reject, error) + } else if let messageSendResult { + resolve(messageSendResult.successfulReceiverUuids ?? []) + } else { + RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("messageSendResult")) + } + } + + if let templateId { + TalkApi.shared.sendCustomMessage( + templateId: templateId, + templateArgs: templateArgs, + receiverUuids: receiverUuids, + completion: sendCompletion + ) + } else if var defaultTemplate { + do { + let templatable = try generateTemplatable(templateType, &defaultTemplate) + TalkApi.shared.sendDefaultMessage( + templatable: templatable, + receiverUuids: receiverUuids, + completion: sendCompletion + ) + } catch { + RNCKakaoUtil.reject(reject, error) + } + } else { + RNCKakaoUtil.reject( + reject, + RNCKakaoError.unknown("templateId or defaultTemplate not passed") + ) } } private func runShare( + templateType: String, templateId: Int64? = nil, defaultTemplate: [String: Any?]? = nil, - templateType: String? = nil, useWebBrowserIfKakaoTalkNotAvailable: Bool, templateArgs: [String: String]? = nil, serverCallbackArgs: [String: String]?, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock ) { - let callback = { (sharingResult: SharingResult?, error: Error?) in + let shareCompletion = { (sharingResult: SharingResult?, error: Error?) in if let error { RNCKakaoUtil.reject(reject, error) } else if let sharingResult { @@ -84,19 +246,19 @@ import SafariServices templateId: templateId, templateArgs: templateArgs, serverCallbackArgs: serverCallbackArgs, - completion: callback + completion: shareCompletion ) - } else if var defaultTemplate, let templateType { + } else if var defaultTemplate { do { let templatable = try generateTemplatable(templateType, &defaultTemplate) - ShareApi.shared.shareDefault(templatable: templatable, completion: callback) + ShareApi.shared.shareDefault(templatable: templatable, completion: shareCompletion) } catch { RNCKakaoUtil.reject(reject, error) } } else { RNCKakaoUtil.reject( reject, - RNCKakaoError.unknown("templateId or defaultTemplate and templateType not passed") + RNCKakaoError.unknown("templateId or defaultTemplate not passed") ) } } else if useWebBrowserIfKakaoTalkNotAvailable { @@ -122,7 +284,7 @@ import SafariServices } else { RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("makeCustomUrl failed")) } - } else if var defaultTemplate, let templateType { + } else if var defaultTemplate { do { let templatable = try generateTemplatable(templateType, &defaultTemplate) @@ -149,11 +311,11 @@ import SafariServices } else { RNCKakaoUtil.reject( reject, - RNCKakaoError.unknown("templateId or defaultTemplate and templateType not passed") + RNCKakaoError.unknown("templateId or defaultTemplate not passed") ) } } else { - RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("kakaotalk not available")) + RNCKakaoUtil.reject(reject, RNCKakaoError.kakaoAppNotAvailable(app: .talk)) } } diff --git a/packages/share/src/index.tsx b/packages/share/src/index.tsx index 7dc42a6..b7a80a1 100644 --- a/packages/share/src/index.tsx +++ b/packages/share/src/index.tsx @@ -56,7 +56,18 @@ const Native: Spec = Module }, ); -export function shareCustom({ +const SendTypes = { share: 'share', sendMe: 'send-me', sendFriend: 'send-friend' }; +const TemplateTypes = { + custom: 'custom', + feed: 'feed', + list: 'list', + location: 'location', + commerce: 'commerce', + text: 'text', + calendar: 'calendar', +}; + +export function shareCustomTemplate({ templateId, useWebBrowserIfKakaoTalkNotAvailable = true, serverCallbackArgs = {}, @@ -67,14 +78,58 @@ export function shareCustom({ templateArgs?: Record; serverCallbackArgs?: Record; }) { - return Native.shareCustom( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.custom, templateId, + {}, + [], useWebBrowserIfKakaoTalkNotAvailable, templateArgs, serverCallbackArgs, ); } +export function sendCustomTemplateToMe({ + templateId, + templateArgs = {}, +}: { + templateId: number; + templateArgs?: Record; +}) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.custom, + templateId, + {}, + [], + false, + templateArgs, + {}, + ); +} + +export function sendCustomTemplateToFriends({ + templateId, + templateArgs = {}, + receiverUuids, +}: { + templateId: number; + templateArgs?: Record; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.custom, + templateId, + {}, + receiverUuids, + false, + templateArgs, + {}, + ); +} + export function shareFeedTemplate({ template, useWebBrowserIfKakaoTalkNotAvailable = true, @@ -84,13 +139,50 @@ export function shareFeedTemplate({ useWebBrowserIfKakaoTalkNotAvailable?: boolean; serverCallbackArgs?: Record; }) { - return Native.shareFeedTemplate( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.feed, + -1, template, + [], useWebBrowserIfKakaoTalkNotAvailable, + {}, serverCallbackArgs, ); } +export function sendFeedTemplateToMe({ template }: { template: KakaoFeedTemplate }) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.feed, + -1, + template, + [], + false, + {}, + {}, + ); +} + +export function sendFeedTemplateToFriends({ + template, + receiverUuids, +}: { + template: KakaoFeedTemplate; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.feed, + -1, + template, + receiverUuids, + false, + {}, + {}, + ); +} + export function shareListTemplate({ template, useWebBrowserIfKakaoTalkNotAvailable = true, @@ -100,13 +192,50 @@ export function shareListTemplate({ useWebBrowserIfKakaoTalkNotAvailable?: boolean; serverCallbackArgs?: Record; }) { - return Native.shareListTemplate( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.list, + -1, template, + [], useWebBrowserIfKakaoTalkNotAvailable, + {}, serverCallbackArgs, ); } +export function sendListTemplateToMe({ template }: { template: KakaoListTemplate }) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.list, + -1, + template, + [], + false, + {}, + {}, + ); +} + +export function sendListTemplateToFriends({ + template, + receiverUuids, +}: { + template: KakaoListTemplate; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.list, + -1, + template, + receiverUuids, + false, + {}, + {}, + ); +} + export function shareLocationTemplate({ template, useWebBrowserIfKakaoTalkNotAvailable = true, @@ -116,13 +245,50 @@ export function shareLocationTemplate({ useWebBrowserIfKakaoTalkNotAvailable?: boolean; serverCallbackArgs?: Record; }) { - return Native.shareLocationTemplate( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.location, + -1, template, + [], useWebBrowserIfKakaoTalkNotAvailable, + {}, serverCallbackArgs, ); } +export function sendLocationTemplateToMe({ template }: { template: KakaoLocationTemplate }) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.location, + -1, + template, + [], + false, + {}, + {}, + ); +} + +export function sendLocationTemplateToFriends({ + template, + receiverUuids, +}: { + template: KakaoLocationTemplate; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.location, + -1, + template, + receiverUuids, + false, + {}, + {}, + ); +} + export function shareCommerceTemplate({ template, useWebBrowserIfKakaoTalkNotAvailable = true, @@ -132,13 +298,50 @@ export function shareCommerceTemplate({ useWebBrowserIfKakaoTalkNotAvailable?: boolean; serverCallbackArgs?: Record; }) { - return Native.shareCommerceTemplate( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.commerce, + -1, template, + [], useWebBrowserIfKakaoTalkNotAvailable, + {}, serverCallbackArgs, ); } +export function sendCommerceTemplateToMe({ template }: { template: KakaoCommerceTemplate }) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.commerce, + -1, + template, + [], + false, + {}, + {}, + ); +} + +export function sendCommerceTemplateToFriends({ + template, + receiverUuids, +}: { + template: KakaoCommerceTemplate; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.commerce, + -1, + template, + receiverUuids, + false, + {}, + {}, + ); +} + export function shareTextTemplate({ template, useWebBrowserIfKakaoTalkNotAvailable = true, @@ -148,13 +351,50 @@ export function shareTextTemplate({ useWebBrowserIfKakaoTalkNotAvailable?: boolean; serverCallbackArgs?: Record; }) { - return Native.shareTextTemplate( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.text, + -1, template, + [], useWebBrowserIfKakaoTalkNotAvailable, + {}, serverCallbackArgs, ); } +export function sendTextTemplateToMe({ template }: { template: KakaoTextTemplate }) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.text, + -1, + template, + [], + false, + {}, + {}, + ); +} + +export function sendTextTemplateToFriends({ + template, + receiverUuids, +}: { + template: KakaoTextTemplate; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.text, + -1, + template, + receiverUuids, + false, + {}, + {}, + ); +} + export function shareCalendarTemplate({ template, useWebBrowserIfKakaoTalkNotAvailable = true, @@ -164,9 +404,46 @@ export function shareCalendarTemplate({ useWebBrowserIfKakaoTalkNotAvailable?: boolean; serverCallbackArgs?: Record; }) { - return Native.shareCalendarTemplate( + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.share, + TemplateTypes.calendar, + -1, template, + [], useWebBrowserIfKakaoTalkNotAvailable, + {}, serverCallbackArgs, ); } + +export function sendCalendarTemplateToMe({ template }: { template: KakaoCalendarTemplate }) { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.calendar, + -1, + template, + [], + false, + {}, + {}, + ); +} + +export function sendCalendarTemplateToFriends({ + template, + receiverUuids, +}: { + template: KakaoCalendarTemplate; + receiverUuids: string[]; +}): Promise { + return Native.shareOrSendMeOrSendFriendOrWhatever( + SendTypes.sendMe, + TemplateTypes.calendar, + -1, + template, + receiverUuids, + false, + {}, + {}, + ); +} diff --git a/packages/share/src/spec/NativeKakaoShare.ts b/packages/share/src/spec/NativeKakaoShare.ts index 824090c..b5ff711 100644 --- a/packages/share/src/spec/NativeKakaoShare.ts +++ b/packages/share/src/spec/NativeKakaoShare.ts @@ -217,64 +217,21 @@ export interface KakaoCalendarTemplate { } export interface Spec extends TurboModule { - // shareOrSendMeOrSendFriendOrBlahBlahBlahBlah( - // /* share, send-me, send-friend */ - // sendType: string, - // /* custom, feed, list, location, commerce, text, calendar */ - // messageType: string, - // /* only for custom */ - // templateId: Int32, - // /* only for default templates */ - // templateJson: UnsafeObject, - // /* only for pass friend uuid directly */ - // receiverUuids: ReadonlyArray, - // useWebBrowserIfKakaoTalkNotAvailable: boolean, - // templateArgs: Readonly<{ [key: string]: string }>, - // serverCallbackArgs: Readonly<{ [key: string]: string }>, - // ): Promise; - - shareCustom( + shareOrSendMeOrSendFriendOrWhatever( + /* share, send-me, send-friend */ + sendType: string, + /* custom, feed, list, location, commerce, text, calendar */ + templateType: string, + /* only for custom */ templateId: Int32, + /* only for default templates */ + templateJson: UnsafeObject, + /* only for pass friend uuid directly */ + receiverUuids: ReadonlyArray, useWebBrowserIfKakaoTalkNotAvailable: boolean, templateArgs: Readonly<{ [key: string]: string }>, serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; - - shareFeedTemplate( - value: UnsafeObject, - useWebBrowserIfKakaoTalkNotAvailable: boolean, - serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; - - shareListTemplate( - value: UnsafeObject, - useWebBrowserIfKakaoTalkNotAvailable: boolean, - serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; - - shareLocationTemplate( - value: UnsafeObject, - useWebBrowserIfKakaoTalkNotAvailable: boolean, - serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; - - shareCommerceTemplate( - value: UnsafeObject, - useWebBrowserIfKakaoTalkNotAvailable: boolean, - serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; - - shareTextTemplate( - value: UnsafeObject, - useWebBrowserIfKakaoTalkNotAvailable: boolean, - serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; - - shareCalendarTemplate( - value: UnsafeObject, - useWebBrowserIfKakaoTalkNotAvailable: boolean, - serverCallbackArgs: Readonly<{ [key: string]: string }>, - ): Promise; + ): Promise; } export default TurboModuleRegistry.getEnforcing('RNCKakaoShare'); From 68c4337b4d94a6ae47e7cba70602ba93a2dc9bd8 Mon Sep 17 00:00:00 2001 From: mym0404 Date: Sun, 28 Apr 2024 00:29:34 +0900 Subject: [PATCH 3/6] docs: update docs --- docs/docs/share/intro.mdx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/docs/share/intro.mdx b/docs/docs/share/intro.mdx index a9e2292..9a5ca88 100644 --- a/docs/docs/share/intro.mdx +++ b/docs/docs/share/intro.mdx @@ -3,11 +3,6 @@ sidebar_position: 1 --- - - - - - import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -36,17 +31,17 @@ import TabItem from '@theme/TabItem'; ```shell - npm install --save @react-native-kakao/share + npm install --save @react-native-kakao/share @react-native-kakao/social ``` ```shell - yarn add @react-native-kakao/share + yarn add @react-native-kakao/{share,social} ``` ```shell - npx expo install @react-native-kakao/share + npx expo install @react-native-kakao/share @react-native-kakao/social ``` From c2292a59aacb352f027bcf0eaa98011edfcfa894 Mon Sep 17 00:00:00 2001 From: mym0404 Date: Sun, 28 Apr 2024 02:30:21 +0900 Subject: [PATCH 4/6] feat(share): message - android impl --- example/src/app/share.tsx | 3 +- packages/core/android/package-json.gradle | 14 +- .../rnkakao/core/util/RNCKakaoException.kt | 9 + .../rnkakao/core/util/RNCKakaoUtil.kt | 58 ++-- packages/navi/android/build.gradle | 9 +- packages/share/android/build.gradle | 11 +- .../rnkakao/share/RNCKakaoShareModule.kt | 316 +++++++++++------- .../rnkakao/share/RNCKakaoShareTemplates.kt | 28 +- .../android/src/oldarch/KakaoShareSpec.kt | 12 + packages/share/ios/RNCKakaoShareManager.swift | 4 +- packages/share/src/index.tsx | 14 +- packages/social/android/build.gradle | 13 +- packages/user/android/build.gradle | 9 +- 13 files changed, 302 insertions(+), 198 deletions(-) diff --git a/example/src/app/share.tsx b/example/src/app/share.tsx index 148e2ce..cfc5803 100644 --- a/example/src/app/share.tsx +++ b/example/src/app/share.tsx @@ -177,13 +177,14 @@ export default function Page() { title={'Send Custom Template To Friends'} onPress={async () => { const { users } = await selectMultipleFriends({ mode: 'popup' }); - await sendCustomTemplateToFriends({ + const ret = await sendCustomTemplateToFriends({ templateId: 107430, templateArgs: { price: '20000', }, receiverUuids: users.map((u) => u.uuid), }); + console.log(ret); }} /> {'Feed'} diff --git a/packages/core/android/package-json.gradle b/packages/core/android/package-json.gradle index 78b6ad1..1549c3c 100644 --- a/packages/core/android/package-json.gradle +++ b/packages/core/android/package-json.gradle @@ -31,4 +31,16 @@ try { ext.RNCKakaoPkg = pkg } catch (Exception ignored) { throw new GradleException(":${project.name} failed to parse ${fileName} found at ${_pkg}.") -} \ No newline at end of file +} + +ext.getWorkspaceProject = { name -> + Project ret + if (findProject(":@react-native-kakao_$name")) { + ret = project(":@react-native-kakao_$name") + } else if (findProject(":react-native-kakao_$name")) { + ret = project(":react-native-kakao_$name") + } else { + throw new GradleException("Could not find the react-native-kakao/$name package, have you installed it?") + } + return ret +} diff --git a/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoException.kt b/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoException.kt index 9315a6d..4a479ae 100644 --- a/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoException.kt +++ b/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoException.kt @@ -17,3 +17,12 @@ class RNCKakaoResponseNotFoundException(name: String) : RNCKakaoException("The A class RNCKakaoSdkNotInitializedException : RNCKakaoException("The SDK is not initialized from react-native-kakao") { override val code: String = "Package-SDKNotInitialized" } + +enum class KakaoApp(val appName: String) { + TALK("talk"), + NAVI("navi"), +} + +class RNCKakaoAppNotAvailableException(val app: KakaoApp) : RNCKakaoException("Kakao application is not available. app: ${app.appName}") { + override val code: String = "Package-KakaoAppNotAvailable" +} diff --git a/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoUtil.kt b/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoUtil.kt index 428c911..9b28f03 100644 --- a/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoUtil.kt +++ b/packages/core/android/src/main/java/net/mjstudio/rnkakao/core/util/RNCKakaoUtil.kt @@ -13,6 +13,7 @@ import com.kakao.sdk.common.model.ApiError import com.kakao.sdk.common.model.AppsError import com.kakao.sdk.common.model.AuthError import com.kakao.sdk.common.model.ClientError +import com.kakao.sdk.common.model.KakaoSdkError import java.util.Date fun Promise.rejectWith(e: Throwable) { @@ -31,25 +32,29 @@ fun Promise.rejectWith(e: Throwable) { } when (e) { - is ClientError -> { - userInfo.putBoolean("isClientFailed", true) - userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) - reject(e.reason.name, e.msg, userInfo) - } - is ApiError -> { - userInfo.putBoolean("isApiFailed", true) - userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) - reject(e.reason.name, e.msg, userInfo) - } - is AuthError -> { - userInfo.putBoolean("isAuthFailed", true) - userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) - reject(e.reason.name, e.msg, userInfo) - } - is AppsError -> { - userInfo.putBoolean("isAppsFailed", true) - userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) - reject(e.reason.name, e.msg, userInfo) + is KakaoSdkError -> { + when (e) { + is ClientError -> { + userInfo.putBoolean("isClientFailed", true) + userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) + reject(e.reason.name, e.msg, userInfo) + } + is ApiError -> { + userInfo.putBoolean("isApiFailed", true) + userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) + reject(e.reason.name, e.msg, userInfo) + } + is AuthError -> { + userInfo.putBoolean("isAuthFailed", true) + userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) + reject(e.reason.name, e.msg, userInfo) + } + is AppsError -> { + userInfo.putBoolean("isAppsFailed", true) + userInfo.putBoolean("isInvalidTokenError", e.isInvalidTokenError()) + reject(e.reason.name, e.msg, userInfo) + } + } } is RNCKakaoException -> { userInfo.putBoolean("isPackageError", true) @@ -80,11 +85,20 @@ fun ReadableArray.filterIsReadableMap(): List { return ret } -fun WritableArray.pushStringList(list: List) = list.forEach(::pushString) +fun WritableArray.pushStringList(list: List): WritableArray { + list.forEach(::pushString) + return this +} -fun WritableArray.pushIntList(list: List) = list.forEach(::pushInt) +fun WritableArray.pushIntList(list: List): WritableArray { + list.forEach(::pushInt) + return this +} -fun WritableArray.pushDoubleList(list: List) = list.forEach(::pushDouble) +fun WritableArray.pushDoubleList(list: List): WritableArray { + list.forEach(::pushDouble) + return this +} fun WritableArray.pushMapList(list: List): WritableArray { list.forEach(::pushMap) diff --git a/packages/navi/android/build.gradle b/packages/navi/android/build.gradle index 7d92aa3..5f2289a 100644 --- a/packages/navi/android/build.gradle +++ b/packages/navi/android/build.gradle @@ -1,13 +1,6 @@ apply from: file('./../../core/android/package-json.gradle') def Versions = project.ext.RNCKakaoSdkVersions -def coreProject -if (findProject(':@react-native-kakao_core')) { - coreProject = project(':@react-native-kakao_core') -} else if (findProject(':react-native-kakao_core')) { - coreProject = project(':react-native-kakao_core') -} else { - throw new GradleException('Could not find the react-native-kakao/core package, have you installed it?') -} +Project coreProject = project.ext.getWorkspaceProject("core") buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault diff --git a/packages/share/android/build.gradle b/packages/share/android/build.gradle index 7993e97..d21f9f9 100644 --- a/packages/share/android/build.gradle +++ b/packages/share/android/build.gradle @@ -1,13 +1,7 @@ apply from: file('./../../core/android/package-json.gradle') def Versions = project.ext.RNCKakaoSdkVersions -def coreProject -if (findProject(':@react-native-kakao_core')) { - coreProject = project(':@react-native-kakao_core') -} else if (findProject(':react-native-kakao_core')) { - coreProject = project(':react-native-kakao_core') -} else { - throw new GradleException('Could not find the react-native-kakao/core package, have you installed it?') -} +Project coreProject = project.ext.getWorkspaceProject("core") +Project socialProject = project.ext.getWorkspaceProject("social") buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault @@ -112,6 +106,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" api coreProject + api socialProject implementation "com.kakao.sdk:v2-share:${Versions.share}" } diff --git a/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareModule.kt b/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareModule.kt index e5597dc..bc2d887 100644 --- a/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareModule.kt +++ b/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareModule.kt @@ -3,15 +3,23 @@ package net.mjstudio.rnkakao.share import android.content.ActivityNotFoundException import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactMethod +import com.facebook.react.bridge.ReadableArray import com.facebook.react.bridge.ReadableMap import com.kakao.sdk.common.util.KakaoCustomTabsClient import com.kakao.sdk.share.ShareClient import com.kakao.sdk.share.WebSharerClient import com.kakao.sdk.share.model.SharingResult -import com.kakao.sdk.template.model.DefaultTemplate +import com.kakao.sdk.talk.TalkApiClient +import com.kakao.sdk.talk.model.MessageSendResult +import net.mjstudio.rnkakao.core.util.KakaoApp.TALK +import net.mjstudio.rnkakao.core.util.RNCKakaoAppNotAvailableException +import net.mjstudio.rnkakao.core.util.RNCKakaoResponseNotFoundException import net.mjstudio.rnkakao.core.util.RNCKakaoUnknownException +import net.mjstudio.rnkakao.core.util.argArr +import net.mjstudio.rnkakao.core.util.argMap +import net.mjstudio.rnkakao.core.util.filterIsInstance import net.mjstudio.rnkakao.core.util.onMain +import net.mjstudio.rnkakao.core.util.pushStringList import net.mjstudio.rnkakao.core.util.rejectWith import net.mjstudio.rnkakao.core.util.toStringMap @@ -21,116 +29,168 @@ class RNCKakaoShareModule internal constructor(context: ReactApplicationContext) return NAME } - @ReactMethod - override fun shareCustom( + override fun shareOrSendMeOrSendFriendOrWhatever( + sendType: String, + templateType: String, templateId: Double, + templateJson: ReadableMap, + receiverUuids: ReadableArray, useWebBrowserIfKakaoTalkNotAvailable: Boolean, - templateArgs: ReadableMap?, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) = onMain { - runShare( - templateId = templateId, - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - templateArgs = templateArgs, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) - } - - @ReactMethod - override fun shareFeedTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) = onMain { - runShare( - defaultTemplate = RNCKakaoShareTemplates.createFeedTemplate(value), - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) - } - - @ReactMethod - override fun shareListTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, + templateArgs: ReadableMap, + serverCallbackArgs: ReadableMap, promise: Promise, ) = onMain { - runShare( - defaultTemplate = RNCKakaoShareTemplates.createListTemplate(value), - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) + if (templateType == "custom") { + shareOrSendCustom( + sendType, + templateType, + templateId, + receiverUuids = receiverUuids.filterIsInstance(), + useWebBrowserIfKakaoTalkNotAvailable, + templateArgs, + serverCallbackArgs, + promise, + ) + } else { + shareOrSendDefaultTemplate( + sendType, + templateType, + templateJson, + receiverUuids = receiverUuids.filterIsInstance(), + useWebBrowserIfKakaoTalkNotAvailable, + serverCallbackArgs, + promise, + ) + } } - @ReactMethod - override fun shareLocationTemplate( - value: ReadableMap, + private fun shareOrSendCustom( + sendType: String, + templateType: String, + templateId: Double, + receiverUuids: List, useWebBrowserIfKakaoTalkNotAvailable: Boolean, + templateArgs: ReadableMap?, serverCallbackArgs: ReadableMap?, promise: Promise, - ) = onMain { - runShare( - defaultTemplate = RNCKakaoShareTemplates.createLocationTemplate(value), - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) + ) = when (sendType) { + "share" -> { + runShare( + templateType, + templateId, + null, + useWebBrowserIfKakaoTalkNotAvailable, + templateArgs, + serverCallbackArgs, + promise, + ) + } + "send-me" -> { + runSendToMe(templateType, templateId, null, templateArgs, promise) + } + "send-friend" -> { + runSendToFriends(templateType, receiverUuids, templateId, null, templateArgs, promise) + } + else -> { + promise.rejectWith(RNCKakaoUnknownException("Unknown sendType: $sendType")) + } } - @ReactMethod - override fun shareCommerceTemplate( - value: ReadableMap, + private fun shareOrSendDefaultTemplate( + sendType: String, + templateType: String, + template: ReadableMap, + receiverUuids: List, useWebBrowserIfKakaoTalkNotAvailable: Boolean, serverCallbackArgs: ReadableMap?, promise: Promise, - ) = onMain { - runShare( - defaultTemplate = RNCKakaoShareTemplates.createCommerceTemplate(value), - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) + ) = when (sendType) { + "share" -> { + runShare( + templateType, + null, + template, + useWebBrowserIfKakaoTalkNotAvailable, + argMap(), + serverCallbackArgs, + promise, + ) + } + "send-me" -> { + runSendToMe(templateType, null, template, null, promise) + } + "send-friend" -> { + runSendToFriends(templateType, receiverUuids, null, template, null, promise) + } + else -> { + promise.rejectWith(RNCKakaoUnknownException("Unknown sendType: $sendType")) + } } - @ReactMethod - override fun shareTextTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, + private fun runSendToMe( + templateType: String, + templateId: Double? = null, + defaultTemplate: ReadableMap? = null, + templateArgs: ReadableMap? = null, promise: Promise, - ) = onMain { - runShare( - defaultTemplate = RNCKakaoShareTemplates.createTextTemplate(value), - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) + ) { + val callback = { e: Throwable? -> + if (e != null) { + promise.rejectWith(e) + } else { + promise.resolve(42) + } + } + if (templateId != null) { + TalkApiClient.instance.sendCustomMemo(templateId.toLong(), templateArgs?.toStringMap(), callback) + } else if (defaultTemplate != null) { + runCatching { + TalkApiClient.instance.sendDefaultMemo( + RNCKakaoShareTemplates.createDefaultTemplate(defaultTemplate, templateType), + callback, + ) + }.onFailure { promise.rejectWith(it) } + } else { + promise.rejectWith(RNCKakaoUnknownException("one of templateId or defaultTemplate should exist")) + } } - @ReactMethod - override fun shareCalendarTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, + private fun runSendToFriends( + templateType: String, + receiverUuids: List, + templateId: Double? = null, + defaultTemplate: ReadableMap? = null, + templateArgs: ReadableMap? = null, promise: Promise, - ) = onMain { - runShare( - defaultTemplate = RNCKakaoShareTemplates.createCalendarTemplate(value), - useWebBrowserIfKakaoTalkNotAvailable = useWebBrowserIfKakaoTalkNotAvailable, - serverCallbackArgs = serverCallbackArgs, - promise = promise, - ) + ) { + val callback = { messageSendResult: MessageSendResult?, e: Throwable? -> + if (e != null) { + promise.rejectWith(e) + } else if (messageSendResult == null) { + promise.rejectWith(RNCKakaoResponseNotFoundException("messageSendResult")) + } else { + promise.resolve(argArr().pushStringList(messageSendResult.successfulReceiverUuids ?: listOf())) + } + } + if (templateId != null) { + TalkApiClient.instance.sendCustomMessage(receiverUuids, templateId.toLong(), templateArgs?.toStringMap(), callback) + } else if (defaultTemplate != null) { + runCatching { + TalkApiClient.instance.sendDefaultMessage( + receiverUuids, + RNCKakaoShareTemplates.createDefaultTemplate(defaultTemplate, templateType), + callback, + ) + }.onFailure { promise.rejectWith(it) } + } else { + promise.rejectWith(RNCKakaoUnknownException("one of templateId or defaultTemplate should exist")) + } } private fun runShare( + templateType: String, templateId: Double? = null, - defaultTemplate: DefaultTemplate? = null, + defaultTemplate: ReadableMap? = null, useWebBrowserIfKakaoTalkNotAvailable: Boolean, templateArgs: ReadableMap? = null, serverCallbackArgs: ReadableMap? = null, @@ -163,48 +223,56 @@ class RNCKakaoShareModule internal constructor(context: ReactApplicationContext) callback = callback, ) } else if (defaultTemplate != null) { - ShareClient.instance.shareDefault( - context, - defaultTemplate, - serverCallbackArgs = serverCallbackArgs?.toStringMap(), - callback = callback, - ) - } - } else if (useWebBrowserIfKakaoTalkNotAvailable) { - val sharerUrl = - if (templateId != null) { - WebSharerClient.instance.makeCustomUrl( - templateId.toLong(), - templateArgs = templateArgs?.toStringMap(), - serverCallbackArgs = serverCallbackArgs?.toStringMap(), - ) - } else if (defaultTemplate != null) { - WebSharerClient.instance.makeDefaultUrl( - defaultTemplate, + runCatching { + ShareClient.instance.shareDefault( + context, + RNCKakaoShareTemplates.createDefaultTemplate(defaultTemplate, templateType), serverCallbackArgs = serverCallbackArgs?.toStringMap(), + callback = callback, ) - } else { - run { - promise.rejectWith(RNCKakaoUnknownException("one of templateId or template shouldn't be null")) - return - } + }.onFailure { + promise.rejectWith(it) } - try { - KakaoCustomTabsClient.openWithDefault(context, sharerUrl) - promise.resolve(42) - return - } catch (_: UnsupportedOperationException) { - } - try { - KakaoCustomTabsClient.open(context, sharerUrl) - promise.resolve(42) - return - } catch (_: ActivityNotFoundException) { } + } else if (useWebBrowserIfKakaoTalkNotAvailable) { + runCatching { + val sharerUrl = + if (templateId != null) { + WebSharerClient.instance.makeCustomUrl( + templateId.toLong(), + templateArgs = templateArgs?.toStringMap(), + serverCallbackArgs = serverCallbackArgs?.toStringMap(), + ) + } else if (defaultTemplate != null) { + WebSharerClient.instance.makeDefaultUrl( + RNCKakaoShareTemplates.createDefaultTemplate(defaultTemplate, templateType), + serverCallbackArgs = serverCallbackArgs?.toStringMap(), + ) + } else { + run { + promise.rejectWith(RNCKakaoUnknownException("one of templateId or template shouldn't be null")) + return + } + } + try { + KakaoCustomTabsClient.openWithDefault(context, sharerUrl) + promise.resolve(42) + return + } catch (_: UnsupportedOperationException) { + } + try { + KakaoCustomTabsClient.open(context, sharerUrl) + promise.resolve(42) + return + } catch (_: ActivityNotFoundException) { + } - promise.rejectWith(RNCKakaoUnknownException("web url open failed $sharerUrl")) + promise.rejectWith(RNCKakaoUnknownException("web url open failed $sharerUrl")) + }.onFailure { + promise.rejectWith(it) + } } else { - promise.rejectWith(RNCKakaoUnknownException("kakaotalk not available")) + promise.rejectWith(RNCKakaoAppNotAvailableException(TALK)) } } diff --git a/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareTemplates.kt b/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareTemplates.kt index 324e8db..69e0194 100644 --- a/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareTemplates.kt +++ b/packages/share/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareTemplates.kt @@ -6,6 +6,7 @@ import com.kakao.sdk.template.model.CalendarTemplate import com.kakao.sdk.template.model.Commerce import com.kakao.sdk.template.model.CommerceTemplate import com.kakao.sdk.template.model.Content +import com.kakao.sdk.template.model.DefaultTemplate import com.kakao.sdk.template.model.FeedTemplate import com.kakao.sdk.template.model.IdType.CALENDAR import com.kakao.sdk.template.model.IdType.EVENT @@ -16,11 +17,26 @@ import com.kakao.sdk.template.model.ListTemplate import com.kakao.sdk.template.model.LocationTemplate import com.kakao.sdk.template.model.Social import com.kakao.sdk.template.model.TextTemplate +import net.mjstudio.rnkakao.core.util.RNCKakaoUnknownException import net.mjstudio.rnkakao.core.util.filterIsReadableMap import net.mjstudio.rnkakao.core.util.getIntElseNull import net.mjstudio.rnkakao.core.util.toStringMap object RNCKakaoShareTemplates { + fun createDefaultTemplate( + template: ReadableMap, + templateType: String, + ): DefaultTemplate = + when (templateType) { + "feed" -> createFeedTemplate(template) + "list" -> createListTemplate(template) + "location" -> createLocationTemplate(template) + "commerce" -> createCommerceTemplate(template) + "text" -> createTextTemplate(template) + "calendar" -> createCalendarTemplate(template) + else -> throw RNCKakaoUnknownException("Unknown templateType: $templateType") + } + private fun ReadableMap.toLink() = Link( webUrl = getString("webUrl"), @@ -83,7 +99,7 @@ object RNCKakaoShareTemplates { currencyUnitPosition = getIntElseNull("currencyUnitPosition"), ) - fun createFeedTemplate(map: ReadableMap) = + private fun createFeedTemplate(map: ReadableMap) = FeedTemplate( content = map.getMap("content")!!.toContent(), itemContent = map.getMap("itemContent")?.toItemContent(), @@ -92,7 +108,7 @@ object RNCKakaoShareTemplates { buttonTitle = map.getString("buttonTitle"), ) - fun createListTemplate(map: ReadableMap): ListTemplate { + private fun createListTemplate(map: ReadableMap): ListTemplate { return ListTemplate( headerTitle = map.getString("headerTitle") ?: "", headerLink = map.getMap("headerLink")?.toLink() ?: Link(), @@ -104,7 +120,7 @@ object RNCKakaoShareTemplates { ) } - fun createLocationTemplate(map: ReadableMap) = + private fun createLocationTemplate(map: ReadableMap) = LocationTemplate( address = map.getString("address") ?: "", content = map.getMap("content")!!.toContent(), @@ -114,7 +130,7 @@ object RNCKakaoShareTemplates { buttonTitle = map.getString("buttonTitle"), ) - fun createCommerceTemplate(map: ReadableMap) = + private fun createCommerceTemplate(map: ReadableMap) = CommerceTemplate( content = map.getMap("content")!!.toContent(), commerce = map.getMap("commerce")!!.toCommerce(), @@ -122,7 +138,7 @@ object RNCKakaoShareTemplates { buttonTitle = map.getString("buttonTitle"), ) - fun createTextTemplate(map: ReadableMap) = + private fun createTextTemplate(map: ReadableMap) = TextTemplate( text = map.getString("text") ?: "", link = map.getMap("link")?.toLink() ?: Link(), @@ -130,7 +146,7 @@ object RNCKakaoShareTemplates { buttonTitle = map.getString("buttonTitle"), ) - fun createCalendarTemplate(map: ReadableMap) = + private fun createCalendarTemplate(map: ReadableMap) = CalendarTemplate( id = map.getString("id")!!, idType = if (map.getString("id") == "event") EVENT else CALENDAR, diff --git a/packages/share/android/src/oldarch/KakaoShareSpec.kt b/packages/share/android/src/oldarch/KakaoShareSpec.kt index be45412..0e55822 100644 --- a/packages/share/android/src/oldarch/KakaoShareSpec.kt +++ b/packages/share/android/src/oldarch/KakaoShareSpec.kt @@ -56,4 +56,16 @@ abstract class KakaoShareSpec internal constructor(context: ReactApplicationCont serverCallbackArgs: ReadableMap?, promise: Promise, ) + + abstract fun shareOrSendMeOrSendFriendOrWhatever( + sendType: String, + templateType: String, + templateId: Double, + templateJson: ReadableMap, + receiverUuids: ReadableArray, + useWebBrowserIfKakaoTalkNotAvailable: Boolean, + templateArgs: ReadableMap, + serverCallbackArgs: ReadableMap, + promise: Promise, + ) } diff --git a/packages/share/ios/RNCKakaoShareManager.swift b/packages/share/ios/RNCKakaoShareManager.swift index 50f2108..b98a555 100644 --- a/packages/share/ios/RNCKakaoShareManager.swift +++ b/packages/share/ios/RNCKakaoShareManager.swift @@ -40,7 +40,6 @@ import SafariServices sendType: sendType, templateType: templateType, dict: templateJson, - type: templateType, receiverUuids: receiverUuids, useWebBrowserIfKakaoTalkNotAvailable: useWebBrowserIfKakaoTalkNotAvailable, serverCallbackArgs: serverCallbackArgs, @@ -97,7 +96,6 @@ import SafariServices sendType: String, templateType: String, dict: [String: Any], - type: String, receiverUuids: [String], useWebBrowserIfKakaoTalkNotAvailable: Bool, serverCallbackArgs: [String: String]?, @@ -341,7 +339,7 @@ import SafariServices } else if type == "calendar" { return try SdkJSONDecoder.custom.decode(CalendarTemplate.self, from: json) as Templatable } else { - throw SdkError.ApiFailed(reason: .BadParameter, errorInfo: nil) + throw RNCKakaoError.unknown("Unknown templateType: \(type)") } } } diff --git a/packages/share/src/index.tsx b/packages/share/src/index.tsx index b7a80a1..cab0994 100644 --- a/packages/share/src/index.tsx +++ b/packages/share/src/index.tsx @@ -119,7 +119,7 @@ export function sendCustomTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.custom, templateId, {}, @@ -172,7 +172,7 @@ export function sendFeedTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.feed, -1, template, @@ -225,7 +225,7 @@ export function sendListTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.list, -1, template, @@ -278,7 +278,7 @@ export function sendLocationTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.location, -1, template, @@ -331,7 +331,7 @@ export function sendCommerceTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.commerce, -1, template, @@ -384,7 +384,7 @@ export function sendTextTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.text, -1, template, @@ -437,7 +437,7 @@ export function sendCalendarTemplateToFriends({ receiverUuids: string[]; }): Promise { return Native.shareOrSendMeOrSendFriendOrWhatever( - SendTypes.sendMe, + SendTypes.sendFriend, TemplateTypes.calendar, -1, template, diff --git a/packages/social/android/build.gradle b/packages/social/android/build.gradle index eb5994f..dde5fd9 100644 --- a/packages/social/android/build.gradle +++ b/packages/social/android/build.gradle @@ -1,13 +1,6 @@ apply from: file('./../../core/android/package-json.gradle') def Versions = project.ext.RNCKakaoSdkVersions -def coreProject -if (findProject(':@react-native-kakao_core')) { - coreProject = project(':@react-native-kakao_core') -} else if (findProject(':react-native-kakao_core')) { - coreProject = project(':react-native-kakao_core') -} else { - throw new GradleException('Could not find the react-native-kakao/core package, have you installed it?') -} +Project coreProject = project.ext.getWorkspaceProject("core") buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault @@ -112,8 +105,8 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" api coreProject - implementation "com.kakao.sdk:v2-friend:${Versions.friend}" - implementation "com.kakao.sdk:v2-talk:${Versions.talk}" + api "com.kakao.sdk:v2-friend:${Versions.friend}" + api "com.kakao.sdk:v2-talk:${Versions.talk}" } if (isNewArchitectureEnabled()) { diff --git a/packages/user/android/build.gradle b/packages/user/android/build.gradle index d728dcb..366c0f6 100644 --- a/packages/user/android/build.gradle +++ b/packages/user/android/build.gradle @@ -1,13 +1,6 @@ apply from: file('./../../core/android/package-json.gradle') def Versions = project.ext.RNCKakaoSdkVersions -def coreProject -if (findProject(':@react-native-kakao_core')) { - coreProject = project(':@react-native-kakao_core') -} else if (findProject(':react-native-kakao_core')) { - coreProject = project(':react-native-kakao_core') -} else { - throw new GradleException('Could not find the react-native-kakao/core package, have you installed it?') -} +Project coreProject = project.ext.getWorkspaceProject("core") buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault From d8f14673fd7ad0bcd47ee44893d3df22096ec50c Mon Sep 17 00:00:00 2001 From: mym0404 Date: Sun, 28 Apr 2024 03:55:11 +0900 Subject: [PATCH 5/6] docs(share): update share docs --- docs/docs/share/partial/_calendar.mdx | 27 ++ docs/docs/share/partial/_commerce.mdx | 26 ++ docs/docs/share/partial/_feed.mdx | 32 ++ docs/docs/share/partial/_list.mdx | 28 ++ docs/docs/share/partial/_location.mdx | 30 ++ .../share/partial/_send_default_template.mdx | 42 ++ .../share/partial/_share_default_template.mdx | 28 ++ docs/docs/share/partial/_text.mdx | 26 ++ docs/docs/share/send-custom.mdx | 51 +++ docs/docs/share/send-default-calendar.mdx | 11 + docs/docs/share/send-default-commerce.mdx | 11 + docs/docs/share/send-default-feed.mdx | 11 + docs/docs/share/send-default-list.mdx | 11 + docs/docs/share/send-default-location.mdx | 11 + docs/docs/share/send-default-text.mdx | 11 + docs/docs/share/share-custom.mdx | 2 +- docs/docs/share/share-default-calendar.mdx | 52 +-- docs/docs/share/share-default-commerce.mdx | 51 +-- docs/docs/share/share-default-feed.mdx | 58 +-- docs/docs/share/share-default-list.mdx | 54 +-- docs/docs/share/share-default-location.mdx | 55 +-- docs/docs/share/share-default-text.mdx | 51 +-- docs/docusaurus.config.ts | 2 + yarn.lock | 406 +++++++++--------- 24 files changed, 588 insertions(+), 499 deletions(-) create mode 100644 docs/docs/share/partial/_calendar.mdx create mode 100644 docs/docs/share/partial/_commerce.mdx create mode 100644 docs/docs/share/partial/_feed.mdx create mode 100644 docs/docs/share/partial/_list.mdx create mode 100644 docs/docs/share/partial/_location.mdx create mode 100644 docs/docs/share/partial/_send_default_template.mdx create mode 100644 docs/docs/share/partial/_share_default_template.mdx create mode 100644 docs/docs/share/partial/_text.mdx create mode 100644 docs/docs/share/send-custom.mdx create mode 100644 docs/docs/share/send-default-calendar.mdx create mode 100644 docs/docs/share/send-default-commerce.mdx create mode 100644 docs/docs/share/send-default-feed.mdx create mode 100644 docs/docs/share/send-default-list.mdx create mode 100644 docs/docs/share/send-default-location.mdx create mode 100644 docs/docs/share/send-default-text.mdx diff --git a/docs/docs/share/partial/_calendar.mdx b/docs/docs/share/partial/_calendar.mdx new file mode 100644 index 0000000..e050935 --- /dev/null +++ b/docs/docs/share/partial/_calendar.mdx @@ -0,0 +1,27 @@ +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) + +[톡캘린더](https://developers.kakao.com/docs/latest/ko/talkcalendar/common)의 공개 일정 또는 구독 캘린더 정보를 포함한 메시지 형식입니다. 카카오톡 채널의 공개 일정 또는 구독 캘린더를 사용자의 톡캘린더에 추가하는 기능을 제공합니다. 서비스 앱과 연결된 카카오톡 채널의 공개 일정이나 구독 캘린더에 대한 메시지만 전송 가능합니다. + +활용 예시: 카카오톡 메시지를 통해 사용자가 서비스의 공개 일정을 사용자 캘린더에 추가하거나, 서비스의 구독 캘린더를 구독하도록 권유하는 용도로 사용합니다. + +![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220340125.webp) + +## 템플릿 타입 정의 + +```ts +/** + * 톡캘린더의 구독 캘린더 또는 공개 일정 정보를 포함한 메시지 형식입니다. + * 카카오톡 채널의 구독 캘린더 또는 공개 일정을 사용자의 톡캘린더에 추가하는 기능을 제공합니다. + * + * @property id 구독 캘린더 또는 공개 일정 ID + * @property idType id의 타입, event(공개 일정) 또는 calendar(구독 캘린더) 중 하나 + * @property content 일정에 대해 설명하는 컨텐츠 정보 + * @property buttons 버튼 목록. 기본 버튼의 타이틀 외에 링크도 변경하고 싶을 때 설정. (최대 1개, 오른쪽 위치 보기 버튼은 고정) + */ +export interface KakaoCalendarTemplate { + id: string; + idType: 'event' | 'calendar'; + content: KakaoTemplateContent; + buttons?: KakaoTemplateButton[]; +} +``` diff --git a/docs/docs/share/partial/_commerce.mdx b/docs/docs/share/partial/_commerce.mdx new file mode 100644 index 0000000..e353229 --- /dev/null +++ b/docs/docs/share/partial/_commerce.mdx @@ -0,0 +1,26 @@ +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) + +상품 가격을 포함해 상품 정보를 자세히 보여주는 메시지 형식입니다. 피드 템플릿만큼 긴 텍스트를 추가하거나 소셜 정보를 추가할 수는 없지만, 사용자에게 가격 정보를 안내할 수 있는 장점이 있습니다. + +활용 예시: 상품의 가격 정보(정상 가격, 할인 가격, 할인율)를 담을 수 있어 쇼핑몰에서 판매하는 상품이나 프로모션 진행 상품의 소식을 알리는 데 적합합니다. + +![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220338423.webp) + +## 템플릿 타입 정의 + +```ts +/** + * 기본 템플릿으로 제공되는 커머스 템플릿 클래스 + * + * @property content 메시지의 내용. 텍스트 및 이미지, 링크 정보 포함. + * @property commerce 컨텐츠에 대한 가격 정보 + * @property buttons 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개) + * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content 에 입력된 값이 사용됨. + */ +export interface KakaoCommerceTemplate { + content: KakaoTemplateContent; + commerce: KakaoTemplateCommerce; + buttons?: KakaoTemplateButton[]; + buttonTitle?: string; +} +``` diff --git a/docs/docs/share/partial/_feed.mdx b/docs/docs/share/partial/_feed.mdx new file mode 100644 index 0000000..ae9a014 --- /dev/null +++ b/docs/docs/share/partial/_feed.mdx @@ -0,0 +1,32 @@ +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android) + +이미지와 글로 구성된 기본 메시지 형식입니다. 아이템 목록을 포함할 수 있습니다. + +스크랩 메시지를 보내는 경우에도, 피드 템플릿 구조가 사용됩니다. + +스크랩 메시지는 요청한 웹 페이지 URL에서 오픈 그래프 프로토콜(Open Graph Protocol)을 기반으로 웹 페이지 정보를 읽어와 구성한 메시지 형식입니다. + +활용 예시: 서비스의 새로운 소식이나 프로모션 이벤트를 공유하는데 활용할 수 있습니다. 간편하게 웹 페이지를 공유할 때는 스크랩 메시지를 활용합니다. 아이템 영역을 사용하면 주문 내역, 카탈로그, 영수증과 같은 형태의 피드 메시지를 만들 수 있습니다. + +![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220336612.webp) + +### 템플릿 타입 정의 + +```ts +/** + * 기본 템플릿으로 제공되는 피드 템플릿 클래스. + * + * @property content 메시지의 메인 콘텐츠 정보 + * @property itemContent 아이템 영역에 포함할 콘텐츠, [ItemContent] 참고 + * @property social 콘텐츠에 대한 소셜 정보 + * @property buttons 버튼 목록, 최대 2개. 버튼 타이틀과 링크를 변경하고 싶을 때, 버튼 두 개를 넣고 싶을 때 사용 + * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content 에 입력된 값이 사용됨. + */ +export interface KakaoFeedTemplate { + content: KakaoTemplateContent; + itemContent?: KakaoTemplateItemContent; + social?: KakaoTemplateSocial; + buttons?: KakaoTemplateButton[]; + buttonTitle?: string; +} +``` diff --git a/docs/docs/share/partial/_list.mdx b/docs/docs/share/partial/_list.mdx new file mode 100644 index 0000000..a545a95 --- /dev/null +++ b/docs/docs/share/partial/_list.mdx @@ -0,0 +1,28 @@ +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) + +한 개 이상의 콘텐츠를 세로로 된 목록 형태로 보여주는 메시지 형식입니다. 각 목록은 이미지와 글로 구성할 수 있습니다. + +활용 예시: 메시지 하나로 여러 개의 소식이나 상품을 안내하는 데 적합합니다. + +![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220337407.webp) + +### 템플릿 타입 정의 + +```ts +/** + * 여러 개의 컨텐츠를 리스트 형태로 보여줄 수 있는 메시지 템플릿 클래스. + * + * @property headerTitle 리스트 상단에 노출되는 헤더 타이틀 (최대 200자) + * @property headerLink 헤더 타이틀 내용에 해당하는 링크 정보 + * @property contents 리스트에 노출되는 컨텐츠 목록 (최소 2개, 최대 3개) + * @property buttons 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개) + * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content 에 입력된 값이 사용됨. + */ +export interface KakaoListTemplate { + headerTitle: string; + headerLink: KakaoTemplateLink; + contents: KakaoTemplateContent[]; + buttons?: KakaoTemplateButton[]; + buttonTitle?: string; +} +``` diff --git a/docs/docs/share/partial/_location.mdx b/docs/docs/share/partial/_location.mdx new file mode 100644 index 0000000..2a6184a --- /dev/null +++ b/docs/docs/share/partial/_location.mdx @@ -0,0 +1,30 @@ +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) + +위치 정보를 포함한 메시지 형식입니다. 보내는 사람이 주소 정보를 담아 메시지를 보내면, 받는 사람이 메시지에 포함된 위치 정보 버튼을 눌러서 카카오맵을 통해 자세한 장소 정보를 확인할 수 있습니다. + +활용 예시: 위치 정보와 함께 새로운 상점의 오픈 소식이나 메뉴를 소개할 때 유용합니다. + +![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220338261.webp) + +## 템플릿 타입 정의 + +```ts +/** + * 주소를 이용하여 특정 위치를 공유할 수 있는 메시지 템플릿. + * + * @property address 공유할 위치의 주소. 예) 경기 성남시 분당구 판교역로 235 + * @property addressTitle 카카오톡 내의 지도 뷰에서 사용되는 타이틀. 예) 카카오판교오피스 + * @property content 위치에 대해 설명하는 컨텐츠 정보 + * @property social 댓글수, 좋아요수 등, 컨텐츠에 대한 소셜 정보 + * @property buttons 버튼 목록. 기본 버튼의 타이틀 외에 링크도 변경하고 싶을 때 설정. (최대 1개, 오른쪽 위치 보기 버튼은 고정) + * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됨. + */ +export interface KakaoLocationTemplate { + address: string; + content: KakaoTemplateContent; + addressTitle?: string; + social?: KakaoTemplateSocial; + buttons?: KakaoTemplateButton[]; + buttonTitle?: string; +} +``` diff --git a/docs/docs/share/partial/_send_default_template.mdx b/docs/docs/share/partial/_send_default_template.mdx new file mode 100644 index 0000000..b4ea646 --- /dev/null +++ b/docs/docs/share/partial/_send_default_template.mdx @@ -0,0 +1,42 @@ +import Code from '@theme/CodeInline' +import CodeBlock from '@theme/CodeBlock' + +{props.description} + +## 나에게 메세지 전송하기 + +{`send${props.name[0].toUpperCase() + props.name.slice(1)}TemplateToMe`} 로 템플릿 메세지를 나에게 전송할 수 있습니다. + + +{` +export function send${props.name[0].toUpperCase() + props.name.slice(1)}TemplateToMe(params: { + template: Kakao${props.name[0].toUpperCase() + props.name.slice(1)}Template; +}) +`.trim()} + + +- `template`: 템플릿 객체입니다. + +## 친구들에게 메세지 전송하기 + +{`send${props.name[0].toUpperCase() + props.name.slice(1)}TemplateToFriends`} 로 템플릿 메세지를 친구들에게 전송할 수 있습니다. + + + {` +export function send${props.name[0].toUpperCase() + props.name.slice(1)}TemplateToFriends(params: { + template: Kakao${props.name[0].toUpperCase() + props.name.slice(1)}Template; + receiverUuids: string[]; +}) +`.trim()} + + +- `template`: 템플릿 객체입니다. +- `receiverUuids`: 메세지를 보낼 친구들의 uuid 리스트입니다. [social](/docs/social/intro)패키지의 +[카카오톡 친구 선택하기](/docs/social/select-talk-friends)나 [카카오톡 친구 가져오기](/docs/social/get-friends)에서 얻어올 수 있습니다. + +:::info +자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. + +사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 +::: + diff --git a/docs/docs/share/partial/_share_default_template.mdx b/docs/docs/share/partial/_share_default_template.mdx new file mode 100644 index 0000000..d768017 --- /dev/null +++ b/docs/docs/share/partial/_share_default_template.mdx @@ -0,0 +1,28 @@ +import Code from '@theme/CodeInline' +import CodeBlock from '@theme/CodeBlock' + +{props.description} + +## Usage + +{`share${props.name[0].toUpperCase() + props.name.slice(1)}Template`} 로 템플릿 메세지를 공유할 수 있습니다. + + +{` +export function share${props.name[0].toUpperCase() + props.name.slice(1)}Template(params: { + template: Kakao${props.name[0].toUpperCase() + props.name.slice(1)}Template; + useWebBrowserIfKakaoTalkNotAvailable?: boolean; + serverCallbackArgs?: Record; +}) +`.trim()} + + +- `template`: 템플릿 객체입니다. +- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 `true`입니다. +- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. + +:::info +자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. + +사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 +::: diff --git a/docs/docs/share/partial/_text.mdx b/docs/docs/share/partial/_text.mdx new file mode 100644 index 0000000..7f72131 --- /dev/null +++ b/docs/docs/share/partial/_text.mdx @@ -0,0 +1,26 @@ +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) + +글로만 구성된 메시지 형식입니다. + +활용 예시: 장문의 메시지로 사용자에게 많은 정보를 전달해야 하는 경우나, 간단하게 텍스트로만 구성된 메시지를 구성하는 데 적합합니다. + +![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220338059.webp) + +## 템플릿 타입 정의 + +```ts +/** + * 텍스트형 기본 템플릿 클래스 + * + * @property text 메시지에 들어갈 텍스트 (최대 200자) + * @property link 컨텐츠 클릭 시 이동할 링크 정보 + * @property buttons 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개) + * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됨. + */ +export interface KakaoTextTemplate { + text: string; + link: KakaoTemplateLink; + buttons?: KakaoTemplateButton[]; + buttonTitle?: string; +} +``` diff --git a/docs/docs/share/send-custom.mdx b/docs/docs/share/send-custom.mdx new file mode 100644 index 0000000..e5edfbe --- /dev/null +++ b/docs/docs/share/send-custom.mdx @@ -0,0 +1,51 @@ +--- +sidebar_position: 101 +--- + +# 사용자 정의 템플릿으로 메세지 전송하기 +## 사용자 정의 템플릿 + +[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android) + +`[도구] > [메시지 템플릿]`에서 직접 구성한 사용자 정의 템플릿을 사용하여 카카오톡으로 메시지를 전송하는 기능입니다. + +## 나에게 메세지 전송하기 + +`sendCustomTemplateToMe()` 함수를 이용해 메세지를 보낼 수 있습니다. + +이 함수는 다음과 같이 정의됩니다. + +```tsx +export function sendCustomTemplateToMe(params: { + templateId: number; + templateArgs?: Record; +}) +``` + +- `templateId`: 콘솔에서 지정한 메세지 템플릿입니다. +- `templateArgs`: 템플릿 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. + +## 친구들에게 메세지 전송하기 + +`sendCustomTemplateToFriends()` 함수를 이용해 메세지를 보낼 수 있습니다. + +이 함수는 다음과 같이 정의됩니다. + +```tsx +export function sendCustomTemplateToFriends(params: { + templateId: number; + templateArgs?: Record; + receiverUuids: string[]; +}) +``` + +- `templateId`: 콘솔에서 지정한 메세지 템플릿입니다. +- `templateArgs`: 템플릿 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. +- `receiverUuids`: 메세지를 보낼 친구들의 uuid 리스트입니다. [social](/docs/social/intro)패키지의 +[카카오톡 친구 선택하기](/docs/social/select-talk-friends)나 [카카오톡 친구 가져오기](/docs/social/get-friends)에서 얻어올 수 있습니다. + +:::info +자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. + +사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 +::: diff --git a/docs/docs/share/send-default-calendar.mdx b/docs/docs/share/send-default-calendar.mdx new file mode 100644 index 0000000..ede8d82 --- /dev/null +++ b/docs/docs/share/send-default-calendar.mdx @@ -0,0 +1,11 @@ +--- +sidebar_position: 107 +--- + +# 달력 템플릿으로 메세지 전송하기 +## 달력 템플릿 + +import Description from './partial/_calendar.mdx'; +import Send from './partial/_send_default_template.mdx'; + +}/> diff --git a/docs/docs/share/send-default-commerce.mdx b/docs/docs/share/send-default-commerce.mdx new file mode 100644 index 0000000..af9fa0c --- /dev/null +++ b/docs/docs/share/send-default-commerce.mdx @@ -0,0 +1,11 @@ +--- +sidebar_position: 105 +--- + +# 커머스 템플릿으로 메세지 전송하기 +## 커머스 템플릿 + +import Description from './partial/_commerce.mdx'; +import Send from './partial/_send_default_template.mdx'; + +}/> diff --git a/docs/docs/share/send-default-feed.mdx b/docs/docs/share/send-default-feed.mdx new file mode 100644 index 0000000..dc0f026 --- /dev/null +++ b/docs/docs/share/send-default-feed.mdx @@ -0,0 +1,11 @@ +--- +sidebar_position: 102 +--- + +# 피드 템플릿으로 메세지 전송하기 +## 피드 템플릿 + +import Description from './partial/_feed.mdx'; +import Send from './partial/_send_default_template.mdx'; + +}/> diff --git a/docs/docs/share/send-default-list.mdx b/docs/docs/share/send-default-list.mdx new file mode 100644 index 0000000..8b1354b --- /dev/null +++ b/docs/docs/share/send-default-list.mdx @@ -0,0 +1,11 @@ +--- +sidebar_position: 103 +--- + +# 리스트 템플릿으로 메세지 전송하기 +## 리스트 템플릿 + +import Description from './partial/_list.mdx'; +import Send from './partial/_send_default_template.mdx'; + +}/> diff --git a/docs/docs/share/send-default-location.mdx b/docs/docs/share/send-default-location.mdx new file mode 100644 index 0000000..2cbc85f --- /dev/null +++ b/docs/docs/share/send-default-location.mdx @@ -0,0 +1,11 @@ +--- +sidebar_position: 104 +--- + +# 위치 템플릿으로 메세지 전송하기 +## 위치 템플릿 + +import Description from './partial/_location.mdx'; +import Send from './partial/_send_default_template.mdx'; + +}/> diff --git a/docs/docs/share/send-default-text.mdx b/docs/docs/share/send-default-text.mdx new file mode 100644 index 0000000..6519c09 --- /dev/null +++ b/docs/docs/share/send-default-text.mdx @@ -0,0 +1,11 @@ +--- +sidebar_position: 106 +--- + +# 텍스트 템플릿으로 메세지 전송하기 +## 텍스트 템플릿 + +import Description from './partial/_text.mdx'; +import Send from './partial/_send_default_template.mdx'; + +}/> diff --git a/docs/docs/share/share-custom.mdx b/docs/docs/share/share-custom.mdx index f345516..26249ff 100644 --- a/docs/docs/share/share-custom.mdx +++ b/docs/docs/share/share-custom.mdx @@ -3,7 +3,7 @@ sidebar_position: 5 --- # 사용자 정의 템플릿으로 메세지 공유하기 -## 사용자 정의 템플릿으로 메세지 공유하기 +## 사용자 정의 템플릿 [공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#custom-template-msg) diff --git a/docs/docs/share/share-default-calendar.mdx b/docs/docs/share/share-default-calendar.mdx index 802cbea..ef47cd3 100644 --- a/docs/docs/share/share-default-calendar.mdx +++ b/docs/docs/share/share-default-calendar.mdx @@ -3,53 +3,9 @@ sidebar_position: 11 --- # 달력 템플릿으로 메세지 공유하기 -## 달력 템플릿으로 메세지 공유하기 +## 달력 템플릿 -[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) +import Description from './partial/_calendar.mdx'; +import Share from './partial/_share_default_template.mdx' -[톡캘린더](https://developers.kakao.com/docs/latest/ko/talkcalendar/common)의 공개 일정 또는 구독 캘린더 정보를 포함한 메시지 형식입니다. 카카오톡 채널의 공개 일정 또는 구독 캘린더를 사용자의 톡캘린더에 추가하는 기능을 제공합니다. 서비스 앱과 연결된 카카오톡 채널의 공개 일정이나 구독 캘린더에 대한 메시지만 전송 가능합니다. - -활용 예시: 카카오톡 메시지를 통해 사용자가 서비스의 공개 일정을 사용자 캘린더에 추가하거나, 서비스의 구독 캘린더를 구독하도록 권유하는 용도로 사용합니다. - -![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220340125.webp) - -## Usage - -캘린더 템플릿은 다음과 같은 타입을 가집니다. - -```ts -/** - * 톡캘린더의 구독 캘린더 또는 공개 일정 정보를 포함한 메시지 형식입니다. - * 카카오톡 채널의 구독 캘린더 또는 공개 일정을 사용자의 톡캘린더에 추가하는 기능을 제공합니다. - * - * @property id 구독 캘린더 또는 공개 일정 ID - * @property idType id의 타입, event(공개 일정) 또는 calendar(구독 캘린더) 중 하나 - * @property content 일정에 대해 설명하는 컨텐츠 정보 - * @property buttons 버튼 목록. 기본 버튼의 타이틀 외에 링크도 변경하고 싶을 때 설정. (최대 1개, 오른쪽 위치 보기 버튼은 고정) - */ -export interface KakaoCalendarTemplate { - id: string; - idType: 'event' | 'calendar'; - content: KakaoTemplateContent; - buttons?: KakaoTemplateButton[]; -} -``` - -`shareCalendarTemplate` 함수로 사용할 수 있습니다. - -```tsx -export function shareCalendarTemplate(params: { - template: KakaoCalendarTemplate; - useWebBrowserIfKakaoTalkNotAvailable?: boolean; - serverCallbackArgs?: Record; -}) -``` - -- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 true입니다. -- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. - -:::info -자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. - -사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +}/> diff --git a/docs/docs/share/share-default-commerce.mdx b/docs/docs/share/share-default-commerce.mdx index cd4d6b1..861d87e 100644 --- a/docs/docs/share/share-default-commerce.mdx +++ b/docs/docs/share/share-default-commerce.mdx @@ -3,52 +3,9 @@ sidebar_position: 9 --- # 커머스 템플릿으로 메세지 공유하기 -## 커머스 템플릿으로 메세지 공유하기 +## 커머스 템플릿 -[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) +import Description from './partial/_commerce.mdx'; +import Share from './partial/_share_default_template.mdx' -상품 가격을 포함해 상품 정보를 자세히 보여주는 메시지 형식입니다. 피드 템플릿만큼 긴 텍스트를 추가하거나 소셜 정보를 추가할 수는 없지만, 사용자에게 가격 정보를 안내할 수 있는 장점이 있습니다. - -활용 예시: 상품의 가격 정보(정상 가격, 할인 가격, 할인율)를 담을 수 있어 쇼핑몰에서 판매하는 상품이나 프로모션 진행 상품의 소식을 알리는 데 적합합니다. - -![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220338423.webp) - -## Usage - -커머스 템플릿은 다음과 같은 타입을 가집니다. - -```ts -/** - * 기본 템플릿으로 제공되는 커머스 템플릿 클래스 - * - * @property content 메시지의 내용. 텍스트 및 이미지, 링크 정보 포함. - * @property commerce 컨텐츠에 대한 가격 정보 - * @property buttons 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개) - * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content 에 입력된 값이 사용됨. - */ -export interface KakaoCommerceTemplate { - content: KakaoTemplateContent; - commerce: KakaoTemplateCommerce; - buttons?: KakaoTemplateButton[]; - buttonTitle?: string; -} -``` - -`shareCommerceTemplate` 함수로 사용할 수 있습니다. - -```tsx -export function shareCommerceTemplate(params: { - template: KakaoCommerceTemplate; - useWebBrowserIfKakaoTalkNotAvailable?: boolean; - serverCallbackArgs?: Record; -}) -``` - -- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 true입니다. -- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. - -:::info -자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. - -사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +}/> diff --git a/docs/docs/share/share-default-feed.mdx b/docs/docs/share/share-default-feed.mdx index cf125b5..a984b55 100644 --- a/docs/docs/share/share-default-feed.mdx +++ b/docs/docs/share/share-default-feed.mdx @@ -1,60 +1,10 @@ --- sidebar_position: 6 --- - # 피드 템플릿으로 메세지 공유하기 -## 피드 템플릿으로 메세지 공유하기 - -[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) - -이미지와 글로 구성된 기본 메시지 형식입니다. 아이템 목록을 포함할 수 있습니다. - -스크랩 메시지를 보내는 경우에도, 피드 템플릿 구조가 사용됩니다. - -스크랩 메시지는 요청한 웹 페이지 URL에서 오픈 그래프 프로토콜(Open Graph Protocol)을 기반으로 웹 페이지 정보를 읽어와 구성한 메시지 형식입니다. - -활용 예시: 서비스의 새로운 소식이나 프로모션 이벤트를 공유하는데 활용할 수 있습니다. 간편하게 웹 페이지를 공유할 때는 스크랩 메시지를 활용합니다. 아이템 영역을 사용하면 주문 내역, 카탈로그, 영수증과 같은 형태의 피드 메시지를 만들 수 있습니다. - -![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220336612.webp) - -## Usage - -피드 템플릿은 다음과 같은 타입을 가집니다. - -```ts -/** - * 기본 템플릿으로 제공되는 피드 템플릿 클래스. - * - * @property content 메시지의 메인 콘텐츠 정보 - * @property itemContent 아이템 영역에 포함할 콘텐츠, [ItemContent] 참고 - * @property social 콘텐츠에 대한 소셜 정보 - * @property buttons 버튼 목록, 최대 2개. 버튼 타이틀과 링크를 변경하고 싶을 때, 버튼 두 개를 넣고 싶을 때 사용 - * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content 에 입력된 값이 사용됨. - */ -export interface KakaoFeedTemplate { - content: KakaoTemplateContent; - itemContent?: KakaoTemplateItemContent; - social?: KakaoTemplateSocial; - buttons?: KakaoTemplateButton[]; - buttonTitle?: string; -} -``` - -`shareFeedTemplate` 함수로 사용할 수 있습니다. - -```tsx -export function shareFeedTemplate(params: { - template: KakaoFeedTemplate; - useWebBrowserIfKakaoTalkNotAvailable?: boolean; - serverCallbackArgs?: Record; -}) -``` - -- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 true입니다. -- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. +## 피드 템플릿 -:::info -자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. +import Description from './partial/_feed.mdx'; +import Share from './partial/_share_default_template.mdx' -사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +}/> diff --git a/docs/docs/share/share-default-list.mdx b/docs/docs/share/share-default-list.mdx index 153b7c7..32bd563 100644 --- a/docs/docs/share/share-default-list.mdx +++ b/docs/docs/share/share-default-list.mdx @@ -1,56 +1,10 @@ --- sidebar_position: 7 --- - # 리스트 템플릿으로 메세지 공유하기 -## 리스트 템플릿으로 메세지 공유하기 - -[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) - -한 개 이상의 콘텐츠를 세로로 된 목록 형태로 보여주는 메시지 형식입니다. 각 목록은 이미지와 글로 구성할 수 있습니다. - -활용 예시: 메시지 하나로 여러 개의 소식이나 상품을 안내하는 데 적합합니다. - -![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220337407.webp) - -## Usage - -리스트 템플릿은 다음과 같은 타입을 가집니다. - -```ts -/** - * 여러 개의 컨텐츠를 리스트 형태로 보여줄 수 있는 메시지 템플릿 클래스. - * - * @property headerTitle 리스트 상단에 노출되는 헤더 타이틀 (최대 200자) - * @property headerLink 헤더 타이틀 내용에 해당하는 링크 정보 - * @property contents 리스트에 노출되는 컨텐츠 목록 (최소 2개, 최대 3개) - * @property buttons 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개) - * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content 에 입력된 값이 사용됨. - */ -export interface KakaoListTemplate { - headerTitle: string; - headerLink: KakaoTemplateLink; - contents: KakaoTemplateContent[]; - buttons?: KakaoTemplateButton[]; - buttonTitle?: string; -} -``` - -`shareListTemplate` 함수로 사용할 수 있습니다. - -```tsx -export function shareListTemplate(params: { - template: KakaoListTemplate; - useWebBrowserIfKakaoTalkNotAvailable?: boolean; - serverCallbackArgs?: Record; -}) -``` - -- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 true입니다. -- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. +## 리스트 템플릿 -:::info -자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. +import Description from './partial/_list.mdx'; +import Share from './partial/_share_default_template.mdx' -사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +}/> diff --git a/docs/docs/share/share-default-location.mdx b/docs/docs/share/share-default-location.mdx index 06c38c3..886d881 100644 --- a/docs/docs/share/share-default-location.mdx +++ b/docs/docs/share/share-default-location.mdx @@ -3,56 +3,9 @@ sidebar_position: 8 --- # 위치 템플릿으로 메세지 공유하기 -## 위치 템플릿으로 메세지 공유하기 +## 위치 템플릿 -[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) +import Description from './partial/_location.mdx'; +import Share from './partial/_share_default_template.mdx' -위치 정보를 포함한 메시지 형식입니다. 보내는 사람이 주소 정보를 담아 메시지를 보내면, 받는 사람이 메시지에 포함된 위치 정보 버튼을 눌러서 카카오맵을 통해 자세한 장소 정보를 확인할 수 있습니다. - -활용 예시: 위치 정보와 함께 새로운 상점의 오픈 소식이나 메뉴를 소개할 때 유용합니다. - -![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220338261.webp) - -## Usage - -위치 템플릿은 다음과 같은 타입을 가집니다. - -```ts -/** - * 주소를 이용하여 특정 위치를 공유할 수 있는 메시지 템플릿. - * - * @property address 공유할 위치의 주소. 예) 경기 성남시 분당구 판교역로 235 - * @property addressTitle 카카오톡 내의 지도 뷰에서 사용되는 타이틀. 예) 카카오판교오피스 - * @property content 위치에 대해 설명하는 컨텐츠 정보 - * @property social 댓글수, 좋아요수 등, 컨텐츠에 대한 소셜 정보 - * @property buttons 버튼 목록. 기본 버튼의 타이틀 외에 링크도 변경하고 싶을 때 설정. (최대 1개, 오른쪽 위치 보기 버튼은 고정) - * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됨. - */ -export interface KakaoLocationTemplate { - address: string; - content: KakaoTemplateContent; - addressTitle?: string; - social?: KakaoTemplateSocial; - buttons?: KakaoTemplateButton[]; - buttonTitle?: string; -} -``` - -`shareLocationTemplate` 함수로 사용할 수 있습니다. - -```tsx -export function shareLocationTemplate(params: { - template: KakaoLocationTemplate; - useWebBrowserIfKakaoTalkNotAvailable?: boolean; - serverCallbackArgs?: Record; -}) -``` - -- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 true입니다. -- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. - -:::info -자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. - -사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +}/> diff --git a/docs/docs/share/share-default-text.mdx b/docs/docs/share/share-default-text.mdx index 922f9a8..66fc495 100644 --- a/docs/docs/share/share-default-text.mdx +++ b/docs/docs/share/share-default-text.mdx @@ -3,52 +3,9 @@ sidebar_position: 10 --- # 텍스트 템플릿으로 메세지 공유하기 -## 텍스트 템플릿으로 메세지 공유하기 +## 텍스트 템플릿 -[공식 문서](https://developers.kakao.com/docs/latest/ko/message/android-link#create-message) +import Description from './partial/_text.mdx'; +import Share from './partial/_share_default_template.mdx' -글로만 구성된 메시지 형식입니다. - -활용 예시: 장문의 메시지로 사용자에게 많은 정보를 전달해야 하는 경우나, 간단하게 텍스트로만 구성된 메시지를 구성하는 데 적합합니다. - -![](https://raw.githubusercontent.com/mym0404/image-archive/master/202404220338059.webp) - -## Usage - -텍스트 템플릿은 다음과 같은 타입을 가집니다. - -```ts -/** - * 텍스트형 기본 템플릿 클래스 - * - * @property text 메시지에 들어갈 텍스트 (최대 200자) - * @property link 컨텐츠 클릭 시 이동할 링크 정보 - * @property buttons 버튼 목록. 버튼 타이틀과 링크를 변경하고 싶을때, 버튼 두개를 사용하고 싶을때 사용. (최대 2개) - * @property buttonTitle 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됨. - */ -export interface KakaoTextTemplate { - text: string; - link: KakaoTemplateLink; - buttons?: KakaoTemplateButton[]; - buttonTitle?: string; -} -``` - -`shareTextTemplate` 함수로 사용할 수 있습니다. - -```tsx -export function shareTextTemplate(params: { - template: KakaoTextTemplate; - useWebBrowserIfKakaoTalkNotAvailable?: boolean; - serverCallbackArgs?: Record; -}) -``` - -- `useWebBrowserIfKakaoTalkNotAvailable`: 카카오톡이 사용 가능하지 않을 때 웹 브라우저를 이용해 공유를 할 것인지 여부입니다. 기본값은 true입니다. -- `serverCallbackArgs`: 서버 콜백 인자들입니다. 모두 문자열만 값으로 전달되어야 합니다. - -:::info -자세한 컴포넌트들의 타입은 [컴포넌트 타입들](/docs/share/component-types)을 참고해주세요. - -사용에 문제가 생긴다면 [Troubleshooting](/docs/share/troubleshooting)을 참고해주세요 -::: \ No newline at end of file +}/> diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 93b2b3d..3b2526e 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -38,6 +38,8 @@ const config: Config = { docs: { sidebarPath: './sidebars.ts', editUrl: `${repoUrl}/tree/main/docs/`, + remarkPlugins: [], + rehypePlugins: [], }, theme: { customCss: './src/css/custom.css', diff --git a/yarn.lock b/yarn.lock index 4096e68..ca2d473 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,13 +17,6 @@ __metadata: languageName: node linkType: hard -"@aashutoshrathi/word-wrap@npm:^1.2.3": - version: 1.2.6 - resolution: "@aashutoshrathi/word-wrap@npm:1.2.6" - checksum: 10/6eebd12a5cd03cee38fcb915ef9f4ea557df6a06f642dfc7fe8eb4839eb5c9ca55a382f3604d52c14200b0c214c12af5e1f23d2a6d8e23ef2d016b105a9d6c0a - languageName: node - linkType: hard - "@algolia/autocomplete-core@npm:1.9.3": version: 1.9.3 resolution: "@algolia/autocomplete-core@npm:1.9.3" @@ -373,9 +366,9 @@ __metadata: languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.6.1": - version: 0.6.1 - resolution: "@babel/helper-define-polyfill-provider@npm:0.6.1" +"@babel/helper-define-polyfill-provider@npm:^0.6.1, @babel/helper-define-polyfill-provider@npm:^0.6.2": + version: 0.6.2 + resolution: "@babel/helper-define-polyfill-provider@npm:0.6.2" dependencies: "@babel/helper-compilation-targets": "npm:^7.22.6" "@babel/helper-plugin-utils": "npm:^7.22.5" @@ -384,7 +377,7 @@ __metadata: resolve: "npm:^1.14.2" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10/316e7c0f05d2ae233d5fbb622c6339436da8d2b2047be866b64a16e6996c078a23b4adfebbdb33bc6a9882326a6cc20b95daa79a5e0edc92e9730e36d45fa523 + checksum: 10/bb32ec12024d3f16e70641bc125d2534a97edbfdabbc9f69001ec9c4ce46f877c7a224c566aa6c8c510c3b0def2e43dc4433bf6a40896ba5ce0cef4ea5ccbcff languageName: node linkType: hard @@ -2901,7 +2894,7 @@ __metadata: languageName: node linkType: hard -"@expo/config-plugins@npm:7.8.4, @expo/config-plugins@npm:~7.8.0": +"@expo/config-plugins@npm:7.8.4": version: 7.8.4 resolution: "@expo/config-plugins@npm:7.8.4" dependencies: @@ -3047,13 +3040,13 @@ __metadata: linkType: hard "@expo/json-file@npm:^8.2.37, @expo/json-file@npm:^8.3.0, @expo/json-file@npm:~8.3.0": - version: 8.3.2 - resolution: "@expo/json-file@npm:8.3.2" + version: 8.3.3 + resolution: "@expo/json-file@npm:8.3.3" dependencies: "@babel/code-frame": "npm:~7.10.4" json5: "npm:^2.2.2" write-file-atomic: "npm:^2.3.0" - checksum: 10/85d7e7a32e636c785fd92dd861c86a000be5608771cbd551c702a0fef4d425465298775f09913742295119315386f0e43ffc28f3f2d5ae467ce77692da36402d + checksum: 10/621b21d42023c5a8d7bc3d9be53911434416fd84fd06de527dc4c6b0b54119fa0324a8e1ecb4c716ff6c30d1a12b9b3bfc2317a093bf2a111de40aad991dd6d0 languageName: node linkType: hard @@ -3097,18 +3090,18 @@ __metadata: linkType: hard "@expo/osascript@npm:^2.0.31": - version: 2.1.1 - resolution: "@expo/osascript@npm:2.1.1" + version: 2.1.2 + resolution: "@expo/osascript@npm:2.1.2" dependencies: "@expo/spawn-async": "npm:^1.7.2" exec-async: "npm:^2.2.0" - checksum: 10/dc2f0319da531ef95816e958c1bb2596917ed65836efebbe73cf73cc6985f9b3433e28b523213ac865c3f2828450ed83976f68f4557a41a3444c1ecbcfb9850b + checksum: 10/161ba87a1811bc6d8f5f5c296b68073a23b62cb28af4986cd20602314fce09fc7669d5553519efccbe3c1368e99b5ffa2619b2f18aa665f07775ee83f4267d2f languageName: node linkType: hard "@expo/package-manager@npm:^1.1.1": - version: 1.5.0 - resolution: "@expo/package-manager@npm:1.5.0" + version: 1.5.2 + resolution: "@expo/package-manager@npm:1.5.2" dependencies: "@expo/json-file": "npm:^8.3.0" "@expo/spawn-async": "npm:^1.7.2" @@ -3122,38 +3115,18 @@ __metadata: ora: "npm:^3.4.0" split: "npm:^1.0.1" sudo-prompt: "npm:9.1.1" - checksum: 10/cb1df5435c4d86fadcf9a585540ecfe0292879397424c23840ab24275f2d76bfe0b8fc39cd3f7795a8e92e29aa870b2f2e3f3bfa870d447b8dc158412159748b + checksum: 10/5b95ef943dea3e1143a76f0da6b2477b26183e17028a258bcf22e26eb831d5ae09c00591c76915bf22c0069f7e064d2a0ee02595d3a00e93694f97336d30c2c4 languageName: node linkType: hard "@expo/plist@npm:^0.1.0": - version: 0.1.2 - resolution: "@expo/plist@npm:0.1.2" + version: 0.1.3 + resolution: "@expo/plist@npm:0.1.3" dependencies: "@xmldom/xmldom": "npm:~0.7.7" base64-js: "npm:^1.2.3" xmlbuilder: "npm:^14.0.0" - checksum: 10/695f46c6c75b84b9fe9e7b49276cf438e96bd2d9f57ee3145908ddcf1d763b635e09862f7fa5e2948007d799b00f49c377a2a8c1c54c8b42c9de2625112267a2 - languageName: node - linkType: hard - -"@expo/prebuild-config@npm:6.7.4": - version: 6.7.4 - resolution: "@expo/prebuild-config@npm:6.7.4" - dependencies: - "@expo/config": "npm:~8.5.0" - "@expo/config-plugins": "npm:~7.8.0" - "@expo/config-types": "npm:^50.0.0-alpha.1" - "@expo/image-utils": "npm:^0.4.0" - "@expo/json-file": "npm:^8.2.37" - debug: "npm:^4.3.1" - fs-extra: "npm:^9.0.0" - resolve-from: "npm:^5.0.0" - semver: "npm:7.5.3" - xml2js: "npm:0.6.0" - peerDependencies: - expo-modules-autolinking: ">=0.8.1" - checksum: 10/388367cf3843a7305dd1137fcf8d3485b4806d76a01649e2dc35440258b183c697b8938e59a0a6c9c3df71c195ffc228cd01af99729fddd234530dd34c8ae1dd + checksum: 10/7026e45744784539a0a3534dc393f4d7ccc04cc5a4c71a194f61aa9c5577599e27066c43e60c6611a4d34ebc30bec9380190be1685040bc72b037704fe2d2aec languageName: node linkType: hard @@ -4059,14 +4032,14 @@ __metadata: linkType: hard "@npmcli/installed-package-contents@npm:^2.0.1": - version: 2.0.2 - resolution: "@npmcli/installed-package-contents@npm:2.0.2" + version: 2.1.0 + resolution: "@npmcli/installed-package-contents@npm:2.1.0" dependencies: npm-bundled: "npm:^3.0.0" npm-normalize-package-bin: "npm:^3.0.0" bin: - installed-package-contents: lib/index.js - checksum: 10/4598a97e3d6e4c8602157d9ac47723071f09662852add0f275af62d1038d8e44d0c5ff9afa05358ba3ca7e100c860d679964be0a163add6ea028dc72d31f0af1 + installed-package-contents: bin/index.js + checksum: 10/68ab3ea2994f5ea21c61940de94ec4f2755fe569ef0b86e22db0695d651a3c88915c5eab61d634cfa203b9c801ee307c8aa134c2c4bd2e4fe1aa8d295ce8a163 languageName: node linkType: hard @@ -4088,8 +4061,8 @@ __metadata: linkType: hard "@npmcli/package-json@npm:^5.0.0": - version: 5.0.3 - resolution: "@npmcli/package-json@npm:5.0.3" + version: 5.1.0 + resolution: "@npmcli/package-json@npm:5.1.0" dependencies: "@npmcli/git": "npm:^5.0.0" glob: "npm:^10.2.2" @@ -4098,7 +4071,7 @@ __metadata: normalize-package-data: "npm:^6.0.0" proc-log: "npm:^4.0.0" semver: "npm:^7.5.3" - checksum: 10/b6b3a40114b5181cc215b809c80f85b9b3ec11e28a83f08bb3f997e87c83f4dba4e422eb9ab26bca0fc6b25ee32567bb46e74524bb487f064788d488985302ab + checksum: 10/0e5cb5eff32cf80234525160a702c91a38e4b98ab74e34e2632b43c4350dbad170bd835989cc7d6e18d24798e3242e45b60f3d5e26bd128fe1c4529931105f8e languageName: node linkType: hard @@ -4636,17 +4609,18 @@ __metadata: linkType: soft "@react-native-styled-system/core@npm:^1.0.3": - version: 1.0.3 - resolution: "@react-native-styled-system/core@npm:1.0.3" + version: 1.2.0 + resolution: "@react-native-styled-system/core@npm:1.2.0" dependencies: "@mj-studio/js-util": "npm:1.0.34" invariant: "npm:^2.2.4" + object-hash: "npm:^3.0.0" peerDependencies: react: "*" react-native: "*" bin: generate-theme-type: bin/theme-gen.js - checksum: 10/b89da6f794fefdfdbfad5d5a7af06cf672afc18342876adbd51bb908c5185d360f1a262e54c5c4ef4095e5de531a52ef5c6bfc6a16abe3d107c9a7fdea71342f + checksum: 10/8410289999aef11d62b91d366e8b3105b4040dcb334967661a442e97a463ce409f0e86154db7b584eb562db13fdfd1f4e1a1bd2c752bd636968cbb6f3720aa19 languageName: node linkType: hard @@ -5856,12 +5830,12 @@ __metadata: linkType: hard "@types/react@npm:^18.2.44": - version: 18.2.79 - resolution: "@types/react@npm:18.2.79" + version: 18.3.1 + resolution: "@types/react@npm:18.3.1" dependencies: "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10/2ef833e7d0a5c226beddbbe090811582371f6ae5e2f092a3d9f47cc6087c8bce0b96ee33e351de6d1d470f0a0ec5892d971933f841ef31538c1821681fc6569e + checksum: 10/baa6b8a75c471c89ebf3477b4feab57102ced25f0c1e553dd04ef6a1f0def28d5e0172fa626a631f22e223f840b5aaa2403b2d4bb671c83c5a9d6c7ae39c7a05 languageName: node linkType: hard @@ -6007,14 +5981,14 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:latest": - version: 7.7.0 - resolution: "@typescript-eslint/eslint-plugin@npm:7.7.0" + version: 7.7.1 + resolution: "@typescript-eslint/eslint-plugin@npm:7.7.1" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:7.7.0" - "@typescript-eslint/type-utils": "npm:7.7.0" - "@typescript-eslint/utils": "npm:7.7.0" - "@typescript-eslint/visitor-keys": "npm:7.7.0" + "@typescript-eslint/scope-manager": "npm:7.7.1" + "@typescript-eslint/type-utils": "npm:7.7.1" + "@typescript-eslint/utils": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" @@ -6027,7 +6001,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/9e6b6fbb9920581813c01daaa2f89419c3476e42823755c0627f4491640cfaffaebeb0592231ed4f318eefadfcdd4560b77b2903d66ab4e0c8df746a7037a603 + checksum: 10/54064fe466edcebece50cf4cfc4cb18753bcba7da0e3f0db29bf628586716b14945cadf01529ebc3d823e35bc62debf21aa636ae1f5e4fa92670dce65b3dec8c languageName: node linkType: hard @@ -6049,20 +6023,20 @@ __metadata: linkType: hard "@typescript-eslint/parser@npm:latest": - version: 7.7.0 - resolution: "@typescript-eslint/parser@npm:7.7.0" + version: 7.7.1 + resolution: "@typescript-eslint/parser@npm:7.7.1" dependencies: - "@typescript-eslint/scope-manager": "npm:7.7.0" - "@typescript-eslint/types": "npm:7.7.0" - "@typescript-eslint/typescript-estree": "npm:7.7.0" - "@typescript-eslint/visitor-keys": "npm:7.7.0" + "@typescript-eslint/scope-manager": "npm:7.7.1" + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/typescript-estree": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/9f8c53ca29af09cd366e37420410319c8f69e9f4a676513ecd91f5e6d822b9935b6a8ad7ec931d604fc4a0ecd93d51063d0c93227f78f2380196c8a7fa6970d1 + checksum: 10/39cd5c686e9f7e86da669fc3622b203e1025f162d42c4f45373e827c659b8823535fe4ea62ccb5e672ef999f8491d74c8c5c4c497367c884672fc835497ea180 languageName: node linkType: hard @@ -6086,13 +6060,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:7.7.0": - version: 7.7.0 - resolution: "@typescript-eslint/scope-manager@npm:7.7.0" +"@typescript-eslint/scope-manager@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/scope-manager@npm:7.7.1" dependencies: - "@typescript-eslint/types": "npm:7.7.0" - "@typescript-eslint/visitor-keys": "npm:7.7.0" - checksum: 10/c8890aaf99b57543774e50549c5b178c13695b21a6b30c65292268137fe5e6856cc0e050c118b47b5835dd8a48c96e042fc75891a7f6093a0b94b6b3b251afd9 + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" + checksum: 10/7823cd15e7205d2c0d9e69432717c385b2ecd7559d5edba79113c2e97c6c5e8ca3dae9343a734bc740be97e096bfcb9dfb81a3da697f9fbf5600a56a42cf70e9 languageName: node linkType: hard @@ -6113,12 +6087,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:7.7.0": - version: 7.7.0 - resolution: "@typescript-eslint/type-utils@npm:7.7.0" +"@typescript-eslint/type-utils@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/type-utils@npm:7.7.1" dependencies: - "@typescript-eslint/typescript-estree": "npm:7.7.0" - "@typescript-eslint/utils": "npm:7.7.0" + "@typescript-eslint/typescript-estree": "npm:7.7.1" + "@typescript-eslint/utils": "npm:7.7.1" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.3.0" peerDependencies: @@ -6126,7 +6100,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/a3f5358b4b7046458ea573607f3d6ea7f48e16524390b24c9360bdf8b03cc89fc6eb5da31b3e541e7f1e5f6958194ecaad5b644ca9b0d90c9a7b182f345451aa + checksum: 10/c64dfd3e535741270012d289d1327e487df877adfa8a9920b1f8d6616f3b7159ef8ee1d6b62e866b6a5c64d675c5008e87f4ea20b5fc032e95f197a749d38ae6 languageName: node linkType: hard @@ -6144,10 +6118,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:7.7.0": - version: 7.7.0 - resolution: "@typescript-eslint/types@npm:7.7.0" - checksum: 10/d54ff9eeea168188fcbf1c8efe42892d1646ead801ea0a0f1312c80cfb74ee5dd61a145bc982919fb396683fb4578f98f7ad90e5d466d7aa1ca593e4338e1a2e +"@typescript-eslint/types@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/types@npm:7.7.1" + checksum: 10/a1ecbaf3b8a5243394d421644f2b3eb164feea645e36dd07f1afb5008598201f19c7988141fc162c647f380dda7cf571017c0eabbbc4c5432b0143383853e134 languageName: node linkType: hard @@ -6188,12 +6162,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:7.7.0": - version: 7.7.0 - resolution: "@typescript-eslint/typescript-estree@npm:7.7.0" +"@typescript-eslint/typescript-estree@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/typescript-estree@npm:7.7.1" dependencies: - "@typescript-eslint/types": "npm:7.7.0" - "@typescript-eslint/visitor-keys": "npm:7.7.0" + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/visitor-keys": "npm:7.7.1" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" @@ -6203,7 +6177,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/40af26b3edb07af439f99728aa149bbc8668dae4a700a128abaf98d7f9bc0d5d31f8027aa1d13d6a55b22c20738d7cab84a3046a56417a2551de58671b39dbdf + checksum: 10/df5fe6c573b15e8058b88d1535eeca11115118adc54225f511d2762d74e2d453205ba27e63f6666cb5f3dc73d639208a183fb05db1f75063b115d52b1fae3e20 languageName: node linkType: hard @@ -6225,20 +6199,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:7.7.0": - version: 7.7.0 - resolution: "@typescript-eslint/utils@npm:7.7.0" +"@typescript-eslint/utils@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/utils@npm:7.7.1" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" "@types/json-schema": "npm:^7.0.15" "@types/semver": "npm:^7.5.8" - "@typescript-eslint/scope-manager": "npm:7.7.0" - "@typescript-eslint/types": "npm:7.7.0" - "@typescript-eslint/typescript-estree": "npm:7.7.0" + "@typescript-eslint/scope-manager": "npm:7.7.1" + "@typescript-eslint/types": "npm:7.7.1" + "@typescript-eslint/typescript-estree": "npm:7.7.1" semver: "npm:^7.6.0" peerDependencies: eslint: ^8.56.0 - checksum: 10/4223233ee022460a74f389302b50779537dfbb3bd414486dca356d2628a08d5b2c4c6002bae3bdffad92b368569024faf25faee9be739340d9459c23549a866f + checksum: 10/5a352c3a849300b5d676bf5f451418a2fb0cd3ab515f3733521ad03cf047849c52c76f6e5d2406e08f6d0dbad3a4708b490f909c91a1a9e3d73060a750b3bca2 languageName: node linkType: hard @@ -6279,13 +6253,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:7.7.0": - version: 7.7.0 - resolution: "@typescript-eslint/visitor-keys@npm:7.7.0" +"@typescript-eslint/visitor-keys@npm:7.7.1": + version: 7.7.1 + resolution: "@typescript-eslint/visitor-keys@npm:7.7.1" dependencies: - "@typescript-eslint/types": "npm:7.7.0" + "@typescript-eslint/types": "npm:7.7.1" eslint-visitor-keys: "npm:^3.4.3" - checksum: 10/9f03591ab60b0b164f6bb222b5d5ae75f73fbe7f264be9318f770be9dc5dff8138d34701928940ffc18924058ae80754a738a1e623912a297d57a8a59cdfb41d + checksum: 10/dcc5748b10bb1b169516b33e87b6d86b562e25725a95e5ac515cb197589d9667aaa7cfffa93234095a73c80addb6dd88e2a9ab01d2be0c274254b5be1ca4057a languageName: node linkType: hard @@ -6309,12 +6283,12 @@ __metadata: linkType: hard "@urql/core@npm:>=2.3.1": - version: 5.0.1 - resolution: "@urql/core@npm:5.0.1" + version: 5.0.2 + resolution: "@urql/core@npm:5.0.2" dependencies: "@0no-co/graphql.web": "npm:^1.0.5" wonka: "npm:^6.3.2" - checksum: 10/b00d967465368eb8a10a9ed16876260359f28fa6d053e84d08a09fcf78ff6e6353a5bf3a21fc3e4e22dc2b726d34340ce8e7e2516b7040a218b66bd21c07591e + checksum: 10/7eb109eea49ccd5ff15043eb2b5d4684239a0376ffc60d7b676147348919e6d42e51acb11d62e0f91a05dce9de499ceb9c429f82dfad95cb51d0872554bbb51e languageName: node linkType: hard @@ -7250,15 +7224,15 @@ __metadata: linkType: hard "babel-plugin-polyfill-corejs2@npm:^0.4.10": - version: 0.4.10 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.10" + version: 0.4.11 + resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" dependencies: "@babel/compat-data": "npm:^7.22.6" - "@babel/helper-define-polyfill-provider": "npm:^0.6.1" + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10/9fb5e59a3235eba66fb05060b2a3ecd6923084f100df7526ab74b6272347d7adcf99e17366b82df36e592cde4e82fdb7ae24346a990eced76c7d504cac243400 + checksum: 10/9c79908bed61b9f52190f254e22d3dca6ce25769738642579ba8d23832f3f9414567a90d8367a31831fa45d9b9607ac43d8d07ed31167d8ca8cda22871f4c7a1 languageName: node linkType: hard @@ -7275,13 +7249,13 @@ __metadata: linkType: hard "babel-plugin-polyfill-regenerator@npm:^0.6.1": - version: 0.6.1 - resolution: "babel-plugin-polyfill-regenerator@npm:0.6.1" + version: 0.6.2 + resolution: "babel-plugin-polyfill-regenerator@npm:0.6.2" dependencies: - "@babel/helper-define-polyfill-provider": "npm:^0.6.1" + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10/9df4a8e9939dd419fed3d9ea26594b4479f2968f37c225e1b2aa463001d7721f5537740e6622909d2a570b61cec23256924a1701404fc9d6fd4474d3e845cedb + checksum: 10/150233571072b6b3dfe946242da39cba8587b7f908d1c006f7545fc88b0e3c3018d445739beb61e7a75835f0c2751dbe884a94ff9b245ec42369d9267e0e1b3f languageName: node linkType: hard @@ -7875,9 +7849,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001587, caniuse-lite@npm:^1.0.30001599": - version: 1.0.30001611 - resolution: "caniuse-lite@npm:1.0.30001611" - checksum: 10/24710a9cc026e564508fad6905d93d2be14ff38af6e08dce651521e7f4e87b2d2863dd8976da5349173e0c10b47377634238890dc34aa6d44a4d0ca3b1f6e236 + version: 1.0.30001612 + resolution: "caniuse-lite@npm:1.0.30001612" + checksum: 10/8fb95102aade9147694541a9e576ec16d8d455f37e1456f497403af45f1ddd24465a62057d619d57c052e9634e090e5115e383ab066f8f9f9b87d14f738f81df languageName: node linkType: hard @@ -8208,9 +8182,9 @@ __metadata: linkType: hard "clsx@npm:^2.0.0": - version: 2.1.0 - resolution: "clsx@npm:2.1.0" - checksum: 10/2e0ce7c3b6803d74fc8147c408f88e79245583202ac14abd9691e2aebb9f312de44270b79154320d10bb7804a9197869635d1291741084826cff20820f31542b + version: 2.1.1 + resolution: "clsx@npm:2.1.1" + checksum: 10/cdfb57fa6c7649bbff98d9028c2f0de2f91c86f551179541cf784b1cfdc1562dcb951955f46d54d930a3879931a980e32a46b598acaea274728dbe068deca919 languageName: node linkType: hard @@ -9812,9 +9786,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.4.668": - version: 1.4.744 - resolution: "electron-to-chromium@npm:1.4.744" - checksum: 10/5086fb518d4e79010bfb737ae0da6ac91200384f937c81fba57de90343a2aa7fc2d145b1c1bb4c85ff716beb9b2a20384cfeec707f2ad9cd515246eb57f93312 + version: 1.4.750 + resolution: "electron-to-chromium@npm:1.4.750" + checksum: 10/5eecd983425fe0bcc4e9b6532ded294942c1b8c0a1110ad9149b3ee91d6b067ff8ff3c17cbf8f6e3dd24b4c59653e815ef58c5fabec2238e8696061c4b441a97 languageName: node linkType: hard @@ -9974,7 +9948,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.1, es-abstract@npm:^1.23.2": +"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.1, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.3": version: 1.23.3 resolution: "es-abstract@npm:1.23.3" dependencies: @@ -10045,12 +10019,12 @@ __metadata: linkType: hard "es-iterator-helpers@npm:^1.0.17": - version: 1.0.18 - resolution: "es-iterator-helpers@npm:1.0.18" + version: 1.0.19 + resolution: "es-iterator-helpers@npm:1.0.19" dependencies: call-bind: "npm:^1.0.7" define-properties: "npm:^1.2.1" - es-abstract: "npm:^1.23.0" + es-abstract: "npm:^1.23.3" es-errors: "npm:^1.3.0" es-set-tostringtag: "npm:^2.0.3" function-bind: "npm:^1.1.2" @@ -10062,7 +10036,7 @@ __metadata: internal-slot: "npm:^1.0.7" iterator.prototype: "npm:^1.1.2" safe-array-concat: "npm:^1.1.2" - checksum: 10/a4fd067e148736fbe6a9883f449e0de88be14a4dff9065c457572ede10ba02a4a15c4ae18b9b7baa5c868860d2be9a6764906c3308135e57ec5bfd386bbd2836 + checksum: 10/980a8081cf6798fe17fcea193b0448d784d72d76aca7240b10813207c67e3dc0d8a23992263870c4fc291da5a946935b0c56dec4fa1a9de8fee0165e4fa1fc58 languageName: node linkType: hard @@ -10277,8 +10251,8 @@ __metadata: linkType: hard "eslint-plugin-jest@npm:^28.2.0": - version: 28.2.0 - resolution: "eslint-plugin-jest@npm:28.2.0" + version: 28.3.0 + resolution: "eslint-plugin-jest@npm:28.3.0" dependencies: "@typescript-eslint/utils": "npm:^6.0.0" peerDependencies: @@ -10290,7 +10264,7 @@ __metadata: optional: true jest: optional: true - checksum: 10/029a3d140a561d941580cbfee15ccacf4584971975f61111f07b87f01bf64c9739607cbe8e6fd3888429179ea8fd733e655ccd87b3b83b3b5cee2187e2355a4e + checksum: 10/b26fe20376d24ed5cc497e919f5d34134ae52c1e79e7bbb9e445cfe46e27a2b4bf75bd402bf31ecc39ca5eb54449e37b302f9d29c57e9c25e6d32385ca8d9093 languageName: node linkType: hard @@ -10330,11 +10304,11 @@ __metadata: linkType: hard "eslint-plugin-react-hooks@npm:*, eslint-plugin-react-hooks@npm:^4.6.0": - version: 4.6.0 - resolution: "eslint-plugin-react-hooks@npm:4.6.0" + version: 4.6.2 + resolution: "eslint-plugin-react-hooks@npm:4.6.2" peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - checksum: 10/3c63134e056a6d98d66e2c475c81f904169db817e89316d14e36269919e31f4876a2588aa0e466ec8ef160465169c627fe823bfdaae7e213946584e4a165a3ac + checksum: 10/5a0680941f34e70cf505bcb6082df31a3e445d193ee95a88ff3483041eb944f4cefdaf7e81b0eb1feb4eeceee8c7c6ddb8a2a6e8c4c0388514a42e16ac7b7a69 languageName: node linkType: hard @@ -10920,8 +10894,8 @@ __metadata: linkType: hard "expo-router@npm:~3.4.8": - version: 3.4.8 - resolution: "expo-router@npm:3.4.8" + version: 3.4.9 + resolution: "expo-router@npm:3.4.9" dependencies: "@expo/metro-runtime": "npm:3.1.3" "@expo/server": "npm:^0.3.0" @@ -10929,7 +10903,7 @@ __metadata: "@react-navigation/bottom-tabs": "npm:~6.5.7" "@react-navigation/native": "npm:~6.1.6" "@react-navigation/native-stack": "npm:~6.9.12" - expo-splash-screen: "npm:0.26.4" + expo-splash-screen: "npm:~0.26.5" react-helmet-async: "npm:^1.3.0" schema-utils: "npm:^4.0.1" peerDependencies: @@ -10948,18 +10922,18 @@ __metadata: optional: true react-native-reanimated: optional: true - checksum: 10/c8fe551c1cd1d9c05707e6d1938ad0c32db6bdf668cac0bc62aaf0b741f275aa02c8337572ef1c75d6be7ba2f6fd209ca03cf9530006537aa5d33caafb6486ed + checksum: 10/c55338ada25f0ef687c259c4008d60855728aa5587fa6a5c10fb41ed146f49f69bf8f990958fa6dc0fc15c731f51ee63c5ef89b213b17be40a6e93d0c4a02997 languageName: node linkType: hard -"expo-splash-screen@npm:0.26.4": - version: 0.26.4 - resolution: "expo-splash-screen@npm:0.26.4" +"expo-splash-screen@npm:~0.26.5": + version: 0.26.5 + resolution: "expo-splash-screen@npm:0.26.5" dependencies: - "@expo/prebuild-config": "npm:6.7.4" + "@expo/prebuild-config": "npm:6.8.1" peerDependencies: expo: "*" - checksum: 10/1ec3f5440da735542a73ef3355e71b56089d817141cda88cd01dc31bac1a286ee784d367e6e436269260f4537a3c761e5182af8eb8c5b1db1b8d8f35cd1377d9 + checksum: 10/29c5c0a6e4de29fd7f8a882fa6dbeadb8ff1c516276fb02cb97f42a905fcec849c420599f3e39f4da4c911779c8bfb4436ea9716709e96df182f3047acaf5a43 languageName: node linkType: hard @@ -11419,9 +11393,9 @@ __metadata: linkType: hard "flow-parser@npm:0.*": - version: 0.234.0 - resolution: "flow-parser@npm:0.234.0" - checksum: 10/081d74ebb29ddcac1906195dc762241ec340cc4c58368b40cc3aa813c3b0a83f72aa411beca897f71b4d8da6df735975e217ddd8d1b0a517b08fe3621fdae84d + version: 0.235.1 + resolution: "flow-parser@npm:0.235.1" + checksum: 10/2c158e940deb2f3312dc91fe0890118295c6dc4823930cf18039bc6facd434504008a7b914a5a5be2f4d30274e0b31f8621d05417e5e4579e4df1f3fdd7cc949 languageName: node linkType: hard @@ -13010,8 +12984,8 @@ __metadata: linkType: hard "inquirer@npm:^9.2.18": - version: 9.2.19 - resolution: "inquirer@npm:9.2.19" + version: 9.2.20 + resolution: "inquirer@npm:9.2.20" dependencies: "@inquirer/figures": "npm:^1.0.1" "@ljharb/through": "npm:^2.3.13" @@ -13028,7 +13002,7 @@ __metadata: string-width: "npm:^4.2.3" strip-ansi: "npm:^6.0.1" wrap-ansi: "npm:^6.2.0" - checksum: 10/034fc65c583d61579cb8b86630a53a6a812279daf3cd004d090caf8583f5909e5ce192d230a24d0c4bff7c02adf3d1a4c5c36bf6fa16b117b0e6dca6d47a0972 + checksum: 10/beeca2f0da3eaca18fdf00d1c45e9db71b7699e5b4c96793056434928a96587bf83dcfb594d535162f62e59a6e3c4f0a64e0cdafcc5109123ab16ffa93f87903 languageName: node linkType: hard @@ -14359,15 +14333,15 @@ __metadata: linkType: hard "joi@npm:^17.2.1, joi@npm:^17.9.2": - version: 17.12.3 - resolution: "joi@npm:17.12.3" + version: 17.13.0 + resolution: "joi@npm:17.13.0" dependencies: "@hapi/hoek": "npm:^9.3.0" "@hapi/topo": "npm:^5.1.0" "@sideway/address": "npm:^4.1.5" "@sideway/formula": "npm:^3.0.1" "@sideway/pinpoint": "npm:^2.0.0" - checksum: 10/454dcc8ff1b095f978253bb1ef6d3033812d091d6a0a3da0ba7c3cb85623c7a1e657c19a8685839e991fe1cfb83ca25ea0caa1d17c9806dea0ffd49e43ecb0a2 + checksum: 10/aae196d71edeb752b76c12560728e0c5a2b813956934443ddf5294af993a0bdf81c22cffc2170e4751f2adaa56873a4eafc24d697c2ec7055709219505e3e56b languageName: node linkType: hard @@ -14717,28 +14691,28 @@ __metadata: linkType: hard "libnpmaccess@npm:^8.0.3": - version: 8.0.3 - resolution: "libnpmaccess@npm:8.0.3" + version: 8.0.4 + resolution: "libnpmaccess@npm:8.0.4" dependencies: - npm-package-arg: "npm:^11.0.1" - npm-registry-fetch: "npm:^16.2.0" - checksum: 10/119afc9d7a7bafc971e9fdf4ef078c21ba2ea8de5b8ffb87298182e4f2c7915a06199f3f316abecb7c41ac97216dbf72e87e28fb5a4708af109a16ea5dedcdb0 + npm-package-arg: "npm:^11.0.2" + npm-registry-fetch: "npm:^16.2.1" + checksum: 10/9551c3154b4ac248635edb1b32522f39f8c9d15cf0c55ce142bb6b2694e4e0dcf55adf15d962d52909d53c3ac299a0a82b0f93caae2f22a6a307566024996ee1 languageName: node linkType: hard "libnpmpublish@npm:^9.0.5": - version: 9.0.5 - resolution: "libnpmpublish@npm:9.0.5" + version: 9.0.6 + resolution: "libnpmpublish@npm:9.0.6" dependencies: ci-info: "npm:^4.0.0" normalize-package-data: "npm:^6.0.0" - npm-package-arg: "npm:^11.0.1" - npm-registry-fetch: "npm:^16.2.0" - proc-log: "npm:^3.0.0" + npm-package-arg: "npm:^11.0.2" + npm-registry-fetch: "npm:^16.2.1" + proc-log: "npm:^4.2.0" semver: "npm:^7.3.7" sigstore: "npm:^2.2.0" ssri: "npm:^10.0.5" - checksum: 10/11955a05e570658ac70185867fb237856ff532e68910b7bb2a586f564e61c851da8c3b516df277ef60e31f37cbe4b5e97ffd4f3eefacc63ab2d2ffa84b04e2c9 + checksum: 10/0f7444c0c32c31887b50f3d87872305b9d77ac184275d8c3943f708f0f4feb10e5e1f3a99b391037988fcb989b9169a9e3e9ce439db651931a412c7e52c557e3 languageName: node linkType: hard @@ -15097,9 +15071,9 @@ __metadata: linkType: hard "lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": - version: 10.2.0 - resolution: "lru-cache@npm:10.2.0" - checksum: 10/502ec42c3309c0eae1ce41afca471f831c278566d45a5273a0c51102dee31e0e250a62fa9029c3370988df33a14188a38e682c16143b794de78668de3643e302 + version: 10.2.1 + resolution: "lru-cache@npm:10.2.1" + checksum: 10/65639bf4534c00b7a420be001d7f0485d6147fe0fdc68b9a67d0ef94dca6dace27d87cfa345e817c62bc6e000393379ac744f40870c285bb7c13949c1cc87209 languageName: node linkType: hard @@ -15833,8 +15807,8 @@ __metadata: linkType: hard "micromark-core-commonmark@npm:^2.0.0": - version: 2.0.0 - resolution: "micromark-core-commonmark@npm:2.0.0" + version: 2.0.1 + resolution: "micromark-core-commonmark@npm:2.0.1" dependencies: decode-named-character-reference: "npm:^1.0.0" devlop: "npm:^1.0.0" @@ -15852,7 +15826,7 @@ __metadata: micromark-util-subtokenize: "npm:^2.0.0" micromark-util-symbol: "npm:^2.0.0" micromark-util-types: "npm:^2.0.0" - checksum: 10/67f6e2f062f42a7ae21e8a409f3663843703a830ff27cf0f41cb0fb712c58e55409db428531d8124c4ef8d698cd81e7eb41485d24b8c352d2f0c06b535865367 + checksum: 10/15e788b3222401572ff8f549f8ecba21fa3395c000b8005e47204e8c97200e98bb0652c2c648e357b0996f1b50a7a63cc43e849f2976e4845b4453049040f8cc languageName: node linkType: hard @@ -17041,7 +17015,7 @@ __metadata: languageName: node linkType: hard -"npm-package-arg@npm:^11.0.0, npm-package-arg@npm:^11.0.1, npm-package-arg@npm:^11.0.2": +"npm-package-arg@npm:^11.0.0, npm-package-arg@npm:^11.0.2": version: 11.0.2 resolution: "npm-package-arg@npm:11.0.2" dependencies: @@ -17100,7 +17074,7 @@ __metadata: languageName: node linkType: hard -"npm-registry-fetch@npm:^16.0.0, npm-registry-fetch@npm:^16.2.0, npm-registry-fetch@npm:^16.2.1": +"npm-registry-fetch@npm:^16.0.0, npm-registry-fetch@npm:^16.2.1": version: 16.2.1 resolution: "npm-registry-fetch@npm:16.2.1" dependencies: @@ -17192,6 +17166,13 @@ __metadata: languageName: node linkType: hard +"object-hash@npm:^3.0.0": + version: 3.0.0 + resolution: "object-hash@npm:3.0.0" + checksum: 10/f498d456a20512ba7be500cef4cf7b3c183cc72c65372a549c9a0e6dd78ce26f375e9b1315c07592d3fde8f10d5019986eba35970570d477ed9a2a702514432a + languageName: node + linkType: hard + "object-inspect@npm:^1.13.1": version: 1.13.1 resolution: "object-inspect@npm:1.13.1" @@ -17382,16 +17363,16 @@ __metadata: linkType: hard "optionator@npm:^0.9.3": - version: 0.9.3 - resolution: "optionator@npm:0.9.3" + version: 0.9.4 + resolution: "optionator@npm:0.9.4" dependencies: - "@aashutoshrathi/word-wrap": "npm:^1.2.3" deep-is: "npm:^0.1.3" fast-levenshtein: "npm:^2.0.6" levn: "npm:^0.4.1" prelude-ls: "npm:^1.2.1" type-check: "npm:^0.4.0" - checksum: 10/fa28d3016395974f7fc087d6bbf0ac7f58ac3489f4f202a377e9c194969f329a7b88c75f8152b33fb08794a30dcd5c079db6bb465c28151357f113d80bbf67da + word-wrap: "npm:^1.2.5" + checksum: 10/a8398559c60aef88d7f353a4f98dcdff6090a4e70f874c827302bf1213d9106a1c4d5fcb68dacb1feb3c30a04c4102f41047aa55d4c576b863d6fc876e001af6 languageName: node linkType: hard @@ -18568,7 +18549,7 @@ __metadata: languageName: node linkType: hard -"proc-log@npm:^4.0.0": +"proc-log@npm:^4.0.0, proc-log@npm:^4.2.0": version: 4.2.0 resolution: "proc-log@npm:4.2.0" checksum: 10/4e1394491b717f6c1ade15c570ecd4c2b681698474d3ae2d303c1e4b6ab9455bd5a81566211e82890d5a5ae9859718cc6954d5150bb18b09b72ecb297beae90a @@ -18868,14 +18849,14 @@ __metadata: linkType: hard "react-dom@npm:^18.0.0": - version: 18.2.0 - resolution: "react-dom@npm:18.2.0" + version: 18.3.1 + resolution: "react-dom@npm:18.3.1" dependencies: loose-envify: "npm:^1.1.0" - scheduler: "npm:^0.23.0" + scheduler: "npm:^0.23.2" peerDependencies: - react: ^18.2.0 - checksum: 10/ca5e7762ec8c17a472a3605b6f111895c9f87ac7d43a610ab7024f68cd833d08eda0625ce02ec7178cc1f3c957cf0b9273cdc17aa2cd02da87544331c43b1d21 + react: ^18.3.1 + checksum: 10/3f4b73a3aa083091173b29812b10394dd06f4ac06aff410b74702cfb3aa29d7b0ced208aab92d5272919b612e5cda21aeb1d54191848cf6e46e9e354f3541f81 languageName: node linkType: hard @@ -18933,9 +18914,9 @@ __metadata: linkType: hard "react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.0.0": - version: 18.2.0 - resolution: "react-is@npm:18.2.0" - checksum: 10/200cd65bf2e0be7ba6055f647091b725a45dd2a6abef03bf2380ce701fd5edccee40b49b9d15edab7ac08a762bf83cb4081e31ec2673a5bfb549a36ba21570df + version: 18.3.1 + resolution: "react-is@npm:18.3.1" + checksum: 10/d5f60c87d285af24b1e1e7eaeb123ec256c3c8bdea7061ab3932e3e14685708221bf234ec50b21e10dd07f008f1b966a2730a0ce4ff67905b3872ff2042aec22 languageName: node linkType: hard @@ -18954,11 +18935,11 @@ __metadata: linkType: hard "react-json-view-lite@npm:^1.2.0": - version: 1.3.0 - resolution: "react-json-view-lite@npm:1.3.0" + version: 1.3.1 + resolution: "react-json-view-lite@npm:1.3.1" peerDependencies: react: ^16.13.1 || ^17.0.0 || ^18.0.0 - checksum: 10/19007892c37d82bfefd9e84c10a091b3245b71f9134da00d2d6a16cd85dda922811156c5e258b333866aefb712e5a2248f60daceddf0a7559a7476bf447042e3 + checksum: 10/6123f110f540d166e356171a620c437ee130ea3cbb0e3eda25ef8ef8f3f2161de1d9efa21fc94846ece0d03427d0e976c1c7c8c9528e35d27ef1cdd63c639981 languageName: node linkType: hard @@ -19103,13 +19084,20 @@ __metadata: languageName: node linkType: hard -"react-refresh@npm:0.14.0, react-refresh@npm:^0.14.0": +"react-refresh@npm:0.14.0": version: 0.14.0 resolution: "react-refresh@npm:0.14.0" checksum: 10/75941262ce3ed4fc79b52492943fd59692f29b84f30f3822713b7e920f28e85c62a4386f85cbfbaea95ed62d3e74209f0a0bb065904b7ab2f166a74ac3812e2a languageName: node linkType: hard +"react-refresh@npm:^0.14.0": + version: 0.14.2 + resolution: "react-refresh@npm:0.14.2" + checksum: 10/512abf97271ab8623486061be04b608c39d932e3709f9af1720b41573415fa4993d0009fa5138b6705b60a98f4102f744d4e26c952b14f41a0e455521c6be4cc + languageName: node + linkType: hard + "react-router-config@npm:^5.1.1": version: 5.1.1 resolution: "react-router-config@npm:5.1.1" @@ -19170,7 +19158,7 @@ __metadata: languageName: node linkType: hard -"react@npm:18.2.0, react@npm:^18.0.0": +"react@npm:18.2.0": version: 18.2.0 resolution: "react@npm:18.2.0" dependencies: @@ -19179,6 +19167,15 @@ __metadata: languageName: node linkType: hard +"react@npm:^18.0.0": + version: 18.3.1 + resolution: "react@npm:18.3.1" + dependencies: + loose-envify: "npm:^1.1.0" + checksum: 10/261137d3f3993eaa2368a83110466fc0e558bc2c7f7ae7ca52d94f03aac945f45146bd85e5f481044db1758a1dbb57879e2fcdd33924e2dde1bdc550ce73f7bf + languageName: node + linkType: hard + "read-package-json-fast@npm:^3.0.0": version: 3.0.2 resolution: "read-package-json-fast@npm:3.0.2" @@ -20083,12 +20080,12 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.23.0": - version: 0.23.0 - resolution: "scheduler@npm:0.23.0" +"scheduler@npm:^0.23.2": + version: 0.23.2 + resolution: "scheduler@npm:0.23.2" dependencies: loose-envify: "npm:^1.1.0" - checksum: 10/0c4557aa37bafca44ff21dc0ea7c92e2dbcb298bc62eae92b29a39b029134f02fb23917d6ebc8b1fa536b4184934314c20d8864d156a9f6357f3398aaf7bfda8 + checksum: 10/e8d68b89d18d5b028223edf090092846868a765a591944760942b77ea1f69b17235f7e956696efbb62c8130ab90af7e0949bfb8eba7896335507317236966bc9 languageName: node linkType: hard @@ -21409,8 +21406,8 @@ __metadata: linkType: hard "terser@npm:^5.10.0, terser@npm:^5.15.0, terser@npm:^5.15.1, terser@npm:^5.26.0": - version: 5.30.3 - resolution: "terser@npm:5.30.3" + version: 5.30.4 + resolution: "terser@npm:5.30.4" dependencies: "@jridgewell/source-map": "npm:^0.3.3" acorn: "npm:^8.8.2" @@ -21418,7 +21415,7 @@ __metadata: source-map-support: "npm:~0.5.20" bin: terser: bin/terser - checksum: 10/f4ee378065a327c85472f351ac232fa47ec84d4f15df7ec58c044b41e3c063cf11aaedd90dcfe9c7f2a6ef01d4aab23deb61622301170dc77d0a8b6a6a83cf5e + checksum: 10/79459106281fccb2ff4243ba1553e4aa67a71b336bb8c091b131bb26347fcf03791c6abf6870bd17fe4a210256e08910207cf5733c0d6ba840289e67d5aa84d3 languageName: node linkType: hard @@ -21885,9 +21882,9 @@ __metadata: linkType: hard "type-fest@npm:^4.2.0, type-fest@npm:^4.6.0, type-fest@npm:^4.7.1": - version: 4.15.0 - resolution: "type-fest@npm:4.15.0" - checksum: 10/8f897551877daa0df7bb17a21b6acd8a21ac5a0bdb14dbfd353b16013fed99f23c6d9c12a2c7685c8dededb4739ec8bfb120a914330f8b11a478a89758a11acc + version: 4.17.0 + resolution: "type-fest@npm:4.17.0" + checksum: 10/16df8a9d1856f8662cdcf26a7da878285f1371f2090b25666e28744da6013f39986af712a0d8d0ffde155f46cd4872eceeab9a8b0eb6ddd2f345923257f41c36 languageName: node linkType: hard @@ -22982,6 +22979,13 @@ __metadata: languageName: node linkType: hard +"word-wrap@npm:^1.2.5": + version: 1.2.5 + resolution: "word-wrap@npm:1.2.5" + checksum: 10/1ec6f6089f205f83037be10d0c4b34c9183b0b63fca0834a5b3cee55dd321429d73d40bb44c8fc8471b5203d6e8f8275717f49a8ff4b2b0ab41d7e1b563e0854 + languageName: node + linkType: hard + "wordwrap@npm:^1.0.0": version: 1.0.0 resolution: "wordwrap@npm:1.0.0" From 47e047fb0d4041e390c37cda2148b7d0a6f54b09 Mon Sep 17 00:00:00 2001 From: mym0404 Date: Sun, 28 Apr 2024 03:58:04 +0900 Subject: [PATCH 6/6] feat(share): support old arch android --- .../android/src/oldarch/KakaoShareSpec.kt | 51 +------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/packages/share/android/src/oldarch/KakaoShareSpec.kt b/packages/share/android/src/oldarch/KakaoShareSpec.kt index 0e55822..a5c6b53 100644 --- a/packages/share/android/src/oldarch/KakaoShareSpec.kt +++ b/packages/share/android/src/oldarch/KakaoShareSpec.kt @@ -3,60 +3,11 @@ package net.mjstudio.rnkakao.share import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule +import com.facebook.react.bridge.ReadableArray import com.facebook.react.bridge.ReadableMap abstract class KakaoShareSpec internal constructor(context: ReactApplicationContext) : ReactContextBaseJavaModule(context) { - abstract fun shareCustom( - templateId: Double, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - templateArgs: ReadableMap?, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - - abstract fun shareFeedTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - - abstract fun shareListTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - - abstract fun shareLocationTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - - abstract fun shareCommerceTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - - abstract fun shareTextTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - - abstract fun shareCalendarTemplate( - value: ReadableMap, - useWebBrowserIfKakaoTalkNotAvailable: Boolean, - serverCallbackArgs: ReadableMap?, - promise: Promise, - ) - abstract fun shareOrSendMeOrSendFriendOrWhatever( sendType: String, templateType: String,