android web-app push notification - android

On Safari, it is possible to have the following setup:
I pay Apple $100 / month to be a web developer.
I put up a site, say foo.com
When a user visits foo.com on their iPhone, a message pops up, saying "foo.com would like to send you push notifications. Do you allow? YES NO"
If the user clicks yes, then I can send the user push notifications:
without using SMS
without the user ever installing my app
On Android, is it possible to do the same ?
I know that there is something called GCM. However, every GCM tutorial I have found involves:
* writing code in Java
* installing an app on the android device
I also know of other commercial tools that will do the push for me.
However, my question is. On Android, is the following possible:
I register to be a Google dev of some sort.
I put up some code on foo.com
When a user visits foo.com on their android phone, a message pops up saying "foo.com would like to send you push notificaions. Allow? Yes No"
If the user clicks yes, then, by talking to some Google server, I can now send the user push notifications (without the user installing an Android app).
On iOS, we have https://developer.apple.com/notifications/safari-push-notifications/
I want to find the equivalent for Android.
Thanks!

Nope, you would need to get them to deploy an application onto their phone for you to then register and send push notifications to. You have to right that application as well, most likely in java. I don't even think your idea would work on iPhones either without a native app as well..

Related

A little help in mobile app sector - question

I am new in mobile app sector and I think about applications which contains google maps, can be available for Android/iOS (i do not have any experience in Objective-C/Swift, Android), has notifications between devices.
For google maps I did some research and I know that I have to google account for using google maps API. I will be able to display devices on the map in real time. How to find device in some radius?
For notification I know that there is Firebase but I have not used it. I saw it have REST API.
For application I want to use Apache Cordova (I know there is PhoneGap too).
I have backend in Java. I thought about something like this:
Device <-- REST--> JAVA (server/DB) <-- REST--> (Firebase)/(Google Maps API)
Is it possible to send notification device <-> device in my configuration?
Does Firebase need his own DB for user/device etc?
I thought about when someone open the app will see available other devices on map and will be able to "tap" on one of them and send it a notification. Is it possible?
Maybe someone can give some tips/links/knowledge about how i can achieve this or how it supposed to be done.
Thanks
How to find device in some radius?
You tell the server with your backend your location, it responds with a list of devices that are "in some radius" (by executing some code that does whatever you define that to mean).
Is it possible to send notification device <-> device in my configuration?
This is never really possible (or done that way). Notifications always come from servers from Apple or Google. If you want to trigger a notification from device 1 to device 2, device 1 would tell the server about it, then the server would tell the push provider who then tells Apple or Google to send a notification to device 2. (Which of course means that device 1 has to be able to identify device 2 somehow, and that the backend has to know about both of these and have a push token for device 2 saved so that it can tell the push provider to send a push there.)
Does Firebase need his own DB for user/device etc?
Firebase is a platform that offers multiple services. One of those is to send push notifications, another is a database to store information about device or users. So no, it doesn't need "his own DB" but there will have to be a database about users or their devices to be able to send notifications.
I thought about when someone open the app will see available other devices on map and will be able to "tap" on one of them and send it a notification. Is it possible?
That is technically possible, although not in this direct way you described, but what I elaborated above.

Push notification without client application installed

we have a web application using responsible html, it is seamlesly usable from mobile browsers...
We would like to send "event" (push notification) to users phones (device!). Standard notification with icon of our app and short text. Pending intent would be just open our web application in browser (URL).
So, question is how to do this without need of client application installed on target phone which would provide registration of such device (send it to our server, who will use it later to let firebase to notify such device).
Is it possible to create a device registration from browser (chrome)? Either to google account used in device or ask to fill it ...
How are web notification related? If I understood it correctly, a page with our app needs to be opened to receive web notification. What about instant apps?
Yeah, we could create a very simple application which would be linked (google play) from our web application - which would provide JUST registration a receiving of push notification. And than just open a browser. But it looks to me as unnecessary, because push client is part of android system. The only what we need to send device ID to our server...
Thanks for any idea. Ideally, a link to documentation or proof-of-concept on github (-: because I believe it is a standart situation.
PS: And sure, as always, at the end we would like to have it multi platform. And no, we prefer not to use non-system providers like pushy ...

Android uninstall notification

Is there any way to send notification when user uninstall app. If user uninstall the app the app owner should get the notification that the following user has been uninstalled the appp. Is it possible?
It's not possible from app itself (barring case if there other apps from same author which can check)
But I think there is usable but complex workaround.
App can register for push notifications (either via GCM or FCM). Server side part of part should store app token for this purpose.
If, after some time, server side part send push and get NotRegistered instead (see https://developers.google.com/cloud-messaging/http#error_codes ) this mean app was uninstalled.
edit:
it's possible using hacky way from native code, per Roland's answer in Is it possible to detect Android app uninstall?
The method is based on the fact that the first thing android does when uninstalling your app is deleting your data file. So you could use a file watcher to detect the deletion. Also you need to write this in native code. If you write your code in java, your app will be uninstalled before it could execute any code. please see this demo : https://github.com/sevenler/Uninstall_Statics
Actually answer is no, but you can use one hack way to find out currently app is available in user device or uninstalled.
Registered your app with GCM,and send daily one notification to user, in which day user did not receive notification then you can assume app is uninstall.
I don't know this way is good or not, just i explain may be you can achieve your requirement !

Is it possible to creat some chat in a website to send message in an app?

I wanted to create a chat browser that would send the message to an android app. For example, I do not have an app that my friend uses. However, I don't want to install the app. I will use this browser to send the message to my friend in his app. And when my friend gets this message in his app and he replies from his app, Me on the other hand will receive the message in this browser.
Are you developing both apps? If so, check out something like Firebase: https://www.firebase.com/. It is suited for exactly what you are looking for. Real-time updates to all clients that are connected.
These neat little App_Script created for Android with browser compatibility should do the trick. This takes both an input box and a message box.
Doing the desired function of sending and recievings Messages.
Documentation here
you will need to be in the same source Code as the other user or a mirror App like viber on the example you provided, on the other hand you could create an application to send regular texts to mobile phones, but that's another subject.

Can this mobile app be created with HTML 5 and JS or do I need native capabilites?

I would like the application to have the following capabilities:
The user would be given a timed, periodic alert (with sound) during certain times through the day upon which he/she is prompted to fill-in a quick survey. The information from the survey would then be sent off to an app server/db (this part would obviously be coded in a server-side language).
Would this be possible with HTML 5 / Javascript or would a framework such as phonegap or rhomobile have to be used?
You'll need to use a native app. There's no way for a website to do anything in the background through safari, and no way for safari to notify the user of anything if the website isn't in the foreground.
Timed periodic alerts are exactly what push notifications are for. Push notifications are only available to native apps. Push notifications will show the user an alert and let them launch the app. They also let you send a small amount of metadata into the app with the notification.
Yes You can for that you have to use phonegap. below are some reference :
http://phonegap.com/start/
http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart

Categories

Resources