Fenix: Product & Marketing Should Be Able to Send Push Notifications to Users

Created on 4 Feb 2019  ·  47Comments  ·  Source: mozilla-mobile/fenix

Why/User Benefit/User Problem

Product & Marketing Should Be Able to Send Push Notifications to Users to let them know about all the great features of Fenix.

What / Requirements

  • Fenix has to integrate FCM SDK
  • Fenix has to use some concoction of Android Components to be able to register for and receive push notifications

Acceptance Criteria (how do I know when I’m done?)

Product / Marketing can send a push to Fenix builds
A user can opt out of LP/messaging

E13 P1 ready

Most helpful comment

https://news.ycombinator.com/item?id=20586299

A simple change I'd like to see in tech culture is to change how we refer to the notifications feature. We should call them interruptions instead.

Do I want my meeting interrupted if my spouse calls with an emergency? Absolutely.

Do I want that meeting interrupted to find out I've been given a $10 Lyft credit? Absolutely not.

I don't want to be interrupted by Firefox push notifications either.

All 47 comments

@bbinto Fennec is actually getting away with not using FCM, but Fenix can't as GCM will be deprecated on April 10 and we can't pin to the old Google Play Services version either.

https://bugzilla.mozilla.org/show_bug.cgi?id=1510730

I removed the links to the A-C Push work because now with the new title of this issue, I think this is actually a duplicate of the Leanplum SDK Integration ticket instead.

jennifer davidson did some awesome research on firefox desktop interruptions. i highly encourage people to watch the product club video and take this into consideration for this user story/feature.

https://vreplay.mozilla.com/replay/showRecordingExternal.html?key=HJI4gtp2yXDG8B3

@bbinto to prioritize

I agree with @st3fan as this should be covered by the Leanplum SDK integration. @st3fan would we still have to support/integrate with FCM if we use Leanplum SDK - I feel that's a technical question I can't answer.

Just waiting for Send Tab to be completed.

@boek is this ready to be worked on? Follow-up from Backlog grooming yesterday.

Send tab is landed, removing AC dep.

Probably need to just get keys into LP and then test it.

https://news.ycombinator.com/item?id=20586299

A simple change I'd like to see in tech culture is to change how we refer to the notifications feature. We should call them interruptions instead.

Do I want my meeting interrupted if my spouse calls with an emergency? Absolutely.

Do I want that meeting interrupted to find out I've been given a $10 Lyft credit? Absolutely not.

I don't want to be interrupted by Firefox push notifications either.

@jimbo1qaz and @lime124 raise good points here. I've filed #4663 to track the ability for users to opt out of these communications. Even with this we should be careful about how frequently we use these. I'd love to touch base with @lwa-moz regarding policy on pushing notifs.

@mheubusch is also part of the newly formed mobile marketing communications and may also be thinking about this. :)

Touched base with @lwa-moz. He said that he believes this is working but we still need to go through the full QA process to verify its functionality.

@bifleming I don't actually see any code here, so my guess is that this was already in-app, and nothing needed to be done except verification to close this.

@liuche that's correct :)

Hi @sblatz , not sure how we should test this.
I would kindly ask you to help us out with some extra info's. :)

Hi @sblatz , not sure how we should test this.
I would kindly ask you to help us out with some extra info's. :)

Perhaps @lwa-moz can provide some details on this?

Hi, I'm not sure if I took the correct steps to verify this issue, but I wasn't able to send push notifications from Leanplum to Fenix 2.0.0-rc.1
I've tried sending a push notification using the "client_id" but bumped into an error.
Based on the Leanplum events I've added the device to the "Development Devices" and added it as a target

picturemessage_ttgszwb0 p3f
Capture

@lwa-moz Could you please review and help me out? :)

@AndiAJ - I tried sending an additional push campaign using just your client ID and it doesn't appear that you've received it.

There's nothing wrong with the targeting or campaign set up as far as I can tell. We'll follow up with Leanplum support to understand why the test messages aren't being received.

@AndiAJ
The issue is stemming from the lack of a notification channel in the message itself. The userId in question is using Android OS 9 which requires the usage of a notification channel.

I ran an API call to verify if there are any channels set. Results below:

{
"response": [
{
"success": true,
"notificationChannels": []
}
]
}

Currently, there are none set. I would advise looking into using the addAndroidNotificationChannel API call.

@lwa-moz Sorry! we were missing a piece in the Leanplum console that I'm adding today :) I will let you know when we're ready to test

@boek - I'll remove the QA needed label, please let us know when we can re-test. :)

@boek will test today so we don't need to add points for this sprint.

@boek what was found out about this?

@boek Can you label the channel we discussed: Firefox news

Hi, I've tried to re-test sending push notifications on the latest Nightly Build #12890611 from 16/10 but without any success.

I've created this push notification and identified my device (Device ID = 09f3c01b-9dd5-44f9-958a-d1aa853afb77)
image

After tapping on "Send Preview" this gets displayed "No push tokens exist for this device"
image

@sblatz @boek @lwa-moz - Could you please take a look and let me know if I'm doing something wrong?
If that's the case could you please help me out with the actual steps needed to be performed ? :)

@AndiAJ after looking at your user profile, you indeed do not have a push token set up. This essentially means that your device does not allow push notifications from the Firefox Preview application. Can you confirm that notifications are allowed for Firefox Preview in your device system settings?

@lwa-moz Yes, notifications are allowed.
rsz_screenshot_20191017-095144

Could you help me set up the push token ?

@boek @AndiAJ

In the process of troubleshooting for this issue, it appears that all Preview users do not have push tokens associated with their devices. They should, as long as notifications are enabled (which is the default state). Both Andi and I can confirm that our devices have push notifications enabled, but no push token associated in the Leanplum dashboard.

Leanplum support suggested: If the push token is not populating, there is more than likely an issue with the integration. [Do] the FCM keys match in both the LP dashboard environment and your FCM dashboard?

Thanks @lwa-moz for checking ! :smiley:

I'll remove the QA needed label until the above mentioned matter will be clarified.

Leanplum support suggested: If the push token is not populating, there is more than likely an issue with the integration.

This was my analysis too while investigating https://github.com/mozilla-mobile/android-components/issues/4736

@boek will keep an eye on this while AC works on it.

We're taking this out bc AC is currently busy with other work.

@liuche can we prioritize the A-C work related to this? I don't see an A-C issue linked.

I don't see an A-C issue linked.

To clarify, there is no A-C work here. We found a crash related to this and reverted the changes, now we're going to be re-landing it as well.

Will add it to our next sprint.

@jonalmeida looks like you added this to your sprint, could you summarize what's going on bc I'm confused, as well as what actions Fenix would need to take (if you know)?

See https://github.com/mozilla-mobile/android-components/issues/4736#issuecomment-546038672 for details. Leanplum integration was causing all the push things to crash. I'm doing the Fenix things, but there aren't any a-c specifics needed.

@boek I think I've lost the state of this bug in my head, could you give me a quick refresh on what is done, or what remains to be done? What is this waiting on?

Does this mean no Marketing Push notifications (like Leanplum) work? Or is this separate from LP push notifications?

This is going to be my only priority for our next sprint (monday).

Thanks @jonalmeida let's try to land this before code freeze!

Hi, I've re-checked this matter on the latest Nightly #20490606 from 2/18 using the following devices, which I've registered as my Development devices:
• Google Pixel 3a XL (Android 10)
• Google Pixel 3a (Android 9)
• Huawei Mate 20 Lite (Android 8.1.0)
• Samsung Galaxy S7 (Android 7.0)
• OnePlus A3 (Android 6.0.1)
• LG Nexus 4 (Android 5.1.1)

image

I've created this message and tried to sent it to the above mentioned devices.
image

Success/ Failure of sending the desired Push notification:
| Status | Device & OS| User/Device ID|
| ------------- | ------------- | ------------- |
| ❌ | Google Pixel 3a XL, Android OS 10| 5530ff6e-f0df-4f48-abf3-7027a6d70c16 |
| ✔️ | Google Pixel 3a, Android OS 9 | f255a42c-fba1-4ced-9f03-133cba31da5f |
| ✔️ | Huawei Mate 20 Lite, Android OS 8.1.0 | b7ef0eac-d109-427d-bc85-a89d22ec18c4 |
| ✔️ | Samsung Galaxy S7, Samsung SM-G930F, Android OS 7.0 | 5569dac9-1781-4bb3-b91e-86373836114f |
| ✔️ | OnePlus A3, Android OS 6.0.1 | 81c3486d-6aa0-47a2-83cb-8c34c93401b7 |
| ❌ | LG Nexus 4, Android OS 5.1.1 | f751dc91-db2e-4b55-9e3d-f72ac72c10c2 |

► I've noticed that for the LG Nexus 4 (Android 5.1.1) no Android push token was generated, regarding the Google Pixel 3a XL (Android 10) I'm not sure why the push notification wasn't sent?

► Another worth mentioning aspect would be regarding the aspect of the push notification, namely, I've noticed that on the Pixel 3a & OnePlus A3 the Fenix Nightly icon isn't displayed, whereas on the Huawei Mate 20 Lite, Samsung Galaxy S7 the app icon is properly displayed in the noification.

notif

► I've also tried sending the message using a specific User ID (Samsung SM-G930F, Android OS 7.0 - 5569dac9-1781-4bb3-b91e-86373836114f) and noticed that in fact the message got sent to all my registered test devices.

I've unregistered all the above mentioned devices and tried again using a specific User ID (Samsung SM-G930F, Android OS 7.0 - 5569dac9-1781-4bb3-b91e-86373836114f) but still no luck this error message popped up.
image

@jonalmeida & @boek - Please review the above and advise on how to proceed. ☺️
I'll remove the QA needed label until further notice,

@AndiAJ - I checked with Leanplum support and they had the following suggestions:

  • for LG Nexus 4 (Android 5.1.1): This error usually occurs when push notifications are disabled on the device. If you can confirm push notifications are enabled, which I want to assume is the case, I can ask for more suggested causes.
  • Are all of these test cases "previews" of the message, or are you actually sending a push to your test devices?

Possibly related to this issue: https://github.com/mozilla-mobile/fenix/issues/8974

The Marketing team is continuing to see issues with Push Tokens being generated as expected on test devices, as was the case in Andi's testing.

@st3fan for visibility.

Possibly related to this issue: #8974

We're waiting for QA to verify the fix for the issue, but if you're also to also test it out on your side, that would be helpful too @lwa-moz . 🙂

I'm going to go ahead and close this now since the feature has been tested and follow issues have been filed to address bugs.

Was this page helpful?
0 / 5 - 0 ratings