Configure GCM for project The City

1. PREPARE API_KEY

I assume that you already create new project on https://console.developers.google.com , If not you can read THIS and please check your enabled API :

gcm_enable

[IMPORTANT ] Obtain Server API_KEY :

These API KEY from https://console.developers.google.com will no longer work. You need to go to console.firebase.google.com and import your existing GCM project.

Then go to Project Settings -> Cloud Messaging, and get the new updated API Key. The “Sender Id” should be exactly the same number as your existing “GCM Project Number”.

So now you have :

PROJECT_NUMBER_ID : 239973….

API_KEY : AIzaSyAf8YTqLUtOQcr7l7n5g4……..

 

2. CONFIGURE PROJECT

  Android           : please open java file data/Constant.java and change PROJECT_API_NUMBER with PROJECT_NUMBER_ID from point 1.

  Admin Panel  : please open php file app/services/api.php and change GOOGLE_API_KEY with API_KEY from point 1.

 

3. TESTING

Please make sure your point 1, and point 2 done before go to testing step.

a. REGISTERING DEVICE. Registering device to your server, device will start regsitering device to your server at splash screen, if there’s circle progressbar at the bottom screen that mean device on process get gcm_id from your device and send to your server, If success device will not do this process again at the next.

If you want to activate this process again you can clear data the app ( Android Setting > App > The City > Clear Data ).

b. MAKE SURE DEVICE REGISTERED. To make sure your device succes registering to your server you can go to phpMyAdmin panel from your server side, and delete your device from gcm table. And open again The City App from your device. If your device success registered it will shown on the top of list, and then you GCM is ready to use.

Leave a Reply

Your email address will not be published. Required fields are marked *