I noticed by in Boingo's Wi-Finder iOS app, that the app pushes a notification to the user once he reaches an access point regestered at Boingo's database. The notification tells the user that he can access the wifi network.
How is that done iOS?
3 Answers
Answers 1
I think it can be done by observing the device's connectivity with Reachability class in AppDelegate
's didFinishLaunchingWithOptions
and when networkStatus
is equals to ReachableViaWiFi
then call application.registerForRemoteNotifications()
Answers 2
You can make use of CLLocationManager and UserNotifications to achieve this.
You can use the region-monitoring services like CLCircularRegion class (to get geographical regions) or CLBeaconRegion class (to get beacon regions) to get notified when the user crosses a region-based boundary. If the boundary crossing occurs even if your app isn't running, the system automatically wakes it up (or relaunches it) in the background so that it can process the event.
In this case, the options dictionary passed to the application(_:didFinishLaunchingWithOptions:) method of your app delegate contains UIApplicationLaunchOptionsKey.location. Then trigger a local notification in order to notify the user the available services in that location.
Examples:-
- Using location monitoring:- https://www.raywenderlich.com/136165/core-location-geofencing-tutorial
- Using iBeacons - https://www.raywenderlich.com/101891/ibeacons-tutorial-ios-swift
Answers 3
You can get the SSID of the Wifi hotspot and if it's registered one, you can follow Mohy's answers. Please check the following link.
This will help you to get the SSID of Wifi hotspot.
0 comments:
Post a Comment