Skip to content

Commit

Permalink
Updated payload (#206)
Browse files Browse the repository at this point in the history
* updated tests

* updated version

* add background herder
  • Loading branch information
lassemand authored Sep 10, 2024
1 parent 9d4864e commit febb822
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion notification-server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion notification-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Concordium AG [email protected]"]
edition = "2021"
name = "notification-server"
version = "0.2.3"
version = "0.2.4"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
5 changes: 4 additions & 1 deletion notification-server/src/bin/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ async fn upsert_account_device(
State(state): State<Arc<AppState>>,
Json(subscription): Json<DeviceSubscription>,
) -> impl IntoResponse {
info!("Subscribing accounts {:?} to a device token", subscription);
info!(
"Subscribing accounts {:?} to a device token with preferences: {:?}",
&subscription.accounts, subscription.preferences
);
let response: Result<String, (StatusCode, String)> =
process_device_subscription(subscription, state).await;
match response {
Expand Down
35 changes: 30 additions & 5 deletions notification-server/src/google_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ where
"token": device_token,
"data": entity_data,
"apns": {
"headers": {
"apns-push-type": "background",
},
"payload": {
"content-available": 1
"aps": {
"content-available": 1
}
}
}
});
Expand Down Expand Up @@ -344,8 +349,13 @@ mod tests {
"reference": "3d1c2f4fb9a0eb468bfe39e75c59897c1a375082a6440f4a5da77102182ba055",
},
"apns": {
"headers": {
"apns-push-type": "background",
},
"payload": {
"content-available": 1
"aps": {
"content-available": 1
}
}
}
}
Expand Down Expand Up @@ -411,8 +421,13 @@ mod tests {
"reference": "6a6d250ecefb518253db4c0d7759b2f4ff2862217ed2c8343879a77e0c2c97a2",
},
"apns": {
"headers": {
"apns-push-type": "background",
},
"payload": {
"content-available": 1
"aps": {
"content-available": 1
}
}
}
}
Expand Down Expand Up @@ -483,8 +498,13 @@ mod tests {
"reference": "494d7848e389d44a2c2fe81eeee6dc427ce33ab1d0c92cba23be321d495be110",
},
"apns": {
"headers": {
"apns-push-type": "background",
},
"payload": {
"content-available": 1
"aps": {
"content-available": 1
}
}
}
}
Expand Down Expand Up @@ -554,8 +574,13 @@ mod tests {
"reference": "8a3a09bffa6ead269f79be4192fcb7773cc4e10a2e90c0dec3eb9ca5200c06bc"
},
"apns": {
"headers": {
"apns-push-type": "background",
},
"payload": {
"content-available": 1
"aps": {
"content-available": 1
}
}
}
}
Expand Down

0 comments on commit febb822

Please sign in to comment.