@react-native-kakao/share 0.3.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,6 +48,8 @@ Pod::Spec.new do |s|
48
48
  sdk_version = $KakaoShareSDKVersion
49
49
  end
50
50
 
51
+ s.dependency 'RNCKakaoCore'
52
+
51
53
  # Kakao dependencies
52
54
  s.dependency 'KakaoSDKShare', sdk_version
53
55
  end
@@ -1,120 +1,124 @@
1
+ apply from: file('./../../core/android/package-json.gradle')
2
+ def Versions = project.ext.RNCKakaoSdkVersions
3
+ def coreProject
4
+ if (findProject(':@react-native-kakao_core')) {
5
+ coreProject = project(':@react-native-kakao_core')
6
+ } else if (findProject(':react-native-kakao_core')) {
7
+ coreProject = project(':react-native-kakao_core')
8
+ } else {
9
+ throw new GradleException('Could not find the react-native-kakao/core package, have you installed it?')
10
+ }
11
+
1
12
  buildscript {
2
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
- def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["KakaoShare_kotlinVersion"]
13
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
14
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["Kakao_kotlinVersion"]
4
15
 
5
- repositories {
6
- google()
7
- mavenCentral()
8
- }
16
+ repositories {
17
+ google()
18
+ mavenCentral()
19
+ }
9
20
 
10
- dependencies {
11
- classpath "com.android.tools.build:gradle:7.2.1"
12
- // noinspection DifferentKotlinGradleVersion
13
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
- }
21
+ dependencies {
22
+ classpath "com.android.tools.build:gradle:7.2.1"
23
+ // noinspection DifferentKotlinGradleVersion
24
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
25
+ }
15
26
  }
16
27
 
17
28
  def isNewArchitectureEnabled() {
18
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
29
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19
30
  }
20
31
 
21
32
  apply plugin: "com.android.library"
22
33
  apply plugin: "kotlin-android"
23
34
 
24
35
  if (isNewArchitectureEnabled()) {
25
- apply plugin: "com.facebook.react"
26
- }
27
-
28
- def getExtOrDefault(name) {
29
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["KakaoShare_" + name]
30
- }
31
-
32
- def getExtOrIntegerDefault(name) {
33
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["KakaoShare_" + name]).toInteger()
36
+ apply plugin: "com.facebook.react"
34
37
  }
35
38
 
36
39
  def supportsNamespace() {
37
- def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
38
- def major = parsed[0].toInteger()
39
- def minor = parsed[1].toInteger()
40
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
41
+ def major = parsed[0].toInteger()
42
+ def minor = parsed[1].toInteger()
40
43
 
41
- // Namespace support was added in 7.3.0
42
- return (major == 7 && minor >= 3) || major >= 8
44
+ // Namespace support was added in 7.3.0
45
+ return (major == 7 && minor >= 3) || major >= 8
43
46
  }
44
47
 
45
48
  android {
46
- if (supportsNamespace()) {
47
- namespace "com.kakaoshare"
48
-
49
- sourceSets {
50
- main {
51
- manifest.srcFile "src/main/AndroidManifestNew.xml"
52
- }
49
+ if (supportsNamespace()) {
50
+ namespace "net.mjstudio.rnkakao.share"
51
+
52
+ sourceSets {
53
+ main {
54
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
55
+ }
56
+ }
53
57
  }
54
- }
55
58
 
56
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
59
+ compileSdkVersion Versions.compileSdk
57
60
 
58
- defaultConfig {
59
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
60
- targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
61
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
61
+ defaultConfig {
62
+ minSdkVersion Versions.minSdk
63
+ targetSdkVersion Versions.targetSdk
64
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
65
+ }
62
66
 
63
- }
67
+ buildFeatures {
68
+ buildConfig true
69
+ }
70
+
71
+ buildTypes {
72
+ release {
73
+ minifyEnabled false
74
+ }
75
+ }
64
76
 
65
- buildFeatures {
66
- buildConfig true
67
- }
77
+ lintOptions {
78
+ disable "GradleCompatible"
79
+ }
68
80
 
69
- buildTypes {
70
- release {
71
- minifyEnabled false
81
+ compileOptions {
82
+ sourceCompatibility JavaVersion.VERSION_1_8
83
+ targetCompatibility JavaVersion.VERSION_1_8
72
84
  }
73
- }
74
-
75
- lintOptions {
76
- disable "GradleCompatible"
77
- }
78
-
79
- compileOptions {
80
- sourceCompatibility JavaVersion.VERSION_1_8
81
- targetCompatibility JavaVersion.VERSION_1_8
82
- }
83
-
84
- sourceSets {
85
- main {
86
- if (isNewArchitectureEnabled()) {
87
- java.srcDirs += [
88
- "src/newarch",
89
- // This is needed to build Kotlin project with NewArch enabled
90
- "${project.buildDir}/generated/source/codegen/java"
91
- ]
92
- } else {
93
- java.srcDirs += ["src/oldarch"]
94
- }
85
+
86
+
87
+ sourceSets {
88
+ main {
89
+ if (isNewArchitectureEnabled()) {
90
+ java.srcDirs += [
91
+ "src/newarch",
92
+ // This is needed to build Kotlin project with NewArch enabled
93
+ "${project.buildDir}/generated/source/codegen/java"
94
+ ]
95
+ } else {
96
+ java.srcDirs += ["src/oldarch"]
97
+ }
98
+ }
95
99
  }
96
- }
97
100
  }
98
101
 
99
102
  repositories {
100
- mavenCentral()
101
- google()
103
+ mavenCentral()
104
+ google()
102
105
  }
103
106
 
104
- def kotlin_version = getExtOrDefault("kotlinVersion")
105
-
106
107
  dependencies {
107
- // For < 0.71, this will be from the local maven repo
108
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
109
- //noinspection GradleDynamicVersion
110
- implementation "com.facebook.react:react-native:+"
111
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
108
+ // For < 0.71, this will be from the local maven repo
109
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
110
+ //noinspection GradleDynamicVersion
111
+ implementation "com.facebook.react:react-native:+"
112
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
113
+
114
+ api coreProject
115
+ implementation "com.kakao.sdk:v2-share:${Versions.share}"
112
116
  }
113
117
 
114
118
  if (isNewArchitectureEnabled()) {
115
- react {
116
- jsRootDir = file("../src/")
117
- libraryName = "KakaoShare"
118
- codegenJavaPackageName = "com.kakaoshare"
119
- }
120
- }
119
+ react {
120
+ jsRootDir = file("../src/")
121
+ libraryName = "RNCKakaoShare"
122
+ codegenJavaPackageName = "net.mjstudio.rnkakao.share"
123
+ }
124
+ }
@@ -1,5 +1 @@
1
- KakaoShare_kotlinVersion=1.7.0
2
- KakaoShare_minSdkVersion=21
3
- KakaoShare_targetSdkVersion=31
4
- KakaoShare_compileSdkVersion=31
5
- KakaoShare_ndkversion=21.4.7075529
1
+ Kakao_kotlinVersion=1.7.0
@@ -1,3 +1,3 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.kakaoshare">
2
+ package="net.mjstudio.rnkakao.share">
3
3
  </manifest>
@@ -0,0 +1,15 @@
1
+ package net.mjstudio.rnkakao.share
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+
5
+ class RNCKakaoShareModule internal constructor(context: ReactApplicationContext) :
6
+ KakaoShareSpec(context) {
7
+
8
+ override fun getName(): String {
9
+ return NAME
10
+ }
11
+
12
+ companion object {
13
+ const val NAME = "RNCKakaoShare"
14
+ }
15
+ }
@@ -1,4 +1,4 @@
1
- package com.kakaoshare
1
+ package net.mjstudio.rnkakao.share
2
2
 
3
3
  import com.facebook.react.TurboReactPackage
4
4
  import com.facebook.react.bridge.ReactApplicationContext
@@ -7,10 +7,10 @@ import com.facebook.react.module.model.ReactModuleInfoProvider
7
7
  import com.facebook.react.module.model.ReactModuleInfo
8
8
  import java.util.HashMap
9
9
 
10
- class KakaoSharePackage : TurboReactPackage() {
10
+ class RNCKakaoSharePackage : TurboReactPackage() {
11
11
  override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12
- return if (name == KakaoShareModule.NAME) {
13
- KakaoShareModule(reactContext)
12
+ return if (name == RNCKakaoShareModule.NAME) {
13
+ RNCKakaoShareModule(reactContext)
14
14
  } else {
15
15
  null
16
16
  }
@@ -20,9 +20,9 @@ class KakaoSharePackage : TurboReactPackage() {
20
20
  return ReactModuleInfoProvider {
21
21
  val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
22
22
  val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
23
- moduleInfos[KakaoShareModule.NAME] = ReactModuleInfo(
24
- KakaoShareModule.NAME,
25
- KakaoShareModule.NAME,
23
+ moduleInfos[RNCKakaoShareModule.NAME] = ReactModuleInfo(
24
+ RNCKakaoShareModule.NAME,
25
+ RNCKakaoShareModule.NAME,
26
26
  false, // canOverrideExistingModule
27
27
  false, // needsEagerInit
28
28
  true, // hasConstants
@@ -0,0 +1,6 @@
1
+ package net.mjstudio.rnkakao.share
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+
5
+ abstract class KakaoShareSpec internal constructor(context: ReactApplicationContext) :
6
+ NativeKakaoShareSpec(context)
@@ -0,0 +1,7 @@
1
+ package net.mjstudio.rnkakao.share
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
5
+
6
+ abstract class KakaoShareSpec internal constructor(context: ReactApplicationContext) :
7
+ ReactContextBaseJavaModule(context)
@@ -1,10 +1,14 @@
1
1
  #import "RNCKakaoShare.h"
2
+ #import "RNCKakaoShare-Swift.h"
2
3
 
3
4
  @implementation RNCKakaoShare
5
+
6
+ - (RNCKakaoShareManager*)manager {
7
+ return [RNCKakaoShareManager shared];
8
+ }
9
+
4
10
  RCT_EXPORT_MODULE()
5
11
 
6
- // Example method
7
- // See // https://reactnative.dev/docs/native-modules-ios
8
12
  RCT_EXPORT_METHOD(multiply
9
13
  : (double)a b
10
14
  : (double)b resolve
@@ -15,10 +19,6 @@ RCT_EXPORT_METHOD(multiply
15
19
  resolve(result);
16
20
  }
17
21
 
18
- - (NSNumber*)add:(double)a b:(double)b {
19
- return @(a + b);
20
- }
21
-
22
22
  // Don't compile this code when we build for the old architecture.
23
23
  #ifdef RCT_NEW_ARCH_ENABLED
24
24
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
@@ -0,0 +1,41 @@
1
+ import Foundation
2
+ import KakaoSDKShare
3
+
4
+ @objc public class RNCKakaoShareManager: NSObject {
5
+ @objc public static let shared = RNCKakaoShareManager()
6
+
7
+ @objc public func go() {
8
+ // // 카카오톡 설치여부 확인
9
+ // if ShareApi.isKakaoTalkSharingAvailable() {
10
+ // // 카카오톡으로 카카오톡 공유 가능
11
+ // ShareApi.shared.shareCustom(
12
+ // templateId: templateId,
13
+ // templateArgs: ["title": "제목입니다.", "description": "설명입니다."]
14
+ // ) { sharingResult, error in
15
+ // if let error {
16
+ // print(error)
17
+ // } else {
18
+ // print("shareCustom() success.")
19
+ // if let sharingResult {
20
+ // UIApplication.shared.open(sharingResult.url, options: [:], completionHandler: nil)
21
+ // }
22
+ // }
23
+ // }
24
+ // } else {
25
+ // // 카카오톡 미설치: 웹 공유 사용 권장
26
+ // // Custom WebView 또는 디폴트 브라우져 사용 가능
27
+ // // 웹 공유 예시 코드
28
+ // if let url = ShareApi.shared.makeCustomUrl(
29
+ // templateId: templateId,
30
+ // templateArgs: ["title": "제목입니다.", "description": "설명입니다."]
31
+ // ) {
32
+ // safariViewController = SFSafariViewController(url: url)
33
+ // safariViewController?.modalTransitionStyle = .crossDissolve
34
+ // safariViewController?.modalPresentationStyle = .overCurrentContext
35
+ // present(safariViewController!, animated: true) {
36
+ // print("웹 present success")
37
+ // }
38
+ // }
39
+ // }
40
+ }
41
+ }
@@ -1,28 +1,27 @@
1
+ // import { NativeModules, Platform } from 'react-native';
2
+ //
3
+ // const LINKING_ERROR =
4
+ // `The package '@react-native-kakao/share' doesn't seem to be linked. Make sure: \n\n` +
5
+ // Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ // '- You rebuilt the app after installing the package\n' +
7
+ // '- You are not using Expo Go\n';
8
+ //
9
+ // // @ts-expect-error
10
+ // const isTurboModuleEnabled = global.__turboModuleProxy != null;
11
+ //
12
+ // const Module = isTurboModuleEnabled
13
+ // ? require('./spec/NativeKakaoShare').default
14
+ // : NativeModules.KakaoShare;
15
+ //
16
+ // const Native = Module
17
+ // ? Module
18
+ // : new Proxy(
19
+ // {},
20
+ // {
21
+ // get() {
22
+ // throw new Error(LINKING_ERROR);
23
+ // },
24
+ // }
25
+ // );
1
26
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.add = add;
7
- exports.multiply = multiply;
8
- var _reactNative = require("react-native");
9
- const LINKING_ERROR = `The package '@react-native-kakao/share' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
10
- ios: "- You have run 'pod install'\n",
11
- default: ''
12
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
13
-
14
- // @ts-expect-error
15
- const isTurboModuleEnabled = global.__turboModuleProxy != null;
16
- const Module = isTurboModuleEnabled ? require('./spec/NativeKakaoShare').default : _reactNative.NativeModules.KakaoShare;
17
- const Native = Module ? Module : new Proxy({}, {
18
- get() {
19
- throw new Error(LINKING_ERROR);
20
- }
21
- });
22
- function multiply(a, b) {
23
- return Native.multiply(a, b);
24
- }
25
- function add(a, b) {
26
- return Native.add(a, b);
27
- }
28
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","Module","NativeModules","KakaoShare","Native","Proxy","get","Error","multiply","a","b","add"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,oFAAmF,GACpFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,MAAM,GAAGH,oBAAoB,GAC/BN,OAAO,CAAC,yBAAyB,CAAC,CAACK,OAAO,GAC1CK,0BAAa,CAACC,UAAU;AAE5B,MAAMC,MAAM,GAAGH,MAAM,GACjBA,MAAM,GACN,IAAII,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACd,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,SAASe,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAmB;EAC9D,OAAON,MAAM,CAACI,QAAQ,CAACC,CAAC,EAAEC,CAAC,CAAC;AAC9B;AAEO,SAASC,GAAGA,CAACF,CAAS,EAAEC,CAAS,EAAU;EAChD,OAAON,MAAM,CAACO,GAAG,CAACF,CAAC,EAAEC,CAAC,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["spec/NativeKakaoShare.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQpCC,gCAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["spec/NativeKakaoShare.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAIpCC,gCAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
@@ -1,21 +1,26 @@
1
- import { NativeModules, Platform } from 'react-native';
2
- const LINKING_ERROR = `The package '@react-native-kakao/share' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
- ios: "- You have run 'pod install'\n",
4
- default: ''
5
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
6
-
7
- // @ts-expect-error
8
- const isTurboModuleEnabled = global.__turboModuleProxy != null;
9
- const Module = isTurboModuleEnabled ? require('./spec/NativeKakaoShare').default : NativeModules.KakaoShare;
10
- const Native = Module ? Module : new Proxy({}, {
11
- get() {
12
- throw new Error(LINKING_ERROR);
13
- }
14
- });
15
- export function multiply(a, b) {
16
- return Native.multiply(a, b);
17
- }
18
- export function add(a, b) {
19
- return Native.add(a, b);
20
- }
1
+ // import { NativeModules, Platform } from 'react-native';
2
+ //
3
+ // const LINKING_ERROR =
4
+ // `The package '@react-native-kakao/share' doesn't seem to be linked. Make sure: \n\n` +
5
+ // Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ // '- You rebuilt the app after installing the package\n' +
7
+ // '- You are not using Expo Go\n';
8
+ //
9
+ // // @ts-expect-error
10
+ // const isTurboModuleEnabled = global.__turboModuleProxy != null;
11
+ //
12
+ // const Module = isTurboModuleEnabled
13
+ // ? require('./spec/NativeKakaoShare').default
14
+ // : NativeModules.KakaoShare;
15
+ //
16
+ // const Native = Module
17
+ // ? Module
18
+ // : new Proxy(
19
+ // {},
20
+ // {
21
+ // get() {
22
+ // throw new Error(LINKING_ERROR);
23
+ // },
24
+ // }
25
+ // );
21
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","Module","require","KakaoShare","Native","Proxy","get","Error","multiply","a","b","add"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,oFAAmF,GACpFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,MAAM,GAAGH,oBAAoB,GAC/BI,OAAO,CAAC,yBAAyB,CAAC,CAACL,OAAO,GAC1CL,aAAa,CAACW,UAAU;AAE5B,MAAMC,MAAM,GAAGH,MAAM,GACjBA,MAAM,GACN,IAAII,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACb,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,SAASc,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAmB;EAC9D,OAAON,MAAM,CAACI,QAAQ,CAACC,CAAC,EAAEC,CAAC,CAAC;AAC9B;AAEA,OAAO,SAASC,GAAGA,CAACF,CAAS,EAAEC,CAAS,EAAU;EAChD,OAAON,MAAM,CAACO,GAAG,CAACF,CAAC,EAAEC,CAAC,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["spec/NativeKakaoShare.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAQlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["spec/NativeKakaoShare.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAIlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
@@ -1,3 +1 @@
1
- export declare function multiply(a: number, b: number): Promise<number>;
2
- export declare function add(a: number, b: number): number;
3
1
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":""}
@@ -1,8 +1,5 @@
1
1
  import type { TurboModule } from 'react-native';
2
- import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
3
2
  export interface Spec extends TurboModule {
4
- multiply(a: number, b: number): Promise<number>;
5
- add(a: Int32, b: Int32): Int32;
6
3
  }
7
4
  declare const _default: Spec;
8
5
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeKakaoShare.d.ts","sourceRoot":"","sources":["../../../../src/spec/NativeKakaoShare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAEvE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAChC;;AAED,wBAAuE"}
1
+ {"version":3,"file":"NativeKakaoShare.d.ts","sourceRoot":"","sources":["../../../../src/spec/NativeKakaoShare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;CAAG;;AAE5C,wBAAuE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-native-kakao/share",
3
3
  "description": "React Native Kakao Share SDK",
4
- "version": "0.3.0",
4
+ "version": "0.5.1",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/src/index.d.ts",
@@ -98,7 +98,10 @@
98
98
  "codegenConfig": {
99
99
  "name": "RNCKakaoShareSpec",
100
100
  "type": "all",
101
- "jsSrcsDir": "src"
101
+ "jsSrcsDir": "src",
102
+ "android": {
103
+ "javaPackageName": "net.mjstudio.rnkakao.share"
104
+ }
102
105
  },
103
- "gitHead": "36b16e0ebbd4b107e6f91b230bf75f9bb1ac3637"
106
+ "gitHead": "fdde4feb0d2c64dda2c30077a3e3e68fdab739c7"
104
107
  }
package/src/index.tsx CHANGED
@@ -1,33 +1,25 @@
1
- import { NativeModules, Platform } from 'react-native';
2
-
3
- const LINKING_ERROR =
4
- `The package '@react-native-kakao/share' doesn't seem to be linked. Make sure: \n\n` +
5
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
- '- You rebuilt the app after installing the package\n' +
7
- '- You are not using Expo Go\n';
8
-
9
- // @ts-expect-error
10
- const isTurboModuleEnabled = global.__turboModuleProxy != null;
11
-
12
- const Module = isTurboModuleEnabled
13
- ? require('./spec/NativeKakaoShare').default
14
- : NativeModules.KakaoShare;
15
-
16
- const Native = Module
17
- ? Module
18
- : new Proxy(
19
- {},
20
- {
21
- get() {
22
- throw new Error(LINKING_ERROR);
23
- },
24
- }
25
- );
26
-
27
- export function multiply(a: number, b: number): Promise<number> {
28
- return Native.multiply(a, b);
29
- }
30
-
31
- export function add(a: number, b: number): number {
32
- return Native.add(a, b);
33
- }
1
+ // import { NativeModules, Platform } from 'react-native';
2
+ //
3
+ // const LINKING_ERROR =
4
+ // `The package '@react-native-kakao/share' doesn't seem to be linked. Make sure: \n\n` +
5
+ // Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ // '- You rebuilt the app after installing the package\n' +
7
+ // '- You are not using Expo Go\n';
8
+ //
9
+ // // @ts-expect-error
10
+ // const isTurboModuleEnabled = global.__turboModuleProxy != null;
11
+ //
12
+ // const Module = isTurboModuleEnabled
13
+ // ? require('./spec/NativeKakaoShare').default
14
+ // : NativeModules.KakaoShare;
15
+ //
16
+ // const Native = Module
17
+ // ? Module
18
+ // : new Proxy(
19
+ // {},
20
+ // {
21
+ // get() {
22
+ // throw new Error(LINKING_ERROR);
23
+ // },
24
+ // }
25
+ // );
@@ -1,10 +1,6 @@
1
1
  import type { TurboModule } from 'react-native';
2
2
  import { TurboModuleRegistry } from 'react-native';
3
- import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
4
3
 
5
- export interface Spec extends TurboModule {
6
- multiply(a: number, b: number): Promise<number>;
7
- add(a: Int32, b: Int32): Int32;
8
- }
4
+ export interface Spec extends TurboModule {}
9
5
 
10
6
  export default TurboModuleRegistry.getEnforcing<Spec>('RNCKakaoShare');
@@ -1,24 +0,0 @@
1
- package com.kakaoshare
2
-
3
- import com.facebook.react.bridge.ReactApplicationContext
4
- import com.facebook.react.bridge.ReactMethod
5
- import com.facebook.react.bridge.Promise
6
-
7
- class KakaoShareModule internal constructor(context: ReactApplicationContext) :
8
- KakaoShareSpec(context) {
9
-
10
- override fun getName(): String {
11
- return NAME
12
- }
13
-
14
- // Example method
15
- // See https://reactnative.dev/docs/native-modules-android
16
- @ReactMethod
17
- override fun multiply(a: Double, b: Double, promise: Promise) {
18
- promise.resolve(a * b)
19
- }
20
-
21
- companion object {
22
- const val NAME = "KakaoShare"
23
- }
24
- }