I need to write an IOS app to let a few IOS devices to send local notifications to each other WITHOUT external Internet connection (without using APNS -- apple push notification server). The environment will be a private internal WIFI network with a dedicated server...
Scanario
we work in a bank office all 14 people using Iphones Person A send notification to rest of the 13 people all will recieve the notification one person in the group (for example, Person H) reply back and Person A can recieve Person H's reply not external internet all iphone what we have is a private wifi network, set up by a server . TOTALLY NO LINK to outside world..no link to outside internet
If it is possible in ios app. using swift 3.0. If It's possible can you please guide me.
You can implement this kind of functionality by using a combination Background fetch ( Apple documentation ) and local notifications , if you have a server inside the network that contains the information which is needed to show the notification. Conceptually this would work like this:
There are three things to remember in this approach, though.
EDIT: For example like this:
AppDelegate.didFinishWithLaunchOptions
method, for example: UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping
(UIBackgroundFetchResult) -> Void {
fetchData() { data in
if data.needsToBeNotified {
sendLocalNotification()
}
completionHandler(.newData)
}
}
RayWenderlich have a nice tutorial about the background modes: https://www.raywenderlich.com/143128/background-modes-tutorial-getting-started
The scenario can be addressed using MQTT Protocol within the Wi-Fi network. You will have to set up an MQTT Broker within the network and Make an MQTT Client in your iOs App. You can subscribe the MQTT Client to the MQTT broker on a topic same as GCM works and use MQTT Broker to send Push Notification to topics subscribed by MQTT Clients.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.