Some people have asked about using Push Notifications on Android, so until the help is updated I'll put the information here for everyone to see. Before we begin you will need a server capable of running PHP scripts for this example to work.
1) Follow the instructions on this page
https://developer.android.com/google/gcm/gs.html until you have your API key, ignore the rest.
2) In the Google Play developer console for your app is a section called Services & APIs, in this section you must link your GCM account discovered on the site above with your app.
3) In AGKHelper.java find the function registerPushNotification and replace the number in GCMRegistrar.register() with your project number (not your API key).
4) In your tier 1 code first call PushNotificationSetup(), if it returns 0 then thi platform does not support push notifications. Otherwise wait for GetPushNotificationToken() to return something other than an empty string, if it returns "Error" then something went wrong. Once you have the token you need to send it to your server, you might also want to send some identifying information like a userID so you know who this token belongs to. The code we use looks something like this
result = PushNotificationSetup()
if ( result = 1 )
token = GetPushNotificationToken()
while ( token = "" )
token = GetPushNotificationToken()
endwhile
params$ = "token="+token+"&platform="+getdevicename() + "&id=" + str(g_Net_UserID)
SendHTTPRequestASync( conn, "sendToken.php", params$ )
endif
We also send the output of GetDeviceName so we know which platform this token belongs to, iOS and Android use different methods.
The server will need to remember the token and who it belongs to so you can send them push notifications later, be aware that the tokens can be 183 characters or more in the case of Android. The device takes no further action after this, it simply sends off its token and the server decides when to send a notification.
5) When you want to send a notification to a device use the attached PHP script to send a message to a particular device token, replacing the $apiKey field with your API key. In our case when a device uploads the result of its turn to the server the server works out which token belongs to the opponent and sends them a notification.