NimbusGeo

struct NimbusGeo
extension NimbusGeo : Decodable, Encodable, Equatable

This object encapsulates various methods for specifying a geographic location. When subordinate to a NimbusDevice object, it indicates the location of the device which can also be interpreted as the user’s current location. When subordinate to a NimbusUser object, it indicates the location of the user’s home base (i.e., not necessarily their current location). The NimbusGeo.latitude/NimbusGeo.longitude attributes should only be passed if they conform to the accuracy depicted in the NimbusGeo.type attribute. For example, the centroid of a geographic region such as postal code should not be passed. OpenRTB Section 3.2.19

  • Latitude from -90.0 to +90.0, where negative is south

    Declaration

    Swift

    var latitude: Float
  • Longitude from -180.0 to +180.0, where negative is west

    Declaration

    Swift

    var longitude: Float
  • Source of location data; recommended when passing lat/lon

    Declaration

    Swift

    var type: NimbusLocationType?
  • Service or provider used to determine geolocation from IP address if applicable

    Declaration

    Swift

    var ipService: NimbusIPServiceType?
  • Country code using ISO-3166-1-alpha-3

    Declaration

    Swift

    var country: String?
  • City using United Nations Code for Trade & Transport Locations. United Nations Location Codes

    Declaration

    Swift

    var city: String?
  • Google metro code; similar to but not exactly Nielsen DMAs. Google Metro codes

    Declaration

    Swift

    var metro: String?
  • 2-letter state code

    Declaration

    Swift

    var state: String?
  • Initializes a NimbusGeo object

    • latitude: Latitude from -90.0 to +90.0, where negative is south
    • longitude: Longitude from -180.0 to +180.0, where negative is west
    • type: Source of location data; recommended when passing lat/lon
    • ipService: Service or provider used to determine geolocation from IP address if applicable
    • country: Country code using ISO-3166-1-alpha-3
    • city: City using United Nations Code for Trade & Transport Locations. United Nations Location Codes
    • metro: Google metro code; similar to but not exactly Nielsen DMAs. Google Metro codes
    • state: 2-letter state code

    Declaration

    Swift

    init(latitude: Float, longitude: Float, type: NimbusLocationType? = nil, ipService: NimbusIPServiceType? = nil, country: String? = nil, city: String? = nil, metro: String? = nil, state: String? = nil)

    Parameters

    latitude

    Latitude from -90.0 to +90.0, where negative is south

    longitude

    Longitude from -180.0 to +180.0, where negative is west

    type

    Source of location data; recommended when passing lat/lon

    ipService

    Service or provider used to determine geolocation from IP address if applicable

    country

    Country code using ISO-3166-1-alpha-3

    city

    City using United Nations Code for Trade & Transport Locations. United Nations Location Codes

    metro

    Google metro code; similar to but not exactly Nielsen DMAs. Google Metro codes

    state

    2-letter state code

  • Returns a Boolean value indicating whether two values are not equal.

    Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.

    This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.

    Declaration

    Swift

    static func != (lhs: Self, rhs: Self) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Creates a new instance by decoding from the given decoder.

    This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

    Declaration

    Swift

    init(from decoder: any Decoder) throws