-3

I want to make a background service app in iOS just like we have Intent-filter in android(without an activity) which in invisible to user but still exits on the device.

I need to keep a database file in this service app which user only need to instal in the device, but is not launchable or visible to user.

I've tried using SBAppTags in info.plist and it successfully hides the app icon from springboard but only for simulator and not for real iPhone device. As of iOS 8, Apple has closed off the SBAppTags feature so that one cannot use that to hide apps from springboard. Is there anything else that can be used in iOS similar to this?

In android, I've created Intent-filter for the service app which only needs to be installed once from the play store and thereafter remains invisible to user.

If anyone has done something similar in iOS, please comment below.

Bhavesh Nayi
  • 3,626
  • 1
  • 27
  • 42
Nidhi Sood
  • 125
  • 1
  • 1
  • 7
  • 2
    iOS does not provide support for this.. – Droid GEEK Apr 26 '19 at 11:46
  • Any trick or hack? @DroidGEEK – Nidhi Sood Apr 26 '19 at 11:51
  • iOS has limited background modes. There are some hacks, top of my mind is, you can keep a socket connected to a server when your app is in the foreground but if your app is in the background you should use either silent push notifications or PushKit notifications if your app is a VoIP app. Hope it helps! – Droid GEEK Apr 26 '19 at 12:14
  • I don't get it. My requirement is to just hide my app from user i.e. prevent it from launching and remove it from springboard. @DroidGEEK – Nidhi Sood Apr 26 '19 at 12:17
  • 1
    You can't hide your app from the user in iOS. Also, it is unclear what exactly you are trying to achieve. Lastly, don't use code formatting for emphasis! – dandan78 Apr 26 '19 at 12:50

1 Answers1

1

Background service is a feature provided by Android.

In iOS, the best you can do is create a task, eg. a download task and handover it to the OS, when the app enters in background.

But, this background task will only run for max 30 sec or so(you can never predict). And can be killed by the OS anytime, without any notification.

    let session = URLSession(configuration: URLSessionConfiguration.default)

    if let downloadURL = URL(string: "YOUR FILE URL"){
        let downloadTask = session.dataTask(with: downloadURL)
        downloadTask.resume()
    }

Also if you want to use background service for specific tasks like VOIP, you need to add it to your Capabilities

Configure background modes

Download task documentation

Background Modes documentation

Bhavesh Nayi
  • 3,626
  • 1
  • 27
  • 42
Prateek Pande
  • 495
  • 3
  • 12