Page updated Jan 16, 2024

Enable rich notifications

On Android, Amplify Push Notifications should already be configured to handle rich content for you.

Amplify currently supports adding images to your notifications, but there are some additional steps required.

Create a Notification Service Extension

  1. Open <your-app-name>.xcworkspace located inside the /ios folder of your application project with Xcode.

  2. In the Xcode project, select File > New > Target...

The file menu is selected in the toolbar, then the new option is selected, then the target option.

  1. Select Notification Service Extension > Next.

The notification service extension option is selected in the new target popup.

  1. Enter a name for your service extension (e.g. MyNotificationServiceExtension) and select Finish.

Form for the new target options.

Provide the extension with the Amplify service class

  1. Open Podfile located inside the /ios folder of your application project with a text editor.

  2. Add AmplifyUtilsNotifications to the extension you created above.

1target 'MyNotificationServiceExtension' do # Replace with your service extension
2 pod "AmplifyUtilsNotifications"
3end
  1. Install the new pods by running the following command at the root of your application project.
1npx pod-install
  1. Open <your-app-name>.xcworkspace located inside the /ios folder of your application project with Xcode.

  2. Find your extension folder in the Project navigator pane and select the Info Property List.

Extension info

  1. Update the NSExtensionPrincipalClass property with the value AmplifyUtilsNotifications.AUNotificationService.

Extension class