From 7d81c3bfb83b83595a80d7f94231c840622fdf94 Mon Sep 17 00:00:00 2001 From: hborawski Date: Fri, 17 Nov 2023 16:31:16 -0800 Subject: [PATCH] make AssetBeacon equatable and add public init for metadata --- ios/packages/core/Sources/Types/Assets/Wrappers.swift | 5 +++++ ios/packages/core/Sources/Types/Beacon.swift | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ios/packages/core/Sources/Types/Assets/Wrappers.swift b/ios/packages/core/Sources/Types/Assets/Wrappers.swift index a965a9792..e32fdfd37 100644 --- a/ios/packages/core/Sources/Types/Assets/Wrappers.swift +++ b/ios/packages/core/Sources/Types/Assets/Wrappers.swift @@ -90,4 +90,9 @@ public struct MetaData: Codable, Hashable { /// The role of this asset public var role: String? + + public init(beacon: AnyType?, role: String? = nil) { + self.beacon = beacon + self.role = role + } } diff --git a/ios/packages/core/Sources/Types/Beacon.swift b/ios/packages/core/Sources/Types/Beacon.swift index 2dda5e956..bc49c443f 100644 --- a/ios/packages/core/Sources/Types/Beacon.swift +++ b/ios/packages/core/Sources/Types/Beacon.swift @@ -10,7 +10,7 @@ import Foundation /** An object representing a beacon fired from an `Asset` */ -public struct AssetBeacon: Codable { +public struct AssetBeacon: Codable, Equatable { /// The action that caused the beacon public var action: String @@ -49,7 +49,7 @@ public protocol BeaconableMetaData { } /// Container Object for matching the data type for the JS Beacon Plugin -public struct BeaconableAsset: Codable { +public struct BeaconableAsset: Codable, Equatable { /// The ID of the asset that fired the beacon public var id: String