Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mulitple collapsed notifications don't pass attributes to app.js when tapped #22

Open
falquaddoomi opened this issue Nov 23, 2017 · 4 comments

Comments

@falquaddoomi
Copy link
Collaborator

Android occasionally collapses multiple consecutive notifications for the same app into a "bundled" notification. This bundle can be opened by pulling down on its entry in the notification list, revealing each notification.

Tapping a single notification or one of the entries in a bundle after expanding it works as expected, i.e. it passes along the attributes associated with that notification to the app, which allows it to display the correct screen (in our case, the Notify Log screen, since we only have one type of notification currently). In contrast, tapping the bundle of notifications simply launches the app without any of the per-notification metadata (which makes sense, since it would have to arbitrarily choose one notification to pass along, or perhaps an array of them...)

@falquaddoomi
Copy link
Collaborator Author

Example output of pressing a single notification's entry:

11-23 15:42:49.493 23611 23651 I ReactNativeJS: handleNotification() called: (tray?: 1, local?: true)
11-23 15:42:49.499 23611 23651 I ReactNativeJS: 'payload: ', { fcm: { action: 'android.intent.action.VIEW' },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   variant_id: 54795,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   show_in_foreground: true,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   click_action: 'fcm.ACTION.HELLO',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   opened_from_tray: 1,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   priority: 'high',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   variant_count: 1,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   id: '1511444890325',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   ACTIVITY_PARAMS_BUNDLE:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:    { animationType: 'none',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:      animateShow: false,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:      sideMenu:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:       { left:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:          { screenInstanceID: 'screenInstanceID4',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            screenId: 'brca.SideMenu',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            navigatorID: 'navigatorID3_nav',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            navigationParams:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:             { screenInstanceID: 'screenInstanceID4',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:               navigatorID: 'navigatorID3_nav',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:               navigatorEventID: 'screenInstanceID4_events' },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            navigatorEventID: 'screenInstanceID4_events' } },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:      screen:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:       { navigatorEventID: 'screenInstanceID2_events',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         navigatorID: 'navigatorID1_nav',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         screen: 'brca.HomeScreen',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         screenId: 'brca.HomeScreen',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         title: 'Home',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         screenInstanceID: 'screenInstanceID2',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         styleParams:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:          { drawBelowTopBar: true,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            drawScreenAboveBottomTabs: true,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            expendCollapsingToolBarOnTopTabChange: true },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         navigationParams:
11-23 15:42:49.499 23611 23651 I ReactNativeJS:          { screenInstanceID: 'screenInstanceID2',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            navigatorID: 'navigatorID1_nav',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:            navigatorEventID: 'screenInstanceID2_events' },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         navigatorButtons: { leftButtons: { '0': { id: 'sideMenu' } } },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         navigatorStyle: {},
11-23 15:42:49.499 23611 23651 I ReactNativeJS:         leftButton: { id: 'sideMenu' } },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:      drawer: { left: { screen: 'brca.SideMenu' } } },
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   animationType: 'none',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   body: 'The clinical significance of c.956A>C has changed to \'Likely benign\'',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   local_notification: true,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   icon: 'ic_stat_brca_notify',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   local: true,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   announcement: true,
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   title: '(v281) c.956A>C has changed significance',
11-23 15:42:49.499 23611 23651 I ReactNativeJS:   finish: [Function: finish] }

@falquaddoomi
Copy link
Collaborator Author

Example of pressing a bundled set of notifications:

11-23 15:42:41.324 22507 23550 I ReactNativeJS: handleNotification() called: (tray?: 1, local?: undefined)
11-23 15:42:41.333 22507 23550 I ReactNativeJS: 'payload: ', { opened_from_tray: 1,
11-23 15:42:41.333 22507 23550 I ReactNativeJS:   fcm: { action: 'android.intent.action.VIEW' },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:   animationType: 'none',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:   ACTIVITY_PARAMS_BUNDLE:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:    { animationType: 'none',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:      animateShow: false,
11-23 15:42:41.333 22507 23550 I ReactNativeJS:      sideMenu:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:       { left:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:          { screenInstanceID: 'screenInstanceID4',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            screenId: 'brca.SideMenu',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            navigatorID: 'navigatorID3_nav',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            navigationParams:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:             { screenInstanceID: 'screenInstanceID4',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:               navigatorID: 'navigatorID3_nav',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:               navigatorEventID: 'screenInstanceID4_events' },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            navigatorEventID: 'screenInstanceID4_events' } },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:      screen:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:       { navigatorEventID: 'screenInstanceID2_events',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         navigatorID: 'navigatorID1_nav',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         screen: 'brca.HomeScreen',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         screenId: 'brca.HomeScreen',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         title: 'Home',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         screenInstanceID: 'screenInstanceID2',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         styleParams:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:          { drawBelowTopBar: true,
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            drawScreenAboveBottomTabs: true,
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            expendCollapsingToolBarOnTopTabChange: true },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         navigationParams:
11-23 15:42:41.333 22507 23550 I ReactNativeJS:          { screenInstanceID: 'screenInstanceID2',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            navigatorID: 'navigatorID1_nav',
11-23 15:42:41.333 22507 23550 I ReactNativeJS:            navigatorEventID: 'screenInstanceID2_events' },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         navigatorButtons: { leftButtons: { '0': { id: 'sideMenu' } } },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         navigatorStyle: {},
11-23 15:42:41.333 22507 23550 I ReactNativeJS:         leftButton: { id: 'sideMenu' } },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:      drawer: { left: { screen: 'brca.SideMenu' } } },
11-23 15:42:41.333 22507 23550 I ReactNativeJS:   finish: [Function: finish] }

@falquaddoomi
Copy link
Collaborator Author

Example of pressing the app's icon in the drawer (nearly identical to the bundled notification save for the extra 'profile: 0' entry)

11-23 15:48:32.386 24254 24296 I ReactNativeJS: handleNotification() called: (tray?: 1, local?: undefined)
11-23 15:48:32.407 24254 24296 I ReactNativeJS: 'payload: ', { opened_from_tray: 1,
11-23 15:48:32.407 24254 24296 I ReactNativeJS:   fcm: { action: 'android.intent.action.VIEW' },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:   animationType: 'none',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:   profile: 0,
11-23 15:48:32.407 24254 24296 I ReactNativeJS:   ACTIVITY_PARAMS_BUNDLE:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:    { animationType: 'none',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:      animateShow: false,
11-23 15:48:32.407 24254 24296 I ReactNativeJS:      sideMenu:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:       { left:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:          { screenInstanceID: 'screenInstanceID4',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            screenId: 'brca.SideMenu',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            navigatorID: 'navigatorID3_nav',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            navigationParams:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:             { screenInstanceID: 'screenInstanceID4',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:               navigatorID: 'navigatorID3_nav',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:               navigatorEventID: 'screenInstanceID4_events' },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            navigatorEventID: 'screenInstanceID4_events' } },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:      screen:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:       { navigatorEventID: 'screenInstanceID2_events',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         navigatorID: 'navigatorID1_nav',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         screen: 'brca.HomeScreen',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         screenId: 'brca.HomeScreen',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         title: 'Home',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         screenInstanceID: 'screenInstanceID2',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         styleParams:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:          { drawBelowTopBar: true,
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            drawScreenAboveBottomTabs: true,
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            expendCollapsingToolBarOnTopTabChange: true },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         navigationParams:
11-23 15:48:32.407 24254 24296 I ReactNativeJS:          { screenInstanceID: 'screenInstanceID2',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            navigatorID: 'navigatorID1_nav',
11-23 15:48:32.407 24254 24296 I ReactNativeJS:            navigatorEventID: 'screenInstanceID2_events' },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         navigatorButtons: { leftButtons: { '0': { id: 'sideMenu' } } },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         navigatorStyle: {},
11-23 15:48:32.407 24254 24296 I ReactNativeJS:         leftButton: { id: 'sideMenu' } },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:      drawer: { left: { screen: 'brca.SideMenu' } } },
11-23 15:48:32.407 24254 24296 I ReactNativeJS:   finish: [Function: finish] }

@falquaddoomi
Copy link
Collaborator Author

This problem is exacerbated in the testing case where we receive multiple consecutive notifications within a short timeframe. In practice, the user will never receive more than a single notification per release, which occur with a month between them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant