[android] #3897 - Refactoring check that determines when to send turnstile event
This commit is contained in:
@@ -399,7 +399,6 @@ public class MapView extends FrameLayout {
|
||||
evt.put(MapboxEvent.KEY_LATITUDE, mMapboxMap.getCameraPosition().target.getLatitude());
|
||||
evt.put(MapboxEvent.KEY_LONGITUDE, mMapboxMap.getCameraPosition().target.getLongitude());
|
||||
evt.put(MapboxEvent.KEY_ZOOM, mMapboxMap.getCameraPosition().zoom);
|
||||
// TODO - Punting on Push Enabled Key due to iOS nature for now
|
||||
MapboxEventManager.getMapboxEventManager(getContext()).pushEvent(evt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,8 @@ public class MapboxEventManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventWithAttributes.get(MapboxEvent.TYPE_MAP_LOAD) != null) {
|
||||
String eventType = (String)eventWithAttributes.get(MapboxEvent.ATTRIBUTE_EVENT);
|
||||
if (!TextUtils.isEmpty(eventType) && eventType.equalsIgnoreCase(MapboxEvent.TYPE_MAP_LOAD)) {
|
||||
pushTurnstileEvent();
|
||||
}
|
||||
|
||||
@@ -268,6 +269,7 @@ public class MapboxEventManager {
|
||||
|
||||
// Send to Server Immediately
|
||||
new FlushTheEventsTask().execute();
|
||||
Log.d(TAG, "turnstile event pushed.");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -499,7 +501,7 @@ public class MapboxEventManager {
|
||||
.post(body)
|
||||
.build();
|
||||
Response response = client.newCall(request).execute();
|
||||
Log.i(TAG, "Response Code from Mapbox Events Server: " + response.code() + " for " + events.size() + " events sent in.");
|
||||
Log.d(TAG, "Response Code from Mapbox Events Server: " + response.code() + " for " + events.size() + " events sent in.");
|
||||
|
||||
// Reset Events
|
||||
// ============
|
||||
|
||||
Reference in New Issue
Block a user