HomePhabricator
Diffusion Comm 4a74cf9cecb5

[services] Tunnelbroker - Rust APNS push notifications A2 library wrapper

Description

[services] Tunnelbroker - Rust APNS push notifications A2 library wrapper

Summary:
This is a Rust a2 apns push notifications library wrapper for using the library in the C++ codebase to send the push notifications to iOS devices.

Linear task: ENG-1303

Test Plan:

  1. Rust:

Patch to D4807 (top of the stack) using arc patch D4807.
Run cargo build from services/tunnelbroker/rust-notifications directory.
Rust library will be successfully built.

  1. C++ (Docker):

Patch to D4807 (top of the stack) using arc patch D4807.
Running run run-tunnelbroker-service successfully built the Rust library and link it.

  1. C++ (Nix):

Patch to D4807 (top of the stack) using arc patch D4807.
Call cd services/tunnelbroker.
Running rm -dfr build && cmake -B build . && make -C build -j4 successfully built the Rust library and link it.

Library apns notifications push method can be called from the C++ as:

#include "rust-notifications/src/lib.rs.h"
#include "rust/cxx.h"
...

const unsigned short responseCode = sendNotifToAPNS(
    char const *certificatePath,
    char const *certificatePassword,
    char const *deviceToken,
    char const *message,
    bool const *sandbox
);

Reviewers: tomek, karol, jon

Reviewed By: tomek, jon

Subscribers: varun, jon, ashoat, tomek, adrian, atul, karol, abosh

Differential Revision: https://phab.comm.dev/D4540

Details