Bug 1386151 - Update document for Leanplum push notification. r?liuche
MozReview-Commit-ID: H5CGirKOUIt
--- a/mobile/android/docs/mma.rst
+++ b/mobile/android/docs/mma.rst
@@ -14,24 +14,23 @@ Android 56 release. Leanplum is a San Fr
our codebase and sync upstream when there's a major update. Please find it in ``mobile/android/thirdparty/com/leanplum``.
The SDK is documented at https://www.leanplum.com/docs/android/
There are three major component in Leanplum SDK.
1. Events : Triggers when users perform certain actions. An event will normally trigger a prompt message.
2. Deep Links : Actions that users can perform to interact with the prompt message.
3. Messages : Campaigns that we want to engage with users. Messages is a combination of an Event and a Deep Link.
-
Data collection
~~~~~~~~~~~~~~~
Who will have Leanplum enabled?
======================================================
-* We use Switchboard to filter users to have Leanplum enabled. Currently, for users in the USA
+* We use Switchboard https://wiki.mozilla.org/Firefox/Kinto to filter users to have Leanplum enabled. Currently, for users in the USA
and whose locale is set to English, 10% of that users will have Leanplum enabled.
* If the user has "Health Report" setting enabled.
* If above two are true, when the app starts, and switchboard configure arrived, Fennec will send the
triggers and message interaction history to Leanplum server when available.
Where does data sent to the Leanplum backend go?
==============================================
@@ -90,16 +89,19 @@ following parameters::
// Sent for every action
"userId" -> "b13b3c239d01aa7c" // Set by Fennec, we use random uuid so users are anonymous to Leanplum.
"deviceId" -> "b13b3c239d01aa7c" // Same as above.
"sdkVersion" -> "2.2.2-SNAPSHOT" // Leanplum SDK version.
"devMode" -> "true" // If the SDK is in developer mode. For official builds, it's false.
"time" -> "1.497595093902E9" // System time in second.
"token" -> "nksZ5pa0R5iegC7wj...." // Token come from Leanplum backend.
+
+ "gcmRegistrationId" -> "APA91...." // Send GCM token to Leanplum backend. This happens separately when Leanplum SDK gets initialized.
+
Notes on what data is collected
-------------------------------
User Identifier:
Since Device ID is a random UUID, Leanplum can't map the device to any know Client ID in Fennec nor Advertising ID.
Events:
Most of the Leanplum events can be mapped to a single combination of Telemetry event (Event+Method+Extra).
@@ -156,22 +158,29 @@ trigger the following deep links
* Link to main preferences (firefox://preferences)
* Link to privacy preferences (firefox://preferences_privacy)
* Link to notifications preferences (firefox://preferences_notifications)
* Link to accessibility preferences (firefox://preferences_accessibility)
* Link to general setting (firefox://preferences_general)
* Link to home page setting (firefox://preferences_home)
Messages :
-Messages are in-app prompts to the user from Leanplum. The interaction of that prompt will be kept and sent to Leanplum backend (such
+Messages are prompts to the user from Leanplum. Messages can be in-app prompts or push notifications. The interaction of that prompt will be kept and sent to Leanplum backend (such
as "Accept" and "Show"). A messages is a combination of an Event and a Deep Link. The combinations are downloaded from Leanplum
when Leanplum SDK is initialized. When the criteria is met (set in Leanplum backend, could be when an event happens a certain number of times,
and/or targeting certain user attribute ), a prompt message will show up. And there may be buttons for users to click. Those clicks
may trigger deep links.
+We use another Mozilla's Google Cloud Messaging(GCM) sender ID to send push notifications.
+These push notifications will look like the notifications that Sync sends out.
+Sender ID let GCM knows Mozilla is sending push notifications via Leanplum.
+GCM will generate a token at client side. We'll send this GCM token to Leanplum so Leanplum knows whom to send push notifications.
+This token is only useful to Mozilla's sender ID so it's anonymized to other parties.
+Push Notifications can be triggered by Events, or be sent by Mozilla marketing team manually.
+
The list of current messages for Android can be found here: https://wiki.mozilla.org/Leanplum_Contextual_Hints#Android
Technical notes
~~~~~~~~~~~~~~~
Build flags controlling the Leanplum SDK integration
==================================================
@@ -195,10 +204,10 @@ Technical notes on the Leanplum SDK inte
Just like Adjust, MmaDelegate uses mmaInterface to inject the MmaLeanplumImp and MmaStubImp.
Constants used by Leanplum is in MmaConstants. Services in AndroidManifest are in
``mobile/android/base/MmaAndroidManifest_services.xml.in`` which is also injected by build flag
MOZ_ANDROID_MMA.
Notes and links
===============
-.. _Leanplum web page: http://leanplum.com/
-.. _github repository: https://github.com/Leanplum/Leanplum-Android-SDK
+* Leanplum web page: http://leanplum.com/
+* Leanplum SDK github repo: https://github.com/Leanplum/Leanplum-Android-SDK