You can use:
NSString *countryCode = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
To get the user's country code. The country code for Germany is DE.
You can then check the user's country code and if it isn't DE then lock the app by bringing up a screen saying the app is locked or something like that.
For the WLAN part of your question, you can get the name of the network the user is connected to:
This class will show only the wifi network name you are connected to -
import UIKit
import SystemConfiguration.CaptiveNetwork
class ViewController: UIViewController {
@IBOutlet weak var label: UILabel!
override func viewDidLoad(){
super.viewDidLoad()
let ssid = self.getAllWiFiNameList()
print("SSID: \(ssid)")
}
func getAllWiFiNameList() -> String? {
var ssid: String?
if let interfaces = CNCopySupportedInterfaces() as NSArray? {
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
break
}
}
}
return ssid
}
}
You can check if that class is not equal to a pre-set class to block some functionality.