@@ -54,6 +54,7 @@ public class ActionManager {
5454 private static final String LEANPLUM_LOCAL_PUSH_HELPER =
5555 "com.leanplum.internal.LeanplumLocalPushHelper" ;
5656 private static final String PREFERENCES_NAME = "__leanplum_messaging__" ;
57+ private static boolean loggedLocationManagerFailure = false ;
5758
5859 public static class MessageMatchResult {
5960 public boolean matchedTrigger ;
@@ -68,29 +69,21 @@ public static synchronized ActionManager getInstance() {
6869 return instance ;
6970 }
7071
71- private static boolean loggedLocationManagerFailure = false ;
72-
7372 public static LocationManager getLocationManager () {
7473 if (Util .hasPlayServices ()) {
7574 try {
76- Class <?> googleApiClientClass =
77- Class .forName ("com.google.android.gms.common.api.GoogleApiClient" );
78- if (googleApiClientClass != null
79- && Modifier .isAbstract (googleApiClientClass .getModifiers ())
80- && Modifier .isAbstract (
81- googleApiClientClass .getMethod ("isConnected" ).getModifiers ())
82- && Class .forName ("com.google.android.gms.location.LocationServices" ) != null ) {
83- // Reflection here prevents linker errors
84- // in Google Play Services is not used in the client app.
85- return (LocationManager ) Class
86- .forName ("com.leanplum.LocationManagerImplementation" )
87- .getMethod ("instance" ).invoke (null );
88- }
75+ // Reflection here prevents linker errors
76+ // if Google Play Services is not used in the client app.
77+ return (LocationManager ) Class
78+ .forName ("com.leanplum.LocationManagerImplementation" )
79+ .getMethod ("instance" ).invoke (null );
8980 } catch (Throwable t ) {
9081 if (!loggedLocationManagerFailure ) {
91- Log .e ("Geofencing support requires Google Play Services v8.1 and higher.\n " +
82+ Log .w ("Geofencing support requires leanplum-location module and Google Play " +
83+ "Services v8.1 and higher.\n " +
9284 "Add this to your build.gradle file:\n " +
93- "compile ('com.google.android.gms:play-services-location:8.3.0+')" );
85+ "implementation 'com.google.android.gms:play-services-location:8.3.0+'\n " +
86+ "implementation 'com.leanplum:leanplum-location:+'" );
9487 loggedLocationManagerFailure = true ;
9588 }
9689 }
@@ -136,7 +129,6 @@ public boolean onResponse(ActionContext actionContext) {
136129 .getDeclaredMethod ("scheduleLocalPush" , ActionContext .class , String .class ,
137130 long .class ).invoke (new Object (), actionContext , messageId , eta );
138131 } catch (Throwable throwable ) {
139- Log .e ("scheduleLocalPush problem" ,throwable );
140132 return false ;
141133 }
142134 } catch (Throwable t ) {
0 commit comments