MBXUAComponents


@interface MBXUAComponents : NSObject

UAComponents holds Application and SDK information for generating User-Agent string.

The UA string itself is broken down into four components:

  1. Application Name and version - appName/appVersion.
  2. Application Identifier and OS Information - (appIdentifier; appBuildNumber; osName osVersion). This will be skipped from UA string, if any one of the field is empty or unknown.
  3. SDK Name and Version - sdkName/sdkVersion.
  4. SDK Identifier - (sdkIdentifier; sdkBuildNumber). This will be skipped from UA string, if any one of the field is empty or unknown.

User Agent String Example: AppName/1.0 (app.bundle.identifier; v1; iOS 13.0.1) MapboxFramework/1.0 (framework.bundle.identifier; v1) Mapbox Common Library/v1.0.0

Note that if the User-Agent is already part of the HTTP request headers, we skip the generation using the information provided through the UserAgentComponents.

  • Application Name (e.g. kCFBundleNameKey on Darwin)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *appNameComponent;
  • Application Version (e.g. may be simple version 1.0)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *appVersionComponent;
  • Application Identifier (e.g. bundle identifier on Darwin, package name of Android)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *appIdentifierComponent;
  • Application Build Number (e.g. kCFBundleVersionKey on Darwin)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *appBuildNumberComponent;
  • OS Name (e.g. iOS or Android)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *osNameComponent;
  • OS Version (e.g 13.1.0)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *osVersionComponent;
  • SDK/Framework Name (e.g. Maps)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *sdkNameComponent;
  • SDK/Framework Version (e.g v1.0.0)

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *sdkVersionComponent;
  • SDK/Framework Identifier

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *sdkIdentifierComponent;
  • SDK/Framework Build Number

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nonnull) NSString *sdkBuildNumberComponent;