Skip to content

Commit

Permalink
mac promo exp2 - add support for share link message (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy authored Jun 15, 2023
1 parent 93fe4d8 commit c6bc446
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ struct JsonToRemoteMessageModelMapper {
}

switch RemoteMessageResponse.JsonActionType(rawValue: jsonAction.type) {
case .share:
return .share(url: jsonAction.value, title: jsonAction.additionalValues?[0] ?? "")
case .url:
return .url(value: jsonAction.value)
case .appStore:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public enum RemoteMessageResponse {
struct JsonMessageAction: Decodable {
let type: String
let value: String
let additionalValues: [String]?
}

struct JsonContentTranslation: Decodable {
Expand All @@ -74,6 +75,7 @@ public enum RemoteMessageResponse {
}

enum JsonActionType: String, CaseIterable {
case share
case url
case appStore = "appstore"
case dismiss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public enum RemoteMessageModelType: Codable, Equatable {
}

public enum RemoteAction: Codable, Equatable {
case share(url: String, title: String)
case url(value: String)
case appStore
case dismiss
Expand Down

0 comments on commit c6bc446

Please sign in to comment.