Mahmoud
Mahmoud

Reputation: 353

What are the requirements to use GCM ? Do I need to host an Online Database?

I am working on an android application that should alert the user with any new post in a defined facebook page using a notification, I asked for a mechanism to do this, but some answered with try using Google Cloud Messaging but I don't know what should I have to use it

Upvotes: 3

Views: 1117

Answers (3)

Amit
Amit

Reputation: 381

Check APIDEMOS in your sdk there you can find out about android GCM, all you need is SENDER_ID(For Client) and APP_ID(For your(third party)server use), this you can get from Google Console page, there you will have to register you application package and then you will have to turn on the GCM feature for same and you will get SENDER_ID and APP_ID once this is done you have server demo in apidemos simple host that in your system change the URL in client and try it you will have IDEA how it works, if you have 4.0 and above device then thats great or else you need to login your gmail in you android device.

Upvotes: 0

meda
meda

Reputation: 45490

Well you will need to have your sever (3 party server) that ave database and where you can also have some code you run to push notifications to the Google cloud server.

In your databse you will store the user device tokens, so that when it's time to send out the alert you can retrieve them and submit an array of android tokens

Here is an image from google that illustrate my answer:

enter image description here

Upvotes: 1

Shadow
Shadow

Reputation: 6899

One way is you need a xampp and gcm acts as interlink between android and server to pass information.It has browser key where you will use in server.

Take a look of this.

http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

Upvotes: 0

Related Questions