Are GooglePlayServices required to work with GCM? - android

I've been trying to investigate about this on the internet but the information is either unclear or obsolete. The question is pretty straightforward, does Google Play Services need to be installed on the user device if I want to use Push notifications through GCM? I understand I do need to include GPS libraries as a dependency to develop, but does the user also need the GPS APK on his device?
If so, are there any other alternatives? It seems a little too much to impose this dependency for a pretty basic task such as push notifications.

yes it does, GCM is part of Google Play Services.
alternatives would be to use XMPP but you lose all the benefits of GCM
Update
as of yesterday GCM is now FCM (Firebase Cloud Messaging), its basically GCM re-branded for some dumb reason but it still requires Google Play Services

Related

Does Google ban internally implemented mobile push notification

I want to implement my own push notification system. My question is does google will ban or show warning for my application cause I don't use its Firebase Cloud Messaging?
Wether or not you decide to use FCM, you will have to create notifications locally when a message is received from server. There are no restrictions on local notifications so the answer is No, there are no restrictions or warnings.
Simple answer - No, it does not.
It would be kinda hilarious if they punished(banned) developers for creating notifications, something that's pretty vital in many applications.

Install 2 SDK for Push Service

Can I install 2 Pusk SDK Service in an app (Android and iOS)? we need to migrate from ExactTarget to Parse or UrbanAirship, but managers need time to migrate, so, we want to use ExactTarget for Marketing automation process (already configured) AND use Parse internally for calling API triggers notifications.
if you are working on native android apps then i suggest to use google cloud messaging for sending push notifications,in my experience i use UrbanAirship for Web apps only,using multiple SDK is not good idea because if you are working with one technology/process for notifications then its easy to configure any problem if occurred in future..
There's nothing 'wrong' with using two SDKs to handle push notifications. For iOS, delivery is handled by APNS (Apple), and for Android, delivery is handled by GCM (Google). So, the delivery of the notifications will not change. The SDKs that are provided by the services you listed above are normally used to:
1) Handle the arrival of the notifications
2) Record/manage the audience to which notifications can be sent to
3) Provide analytics for the notifications that were just sent.
The biggest concern/issue that you probably will have will be the handling of your audience. Services such as Urban Airship and Parse, provide the convenience of managing your device information. Without going into too much detail, you have to know WHO you are sending notifications. Depending on which provider you choose, you will need to migrate that device information from old to new. Here's some links that will get you going on that, but let me know if you have any other questions:
Apple:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
Google:
https://developers.google.com/cloud-messaging/server-ref

Is it possible to use GCM without Google account AND Google Play Services on the device?

I'm writing a system app for a device that has
no Google Play Services nor Google Play Store installed.
I want to implement push notifications.
The device is running Android 4.2.2 and official Google GCM docs say:
A Google account is not a requirement on devices running Android 4.0.4 or higher.
But these docs are related to the new version of GCM which uses Google Play Services (not an option for me)
So I tried using the old, deprecated GCM helper library.
I installed GoogleServicesFramework4.0.x on the device (I can install GSF. but not Google Play Services)
I am now getting the AUTHENTICATION_FAILED error and registrationId is null.
I am guessing this is because no Google account is set up on the device.
Does the deprecated GCM library require Google account?
(My SENDER_ID is correct, I already checked that)
Basically, my question is:
Is it possible to make GCM work without Google account,
using the old, deprecated GCM helper library?
NOTE: I mustn't create Google account on the device (this is a requirement)
If this is not possible, then please suggest another way of implementing push notifications.
(Note that most of the push notifications providers actually use GCM "under the hood" (Urban Airpush, for example), so don't suggest those)
I would like to avoid having to poll server for notifications ("pull notifications") if possible,
thank you.
Just prior to the quote you posted (about Google account not being required), you have this :
It requires devices running Android 2.2 or higher that also have the Google Play Store application installed, or or an emulator running Android 2.2 with Google APIs. However, you are not limited to deploying your Android applications through Google Play Store.
Therefore it seems Google Play Store is a must for GCM to work.
Pushy is a paid alternative to GCM that works without Google Play Services. Alternatively, you can develop your own notification service using MQTT or XMPP.
As an alternative to GCM, you could use MQTT as an open source and popular push notification alternative when Google account and Google Play services are absent on the device. Facebook has used aspects of MQTT in Facebook Messenger.
MQTT implementation requires:
1) an MQTT broker which runs on the server side. This could be something like the mosquitto broker which is Open Source.
2) an MQTT client library which you include in your Android app, enabling your app to connect, subscribe, and publish messages. There are a number of Java options listed at http://mqtt.org/software
3) to come up with a way of uniquely identifying users or devices, and then use that as a topic so that you can individually publish a message to one device.
Dale Lane has written a nice guide on this (http://dalelane.co.uk/blog/?p=1599) and there is also a good set of resources about MQTT (https://github.com/mqtt/mqtt.github.io/wiki)
Also the blog post Github sample below provides a practical example to implement MQTT push notification for Android:
http://tokudu.com/post/50024574938/how-to-implement-push-notifications-for-android
https://github.com/tokudu/AndroidPushNotificationsDemo

Can an android work on both GCM and C2DM?

I have an app that currently uses C2DM for push notifications. I would like to inquire if I update the app to GCM and if some users do not upgrade their app, will Google allow me to use both the C2DM and GCM for the two versions of my app?
Or will the users on my previous app never receive a PUSH notification altough I still have the push logic implemented for C2DM?
I've completely replaced C2DM with GCM in the app, and left support for both protocols in the server side. Works like a charm; details are here.
They will still receive them as long as you don't remove any authorisation keys, ids etc. as GCM uses the Project ID while C2DM uses the registered e-mail address.
More on it here: C2DM to GCM Migration
Once the C2DM service was deprecated recently I advice you to migrate your pushes system to GCM service.
The best way to deal with it is doing the thing like Google says. Take a look at this topic in the official GCM's documentation.
While not the original question, an interesting one would be: Can one app simultaneously use C2DM and GCM.
C2DM uses the Sender-Account while GCM uses the Project-ID to register. The only thing they both might share is the App-package name (and obviously the google account of the device, but that shouldn't matter as there are multiple apps which can use gcm/c2dm in parallel anyway).
In my experience registering C2DM and GCM in the same app can cause some serious problems.
Reason to have both in one app might be that you want to use GCM in the app, but can't everywhere because a legacy backend might not be able to switch to GCM yet. Probably a rather rare scenario - but currently happening for our app.

Google Push Notification

Just now Google introduced Google Cloud Messaging for Android. But here problem is that end user must have atleast one google account to use this service. is possible to skip GCM and send push notification end user or suggest any other way?
Important: C2DM has been officially deprecated as of June 26, 2012. At that time C2DM stopped accepting new users and quota requests. C2DM has been replaced by Google Cloud Messaging for Android (GCM). The C2DM service will continue to be maintained in the short term, but developers must use GCM for new development. We also encourage developers to move existing C2DM applications to GCM to take advantage of GCM features. See the C2DM-to-GCM Migration document for more information.
Well this is part of C2DM prerequisite Can't skip this mate.. thanks
To use GCM user have to be registered in goggle service. If you distribute you application only by Google Play this is not a problem.
There are alternatives but they have lots of disadvantages: sending SMS (you have to pay for it); implement own Push Notifications (by polling your server) - it is easy to make some mistake and drain phones battery and requires lots of work.

Categories

Resources