Page MenuHomePhabricator

[iOS] Create empty notification service extension
ClosedPublic

Authored by tomek on Feb 10 2022, 6:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 10:32 AM
Unknown Object (File)
Fri, Apr 12, 3:39 AM
Unknown Object (File)
Fri, Apr 12, 3:39 AM
Unknown Object (File)
Fri, Apr 12, 3:39 AM
Unknown Object (File)
Fri, Apr 12, 3:39 AM
Unknown Object (File)
Fri, Apr 12, 3:39 AM
Unknown Object (File)
Fri, Apr 12, 3:38 AM
Unknown Object (File)
Fri, Apr 12, 3:35 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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