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

mac promo exp2 - add support for share link message #375

Merged
merged 6 commits into from
Jun 15, 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
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