+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Build a version of the mobile client that does not depend on the GCM API

We can remove the dependency on Google Cloud Messaging (GCM) API from the Android version of the client to comply with constraints in some territories. Push notifications do not work on this version of the client.

The Application Center relies on the availability of the Google Cloud Messaging (GCM) API. This API might not be available on devices in some territories such as China. To support those territories, we can build a version of the Application Center client that does not depend on the GCM API. The push notification feature does not work on that version of the Application Center client.


Procedure

  1. Check that push notifications are disabled by checking that the IBMAppCenter/apps/AppCenter/common/js/appcenter/config.json file contains this line: "gcmProjectId": "" ,.
  2. Remove from two places in the IBMAppCenter/apps/AppCenter/android/native/AndroidManifest.xml file all the lines that are located between these comments: <!-- AppCenter Push configuration --> and <!-- end of AppCenter Push configuration -->.
  3. Delete the IBMAppCenter/apps/AppCenter/android/native/src/com/ibm/appcenter/GCMIntenteService.java class.
  4. In Eclipse, run "Build Android Environment" in the IBMAppCenter/apps/AppCenter/android folder.
  5. Delete the IBMAppCenter/apps/AppCenter/android/native/libs/gcm.jar file that was created by the MobileFirst plug-in when you ran the previous "Build Android Environment" command.
  6. Refresh the newly created IBMAppCenterAppCenterAndroid project, so that the removal of the GCM library is taken into account.
  7. Build the .apk file of the Application Center.


What to do next

The gcm.jar library is automatically added by the MobileFirst Eclipse plug-in each time that the Android environment is built. Therefore, this java archive file must be deleted from the IBMAppCenter/apps/AppCenter/android/native/libs/ directory each time that the MobileFirst Android build process is run. Otherwise, the gcm.jar library is present in the resulting appcenter.apk file.

Parent topic: Push notifications of application updates