Enable rich notifications
Amplify currently supports adding images to your notifications, but there are some additional steps required.
Create a Notification Service Extension
-
Open
<your-app-name>.xcworkspace
located inside the/ios
folder of your application project with Xcode. -
In the Xcode project, select File > New > Target...
- Select Notification Service Extension > Next.
- Enter a name for your service extension (e.g. MyNotificationServiceExtension) and select Finish.
Provide the extension with the Amplify service class
-
Open
Podfile
located inside the/ios
folder of your application project with a text editor. -
Add
AmplifyUtilsNotifications
to the extension you created above.
target 'MyNotificationServiceExtension' do # Replace with your service extension pod "AmplifyUtilsNotifications"end
- Install the new pods by running the following command at the root of your application project.
npx pod-install
-
Open
<your-app-name>.xcworkspace
located inside the/ios
folder of your application project with Xcode. -
Find your extension folder in the Project navigator pane and select the Info Property List.
- Update the
NSExtensionPrincipalClass
property with the valueAmplifyUtilsNotifications.AUNotificationService
.