Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14075] Android: Feature Request to expose isGooglePlayServicesAvailable()

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-11T20:38:52.000+0000
Affected Version/sRelease 3.1.0
Fix Version/s2013 Sprint 12 API, 2013 Sprint 12, Release 3.1.1, Release 3.2.0
ComponentsAndroid
Labelsmodule_map, qe-testadded, supportTeam
ReporterEduardo Gomez
AssigneeHieu Pham
Created2013-05-31T21:03:40.000+0000
Updated2014-06-19T12:43:09.000+0000

Description

Feature request

Expose The client library provides a deep link into the Google Play Store when it detects that the device has a missing or incompatible Google Play services APK. Google Play services is an optional part of your app, you can do these checks if the user navigates to that portion of your app:

Google Play set up

1. Query for the status of Google Play services on the device with the isGooglePlayServicesAvailable() method, which returns a result code. 2. If the result code is SUCCESS, then the Google Play services APK is up-to-date, and you can proceed as normal. 3. If the result code is SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED, or SERVICE_DISABLED, then call getErrorDialog() to display an error message to the user, which allows the user to download the APK from the Google Play Store or enable it in the device's system settings. Ref: http://developer.android.com/google/play-services/setup.html

Use case

Currently Android Maps Module 2.1.0 Crashes due to Play Store and Native Maps Application is not updating. Using the Latest 2.1.0 Maps module and the 3.1.0.GA Ti SDK on a Galaxy Nexus running 4.1.1 the application crashes. Most likely due to the Native Maps and Google Play store being out of date. They have the following versions:
Google Maps - 6.9.0
Google Play - 3.7.13
These are old versions and for some reason the Google Play store will not update on this device. It might be related to this google issue. - https://code.google.com/p/android/issues/detail?id=35615&q=3.7.13&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars The problem is that the app crashes if the Google Play store has not been updated because then the Maps have also not been updated. On another device running Maps 6.14.4 and Play 4.1.6 the app works fine and the map loads and works without any issues.

DDMS log

Please see SGNLogMaps. It looks like it needs the updated maps in order to work with the newest maps module.

Attachments

FileDateSize
SGNLogMaps.txt2013-05-31T21:03:40.000+0000409081

Comments

  1. Hieu Pham 2013-06-11

    PR: https://github.com/appcelerator/titanium_modules/pull/120 Testing steps: 1. Run map/mobile/android/example/app.js on a device without Google Play services. Make sure the alert is shown and app doesn't crash 2. Run the same test on a device with Google Play services. It should work as expected.
  2. Ping Wang 2013-06-11

    master PR: https://github.com/appcelerator/titanium_mobile/pull/4379 3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4378
  3. Dhirendra Jha 2013-06-12

    Verified this issue using the below environment - Device : Google Nexus 7 (v4.1), Nexus 4 (v4.0.4), Galaxy Note (v2.3.6) SDK: 3.1.1.v20130611153550 CLI version : 3.1.1-cr OS : MAC OSX 10.8.4 Appcelerator Studio: 3.1.1.201306071750 XCode : 4.5.1 Results - 1) Alert (Google Play Services is not installed/updates/available) is shown when Google Play Services are not present on device and app does not crash. 2) App works fine when Google Play Services are available on device.
  4. Djamel ZAHAL 2013-06-12

    how to call : isGooglePlayServicesAvailable in titanium ? and for reponses ? can you give a small documentation here. i will use the last build in my app. thanks
  5. Djamel ZAHAL 2013-06-12

    how to call : isGooglePlayServicesAvailable in titanium ? and for reponses ? can you give a small documentation here. i will use the last build in my app. thanks
  6. Djamel ZAHAL 2013-06-12

    how to call : isGooglePlayServicesAvailable in titanium ? and for reponses ? can you give a small documentation here. i will use the last build in my app. thanks
  7. Djamel ZAHAL 2013-06-12

    how to call : isGooglePlayServicesAvailable in titanium ? and for reponses ? can you give a small documentation here. i will use the last build in my app. thanks
  8. Ping Wang 2013-06-12

    Hi zahal, here is an [example app](https://github.com/appcelerator/titanium_modules/blob/master/map/mobile/android/example/app.js).
  9. Djamel ZAHAL 2013-06-13

    i used sdk : 3.1.1.v20130612114553 the last one. and i have this message : Map has nos method 'isGooglePlayServicesAvailable' any suggestion ? should i update ti.map module ? thanks
  10. Eric Merriman 2013-06-14

    @Djamel, currently the map module version 2.1.1 (with this feature) is available in build 3.1.1.v20130613185544. You can also get the module from the module marketplace.
  11. Eric Merriman 2013-06-14

    Verified this feature is available and functioning in version 2.1.1 of the module. Closing.

JSON Source