Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: make AssetBeacon equatable and add public init for metadata #248

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ios/packages/core/Sources/Types/Assets/Wrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions ios/packages/core/Sources/Types/Beacon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down