BKBlukiiInfo

open class BKBlukiiInfo : NSObject

Main controller class of package info, for interacting with blukii Manager Info CMS (@see https://manager.blukii.com)

BlukiiClient class contains discovery functions as follows:

  • Request for getting blukii Info output data.
  • Reporting of blukii Info clicks.
  • Reporting of blukii Info violations.

Note: These functions needs to set an developers API key by BKBlukiiCloud.setApiKey(apiKey:). Settings of credentials and user login is not needed for BlukiiInfo functions.

  • Report Info Voilation Delegate

    Declaration

    Swift

    open var reportInfoViolationDelegate: BKBlukiiReportInfoViolationDelegate?
  • Output language id for English

    Declaration

    Swift

    public static let OUTPUTLANGUAGE_ENGLISH: String
  • Output language id for French

    Declaration

    Swift

    public static let OUTPUTLANGUAGE_FRENCH: String
  • Output language id for German

    Declaration

    Swift

    public static let OUTPUTLANGUAGE_GERMAN: String
  • Default Timeout in Milliseconds (30 Minutes)

    Declaration

    Swift

    public static let INFODATA_CACHETIMEOUT_DEFAULT: Int
  • Gets the timeout for the resolver cache.

    Relevant for getInfoData(blukiiIds:completionHandler:)

    You can use this feature to minimize network traffic by caching retrieved values. If InfoData is found for one blukii id the next network request will be done again only after cache timeout.

    If value is 0, cache is off.

    Declaration

    Swift

    open func getInfoDataCacheTimeout() -> Int64

    Return Value

    Cachetimeout in Milliseconds

  • Gets the timeout for the resolver cache.

    Relevant for getInfoData(blukiiIds:completionHandler:)

    You can use this feature to minimize network traffic by caching retrieved values. If InfoData is found for one blukii id the next network request will be done again only after cache timeout.

    If value is 0, cache is off.

    Declaration

    Swift

    open func setInfoDataCacheTimeout(_ infoDataCacheTimeout: Int64)
  • Request to blukii Manager Info CMS for retrieving output data of a list of blukii IDs.

    The blukiiIds must follow the blukii Id format like ‘blukii BXXXXX 1234567890AB’

    If request is finished, the completionHandler will be called.

    Please find teh follwing static helper function for extracting or converting bluii IDs:

    Declaration

    Swift

    open func getInfoData(blukiiIds: [String], completionHandler: @escaping ([BKInfoData]?, Error?) -> ())

    Parameters

    blukiiIds

    Array of blukii Ids

    completionHandler

    Callback [BKInfoData] will be set, if succesfull, Error will be set if something fails.

  • Request to blukii Manager Info CMS for retrieving info bundles data of a list ob bundle IDs.

    Bundle IDs are encoded and can be read from and InfoData object via BKInfoData.bundleList, if the corresponding info is part of at least one info bundle.

    If request is finished, the completionHandler will be called.

    Declaration

    Swift

    open func getInfoBundles(bundleIds: [String], completionHandler: @escaping ([BKInfoBundleData]?, Error?, Bool) -> ())

    Parameters

    infoBundleIds

    array of bundle IDs

    completionHandler

    Callback [BKInfoData] will be set, if succesfull, Error will be set if something fails, Bool will be set to true, if all values were cached.

  • Reports a blukii Info to blukii Manager Info CMS support if the blukii Info data violates copyright laws or contains any not allowed content.

    Declaration

    Swift

    open func reportInfoViolation(infoData: BKInfoData, language: String, senderName: String, senderEmail: String, messageText: String)

    Parameters

    infoData
    language

    language id of the violated output (@see BKInfoData.outputDataList)

    senderName

    Name of person who sends the report

    senderEmail

    Email of person who sends the report

    messageText

    Message text that describes the violation

  • Reports to blukii Manager Info CMS that a blukii Info has been clicked by user.

    Declaration

    Swift

    open func reportClick(blukiiId: String, timeStamp: Date, completionHandler: @escaping (Bool, Error?) -> ())

    Parameters

    blukiiId

    blukii id of the INfo that has been clicked

    timeStamp

    time of click

    completionHandler

    Callback, if it was successful. Bool: true, if it was successful.

Static Helpers

  • Static helper for extracting all blukii IDs out of a list of BKDiscoveryData objects, as it retrieved by BKClient discovery (@see BKClientDiscoveryDelegate.onDiscoveryResult(_:)

    Declaration

    Swift

    public static func extractBlukiiIds(discoveryDataList: [BKDiscoveryData]) -> [String]

    Parameters

    discoveryDataList

    Array of BKDiscoveryData objects

    Return Value

    list of blukii IDs

  • Converts a numbered barcode string into the blukii ID format.

    The following formats can be converted:

    • EAN-8
    • EAN-13
    • UPC-A
    • PZN-7 (must start with ‘-’)
    • PZN-8 (must start with ‘-’)

    Declaration

    Swift

    public static func convertBarCodeToBlukiiId(barCode: String) -> String?

    Parameters

    barCode

    numbered barcode string

    Return Value

    blukii ID, nil if not supported barcode format

  • Converts a NFC Code into the blukii ID format.

    The NFC code must contain the NFC tag’s mac address as hex string.

    Declaration

    Swift

    public static func convertNfcToBlukiiId(nfcCode: String) -> String?

    Parameters

    nfcCode

    NFC hex string

    Return Value

    blukii ID, nil if NFC hex string is not valid