Send Push notifications to iOS/Android on closed WiFi nework (no internet connection) [closed]
Asked Answered
D

5

19

I would like to create an app that users can use in an area/venue where there is NO GSM/3G or any kind of cell reception. We also only provide a closed WiFi network without an internet uplink, so it's a LAN where devices (PC's and Smartphones) can communicate with each other but not with the outside world (don't ask why :)

The users will be instructed to download the app before they come to the venue.

My app needs to be able to receive push notification but of course it cannot reach Apple's APNS or Google cloud messaging services. The app however does register to our central server on the LAN with an IP. (it logs in when the user is connected to the WiFi network and we have the phonenumber that belongs to a registered phone.)

Now my question is: is there a way to send a push notification when an event is triggered and the app needs to wake up without using or connecting to Apple's or Google's online notification services?? E.g. an on premises push notification service that can be used to send a notification to a users phone based on an event that is triggered by our server?
Any suggestions?

Update: Just to clarify, it's a simple VoiP app that connects to our sip server and let's users call each other so it needs to be fairly real time for the two calls to connect. But apparently you can only wake the app up by push notification and therefor need internet.

Disused answered 2/7, 2013 at 10:58 Comment(1)
For Android, check out Pushy (pushy.me) which can be self-hosted, does not depend on GCM/FCM, and does not require an Internet connection to deliver notifications. Full disclaimer - I founded Pushy.Groin
B
7

E.g. an on premises push notification service that can be used to send a notification to a users phone based on an event that is triggered by our server?

With respect to Android, the answer is "not really". Your options are:

  • Implement your "push" mechanism in the form of some message queue, where the devices poll looking for messages every so often, or

  • Use a WakeLock and WifiLock to keep the device (and WiFi) powered on constantly, then use something like MQTT for the push message

Either of these will be bad for the battery, though the first one is more configurable in terms of power drain (e.g., if you only check for messages once per hour, it won't be bad).

The reason why GCM can keep the power drain low is because of special hooks for mobile data connections within the OS and chipset, such that the CPU can power down while retaining an open socket connection to the push server, where incoming packets from that server will wake up the device. This is not available for WiFi.

Breastbeating answered 2/7, 2013 at 11:7 Comment(7)
Could you please explain why WakeLock and WifiLock are necessary?Bizet
@Naxos84: If the device falls asleep, or the WiFi radio gets turned off, MQTT messages will not get delivered.Breastbeating
Thank you. One more question about this. Facebook uses MQTT (without GCM?) but i dont think they use WakeLock and WifiLock. So there must be another way how they get those notifications...Bizet
@Naxos84: Facebook presumably relies on the mobile data connection, which does not require these locks to be on constantly. They just reconnect once the device falls over to mobile data from WiFi. However, that is irrelevant to the question, as the question is about push messaging without an Internet connection.Breastbeating
Do you have a source on "special hooks for mobile data connections within the OS and chipset"? I'd love to read more about this and its associated benefits, whether on Android or iOS.Squib
@Schemetrical: On this topic, what I have learned is mostly from Google I|O presentations. An early presentation on C2DM (the precursor to GCM, which is now FCM) covered what I referred to here. And any I|O presentations on battery/power concerns probably touch on this.Breastbeating
You're right, I found some papers and it turns out it's only well documented in Android due to the clear definition of different device states, whereas on iOS it is mostly a black box. In 2010 ish it is definitely surprising to see iOS choose cellular over Wi-Fi for reliability (due to the power drain), but these days cellular is certainly more reliable.Squib
B
5

And for iOS the answer is NO. You cannot push notify a device without utilizing Apple's APNS server. Your only option would be local notifications triggered in some other fashion on the device via WiFi although you would still need to keep the device awake to receive these or perhaps add VOIP service or another compatible service to allow for continuous background processing.

Local Notifications iOS

Baize answered 2/7, 2013 at 11:11 Comment(1)
The app is a VoiP app so it needs to be fairly realtime to connect the two calls. It's a simple app, it just connects to our sip server but apparently I cannot make the app wake up without push notifications. I also found this https://mcmap.net/q/668102/-apns-spoof-fake ... how about that?Disused
E
2

Receiving Voice and Text Communications on a Local Network added in iOS 14

Refer Apple Docs: https://developer.apple.com/documentation/networkextension/local_push_connectivity/receiving_voice_and_text_communications_on_a_local_network

Eudemonics answered 18/9, 2020 at 7:38 Comment(0)
A
1

You've probably long since solved or given up on your specific problem. But for reference iOS has evolved over the years and now supports the exact type of VOIP functionality you describe.

A Voice over Internet Protocol (VoIP) app allows the user to make phone calls using an Internet connection instead of the device’s cellular service. Such an app needs to maintain a persistent network connection to its associated service so that it can receive incoming calls and other relevant data. Rather than keep VoIP apps awake all the time, the system allows them to be suspended and provides facilities for monitoring their sockets for them. When incoming traffic is detected, the system wakes up the VoIP app and returns control of its sockets to it.

Auriga answered 5/4, 2017 at 17:15 Comment(0)
A
-2

I answered this elsewhere, but this question is older

No. Without the internet, it is not possible to stimulate the OS Push Notification triggering system manually separate to the official OS vendor infrastructure.

You can find a list of workaround options on my answer

Arvillaarvin answered 4/4, 2021 at 12:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.