BRCAChallenge / BRCAMobile

0 stars 0 forks source link

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

Open falquaddoomi opened 6 years ago

falquaddoomi commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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.