Skip to content

Commit 63f4469

Browse files
authored
0.6.0
0.6.0
2 parents b693c76 + 878cbaa commit 63f4469

File tree

6 files changed

+43
-2
lines changed

6 files changed

+43
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.6.0
2+
3+
## Updates
4+
* Added `setPage`, `resetPage` method
5+
16
# 0.5.3
27

38
## Bug Fixes

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ repositories {
5555

5656
dependencies {
5757
implementation 'com.facebook.react:react-native:+'
58-
api 'com.zoyi.channel:plugin-android:8.1.1'
58+
api 'io.channel:plugin-android:8.4.0'
5959
}

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

+10
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,14 @@ public void handleUrlClicked(@Nullable String url) {
258258
IntentUtils.setUrl(activity, url).startActivity();
259259
}
260260
}
261+
262+
@ReactMethod
263+
public void setPage(@Nullable String page) {
264+
ChannelIO.setPage(page);
265+
}
266+
267+
@ReactMethod
268+
public void resetPage() {
269+
ChannelIO.resetPage();
270+
}
261271
}

index.js

+18
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,24 @@ export const ChannelIO = {
221221
*/
222222
openStoredPushNotification: () => ChannelModule.openStoredPushNotification(),
223223

224+
/**
225+
* Set page to be used instead of recent activity name or view controller.
226+
*/
227+
setPage: (page) => {
228+
if (typeof page === "string") {
229+
ChannelModule.setPage(page)
230+
} else if (typeof page === null || page === undefined) {
231+
ChannelModule.setPage(null)
232+
} else {
233+
console.error('ChannelIO', '"page" must be type of "string", null or undefined.')
234+
}
235+
},
236+
237+
/**
238+
* Reset page data customized by developer.
239+
*/
240+
resetPage: () => ChannelModule.resetPage(),
241+
224242
/**
225243
* @deprecated
226244
* Event listener that triggers when badge count has been changed

ios/RNChannelIO.m

+8
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ - (NSDictionary *)constantsToExport {
360360
[CrossPlatformUtils openBrowserWithUrl:url];
361361
}
362362

363+
RCT_EXPORT_METHOD(setPage:(NSString *)page) {
364+
[ChannelIO setPage:page];
365+
}
366+
367+
RCT_EXPORT_METHOD(resetPage) {
368+
[ChannelIO resetPage];
369+
}
370+
363371
#pragma mark ChannelPluginDelegate
364372
- (void)onBadgeChangedWithCount:(NSInteger)count {
365373
if (hasListeners) {

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.5.3",
3+
"version": "0.6.0",
44
"description": "react native module for channel io",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)