Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Background service in Ionic app

I try to use cordova Background Geolocation to send my position to a server in background. But when i put my app in background after some time it stop working. So I tried BackgroundFetch service https://github.com/christocracy/cordova-plugin-background-fetch but doesn't work: the error is:

You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.

how can i add fetch to the list of your supported UIBackgroundModes in my Info.plist?

like image 334
user3706153 Avatar asked Jan 10 '15 17:01

user3706153


1 Answers

Just do it as it is. Find the Info.plist in your project and add a pair of key/value like this,

<key>UIBackgroundModes</key>
<array>
    <string>fetch</string>
</array>

Once you did it, rebuild it and the warning will disappear.

like image 105
Itachi Avatar answered Oct 11 '22 05:10

Itachi