Go to Xcode and open your project.
In your app target, navigate to Capabilities tab.
Turn on Background Modes.