Page MenuHomePhabricator

[iOS] Create empty notification service extension
ClosedPublic

Authored by tomek on Feb 10 2022, 6:33 AM.
Tags
None
Referenced Files
F3409700: D3162.id9615.diff
Wed, Dec 4, 6:34 PM
F3409673: D3162.id9573.diff
Wed, Dec 4, 6:24 PM
F3409662: D3162.id9522.diff
Wed, Dec 4, 6:21 PM
F3408499: D3162.diff
Wed, Dec 4, 11:37 AM
F3406996: D3162.id9572.diff
Wed, Dec 4, 3:46 AM
F3406993: D3162.id9522.diff
Wed, Dec 4, 3:46 AM
F3406992: D3162.id9620.diff
Wed, Dec 4, 3:45 AM
F3406990: D3162.id.diff
Wed, Dec 4, 3:45 AM

Details

Summary

Add an empty extension using XCode new target template. The service extension is executed when the app is backgrounded or killed. When the app is running, this code is not called.

Test Plan

Modify prepareIOSNotification in send.js by setting notification.mutableContent = true. Modify the code in service so that the body gets modified.
Test on a physical device:

  1. Run the app and send a message from other client - the notification should be displayed with the original body.
  2. Background the app and send a message - the modified notification should be displayed.
  3. Kill the app and send a message - the modified notification should be displayed.

Diff Detail

Repository
rCOMM Comm
Branch
ENG-687
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 10 2022, 6:39 AM
Harbormaster failed remote builds in B6712: Diff 9522!
tomek requested review of this revision.Feb 10 2022, 7:31 AM

This build is failing on iOS because No profiles for 'app.comm.NotificationService' were found. This service extension is a separate bundle app.comm.NotificationService and we probably need to create another provisioning profile - not sure if that's something I'm allowed to do. @ashoat could you take a look?

In the current state it is possible to modify a notification, but it's not possible to use any C++ code from comm library - it will be addressed in the next diff

What are the build failures about? Can you either confirm they are unrelated before landing, or re-trigger the build by running arc diff again?

This revision is now accepted and ready to land.Feb 13 2022, 8:51 PM

Link missing dependencies

In D3162#84759, @ashoat wrote:

What are the build failures about? Can you either confirm they are unrelated before landing, or re-trigger the build by running arc diff again?

The failure was caused by me - I forgot to link UserNotifications framework