HomePhabricator
Diffusion Comm d2aa8f6807a0

[services] Tunnelbroker - Add `topic` to APNs

Description

[services] Tunnelbroker - Add topic to APNs

Summary:
This diff introduces changes to the A2 library wrapper to use topic for the APNs message (adding of topic argument to the wrapper function.).

When testing push notifications with the production certificate the topic for the message is mandatory. The topic is an iOS app bundle name. The topic is mandatory because some P12 certificates can have multiple app bundle names (one certificate for a few apps).

Related Linear task: ENG-1743

Test Plan:

  1. Successfully built app without errors.
  2. Device testing:

To test the APNs notification physical iOS device is required.

  • Isolated testing can be done using the apns-ios-push-tester XCode project. To test it clone the apns-ios-push-tester and follow the instruction to set the certificate, run the app on the physical iOS device and get the device token.
  • Comm app testing can be done using the apns certificate provided in 1Password.

Send the apns message using the following library call from C++:

#include "cxxbridge_code/src/lib.rs.h"
#include "rust/cxx.h
...
const std::string cert_path = argv[1];
const std::string cert_pass = argv[2];
const std::string topic = argv[3];
const std::string device_token = argv[4];
const std::string message_body = argv[5];
const bool sandbox = true; // True if your certificate is for development.
sendNotifToAPNS(cert_path, cert_pass, topic, device_token, message_body, sandbox);

The expected result is push message delivery to the device if the credentials are correct. Errors if some of the credentials are wrong.

Reviewers: jon, karol, tomek

Reviewed By: jon, tomek

Subscribers: ashoat, tomek, atul, karol, abosh

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

Details

Provenance
maxAuthored on Sep 8 2022, 3:21 AM
Reviewer
jon
Differential Revision
D5081: [services] Tunnelbroker - Add `topic` to APNs
Parents
rCOMM901d0bf8d6ba: [native] base on existing thread info when there is any and user is not…
Branches
Unknown
Tags
Unknown