BIDMCDigitalPsychiatry / LAMP-platform

The LAMP Platform (issues and documentation).
https://docs.lamp.digital/
Other
13 stars 10 forks source link

Inconsistency lamp.analytics notification format #643

Closed lukeoftheshire closed 2 years ago

lukeoftheshire commented 2 years ago

lamp.analytics notification SensorEvents are not consistent across different device types

From one of our test users using an android device, this is a recent notification SensorEvent:

{'data': {'action': 'notification',
  'user_action': 'Open App',
  'payload': '{expiry=21600000, actions=[{"name":"Open App","page":"\\/participant\\/U2319928193\\/activity\\/qt1qfgrc3rkb5nnjfyk7"}], page=/participant/U2319928193/activity/qt1qfgrc3rkb5nnjfyk7, title=Morning., notificationId=489351, message=You have a mindLAMP activity waiting for you: Morning..}'},
 'sensor': 'lamp.analytics',
 'timestamp': 1653998400648}

From a user using an apple device:

{'data': {'device_type': 'iOS',
   'action': 'notification',
   'content': {'aps': {'expiration': 10,
     'badge': 0,
     'push-type': 'alert',
     'sound': 'default',
     'content-available': 1,
     'alert': 'You have a mindLAMP activity waiting for you: Daily Survey..',
     'mutable-content': 1,
     'collapse-id': '403189'},
    'actions': [{'name': 'Open App',
      'page': '/participant/U0787924669/activity/qexqbpmgygcmmngacx3a'}],
    'notificationId': '403189',
    'page': '/participant/U0787924669/activity/qexqbpmgygcmmngacx3a',
    'expiry': 21600000},
   'user_agent': 'NativeCore 2022.4.23; iOS 14.8.1; iPhone iPhone12,3'},
  'sensor': 'lamp.analytics',
  'timestamp': 1652990400687}]

Can we make it so that the android format is the same as the ios format?

jijopulikkottil commented 2 years ago

We can keep below format for both iOS and Android. @avaidyam please conform.

{
'data': { 'type': 'notification',
          'payload': 'this is the push payload, and will be different for iOS and Android',
      'user_agent': 'NativeCore 2022.4.23; iOS 14.8.1; iPhone iPhone12,3'
    },
'sensor': 'lamp.analytics',
'timestamp': 1652990400687
}

In iOS,

saranya-sajeev commented 2 years ago

@avaidyam Both Android and iOS development completed and given for QA testing.

saranya-sajeev commented 2 years ago

@avaidyam We have pushed Android build to beta and is in review status.