Is it possible to use AppCenter Push notifications without GCM? - android

I have purposely built Android mobile phone without Google Play or any of the Google services installed. I'm building Xamarin.Forms mobile app and need to show Push notification. I'm trying to do this using AppCenter, I can see that the device has been registered on Analytics, but no push messages are showing up. Am I missing anything?

Google announced it is migrating from the Google Cloud Messaging (GSM) platform to Firebase Cloud Messaging (FCM). For Android developers, the Firebase SDK is required to use Push Notifications. For additional information, please refer to the SDK migration guide.
and
Only devices with the Google Play Store application or emulators using Google APIs images can receive notifications.
https://learn.microsoft.com/en-us/appcenter/sdk/push/android
You need FCM (GCM is deprecated)

Related

Is Google GCM still available?

I'm trying to create a simple android push notification app using Phonegap build and GCM.. I currently can get the android's device token using a phonegap plugin and store it in my database without any issue.
I just need to know if I can still use GCM (Google cloud messaging) OR I need to start using FCM (Firebase Cloud Messaging)?
Any tutorial I found on Google is about GCM and they all say to enable the 'Auth & API' under the google cloud messaging section in the google console. but when i go to GCM in my Google console, I don't see anything like that and everything seems to be about FCM which is frustrating when there are no information about how to use it with Phonegap build!
Is Google GCM still available or the new app 'Have' to start using FCM from now on?
I mean Google console is confusing enough without them keep changing everything every month or so!!
Could someone please advise on this issue?
Cloud Messaging (GCM) is now part of Firebase, see also this link.
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features!
If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.
Is GCM going to be deprecated?
We will continue to support the current version of GCM Android and iOS SDKs because we know a lot of developers are using GCM SDKs today to handle notifications, and client app upgrade takes time.
But all new client-side features will be added to FCM SDKs only moving forward. You are strongly encouraged to upgrade to FCM SDKs.
In short, stop using Google developer console in order to use GCM, use this:
https://console.firebase.google.com/?pli=1, as shown below.

Azure Notification Hub no longer accepting GCM API Key

Recently, every time I try to add or modify the GCM API Key in an Azure Notification Hub, I get the following error:
SubCode=40000. Failed to validate credentials with GCM. The remote
server returned an error: (401) Unauthorized...
I have tried using the same key that works in other Notification Hubs, as well as creating a new one via the Google Developer's console.
I've also recently come across articles stating that GCM is moving to FCM (Firebase Cloud Messaging). Could this be the cause of my issue? Is Google beginning to no longer support GCM?
There are two important informations:
Firebase Cloud Messaging (FCM) is the new version of GCM
So we should prefer Firebase Console instead of Google Cloud Console,
There is a useful article here Enabling Google Cloud Messaging (Firebase)
So we need to enable Google Cloud Messaging in Firebase Console for your added Android App.
Step by step:
-- Open your Firebase Console
-- Add your Android app in Firebase Console.
-- Go to Settings
-- Click CLOUD MESSAGING tab.
-- Take Legacy Server key there and use it in Azure Push Notification Service for Google(GCM) settings and Save it. That's all.
This article helps you how to create a Notification Hub Service in Azure then how to connect your Android or IOS App to Firebase Console etc.
Could you make sure that 1) you have enabled Google Cloud Messaging for Android in your cloud push account and 2) you are creating a new Server Key?
Also, use try sending a push notification from the command line to validate that the key is working with GCM directly. If that works, then Azure portal should accept the key. If that's not the case, please leave a comment.

Migration from GCM to FCM needed?

Google just announced that Google Cloud Messaging is now Firebase Cloud Messaging. What does this mean for existing users of GCM and what migration (if any) are needed?
What is FCM and why should we use it?
FCM (Firebase Cloud Messaging) is a new, improved version of the Google Cloud Messaging API under the Firebase brand. It has all the features of GCM as well as some additional features. Per the Firebase FAQ, it "inherits GCM’s core infrastructure, with new SDKs to make Cloud Messaging development easier". Google explained their decision to release FCM in their Cloud Messaging FAQ, where they wrote:
Firebase is known for being cross platform, so FCM now makes a natural fit in the Firebase suite of features designed for Android, iOS, and mobile web
Google recommends upgrading from GCM to FCM in their APIs for Android Release Notes. Reasons for doing so are given in the Firebase FAQ:
Benefits of upgrading to FCM SDK include:
Simpler client development. You no longer have to write your own registration or subscription retry logic.
An out-of-the-box notification solution. You can use Firebase Notifications, a serverless notifications solution with a web console that lets anyone send notifications to target specific audiences based on Firebase Analytics insights.
Is GCM deprecated?
Some features of GCM are already deprecated (see https://developers.google.com/cloud-messaging/android/legacy-regid, for example) and now in the coming days GCM is going to be fully deprecated. Google says:
We will continue to support the current version of GCM Android and iOS SDKs because we know a lot of developers are using GCM SDKs today to handle notifications, and client app upgrade takes time.
But all new client-side features will be added to FCM SDKs only moving forward. You are strongly encouraged to upgrade to FCM SDKs.
How to update old Android applications from GCM to FCM
From https://developers.google.com/cloud-messaging/android/android-migrate-fcm:
Import your GCM project as a Firebase project:
In the Firebase console, select Import Google Project.
Select your GCM project from the list of existing projects and select
Add Firebase.
In the Firebase welcome screen, select Add Firebase to your Android
App.
Provide your package name and SHA-1, and select Add App. A new
google-services.json file for your Firebase app is downloaded.
Select Continue and follow the detailed instructions for adding the
Google Services plugin in Android Studio.
Update: There was a recent announcement via email that GCM is now deprecated and will be completely removed next year (2019), and all GCM users should start migrating to FCM. For more details, see my answer here.
In addition to what Pritam Baral's answer, note that FCM's core is composed of GCM itself. There is no actual need to migrate to it, but it is encouraged, since when migrated to FCM, all of the features tied to it will be available for use. When referring to the Firebase Official Pricings Page, the features that are included for free are:
Analytics, App Indexing, Authentication, Dynamic Links, FCM, Invites, Notifications, Crash Reporting, & Remote Config
Pre-IO GCM implementations should still work for a longer time in the future, as stated in the GCM and FCM FAQs:
We will continue to support the current version of GCM Android and iOS SDKs because we know a lot of developers are using GCM SDKs today to handle notifications, and client app upgrade takes time.
But all new client-side features will be added to FCM SDKs only moving forward. You are strongly encouraged to upgrade to FCM SDKs.
As per the recent highlights:
Firebase Cloud Messaging builds on and improves the Google Cloud Messaging API. You can keep using Google Cloud Messaging with com.google.android.gms.gcm, but we recommend upgrading to com.google.firebase:firebase-messaging.
The cloud infrastructure will mostly remain the same, so existing GCM apps should continue to work fine. Although I haven't found any mention of a deprecation policy from Google yet, it would be unusual for Google to (and they have little reason to) break existing GCM infrastructure/SDK/code.
FCM seems like a better version of GCM, being available on multiple platforms (even web!) and simpler to setup (compare to GCM). Migration guides are available for Android and iOS
Google have expanded GCM to send messages to multiple platforms beyond Android: iOS and Chrome. Firebase is known for being cross platform, so FCM now makes a natural fit in the Firebase suite of features designed for Android, iOS, and mobile web.
FCM
it is advance/improved version of GCM but with new brandname Firebase
very easy/Simplified client development
Server-less console where anyone can send notifications to specific device
Notification payload: 4KB, Message payload: 2KB. Note that the notification includes device and app information too.
Stores 100 notification/messages per device if the device is offline.
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits
the reliable and scalable GCM infrastructure, plus new features! See
the FAQ to learn more. If you are integrating messaging in a new app,
start with FCM. GCM users are strongly recommended to upgrade to FCM,
in order to benefit from new FCM features today and in the future.
FCM is the new version of GCM under the Firebase brand. It inherits GCM’s core infrastructure to make sure we continue to deliver messages reliably on Android, iOS and Chrome.
Yes some features of GCM is deprecated, but they are supporting all previous clients.
To upgrade from GCM SDKs to FCM SDKs, please see the guides for migrating Android
For more information.https://developers.google.com/cloud-messaging/faq

Can I use appengine to push notifications locally?

I want to make an appengine server that can push notifications to android devices locally, without publishing my app to google. Is that possible?
Using GCM (Google cloud Messaging), with or without Google App Engine, does not require you to publish your application on the play store as long as :
The play store is installed on the device.
A google account is configured on the device (not needed anymore for Android 4.0.4+).
See GCM overview (the first bullet list) for more details.
GCM cannot be used without an internet connection.

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

Categories

Resources