Skip to content

Instantly share code, notes, and snippets.

@aitor
Created August 14, 2019 13:41
Show Gist options
  • Save aitor/0e4a247c5d44bfafd5f2820c29b65340 to your computer and use it in GitHub Desktop.
Save aitor/0e4a247c5d44bfafd5f2820c29b65340 to your computer and use it in GitHub Desktop.
private Environment(String ip, String mac, String iccid, String imei,
String carrier, String device, String os, String androidId,
String localization) {
this.ip = ip;
this.mac = mac;
this.iccid = iccid;
this.imei = imei;
this.carrier = carrier;
this.device = device;
this.os = os;
this.devUuid = androidId;
this.localization = localization;
}
public static func build() -> Environment {
var environment = Environment()
environment.devUuid = UIDevice.current.identifierForVendor!.uuidString
environment.device = getDeviceModel()
environment.carriers = getCarriers()
environment.os = "\(UIDevice.current.systemName) \(UIDevice.current.systemVersion)"
environment.ip = getIp()
environment.location = LocationManager().getLocation()
return environment
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment