Closed Bug 1396548 Opened 2 years ago Closed 2 years ago

[LeanPlum] - Push Notifications don't work if the user closes Fennec

Categories

(Firefox for Android :: General, defect, P1, blocker)

57 Branch
ARM
Android
defect

Tracking

()

VERIFIED FIXED
Firefox 57
Tracking Status
firefox57 --- verified

People

(Reporter: bsurd, Assigned: cnevinchen)

References

(Blocks 1 open bug)

Details

(Keywords: qablocker, Whiteboard: [LP_M2][FNC][SPT57.3][INT])

Attachments

(1 file)

Device: 
 - Huawei Honor 8 (Android 6);
 - Huawei MediaPad M2 (Android 5.1.1);
 - Motorola Nexus 6 (Android 7.1.1);
 - Samsung Galaxy Note 4 (Android 5.0.1);

Prerequisites:
 - install Switchboard:Experiments and enable LeanPlum 

Steps to reproduce:
 1. After finishing setting up Fennec close it.
 2. Wait for Campaign C to trigger.

Expected result:
 After a 5 minute period, the user should receive PN1 (push notification 1) from campaign C.

Actual result:
 The user does not receive any kind of push notifications.

Notes:
 The user can receive push notifications if the app is running in the foreground or background. He can't receive push notifications any longer after he closes the app.
Duplicate of this bug: 1396556
Comment on attachment 8904386 [details]
Bug 1396548 - Handle Push Notification when app is not running.

https://reviewboard.mozilla.org/r/176184/#review181128

::: mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java:150
(Diff revision 1)
>          final Tab selectedTab = Tabs.getInstance().getSelectedTab();
> -        // if selected tab is null or private, mma should be disabled.
> -        final boolean isInPrivateBrowsing = selectedTab == null || selectedTab.isPrivate();
> -        return inExperiment && healthReport && isGeckoPrefOn && !isInPrivateBrowsing;
> +
> +        // if selected tab is private, mma should be disabled.
> +        final boolean isInPrivateBrowsing = selectedTab != null && selectedTab.isPrivate();
> +
> +        return (inExperiment || isGeckoPrefOn) && healthReport && !isInPrivateBrowsing;

Maybe add a comment describe why do we make isExperiment and isGeckoPrefOn OR, is it because of switchboard addon not available from 57? or is it because of GeckoThread might not be ready when GCM arrived?
Attachment #8904386 - Flags: review?(max) → review+
Pushed by nechen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/079ab7573850
Handle Push Notification when app is not running. r=maliu
https://hg.mozilla.org/mozilla-central/rev/079ab7573850
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Whiteboard: [LP_M2]
Whiteboard: [LP_M2] → [LP_M2][FNC][SPT57.3][INT]
Hello,

Verified this fix on multiple devices and it's working as expected.
Status: RESOLVED → VERIFIED
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.