Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.52 KB

INSTALL-IOS.md

File metadata and controls

49 lines (34 loc) · 1.52 KB

iOS Setup

Step 1

First, open your project in Xcode, select your Runner and then Signing & Capabilities tab. In the Background Modes section, make sure to enable:

  • Audio, AirPlay, and Picture in Picture
  • Background fetch

bg-mode

This allows the app to check alarms in the background.

Step 2

Then, open your Info.plist and add the key Permitted background task scheduler identifiers, with the item com.gdelataillade.fetch inside.

info-plist

It should add this in your Info.plist code:

	<key>BGTaskSchedulerPermittedIdentifiers</key>
	<array>
		<string>com.gdelataillade.fetch</string>
	</array>

This authorizes the app to run background tasks using the specified identifier.

Step 3

Open your AppDelegate and add the following imports:

import UserNotifications
import alarm

Finally, add the following to your application(_:didFinishLaunchingWithOptions:) method:

if #available(iOS 10.0, *) {
  UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}
SwiftAlarmPlugin.registerBackgroundTasks()

app-delegate

This configures the app to manage foreground notifications and setup background tasks.

Don't forget to run pod install --repo-update to update your pods.