File
—> New
—> Targets
—> Application Extension
—> Notification Service Extension
.Product Name
and click on Finish
.Project
—> Targets
—> Your app Target
—> Signing & Capabilities
—> [+]
—> App Groups
.
[+]
—> Add a new container
—> Enter group name
—> OK
.group.com.yourApp.bundleId
.Project
—> Targets
—> Notification Service Extension Target
—> Signing & Capabilities
—> [+] —> App Groups
.Your app Target
.AppDelegate.swift
and add below code in applicationWillEnterForeground(_ application: UIApplication)
.NotificationService.swift
and replace the below code in it.