Push notification using GCM which key should I create? - android

Hi android developers,
Today I have decided to use Push notification of GCM. But getting stuck with creating key.
Steps I followed below steps provided in docs
Created project.
under API & Auth Google Cloud Messaging for android turned ON
Here I stuck, which key to choose. In docs it clearly says to select server key but in api key help doc says:
A.Create and use a server key if your application runs on a server.
B. Create and use an Android key if your application runs on Android devices.
My Question is I have developed an offline app which runs on android phone. So which key should I prefer? Also if anyone has done this push notification stuff then please share whole procedure in simple words.It will be great help.
Please help!
Thanks in advance.

you just have to create the public server key and shared it with your api developer which will used it for send push notification with using the Google Cloud Messaging.

Related

Push Notification from Web based application to Android

I have developed web based application using yii2 framework and MySQL database and my plan is i want to make an android app that can receive notification from my web based application real time and can pull data from it too. but i'm not sure how can make it works and using which methods i can implement this. can you give me some advise and source to learn it?
thanks
You have to follow below steps to implement push notification
1) You have to register on google developer consol
https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passive=true&continue=https://console.developers.google.com/dcredirect/
2)enable the GCM api from api list that available in api lists further instruction you will get on site when you create account.
3)Generate key for GCM web/ android.
4) Use this GCM key from android app and write the the GCM notification receiver
program in android app and using notification manager show on notification bar.
5)Using server side key you can write the program to push notification from web site.

Using pubnub in android

Has anyone succeeded in using pubnub examples for android? I am working a senior project that uses it for interacting with raspberry pi remotely. The demo project works find but replacing the pub/sub key with my own causes unknownhostExecption. I have created GCM account and using the api key as the sender ID. My manifest is registered the appropriate permission as well. I have been stuck with for a while. but still unable to figure out the cause.
What do i need to do?
I will start by linking to an Android PubNub project that was created to interact with a Raspberry Pi remotely. Take a look here https://github.com/GleasonK/PHue
I have created GCM account and using the api key as the sender ID.
Are you trying to use GCM? If all you need is Pub/Sub you simply need your developer Pub and Sub keys. Unknown host might be because you are using the wrong keys. Visit the admin console and log in (https://admin.pubnub.com/). You should then see Publish Key and Subscribe Key. Those are the two you need to use when instantiating a Pubnub object in Android.
If your project actually requires GCM, PubNub does support that as well. From the PN Blog. If this is what you need me to elaborate on let me know and I would be glad to!

Is Google Cloud Messaging Service required for push notifications

I am looking to create an Android app that uses a MySQL database located on a server. When certain changes are made to this database, I'd like a push notification to be sent to some app users. My question is, is the Google Cloud Messaging Service required to implement this? This page http://developer.android.com/google/gcm/index.html seems to suggest that using the Google Developers Console is also required. If so, is it possible to export this project into Eclipse? Thanks in advance.
My question is, is the Google Cloud Messaging Service required to implement this?
Yes and no, if you want to do real push messages then yes it is required however if you dont want to use GCM you can use XMPP to send messages to devices
Push notification can be generated using alarm in android.See this.
But here you are looking to send push notification after certain changes in your database which is located in your server,for that GCM will be a better option.You can find an excellent tutorial of GCM here.

Implementing the GCM in android app just for pop notification

I have android app which is basically mobile server communication app ,when I send data through this app it gets updated on on all the devices which have this application, Like I send Person "name", "phone no" and some description from this application then It will store onto my online database and will be shown on the this app in the form of listview,NoW I want whenever I put or send data through this app,A push notification or popup notification will be appear on the devices which have this application, I am trying to implement GCM Google cloud messaging AND follow this Tutorial:
But I didnot Know how can I Integrate this with my app, would you please help me and suggest me some blog or tutorial regarding my current senerio.
You are using old concept which has been deprecated.Now it is recommended to implement google cloud messaging(GCM) using google play services library. See this tutorial. Hope this helps
http://techlovejump.in/2013/11/android-push-notification-using-google-cloud-messaging-gcm-php-google-play-service-library/

Create push notification in android

how to create push notification in Android using GCM or either C2DM i have tried and check some sites and didn't get exact answer.i need to know how it works.Can any one provide me good tutorial on push notification
Could anybody help me. Thanks!!
Its Depend on your requirement what you have to do.
here is sample of C2DM: in this sample android device is registered wtih server after that server send massage to all device. so there is one way communication(server to Android device)
So all things are done at server side. just download this tutorial. Both Server side(PHP) and Android code are available.
Edited:
you got application key from Google services which you have to put at server side.
SENDER_ID – Google project id which you have to send when you want to register your device with server.
You can use GCM demo app supported by Google. One needs to install GCM libs using SDK manager and then create API keys in Google APIs console. Follow instructions from the link and you can create an app that receives push notifications from GCM server. I did try this and it worked even on my Android emulators. You need to use Emulator that targets Google APIs though.

Categories

Resources