Showing
3 changed files
with
5 additions
and
2 deletions
... | @@ -1586,8 +1586,8 @@ public enum Warply { | ... | @@ -1586,8 +1586,8 @@ public enum Warply { |
1586 | } | 1586 | } |
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | - if (INSTANCE.mRequestQueue == null) | 1589 | + if (INSTANCE.mRequestQueue == null && INSTANCE.mContext != null) |
1590 | - INSTANCE.mRequestQueue = Volley.newRequestQueue(mContext); | 1590 | + INSTANCE.mRequestQueue = Volley.newRequestQueue(INSTANCE.mContext); |
1591 | 1591 | ||
1592 | if (tempAnalytics != null && tempAnalytics.length() > 0) { | 1592 | if (tempAnalytics != null && tempAnalytics.length() > 0) { |
1593 | String urlAnalytics = WarplyProperty.getBaseUrl(mContext) + WarpConstants.WARPLY_ASYNC + WarpConstants.WARPLY_ANALYTICS + WarplyProperty.getAppUuid(mContext) + "/"; | 1593 | String urlAnalytics = WarplyProperty.getBaseUrl(mContext) + WarpConstants.WARPLY_ASYNC + WarpConstants.WARPLY_ANALYTICS + WarplyProperty.getAppUuid(mContext) + "/"; | ... | ... |
This diff is collapsed. Click to expand it.
... | @@ -659,6 +659,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -659,6 +659,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
659 | private void checkForPermissions(String origin, Callback callback) { | 659 | private void checkForPermissions(String origin, Callback callback) { |
660 | String perm = Manifest.permission.ACCESS_FINE_LOCATION; | 660 | String perm = Manifest.permission.ACCESS_FINE_LOCATION; |
661 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || getContext().checkSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) { | 661 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || getContext().checkSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) { |
662 | + geolocationCallback = callback; | ||
662 | if (isGPSEnabled()) { | 663 | if (isGPSEnabled()) { |
663 | callback.invoke(origin, true, false); | 664 | callback.invoke(origin, true, false); |
664 | } else { | 665 | } else { |
... | @@ -678,6 +679,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -678,6 +679,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
678 | } | 679 | } |
679 | 680 | ||
680 | private void enableLocationSettings() { | 681 | private void enableLocationSettings() { |
682 | + if (geolocationCallback == null) return; | ||
683 | + | ||
681 | GoogleApiClient googleApiClient = new GoogleApiClient.Builder(WarpActivity) | 684 | GoogleApiClient googleApiClient = new GoogleApiClient.Builder(WarpActivity) |
682 | .addApi(LocationServices.API) | 685 | .addApi(LocationServices.API) |
683 | .build(); | 686 | .build(); | ... | ... |
-
Please register or login to post a comment