Skip to content

Commit 96884ad

Browse files
committed
Update readme
1 parent 02920a1 commit 96884ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ For Android sample project please see this repo - https://github.com/NativeScrip
44

55
A sample project demonstrating how NativeScript application can execute JavaScript code while the app is in background state. On `applicationDidEnterBackground` the app starts a custom [background task](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html). It uses the `NSTimer` API to print a console message on a fixed time interval. To start the task press the `Home` button in order to move the app to the background.
66

7+
8+
> Since iOS doesn't allow a general-purpose background task to run forever, such a task will be suspended by the operating system after [approximately 3 minutes](http://stackoverflow.com/questions/28275415/how-long-does-apple-permit-a-background-task-to-run). In some special cases your task is allowed to run longer, but you need to use [UIBackgroundModes](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW23) in your `Info.plist` file to specify the intent of your task (which automatically makes it not general-purpose).
9+
10+
711
# Running the sample
812
```shell
913
git clone https://github.com/NativeScript/sample-ios-background-execution.git

0 commit comments

Comments
 (0)