Push Notification without using the Internet, Wi-Fi, APNS and push push apple server

I need to write an iOS application to allow multiple iOS devices to send local notifications to each other WITHOUT an 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 the bank’s office all 14 people use iPhones A person Send a notification to the rest 13 people everyone will receive a notification one person in a group (for example, person H), answer back and person A can get a person’s response H not external internet all iphone we have a private network Wi-Fi configured by the server. TOTALLY NO COMMUNICATIONS with the outside world. No link to external internet.

If possible in the ios app. using swift 3.0. If possible, you can guide me.

+4
source share
2 answers

You can implement this functionality using a combination of Background Sampling ( Apple Documentation ) and local notifications if you have a server within the network that contains the information necessary to display the notification. Conceptually, this will work as follows:

  • Configuring the application to periodically retrieve data from a server inside the internal network using background fetching features.
  • , , .
, , .
  • , , .. , .
  • , Apple , .. . ( ).
  • , iPhone Wi-Fi ; .

EDIT: , :

  • → →
  • AppDelegate.didFinishWithLaunchOptions, :

UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)

  1. AppDelegate:
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping 
(UIBackgroundFetchResult) -> Void {
    fetchData() { data in 
         if data.needsToBeNotified {
             sendLocalNotification()
         }
         completionHandler(.newData)
    }
}

RayWenderlich : https://www.raywenderlich.com/143128/background-modes-tutorial-getting-started

+2

! . , Push Notification -, Wi-Fi, APNS Apple

0

Source: https://habr.com/ru/post/1682012/


All Articles