@react-native-kakao/share 1.5.0 → 1.5.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 mym0404
3
+ Copyright (c) 2024 MJ Studio
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
6
6
  in the Software without restriction, including without limitation the rights
@@ -10,6 +10,7 @@ import com.kakao.sdk.share.ShareClient
10
10
  import com.kakao.sdk.share.WebSharerClient
11
11
  import com.kakao.sdk.share.model.SharingResult
12
12
  import com.kakao.sdk.template.model.DefaultTemplate
13
+ import net.mjstudio.rnkakao.core.util.RNCKakaoUnknownException
13
14
  import net.mjstudio.rnkakao.core.util.onMain
14
15
  import net.mjstudio.rnkakao.core.util.rejectWith
15
16
  import net.mjstudio.rnkakao.core.util.toStringMap
@@ -184,7 +185,7 @@ class RNCKakaoShareModule internal constructor(context: ReactApplicationContext)
184
185
  )
185
186
  } else {
186
187
  run {
187
- promise.rejectWith("one of templateId or template shouldn't be null")
188
+ promise.rejectWith(RNCKakaoUnknownException("one of templateId or template shouldn't be null"))
188
189
  return
189
190
  }
190
191
  }
@@ -201,9 +202,9 @@ class RNCKakaoShareModule internal constructor(context: ReactApplicationContext)
201
202
  } catch (_: ActivityNotFoundException) {
202
203
  }
203
204
 
204
- promise.rejectWith("web url open failed $sharerUrl")
205
+ promise.rejectWith(RNCKakaoUnknownException("web url open failed $sharerUrl"))
205
206
  } else {
206
- promise.rejectWith("kakaotalk not available")
207
+ promise.rejectWith(RNCKakaoUnknownException("kakaotalk not available"))
207
208
  }
208
209
  }
209
210
 
@@ -67,11 +67,14 @@ import SafariServices
67
67
  if success {
68
68
  resolve(42)
69
69
  } else {
70
- RNCKakaoUtil.reject(reject, "sharingResult url open failed \(sharingResult.url)")
70
+ RNCKakaoUtil.reject(
71
+ reject,
72
+ RNCKakaoError.unknown("sharingResult url open failed \(sharingResult.url)")
73
+ )
71
74
  }
72
75
  }
73
76
  } else {
74
- RNCKakaoUtil.reject(reject, "sharingResult url not found")
77
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "sharingResult"))
75
78
  }
76
79
  }
77
80
 
@@ -91,7 +94,10 @@ import SafariServices
91
94
  RNCKakaoUtil.reject(reject, error)
92
95
  }
93
96
  } else {
94
- RNCKakaoUtil.reject(reject, "templateId or defaultTemplate and templateClazz not passed")
97
+ RNCKakaoUtil.reject(
98
+ reject,
99
+ RNCKakaoError.unknown("templateId or defaultTemplate and templateType not passed")
100
+ )
95
101
  }
96
102
  } else if useWebBrowserIfKakaoTalkNotAvailable {
97
103
  if let templateId {
@@ -107,11 +113,14 @@ import SafariServices
107
113
  if success {
108
114
  resolve(42)
109
115
  } else {
110
- RNCKakaoUtil.reject(reject, "SFSafariViewController open failed")
116
+ RNCKakaoUtil.reject(
117
+ reject,
118
+ RNCKakaoError.unknown("SFSafariViewController open failed")
119
+ )
111
120
  }
112
121
  }
113
122
  } else {
114
- RNCKakaoUtil.reject(reject, "makeCustomUrl failed")
123
+ RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("makeCustomUrl failed"))
115
124
  }
116
125
  } else if var defaultTemplate, let templateType {
117
126
  do {
@@ -125,20 +134,26 @@ import SafariServices
125
134
  if success {
126
135
  resolve(42)
127
136
  } else {
128
- RNCKakaoUtil.reject(reject, "SFSafariViewController open failed")
137
+ RNCKakaoUtil.reject(
138
+ reject,
139
+ RNCKakaoError.unknown("SFSafariViewController open failed")
140
+ )
129
141
  }
130
142
  }
131
143
  } else {
132
- RNCKakaoUtil.reject(reject, "makeDefaultUrl failed")
144
+ RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("makeDefaultUrl failed"))
133
145
  }
134
146
  } catch {
135
147
  RNCKakaoUtil.reject(reject, error)
136
148
  }
137
149
  } else {
138
- RNCKakaoUtil.reject(reject, "templateId or defaultTemplate and templateClazz not passed")
150
+ RNCKakaoUtil.reject(
151
+ reject,
152
+ RNCKakaoError.unknown("templateId or defaultTemplate and templateType not passed")
153
+ )
139
154
  }
140
155
  } else {
141
- RNCKakaoUtil.reject(reject, "kakaotalk not available")
156
+ RNCKakaoUtil.reject(reject, RNCKakaoError.unknown("kakaotalk not available"))
142
157
  }
143
158
  }
144
159
 
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": "1.5.0",
4
+ "version": "1.5.2",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/src/index.d.ts",
@@ -45,7 +45,10 @@
45
45
  "javascript",
46
46
  "react",
47
47
  "expo",
48
- "kakao-share"
48
+ "kakao-share",
49
+ "kakao-message",
50
+ "kakao-message-template",
51
+ "kakaotalk"
49
52
  ],
50
53
  "repository": {
51
54
  "type": "git",
@@ -58,7 +61,7 @@
58
61
  "access": "public"
59
62
  },
60
63
  "devDependencies": {
61
- "@react-native-kakao/core": "1.5.0",
64
+ "@react-native-kakao/core": "1.5.2",
62
65
  "@types/jest": "^29.5.5",
63
66
  "@types/react": "^18.2.44",
64
67
  "del-cli": "^5.1.0",
@@ -69,7 +72,7 @@
69
72
  "typescript": "5.1.6"
70
73
  },
71
74
  "peerDependencies": {
72
- "@react-native-kakao/core": "1.5.0",
75
+ "@react-native-kakao/core": "1.5.2",
73
76
  "react": "*",
74
77
  "react-native": "*"
75
78
  },
@@ -105,5 +108,5 @@
105
108
  "javaPackageName": "net.mjstudio.rnkakao.share"
106
109
  }
107
110
  },
108
- "gitHead": "ba7c3f3187831f8576c08cc9346d38fbf696049f"
111
+ "gitHead": "d2e36f7ac4fe2996320418ffb3020bd40bf4b73d"
109
112
  }