I'm building an open source application which is intended for users to self-host. Now, I would like to add push notifications on Android and iOS that would be sent from the self-hosted server application. Is there any alternative push notification service that does not require an API key (FCM, APNS) or per hosted instance registration (PushBullet) for this use case?
I've googled for this, but the only thing I've come across which even remotely resembles this is Pushjet.
Open source projects seem not to rely on Push Notifications, which is a shame considering how many great things can be done with them. I would really appreciate any and all suggestions.
To clarify, the project can't use Firebase, PushBullet, APNS or similar because all of these either require the developer to publish an API key in their app (Firebase) or require the user to register their clients and servers individually with a service like Pushbullet.
This question is specifically about avoiding this registration requirement and using some "public push" type service (if one exists).
Some examples of exactly what I'm trying to avoid:
https://julienrenaux.fr/2015/06/25/ios-android-push-notifications-100-free-and-self-hosted-for-wordpress-using-cordova-and-ionic/
https://home-assistant.io/components/notify.pushbullet/
https://github.com/mattermost/mattermost-push-proxy/blob/master/README.md
For anyone who's curious, the project is here: http://gitlab.mccollum.enterprises/icing/
Related
without getting into too many details, I would like to build an app capable of messaging between small groups of people. Basically, I need an API that will allow me to a) create a group message, and b) will allow me to later add people to it based on their selections from the application itself. I am relatively new to server side coding and am looking for some suggestions, tutorials, suggested apis (google hangouts vs facebook vs any other services that would be of use), etc. I already have google plus integration with the client side and server side authentication, so it seems like if something is possible with hangouts that would be the easiest route, but again I am just looking for anything really at this point.
The way I was kind of (hoping) it would work is that some messaging service provides the group chat and gives me an ID to it, which I could then have the clients request to be added to a particular chat and then I pass them back the ID to the chat and it begins an intent that takes them to the app itself that is hosting the chat between my users. Let me know if this is possible please, along with any suggestions!
You might want to try researching the ejabberd messaging server. It is probably going to be a bit heavy for your needs as well as difficult to learn (it is in Erlang) but I've found it extremely steady as a back-end for building a messaging server.
I have an android application that is designed to receive push notifications via GCM. When I initially designed the application, I used a "deprecated" tutorial (merely because it was one of the most in-depth I found) and my dev phone was running API 2.4, so I was able to get the service up and running without much issue.
Now, my development device is running Android version 4.4.2, so my goal is to "upgrade" my application to handle GCM properly for all devices (for now, lets ignore the fact that I'll have to differentiate how to handle Push Notifications depending on API level).
I attempted to follow the Android Developer tutorial for creating a demo client app for Google Cloud messaging, which can be found here. https://developer.android.com/google/gcm/client.html
While I hate to sound like I want to ignore to smart coding practices, this official walk through was a little big in terms of scope (My application supports Phonegap, and while I think implementing native GCM is much easier than using the PushPlugin for Phonegap, I don't want to handle more than is absolutely necessary in my Java code)
As a last ditch effort, I simply downloaded the demo gcm code from the source they provided here: https://code.google.com/p/gcm/source/browse/samples/?r=1ca8e646c517310e2d46a6a6eda74106b8084fc5
I attempted to import the gcm-demo-client application, and although I know my SENDER_ID, I don't understand anything about the SERVER_URL. The documentation provided by Android Developers talks very generally about HTTP vs. CCS, and I'm struggling to grasp where this server fits into the grand scheme of all that is Google Cloud Messaging.
Assuming I download the gcm-demo-server project directory they included (which seems to be some kind of Java Project), how do I host it? My previous deprecated GCM simply used a basic android application in which I would submit a form containing the device Registration Id, and a message with a title and context. Unfortunately, I can't figure out how to import their demo-server into Eclipse (since Eclipse doesn't think it contains ANY project files), AND I cannot seem to understand how this server connects with my application in any capacity.
TL/DR Summary of questions:
1.) How can I go about "hosting" the gcm-demo-server from URL #2 above?
2.) If I can just copy the Registration Id from my client app to the clipboard, can I just use my "android server" application to send my messages?
3.) Maybe it's just me, but I don't see anything resembling a Receiver class in the gcm-demo-client project directory, only a GcmIntentService. How can there be an intent when the application can't even properly handle messages?!
Thank you for your patience and help!
(P.S. - I cannot provide any code- however since the code in question is merely the provided Android Developer GCM demo code, this hopefully won't be a big issue)
1) There are many companies that offer server hosting services. You should choose one.
2) If you copy the registration Id manually, and hard code it in an application that serves as a "server", you don't need to host a real server, though that would only work in development. In production, assuming you'll have multiple users who install you app, you'll need a real server that receives and stores the registration IDs of all of them.
3) The demo client project you are referring to is old, and relies on a deprecated library (gcm.jar) which contains a default implementation of the BroadcastReceiver, which receives the messages from GCM server and starts the intent service. If you refer to the current demo app, you'll find a BroadcastReceiver class.
The demo app might not work because it is a gradle project and you should preferably open it in Android Studio. That might be why it could not see it as an Android project at all.
I have recently started implementing GCM myself and it is not difficult at all. I am using AppEngine for holding the backend part of my app. In Android studio, there is a very quick and easy way to generate both the android client and the backend part including the cloud endpoints and even a web interface for sending the messages (you don't need to use it though).
I followed this tutorial https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints
Maybe this is not a fully satisfying answer for you, but I found the code very much readable and I understood how this stuff works.
I am conceptualizing an Android app that sends data from one device to another (like a picture message), but because I do not have a server, I am looking into other ways of messaging. Google Cloud Messaging (GCM) seems like a good choice, since its made for Android, and is free to use, but it still requires a server to use. Is there a way around this requirement- such as running the GCM server on the app itself? Or is there a better approach to serverless messaging on Android?
Yes you can - it's possible to send the same messages from a device that would be sent from a server. However, this has the following problems:
You're putting your API key in your app, so somebody could decompile your APK to get it.
Your users would need some way to share their GCM registration IDs with each other. If two users had both their IDs expire at the same time, there would be no way to share them again.
Really, building your app and hosting it on AppEngine would take about an hour to write, and cost less than $10 a month, even for a ton of users.
For a dead-simple messaging server example written in Java, check out the server backing one of my apps:
https://github.com/charlesmunger/touch-to-text-server.git
I think that will be hard to do what you want effectively without a server but you can check out Parse's SDK. It is free to try and free up to a certain monthly limit.
The docs.
You may want to read "Sending Pushes to Channels" and "Using Advanced Targeting".
What is the easiest way to implement a simple app which does two things:
receive push notifications (new messages in user's inbox),
open a page on my website in a webview or web browser.
It would be best if the solution was portable among iOS, Android and possibly other mobile systems like Windows Phone and BlackBerry 10, but I'm happy with separate solutions, if it's the only way to do it.
I suggest that, checking out Parse apis for this task.
There are solutions like http://xtify.com/ or http://urbanairship.com/products/push-notifications/ that provide an all in one package across platforms but I don't know the quality of service or which one would be right for you, some research on your part will be necessary if you choose this path.
Or you could implement it yourself but it will require your own server. The server would notify both Androids C2DM And Apple Push Service at the same time. You will have to implement the client side on each.
For iPhone here's a good tutorial for setting it up http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
For Android http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html
You register your app with both services then sends the push keys to your server. With the keys the server can then notify both platforms respective push services to send a notification .
I can't really help with the server setup stuff as its not my area of expertise but this is how we implement push notifications for the apps my company makes.
I'd recommend a Phonegap (Cordova) app and UrbanAirship for the notifications. You can get a free account with that. It's relatively easy to implement too.
As for the browser, I'm not sure exactly what you want it for. Could you elaborate and I'll post a response.
I am trying to write an app that will have a web interface for business owners who can select a specific Android mobile app user via querying a database and then have either the website or database(a little unsure about how this would work) push information to the queried user's phone to create a notification for them via the app.
I have never created an app like this and the connection between the website, the database, and the mobile app on a user's phone are all a mystery to me. I've searched the Android developer website and cannot find anything that will accurately explain how to do this, and have also Google'd the topic without much luck.
All I ask is for someone to point me in the right direction to place the pieces together, any information you can provide would be greatly appreciated, thanks!
Your solution will almost certainly involve Google Cloud Messaging.
Implementing GCM will involve a server in which all devices are registered with a central service. So you are half way there once you have GCM implemented. Well perhaps more so, almost everything you mentioned is basically just GCM.
http://developer.android.com/guide/google/gcm/index.html
For this you can use PHP programming to interact with the website.
Refer Android App interaction with Web
and also
Android App Development and Web Server Interactions
These links will be useful.Good luck..