File tree 3 files changed +9
-0
lines changed
src/main/java/mozilla/components/feature/pwa
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ This component emits the following [Facts](../../support/base/README.md#Facts):
65
65
66
66
| Action | Item | Extras | Description |
67
67
| --------| ---------| ----------------| ------------------------------------|
68
+ | CLICK | install_shortcut | | The user installs a PWA shortcut. |
68
69
| CLICK | homescreen_icon_tap | | The user tapped the PWA icon on the homescreen. |
69
70
| INTERACTION | enter_background | ` itemExtras ` | The current system time when the app is backgrounded. |
70
71
| INTERACTION | enter_foreground | ` itemExtras ` | The current system time when the app is foregrounded. |
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class ProgressiveWebAppFacts {
18
18
* Items that specify which portion of the [PwaFeature] was interacted with
19
19
*/
20
20
object Items {
21
+ const val INSTALL_SHORTCUT = " install_shortcut"
21
22
const val HOMESCREEN_ICON_TAP = " homescreen_icon_tap"
22
23
const val ENTER_BACKGROUND = " enter_background"
23
24
const val ENTER_FOREGROUND = " enter_foreground"
@@ -58,6 +59,12 @@ internal fun emitHomescreenIconTapFact() =
58
59
ProgressiveWebAppFacts .Items .HOMESCREEN_ICON_TAP
59
60
)
60
61
62
+ internal fun emitPwaInstallFact () =
63
+ emitPwaFact(
64
+ Action .CLICK ,
65
+ ProgressiveWebAppFacts .Items .INSTALL_SHORTCUT
66
+ )
67
+
61
68
internal fun emitForegroundTimingFact (timingNs : Long ) =
62
69
emitPwaFact(
63
70
Action .INTERACTION ,
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ class WebAppShortcutManager(
80
80
if (ShortcutManagerCompat .isRequestPinShortcutSupported(context)) {
81
81
val manifest = session.installableManifest()
82
82
val shortcut = if (supportWebApps && manifest != null ) {
83
+ emitPwaInstallFact()
83
84
buildWebAppShortcut(context, manifest)
84
85
} else {
85
86
buildBasicShortcut(context, session, overrideShortcutName)
You can’t perform that action at this time.
0 commit comments