File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed
src/main/java/com/zoyi/channel/rn Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -55,5 +55,5 @@ repositories {
5555
5656dependencies {
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}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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) {
You can’t perform that action at this time.
0 commit comments