Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Implement App Turnstile Event #3897

Closed
Closed

Description

@bleege

As part of Android Telemetry, the SDK needs to implement the App Turnstile event. This is similar to #3889, but should be implemented first.

Activity

  1. added
    Android
    telemetry
    on Feb 11, 2016
  2. self-assigned this
    on Feb 11, 2016
  3. added this to the android-v4.0.0 milestone on Feb 11, 2016
  4. added a commit that references this issue on Feb 16, 2016
  5. added a commit that references this issue on Feb 17, 2016
  6. bleege commented on Feb 17, 2016

    @bleege
    ContributorAuthor

    Initial implementation of Turnstile and Map Load are built. Testing is needed to verify. Also, I punted on the the "Push Enabled" key on the Map Load event as this is iOS in nature. Need to confirm that on Android we'll use this to mean Cloud Messaging.

  7. added a commit that references this issue on Feb 17, 2016
  8. bleege commented on Feb 17, 2016

    @bleege
    ContributorAuthor

    Google's example code for how to implement Google Cloud Messaging in Android apps. Will investigate to see what hooks / tech is being used that Telemetry can detect for.

  9. boundsj commented on Feb 17, 2016

    @boundsj
    Contributor

    @bleege I'm not sure if this is useful info for you but I recently merged #3713

    The idea is that we now only send turnstile when the map loads instead of when telemetry is inited

  10. boundsj commented on Feb 17, 2016

    @boundsj
    Contributor

    Oh! Nvm, I see you listed it above now.

  11. bleege commented on Feb 17, 2016

    @bleege
    ContributorAuthor

    @boundsj Actually, thanks for the link to the ticket #3713! I discovered the commit in master the other day but couldn't find the larger ticket.

  12. bleege commented on Feb 17, 2016

    @bleege
    ContributorAuthor

    Discovered in Google's sample app, that the client requires Google Play Services library to run. Based on this we can do a runtime classpath search for a member class of this library (such as GcmListenerService) and if it's found then mark "Push Enabled" as true otherwise default it to false.

  13. bleege commented on Feb 18, 2016

    @bleege
    ContributorAuthor

    Just looking now at the newly minted V2 of the Events API, Push Enabled is no longer in it so there's no need to worry about this attribute. Next action will be to confirm that Map Load and Turnstile are being sent as expected and then merge.

    The plan will be to double back after initial implementation of these events and the remaining Interaction Events in #3889 and convert them and the server URL to V2.

    /cc @camilleanne @mick

  14. added 2 commits that reference this issue on Feb 18, 2016
  15. bleege commented on Feb 18, 2016

    @bleege
    ContributorAuthor

    I refactored the control logic for sending in the Turnstile Event and confirmed that it sends it in at Map Load time. I also confirmed that Map Load only is sent when the MapView is initially created and won't resend on device rotation which recreates the MapView instance as that's just how the Android lifecycle rolls.

    The Turnstile Event and Map Load events use the same "send data to Mapbox" HTTP infrastructure as the Location events do. However during testing the server responds with an HTTP 500 error code when Turnstile and Map Load are sent in, but HTTP 204 all good code when Location is sent in (see below). This tells me that there's still some validation logic that's getting tripped up on the server. I'm not too worried about this as this is V1 of the API and the staging server is in a bit of transient state these days. I'm going to merge this code in now and will confirm that everything is 100% A-OK when the migration to V2 happens.

    02-18 10:50:34.044 22101-22486/com.mapbox.mapboxsdk.testapp D/MapboxEventManager: url = https://cloudfront-staging.tilestream.net/events/v1?access_token=sk.eyJ1IjoiYmxlZWdlIiwiYSI6InNpcml1c2x5In0.KyT-boMyC_xZYTYojTc8zg
    02-18 10:50:40.864 22101-22486/com.mapbox.mapboxsdk.testapp D/MapboxEventManager: Response Code from Mapbox Events Server: 500 for 3 events sent in.
    02-18 10:51:14.662 22101-22101/com.mapbox.mapboxsdk.testapp I/LocationServices: onLocationChanged()...Location[network 43.054829,-89.443154 acc=18 et=+4d13h40m52s958ms {Bundle[mParcelledData.dataSize=696]}]
    02-18 10:51:14.665 22101-22101/com.mapbox.mapboxsdk.testapp D/TelemLocationReceiver: location received = Location[network 43.054829,-89.443154 acc=18 et=+4d13h40m52s958ms {Bundle[mParcelledData.dataSize=696]}]
    02-18 10:52:15.851 22101-23867/com.mapbox.mapboxsdk.testapp D/MapboxEventManager: original = 8a07f5a6-cde5-4aea-a083-c81c2938fe3f; hex = 2E7BD9E094FF09ADCCFA8312897DB49E0DAA5182
    02-18 10:52:18.642 22101-23867/com.mapbox.mapboxsdk.testapp D/MapboxEventManager: url = https://cloudfront-staging.tilestream.net/events/v1?access_token=sk.eyJ1IjoiYmxlZWdlIiwiYSI6InNpcml1c2x5In0.KyT-boMyC_xZYTYojTc8zg
    02-18 10:52:23.871 22101-23867/com.mapbox.mapboxsdk.testapp D/MapboxEventManager: Response Code from Mapbox Events Server: 204 for 1 events sent in.
    
  16. added 5 commits that reference this issue on Feb 18, 2016
  17. bleege commented on Feb 18, 2016

    @bleege
    ContributorAuthor

    Rebased and Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Androidtelemetry

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions