Step-by-step guide to setup APNS iOSpush notifications in your flutter app.
Add capabilities in iOS application
Register for push notification in AppDelegate.swift file
registerForPushNotifications
method below the SuprSend SDK initialized code which will register the iOS device for push serviceAsking User to send push notifications
Explicit Authorization
Provisional Authorization
Enable sending and tracking of push notifications
Adding support for Notification service.
In Xcode go to File > New > Target.
Select Notification Service Extension from the template list.
Name your Notification Service
A folder will be created
Finish
, a folder will be created with your given product name. Inside that there will be NotificationService.swift
file like below.Rename and Run the pod install
podFile
add following snippet. Replace <your notification service name>
with name you given to notification service while creating it. After that Run pod install
.Replace values with your Workspace Key and Workspace Secret.
NotificationService.swift
file with below code. In this snippet on line 11, 12 replace values with your workspace key and workspace secret.Final Step
Embedded Foundation Extensions
section and drop it below theCopy Bundle Resources
section like in image.