Page updated Nov 14, 2023

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.

target 'MyNotificationServiceExtension' do # Replace with your service extension use_frameworks! pod "AmplifyUtilsNotifications" end
1target 'MyNotificationServiceExtension' do # Replace with your service extension
2 use_frameworks!
3
4 pod "AmplifyUtilsNotifications"
5end
  1. Install the new pods by running pod install in the ios/ of your application project.

Note: You will first need to install Cocoapods to enable the pod command.

cd ios pod install
1cd ios
2pod 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