about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-08-24 16:07:16 -0700
committerGitHub <noreply@github.com>2023-08-24 16:07:16 -0700
commitc6f321862bf0bb7006462b9c7b4b7e833a1d868c (patch)
tree8bf173770ed9061e26ea4e126da50c7f07daaafa
parenta115c17a096fe6ac868a28ca9c8678a7318e09a6 (diff)
downloadvoidsky-c6f321862bf0bb7006462b9c7b4b7e833a1d868c.tar.zst
Add analytics event for when the app is opened from a notification (#1270)
* Add analytics event for when the app is opened from a notification

* Tweak notification ID
-rw-r--r--src/lib/analytics/types.ts2
-rw-r--r--src/lib/notifications/notifications.ts2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/analytics/types.ts b/src/lib/analytics/types.ts
index 2be37856e..f876c6d53 100644
--- a/src/lib/analytics/types.ts
+++ b/src/lib/analytics/types.ts
@@ -86,6 +86,8 @@ interface TrackPropertiesMap {
   'MobileShell:SearchButtonPressed': {}
   'MobileShell:NotificationsButtonPressed': {}
   'MobileShell:FeedsButtonPressed': {}
+  // NOTIFICATIONS events
+  'Notificatons:OpenApp': {}
   // LISTS events
   'Lists:onRefresh': {}
   'Lists:onEndReached': {}
diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts
index 2a9ed8706..88ebed044 100644
--- a/src/lib/notifications/notifications.ts
+++ b/src/lib/notifications/notifications.ts
@@ -2,6 +2,7 @@ import * as Notifications from 'expo-notifications'
 import {RootStoreModel} from '../../state'
 import {resetToTab} from '../../Navigation'
 import {devicePlatform, isIOS} from 'platform/detection'
+import {track} from 'lib/analytics/analytics'
 
 const SERVICE_DID = (serviceUrl?: string) =>
   serviceUrl?.includes('staging')
@@ -89,6 +90,7 @@ export function init(store: RootStoreModel) {
         store.log.debug(
           'User pressed a notification, opening notifications tab',
         )
+        track('Notificatons:OpenApp')
         resetToTab('NotificationsTab')
       }
     },