HomePhabricator
Diffusion Comm ec5b4c00245d

[services] Tunnelbroker - Rust FCM push notifications library wrapper

Description

[services] Tunnelbroker - Rust FCM push notifications library wrapper

Summary:
This is a Rust fcm fcm notifications library wrapper to use the library in the C++ codebase to send push notifications to Android devices.

Linear task: ENG-1303

Test Plan:

  1. Rust:

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's FCM notifications push method can be called from the C++ as:

#include "rust_notifications/src/lib.rs.h"
#include "rust/cxx.h"
...

const unsigned long messageID = sendNotifToFCM(
    char const *fcmAPIKey,
    char const *deviceRegistrationID,
    char const *messageTitle,
    char const *messageBody
);

Reviewers: varun, tomek, karol, jon

Reviewed By: tomek, jon

Subscribers: ashoat, tomek, atul, karol, abosh

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

Details