//
/* NOTICE: All information contained herein is, and remains the property of Brightinsight Inc. or its customer.
The intellectual and technical concepts contained herein are proprietary to Brightinsight Inc. or its customer and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.
Dissemination of this information or reproduction of this material is strictly forbidden unless prior written permission is obtained from Brightinsight Inc. or its customer. Access to the source code contained herein is hereby forbidden to anyone except current Brightinsight Inc. employees, managers or contractors who have executed
Confidentiality and Non-disclosure agreements explicitly covering such access.
*/
/**
* System Name : BISDKCore
* Component ID : BISDKDeviceEnvironmentInfo
* Description :
* Author: Arnold Dominguez
* Copyright © : Brightinsight, Inc.
* -----------------------
* Revision Change
* -----------------------
* Author            Date             Version       Change-Description
*========================================================================================================
*/

import UIKit

public struct BISDKDeviceEnvironmentInfo {
    static func toDict() -> [String:String] {
        return [
            "x-sdk-device":UIDevice.current.model,
            "x-sdk-osname":UIDevice.current.systemName,
            "x-sdk-osversion":UIDevice.current.systemVersion,
            "x-sdk-manufacturer":"Apple Inc.",
            "x-sdk-sdkcore":bundleVersion(with: "com.brightinsight.ios.sdk.core"),
            "x-sdk-sdkmessaging":bundleVersion(with: "com.brightinsight.ios.sdk.messaging"),
            "x-sdk-sdkcrypto":bundleVersion(with: "com.brightinsight.ios.sdk.crypto"),
            "x-sdk-sdkdevice":bundleVersion(with: "com.brightinsight.ios.sdk.devices")
        ]
    }
}
private extension BISDKDeviceEnvironmentInfo {
    static func bundleVersion(with identifier: String) -> String {
        Bundle(identifier: identifier)?.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
    }
}
