Skip to content

Commit 3234a67

Browse files
authored
0.9.0 (#127)
* [Feature] v11 지원 및 다크모드 지원 (#115) * [Feature] v11 지원 및 다크모드 지원 * [Fix] 리뷰반영 * [Fix] isAppearance 삭제 후 toAppearance에 합침 * 0.8.1 (#118) * Android - 11.1.0 and ChannelButtonIcon * iOS - ChannelButtonIcon * 0.8.1 * [Fix] 리뷰반영 * 0.8.2 (#120) * 0.8.3 (#122) * 0.8.3 (#123) (#125) * 0.8.3 (#122) * 0.9.0 (#126)
1 parent 876ae29 commit 3234a67

File tree

8 files changed

+64
-30
lines changed

8 files changed

+64
-30
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.9.0
2+
3+
## Update
4+
* Updated channeltalk plugin v12
5+
* We introduce powerful feature to help your chat: Workflow. Workflow will completely replace support bots.
6+
* Removed ChannelIO.openSupportBot() in favor of new ChannelIO.openWorkflow().
7+
* Added new public API: ChannelIO.hidePopup()
8+
19
# 0.8.3
210

311
## Update

RNChannelIO.podspec

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Pod::Spec.new do |s|
22
s.name = "RNChannelIO"
3-
s.version = "0.2.2"
3+
s.version = "0.3.0"
44
s.summary = "RNChannelIO"
55
s.description = "channel plugin for react native"
66
s.homepage = "https://channel.io"
77
s.license = { :type => "SDK", :file => "LICENSE" }
88
s.author = { 'Channel Corp.' => '[email protected]', 'Channel Corp. iOS' => '[email protected]' }
9-
s.platform = :ios, "11.0"
9+
s.platform = :ios, "12.0"
1010
s.source = { :git => "https://github.com/zoyi/react-native-channel-io.git" }
1111
s.source_files = "ios/**/*.{h,m}"
1212
s.requires_arc = true
1313
s.swift_version = '5.0'
1414

15-
s.ios.deployment_target = '11.0'
15+
s.ios.deployment_target = '12.0'
1616

1717
s.dependency "React"
18-
s.dependency "ChannelIOSDK", '~> 11.2'
18+
s.dependency "ChannelIOSDK", '~> 12'
1919
end

android/build.gradle

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ buildscript {
1717
}
1818

1919
dependencies {
20-
classpath 'com.android.tools.build:gradle:3.1.3'
20+
classpath 'com.android.tools.build:gradle:3.2.0'
2121
}
2222
}
2323

2424
apply plugin: 'com.android.library'
2525

2626
android {
27-
compileSdkVersion 33
28-
buildToolsVersion "31.0.0"
29-
3027
defaultConfig {
31-
minSdkVersion 15
32-
targetSdkVersion 33
28+
compileSdk 34
29+
minSdkVersion 23
30+
targetSdkVersion 34
3331
versionCode 1
3432
// get version name from package.json version
3533
versionName computeVersionName()
@@ -51,9 +49,13 @@ repositories {
5149
url 'https://maven.google.com/'
5250
name 'Google'
5351
}
52+
maven {
53+
url 'https://maven.channel.io/maven2'
54+
name 'ChannelTalk'
55+
}
5456
}
5557

5658
dependencies {
5759
implementation 'com.facebook.react:react-native'
58-
api 'io.channel:plugin-android:11.6.3'
60+
api 'io.channel:plugin-android:12.0.0'
5961
}

android/src/main/java/com/zoyi/channel/rn/RNChannelIO.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public void openChat(String chatId, String message) {
108108
}
109109

110110
@ReactMethod
111-
public void openSupportBot(String supportBotId, String message) {
112-
ChannelIO.openSupportBot(getCurrentActivity(), supportBotId, message);
111+
public void openWorkflow(String workflowId) {
112+
ChannelIO.openWorkflow(getCurrentActivity(), workflowId);
113113
}
114114

115115
@ReactMethod
@@ -326,8 +326,9 @@ private Intent reconstructHostAppIntent(String userId, String chatId) {
326326
}
327327

328328
@ReactMethod
329-
public void setPage(@Nullable String page) {
330-
ChannelIO.setPage(page);
329+
public void setPage(@Nullable String page, @Nullable ReadableMap profile) {
330+
Map<String, Object> profileMap = profile == null ? null : profile.toHashMap();
331+
ChannelIO.setPage(page, profileMap);
331332
}
332333

333334
@ReactMethod
@@ -342,4 +343,9 @@ public void setAppearance(@Nullable String appearance) {
342343
ChannelIO.setAppearance(appearanceValue);
343344
}
344345
}
346+
347+
@ReactMethod
348+
public void hidePopup() {
349+
ChannelIO.hidePopup();
350+
}
345351
}

index.js

+19-9
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,13 @@ export const ChannelIO = {
135135
},
136136

137137
/**
138-
* Opens User chat to run a specific Support bot.
139-
* @param {String} supportBotId This is the support bot's ID. If supportBotId is invalid or nil, the chat room is closed.
140-
* @param {String} message This message will be displayed in the input field after completing the support bot operation.
138+
* Opens a user chat and starts the specified workflow.
139+
* - If a corresponded workflow with the provided workflowId is exists, it will be executed. if workflowId is invalid, an error page is displayed.
140+
* - If you don't pass workflowId, no action is taken.
141+
* @param {String} workflowId The ID of workflow to start with. An error page will be shown if such workflow does not exist.
141142
*/
142-
openSupportBot: (supportBotId, message) => {
143-
ChannelModule.openSupportBot(supportBotId, message);
143+
openWorkflow: (workflowId) => {
144+
ChannelModule.openWorkflow(workflowId);
144145
},
145146

146147
/**
@@ -231,13 +232,17 @@ export const ChannelIO = {
231232
openStoredPushNotification: () => ChannelModule.openStoredPushNotification(),
232233

233234
/**
234-
* Set page to be used instead of recent activity name or view controller.
235+
* Sets the name of the screen along with user chat profile. If track is called before setPage, the event will not reflect the page information.
236+
* @param {String} page This is the screen name when track is called. When calling .track(), the event's page is set to null.
237+
* @param {String} profile The user chat profile value.
238+
* - When nil is assigned to a specific field within the profile object, only the value of that field is cleared.
239+
* - The user chat profile value is applied when a user chat is created.
235240
*/
236-
setPage: (page) => {
241+
setPage: (page, profile) => {
237242
if (typeof page === "string") {
238-
ChannelModule.setPage(page)
243+
ChannelModule.setPage(page, profile)
239244
} else if (page === null || page === undefined) {
240-
ChannelModule.setPage(null)
245+
ChannelModule.setPage(null, profile)
241246
} else {
242247
console.error('ChannelIO', '"page" must be type of "string", null or undefined.')
243248
}
@@ -260,6 +265,11 @@ export const ChannelIO = {
260265
}
261266
},
262267

268+
/**
269+
* Hides the Channel popup on the global screen.
270+
*/
271+
hidePopup: () => ChannelModule.hidePopup(),
272+
263273
/**
264274
* @deprecated
265275
* Event listener that triggers when badge count has been changed

ios/RNChannelIO.m

+11-3
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ - (NSDictionary *)constantsToExport {
209209
[ChannelIO openChatWith:chatId message:payload];
210210
}
211211

212-
RCT_EXPORT_METHOD(openSupportBot:(NSString *)supportBotId message:(NSString *)message) {
213-
[ChannelIO openSupportBotWith:supportBotId message:message];
212+
RCT_EXPORT_METHOD(openWorkflow:(NSString *)workflowId) {
213+
[ChannelIO openWorkflowWith:workflowId];
214214
}
215215

216216
RCT_EXPORT_METHOD(track:(NSString *)name eventProperty:(NSDictionary *)properties) {
@@ -377,7 +377,11 @@ - (NSDictionary *)constantsToExport {
377377
}
378378

379379
RCT_EXPORT_METHOD(setPage:(NSString *)page) {
380-
[ChannelIO setPage:page];
380+
[ChannelIO setPage:page profile:[[NSDictionary alloc] init]];
381+
}
382+
383+
RCT_EXPORT_METHOD(setPage:(NSString *)page profile:(NSDictionary<NSString *, id> *)profile) {
384+
[ChannelIO setPage:page profile:profile];
381385
}
382386

383387
RCT_EXPORT_METHOD(resetPage) {
@@ -396,6 +400,10 @@ - (NSDictionary *)constantsToExport {
396400
}
397401
}
398402

403+
RCT_EXPORT_METHOD(hidePopup) {
404+
[ChannelIO hidePopup];
405+
}
406+
399407
#pragma mark ChannelPluginDelegate
400408
- (void)onBadgeChangedWithUnread:(NSInteger)unread alert:(NSInteger)alert {
401409
if (hasListeners) {

ios/RNChannelIO.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
164164
GCC_WARN_UNUSED_FUNCTION = YES;
165165
GCC_WARN_UNUSED_VARIABLE = YES;
166-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
166+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
167167
MTL_ENABLE_DEBUG_INFO = YES;
168168
ONLY_ACTIVE_ARCH = YES;
169169
SDKROOT = iphoneos;
@@ -200,7 +200,7 @@
200200
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
201201
GCC_WARN_UNUSED_FUNCTION = YES;
202202
GCC_WARN_UNUSED_VARIABLE = YES;
203-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
203+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
204204
MTL_ENABLE_DEBUG_INFO = NO;
205205
SDKROOT = iphoneos;
206206
VALIDATE_PRODUCT = YES;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-channel-plugin",
3-
"version": "0.8.3",
3+
"version": "0.9.0",
44
"description": "react native module for channel io",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)