[Feature Request] Keep iSH Running in the Background Using the New PIP API
- Dominant language
- C
- Stars
- 20.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Keep iSH running in the background using the new [PIP](https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller?language=objc) API.
Many discussions have been brought up on how we should enable "background running" mode for iSH. All [seem to lead to the command](https://github.com/ish-app/ish/issues/1516)
```cat /dev/location > /dev/null &```
which tracks the location of the device, thus (presumably) keeping the app running in the background.
The solution, however, is battery-consuming. Moreover, no guarantee has been made that Apple will not kill an app constantly querying GPS information in the background.
I found that many clipboard managing apps (Yoink, Paste, Pin, etc.) on the App Store utilize the PIP (Picture in Picture) API to keep apps alive in the background (See [this article](https://www.macstories.net/ios/yoink-brings-background-clipboard-monitoring-to-ios-and-ipados-15-via-picture-in-picture-workaround/)). This method seems to be more reliable and does not violate Apple's policy: they have been doing this for years.

Quote:
> Starting with iOS and iPadOS 15, developers can display static images or arbitrary content in Picture in Picture using the AVSampleBufferDisplayLayer and AVPictureInPictureController.ContentSource APIs. This technology has already been used by other apps to display non-video content in Picture in Picture as a new kind of real-time feed: Secure ShellFish, for instance, uses Picture in Picture in iOS and iPadOS 15 to display a terminal log from your server. MiniSpeech, an incredible speech-to-text utility by developer Steven Shen, can transcribe text in real-time and display it in a Picture in Picture window; it was featured by Apple on the App Store, too.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the linked Apple AVPictureInPictureController documentation and issue #1516, then locate iSH's existing iOS lifecycle and background-execution entry points. Determine how the PIP content source would keep the shell active without GPS polling; done means background execution is reliable, battery-conscious, and compatible with Apple's policies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, objective-c
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100