Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In Xcode File > New > Target...

  2. Select Notification Service Extension then press Next.

  3. Enter the product name as NotificationService and press Finish.

  4. Do not select Activate on the dialog that is shown after selecting Finish.

    By canceling, you are keeping Xcode debugging your app, instead of the extension you just created.

    If you activated by accident, you can switch back to debug your app within Xcode (next to the play button).

  5. In the project navigator, select the top-level project directory and select the Euro-IOSNotificationServiceExtension NotificationSerivce target in the project and targets list. Unless you have a specific reason not to, you should set the Deployment Target to be iOS 11.

  6. Open NotificationService.swift and replace the whole file's contents with the following code.

...

  1. In Xcode File > New > Target...

  2. Select Notification Content Extension then press Next.

  3. Enter the product name as NotificationContent and press Finish.

  4. Do not select Activate on the dialog that is shown after selecting Finish.

    By canceling, you are keeping Xcode debugging your app, instead of the extension you just created.

    If you activated by accident, you can switch back to debug your app within Xcode (next to the play button).

  5. In the project navigator, select the top-level project directory and select the Euro-IOSNotificationServiceExtension NotificationContent target in the project and targets list. Unless you have a specific reason not to, you should set the Deployment Target to be iOS 11.

  6. Delete MainInterface.storyboard and NotificationContent.swift files. Then create a swift file named EMNotificationViewController under the NotificationContent folder.

  7. Open EMNotificationViewController.swift and replace the whole file's contents with the following code

...

Firstly import Euromsg and UserNotifications

Code Block
languageswift
import Euromsg
import UserNotifications

Add UNUserNotificationCenterDelegate to the class AppDelegate section.

Code Block
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate

Add this code under didFinishLaunchingWithOptions.

...