DMSPayload


@interface DMSPayload : NSObject <NSSecureCoding, NSCopying>

A Payload object contains the data, symbology, representations, and GS1 Application Identifiers from a single image, video, or audio detect.

A Payload object contains the data and possible representations that resulted from an image, video, or audio detection. The Payload object also provides the symbology type of the original data that was detected.

If the data for particular symbology can be represented in the format of another symbology, it can be queried from the representations dictionary within Payload. Use the DMPayloadRepresentationType constants for the specific representation to be queried.

Payload also carries any applicable GS1 Application Identifiers (AIs). Use the appropriate GS1 Application Identifiers to query the GS1Attributes dictionary for a specific supported AI.

  • Initializes a payload with a valid payload identifier. Will return nil if the identifier is not valid. Use a payload’s identifier property to get the identifier for an existing payload. This is the designated initializer.

    Declaration

    Objective-C

    - (nullable instancetype)initWithIdentifier:(nonnull NSString *)identifier;

    Swift

    init?(id identifier: String)

    Parameters

    identifier

    The identifier string to initialize the payload with. Must conform to Digimarc’s CPM standard.

    Return Value

    A payload object. If identifier does not conform to the CPM protocol defined by Digimarc, this initializer may return nil.

  • Returns the identifier for a payload. Identifiers are unique for the origin symbology and the data carried within the symbol.

    Declaration

    Objective-C

    @property (readonly, nonnull) NSString *identifier;

    Swift

    var id: String { get }
  • A map of different known representations of the data carried by the payload. See the DMPayloadRepresentationType constants for possible keys.

    Declaration

    Objective-C

    @property (readonly, nonnull) NSDictionary<DMSPayloadRepresentationType, id> *representations;

    Swift

    var representations: [PayloadRepresentationType : Any] { get }
  • The symbology type that originated this payload. See the DMSSymbology enum for possible values.

    Declaration

    Objective-C

    @property (readonly) DMSSymbologies symbology;

    Swift

    var symbology: Symbologies { get }

    Return Value

    The symbology associated with the payload. If the payload was initialized with a valid identifier that does not conform to a known symbology, this function will return a symbology type of “unknown”.

  • Dictionary of GS1 AI data derived from this payload. Contains GS1 formatted value strings, keyed by GS1 AIs as strings. Refer to the GS1 documentation for more information. The full element string can be obtained with the DMSPayloadRepresentationTypeGS1ElementString represenation, through a Payload’s representation property. This dictionary contains individual, validated values.

    Declaration

    Objective-C

    @property (readonly, nonnull) NSDictionary<NSString *, NSString *> *GS1Attributes;

    Swift

    var gs1Attributes: [String : String] { get }