I have App "A" in android device "A" and i have the App "A" in android device "B" . Is it possible for me to send the notifications between the devices through WIFI??
Thanks in advance
There's a variety of ways to do this, but ultimately it all boils down to have an app running on the second device that receives some trigger to show a notification.
Some examples....
You can have an app with a open server socket on device b and then discover and connect to it to send a message that triggers a notification over TCP/IP. http://jmdns.sourceforge.net/ can help with discovery.
If they both have a network connection, you can build something on the App Engine to send a C2DM message to device B, and then upon receiving that message trigger a notification.
Related
I am building a beacon device, which can send data through Bluetooth to a connected device(my phone). To respond to the received data, I'm writing a React Native app. Once connected I want my app to keep running in background listening if some data is received from the connected Bluetooth beacon and then maybe do something with it like push notification or start the app up and sound the alarm.
for do this, you should run your tasks for send and get data while your app not open on mobile, and you can use some packages such as 'react-native-background-fetch' for run your task in background.
I hope could helped to you
I was wondering how the actual request from Server get routed to the Application if the browser is not running. Also, does the service workers maintain an active connection to the server so that it receives the push notification whenever the server publishes something?
I think for every iOS device, Apple keeps a socket open between that device and the Apple Push Notification Service. Which essentially acts as a router for all notifications across all apps and all devices. So your server can send messages to APNS saying "yo, hit up this guy with this message", and APNS will use the socket it has open with every device to send the notification.
Also check out https://developer.apple.com/notifications/.
And https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server
Scenario: Suppose I have set up some WiFi and have one server in it. When android user connect to that WiFi area then I want to send notifications to those devices which is connected with WiFi. I don't want user, to install any app in their devices to receive notifications.
Can I use any system service to receive notification which is already running in the device? or something else which help me in this.
You can create a login page to force users to allow notifications. After the user allows the notification, internet is free to use.
That way, you can send notifications without installing any app.
I am developing app on Android GCM push notification. Everything works fine .But I am not able to get the notification message when my device is on wifi rather than on data plan of service provider. In my case data plan is 3G but and notification comes as usual to devices but when device is connected through wifi I am not able to get any notifications.
Well this should not be the case, I have an android app that receives GCM push notifications regardless it is connected via 3G or Wi-Fi.
What I would suggest to troubleshoot this problem:
When you send the push notification from the server make sure to NOT include delay_while_idle, so the notification get delivered right away. Also make sure you have set time_to_live to a reasonable value (default is 4 weeks)
Try to hold a Wi-Fi lock in your app
Test with different device and/or Android version (maybe it is a problem with certain hardware/API version)
is there a way to determine, if a push notification can be delivered right now?
As far as i know its not possible, but im not sure about it.
So my scenario looks like this:
I have a android app
I have my own server
My app on my android phone should communicate with my app on my friends android phone.
Now im looking for a realtime communication framework and i guess C2DM could help me.
So lets say:
My app on phone A should write a little message to my app on phone B.
Lets assume, phone A is online and can communicate with my server. So phone A would send the message to my server, and my server would now try to deliver this message to phone B.
And thats the point, where my server would try to deliver the message to phone B via C2DM, and thats also the point, where my server needs to know, if its possible to send this message via C2DM or not. Otherwise my server should use another communication way to deliver the message, like sms or whatever.
So the point is, that i really need to know if its possible at this very moment to deliver to Phone B via C2DM (of course my server knows the C2DM Registration ID of Phone B).
Otherwise, for example if Phone B is not connected to the internet and can not receive C2DM push notifications, my server would send a sms to phone B.
Is it possible, to dertemine if phone B is online?
What i try to do is, to reach every user (if his phone is turned on). If he is online, then via C2DM, otherwise via SMS, so that the message is delivered at this very moment in any way.
Note:
I know that C2DM can store notifications and deliver the stored notifications when phone B is online, but thats not the way i want to use it. Note also, that i know (architectural) how to use C2DM. So the "message", that should be delivered from phone A to phone B will not be delivered directly in a C2DM push notification with the message text / sensitive data as message body. Of course the delivered message is only a "update message" to tell my app on phone B, that something has changed and the app should connect now to my server to get (polling) the latest state with the "text message" which has been sent from phone A to you (phone B)
is there a way to determine, if a push notification can be delivered right now?
No. There is no guarantee that a C2DM message will ever be delivered, let alone immediately.
Is it possible, to dertemine if phone B is online?
Phone B can know if it is online. If you implement a server with some sort of long-held socket connection (e.g., XMPP), that server can know if it has an open socket connection with Phone B.