Page MenuHomePhabricator

[lib] implement sending APNs notifs using Tunnelbroker
Needs ReviewPublic

Authored by kamil on Fri, Jun 28, 5:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 12:47 AM
Unknown Object (File)
Sat, Jun 29, 12:47 AM
Unknown Object (File)
Sat, Jun 29, 12:46 AM
Unknown Object (File)
Fri, Jun 28, 7:24 AM

Details

Reviewers
bartek
marcin
Summary

Client code to send notif.

Depends on D12616

Test Plan
try {
     const notif: TunnelbrokerAPNsNotif = {
       type: 'APNsNotif',
       headers: JSON.stringify({ 'apns-topic': 'app.comm' }),
       clientMessageID: uuid.v4(),
       deviceID: '[my device ID]',
       payload:
         '{"aps":{"alert":{"title":"your_title_here","body":"your_body_here"},"mutable-content":1}}',
     };
     await sendNotif(notif);
   } catch (e) {
     console.log(e);
   }

Testing this code multiple times with different TB configs and different headers.

Note: Not testing different payloads, code to create that is now being moved from keyserver so assuming it should work, Tunnelbroker does not modify notif itself. (cc. @marcin)

Diff Detail

Repository
rCOMM Comm
Branch
apns-tb
Lint
No Lint Coverage
Unit
No Test Coverage