@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.
- package/RNCKakaoShare.podspec +2 -0
- package/android/build.gradle +88 -84
- package/android/gradle.properties +1 -5
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/net/mjstudio/rnkakao/share/RNCKakaoShareModule.kt +15 -0
- package/android/src/main/java/{com/kakaoshare/KakaoSharePackage.kt → net/mjstudio/rnkakao/share/RNCKakaoSharePackage.kt} +7 -7
- package/android/src/newarch/KakaoShareSpec.kt +6 -0
- package/android/src/oldarch/KakaoShareSpec.kt +7 -0
- package/ios/RNCKakaoShare.mm +6 -6
- package/ios/RNCKakaoShareManager.swift +41 -0
- package/lib/commonjs/index.js +25 -26
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/spec/NativeKakaoShare.js.map +1 -1
- package/lib/module/index.js +25 -20
- package/lib/module/index.js.map +1 -1
- package/lib/module/spec/NativeKakaoShare.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/spec/NativeKakaoShare.d.ts +0 -3
- package/lib/typescript/src/spec/NativeKakaoShare.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/index.tsx +25 -33
- package/src/spec/NativeKakaoShare.ts +1 -5
- package/android/src/main/java/com/kakaoshare/KakaoShareModule.kt +0 -24
package/RNCKakaoShare.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
repositories {
|
|
17
|
+
google()
|
|
18
|
+
mavenCentral()
|
|
19
|
+
}
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
59
|
+
compileSdkVersion Versions.compileSdk
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
lintOptions {
|
|
78
|
+
disable "GradleCompatible"
|
|
79
|
+
}
|
|
68
80
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
compileOptions {
|
|
82
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
83
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
72
84
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
101
|
-
|
|
103
|
+
mavenCentral()
|
|
104
|
+
google()
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
105
|
-
|
|
106
107
|
dependencies {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
119
|
+
react {
|
|
120
|
+
jsRootDir = file("../src/")
|
|
121
|
+
libraryName = "RNCKakaoShare"
|
|
122
|
+
codegenJavaPackageName = "net.mjstudio.rnkakao.share"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -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
|
|
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
|
|
10
|
+
class RNCKakaoSharePackage : TurboReactPackage() {
|
|
11
11
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
|
-
return if (name ==
|
|
13
|
-
|
|
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[
|
|
24
|
-
|
|
25
|
-
|
|
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,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)
|
package/ios/RNCKakaoShare.mm
CHANGED
|
@@ -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
|
+
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -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":[
|
|
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,
|
|
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":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
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;
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"
|
|
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;
|
|
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.
|
|
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": "
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// @ts-expect-error
|
|
10
|
-
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
11
|
-
|
|
12
|
-
const Module = isTurboModuleEnabled
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const Native = Module
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
}
|