Skip to content

Instantly share code, notes, and snippets.

@APwhitehat
Forked from CHEF-KOCH/ANDGCMalt.txt
Created March 19, 2017 01:14
Show Gist options
  • Save APwhitehat/c8896622766c44e6c5e583556448d772 to your computer and use it in GitHub Desktop.
Save APwhitehat/c8896622766c44e6c5e583556448d772 to your computer and use it in GitHub Desktop.
Android Google Cloud Messaging (GCM) alternative
Android Cloud to Device Messaging Framework
https://developers.google.com/android/c2dm/?csw=1
MQTT
http://dalelane.co.uk/blog/?p=1599
https://github.com/JesseFarebro/Android-Mqtt
http://stephendnicholas.com/archives/219
http://stephendnicholas.com/archives/1217
http://ollieparsley.com/2013/05/20/using-mqtt-as-a-gcm-replacement-for-android-push-notifications/
http://www.slideshare.net/henriksjostrand/devmobile-2013-low-latencymessagingusingmqtt
What benefits does MQTT have over GCM?
- Pub/Sub: A client can subscribe to multiple topics
- Quality of Service (QoS): GCM is pretty much “fire and forget”. You receive acknowledgement that the message has been received but the server, but not that it is delivered to the client, so you will never know if the client got the message unless they communicate back to the server (which my code used to do). MQTT has 3 levels of QoS. Which vary from “fire and forget” to full acknowledgement that the client received the message.
But there are a few things you might miss if you move away from GCM:
- The massive Google infrastructure
- You don’t need to manage your own long-lived TCP connections in a service
Good read about websockets and energy efficiency on mobile phones:
http://nordsecmob.aalto.fi/en/publications/theses2013/thesis_estep/
WebSocket info:
http://www.elabs.se/blog/66-using-websockets-in-native-ios-and-android-apps
The WebSockets part is desired to have an alternate PUSH mechanism besides GCM or APN, the federation is using plain-old HTTP between the servers' APIs as far as I see.
GCM/C2DM problems:
- When using the current GCM data-channel messaging, I assume that the server has access to the metadata?
- When using the current GCM data-channel messaging, who controls the server? Are they Google hosted servers pr other externals?
* In short, how do I know who does and doesn't have access to my metadata?
- The message size limit is 1024 bytes
- Google limits the number of messages a sender sends in aggregate, and the number of messages a sender sends to a specific device
Apple's Push Service:
https://developer.apple.com/library/IOs/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
iOS XMPP clients divide into two groups. In the first group there are apps that do not use Apple Push, that maintain your privacy but silently close the connection if the phone screen is turned off or another app is opened.
In the second group, there are apps that use their own custom proxy server, to which they forward your XMPP credentials.
http://legastero.github.io/customxeps/extensions/push.html
https://cloudup.com/c223kt48cGZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment