Skip to content

Commit a8221e8

Browse files
MBL-2722: Support edit order deeplinks and push notifications
1 parent c4890ff commit a8221e8

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Library/Navigation.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ private let allRoutes: [String: (RouteParamsDecoded) -> Navigation?] = [
160160
"/projects/:creator_param/:project_param/surveys/:survey_param/edit": pledgeManagerWebview,
161161
"/projects/:creator_param/:project_param/surveys/:survey_param/edit_address": pledgeManagerWebview,
162162
"/settings/:notification_param/:enabled_param": settingsNotifications,
163-
"/users/:user_param/surveys/:survey_response_id": userSurvey
163+
"/users/:user_param/surveys/:survey_response_id": userSurvey,
164+
"/projects/:creator_param/:project_param/order_edits/:order_edit_id/checkout": pledgeManagerWebview
164165
]
165166

166167
private let deepLinkRoutes: [String: (RouteParamsDecoded) -> Navigation?] = allRoutes.restrict(
@@ -186,7 +187,8 @@ private let deepLinkRoutes: [String: (RouteParamsDecoded) -> Navigation?] = allR
186187
"/projects/:creator_param/:project_param/surveys/:survey_param/edit_address",
187188
"/projects/:creator_param/:project_param/pledge",
188189
"/settings/:notification_param/:enabled_param",
189-
"/users/:user_param/surveys/:survey_response_id"
190+
"/users/:user_param/surveys/:survey_response_id",
191+
"/projects/:creator_param/:project_param/order_edits/:order_edit_id/checkout"
190192
]
191193
)
192194

@@ -634,6 +636,7 @@ extension RouteParamsDecoded {
634636
case surveyParam = "survey_param"
635637
case userParam = "user_param"
636638
case surveyResponseId = "survey_response_id"
639+
case orderEditId = "order_edit_id"
637640
}
638641

639642
public func comment() -> String? {
@@ -725,4 +728,9 @@ extension RouteParamsDecoded {
725728
let key = CodingKeys.surveyResponseId.rawValue
726729
return self[key].flatMap { Int($0) }
727730
}
731+
732+
public func orderEditParam() -> Int? {
733+
let key = CodingKeys.orderEditId.rawValue
734+
return self[key].flatMap { Int($0) }
735+
}
728736
}

push_payload.apns

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"aps": {
3+
"alert": "This is a push notification to order edits.",
4+
},
5+
"pledgeRedemption": {
6+
"id": 123,
7+
"project_id": 1631365409,
8+
"pledge_manager_path": "/projects/1768690592/reclaimed-coffee-video-game/order_edits/5/checkout"
9+
},
10+
"Simulator Target Bundle": "com.kickstarter.kickstarter.debug"
11+
}

0 commit comments

Comments
 (0)