DMSResolver


@interface DMSResolver : NSObject

The Resolver class retrieves additional metadata that is not available locally from the Digimarc Barcode Resolver.

  • Creates a resolver with a given set of options.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithOptions:(nonnull NSDictionary<DMSResolverOptionKey, id> *)options
                  error:(NSError *_Nullable *_Nullable)error;

    Swift

    convenience init(options: [ResolverOptionKey : Any] = [:]) throws

    Parameters

    options

    A dictionary of options to create the resolver

    error

    An error returned by this function. Typically returned if a set of options is inconsistent, or if the current or supplied API key is invalid.

    Return Value

    A resolver instance, or nil if parameters or license is invalid.

  • Designated initializer for a resolver.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithURLSessionConfiguration:
            (nullable NSURLSessionConfiguration *)URLSessionConfiguration
                                 APIKey:(nullable NSString *)APIKey
                                options:(nonnull NSDictionary<DMSResolverOptionKey,
                                                              id> *)options
                                  error:(NSError *_Nullable *_Nullable)error;

    Swift

    init(urlSessionConfiguration URLSessionConfiguration: URLSessionConfiguration?, apiKey APIKey: String?, options: [ResolverOptionKey : Any] = [:]) throws

    Parameters

    options

    A dictionary of options to create the resolver

    APIKey

    Custom API key to use. Will override any other currently set API key.

    URLSessionConfiguration

    A URL session to submit resolver requests with. Background sessions are not currently supported. Optional. If a URL session configuration is not supplied, DMSResolver will use a default session configuration acceptable for most use cases.

    error

    An error returned by this function. Typically returned if a set of options is inconsistent, or if the current or supplied API key is invalid.

    Return Value

    A resolver instance, or nil if parameters are invalid.

  • Start a resolve for an incoming DMSPayload to a DMSResolvedContent. This is an asynchronous network method that can take up to several seconds to complete, depending on network conditions. If active content is found, then a resolve result will be returned. Otherwise returns nil.

    Declaration

    Objective-C

    - (void)resolve:(nonnull DMSPayload *)payload
                  queue:(nullable NSOperationQueue *)queue
        completionBlock:(nonnull DMSResolveCompletionBlock)completionBlock;

    Swift

    func resolve(_ payload: Payload, queue: OperationQueue?) async throws -> ResolvedContent

    Parameters

    payload

    A payload object to request additional metadata on.

    queue

    The queue that the completion block will be executed on. Defaults to the current queue.

    completionBlock

    Completion block to be executed when the request is completed. Returns either an error or a resolve result, but not both.

  • Start a resolve for an incoming DMSPayload to a DMSResolvedContent. This is an asynchronous network method that can take up to several seconds to complete, depending on network conditions. If active content is found, then a resolve result will be returned. Otherwise returns nil.

    Declaration

    Objective-C

    - (void)resolve:(nonnull DMSPayload *)payload
        completionBlock:(nonnull DMSResolveCompletionBlock)completionBlock;

    Swift

    func resolve(_ payload: Payload) async throws -> ResolvedContent

    Parameters

    payload

    A payload object to request additional metadata on.

    completionBlock

    Completion block to be executed when the request is completed. Returns either an error or a resolve result, but not both. The queue the completion block is executed on is undefined.

  • Cancels all resolves in progress.

    Declaration

    Objective-C

    - (void)cancelAllResolves;

    Swift

    func cancelAllResolves()