I am currently working on my project like Parental control. I am trying to find a way , that if there is any procedure or way to send a notification from an android phone to a website whenever the android phone sends/receives an SMS and dials/receives a call. On website , a database will be maintained for these notifications.
You could send a get request or post request to a website.
Sending POST data in Android
Android - Sending HTTPS Get Request
Just some examples. You will probably be looking for a restful api. I haven't read this, but it looks viable:
http://www.9lessons.info/2012/05/create-restful-services-api-in-php.html
I think you want to maintain database, based on mobile even. You can create API call, that will send data to database while any activity happened on mobile. That api will store notification on DB.
On web you can create AJAX call that will check in DB, if any new notification come or not, if new record found you can show it on website.
This is what I think the best way to do so...
Related
I'm using firebase push notifications php api with android...
When I send a notification from firebase API, to android device, I also make a MySQL input, to register one copy of that, and work!
but...
What happen when the API sends too many push notifications?
There is no problem with my shared server?
I'm worried that my server will collapse for too many records for each push.
Right now It work like this...
Firebase API PHP send notification -> MySQL register that notification in one table -> Android Device recieve the notification.
but I don't think this is the right way...
so... the question is...
what is the proper way to save a firebase push notifications sent...?
I need to send something to tell the android app that a customer just clicked the buy button in the page. The online store is written in php, and is embedded into android app by webview.
Usually I will write api to android, and they will just call the php url, then my php can communicate with the front end. However, in this case, it seems that the android has to provide me some kind api to call, so I can send my data to him.
Or is there a way android can set a listener to check if the buy button is clicked?
You can achieve this using 2 ways.
1) Create a java-script in your PHP code and from android Webview you
can call that java-script to check whether button clicked or not. You can refer this for implementation.
2) You can use Firebase Cloud Messaging Or anyother 3rd party Push
Notification services. But for my opinion FCM is best and you don't
need to pay for it. You can refer this for implementation.
I am trying to develop a web site which will send push notifications to all users currently watching it. I found some tutorials on how to send pushes to myself using GCM for Chrome and they are working fine,
(https://github.com/gauntface/simple-push-demo)
but I cannot understand how to send pushes to every user who is currently on my site and allowed to receive them. As far as I understand I need to collect their browser IDs when they subscribe
navigator.serviceWorker.ready.then(function(serviceWorkerRegistration) {
serviceWorkerRegistration.pushManager.subscribe({ userVisibleOnly: true })
.then(onPushSubscription)
but I cannot find how to get and store them (perhaps in MySQL DB with PHP code) and after that how to send a push to everyone (probably to iterate over all browsers IDs in my DB and send pushes to everyone separately with cURL requests). On my site I have code which uses ServiceWorkers and handles users subscription but everything is working for me only. Noone who is else on a site does not receive any notifications. Any help would be appreciated.
I am following this tutorial from androidhive. http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Everything is working But The tutorial only shows how to send a push to ONE device at a time. I would like to send a push notification to all devices at once using the same method. I believe the way to do this is by editing the send_message.php But i'm still trying to understand how his method works.
I have tried commenting and emailing the person who wrote the article but have not gotten a response. I just need someone to point me in the right direction.
Any hints, guildance, answers, comments are much appreciated.
Now that you have successfully implemented what that tutorial teaches, the basis idea now for sending to multiple users will be something like this:
To send push notification to multiple users, you need to create an application server in PHP.Your application server will receive the registration id from the android application and will store it in a database (may be mysql).
Now when you want to send the message to the application then you write a message and fetch all the registration ids from the database which was stored earlier.
You can follow this useful tutorial to achieve exactly what you want.
The tutorial which you have mentioned was made using GCMRegistrar which is deprecated now.Instead you need to use GoogleCloudMessaging API.The link which i provided uses the new way.Hope this helps you to implement what you want.
I have made a webapp for my android phone where I can check the sales at my store when I'm not there.
I would like to have notifications on my phone whenever a sale is made.
What is the best way of doing this? Any existing android apps that I can configure to check a php-script every 2 minutes or something?
Try using XMPP to send a message to yourself, which you can receive via gtalk on the phone. Alternatively, an email, SMS, etc.
Could you rig up an RSS feed and use a feed reader to notify you?