Skip to content

Meshing together some updates for iOS 13 fixes #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*

.idea/
.sourcemaps/
.sass-cache/
.tmp/
tmp/
$RECYCLE.BIN/

.DS_Store
Thumbs.db
23 changes: 23 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*

.idea/
.sourcemaps/
.sass-cache/
.tmp/
tmp/
$RECYCLE.BIN/

.DS_Store
Thumbs.db
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## ChangeLog
#### Version 0.7.5
- Fixed onactivate call
- Merged new Android permissions

#### Version 0.7.3 (07.08.2019)
#### Version 0.7.4
- Fixed iOS 12.2 crashes
- Merged original repository Android source updates

#### Version 0.7.3.2 (07.08.2019)
This is more a "just publish all changes after long time" release.
- [___change___:] Removed code for Windows 10 Mobile
- [feature:] Check if screen is off on Android
Expand All @@ -10,6 +17,12 @@ This is more a "just publish all changes after long time" release.
- [bugfix:] Cannot install plugin on cordova > 9
- [bugfix:] Function `onactivate` does no longer exist

#### Version 0.7.3
- fixed iOS crashes
- Check if screen is off on Android
- Wake-up device on Android
- Unlock device on Android

#### Version 0.7.2 (02.02.2017)
- Fixed app freeze on iOS using wkwebview-engine
- Websocket sample in SampleApp
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<b><a href="https://github.com/katzer/cordova-plugin-background-mode/tree/example">SAMPLE APP</a> :point_right:</b>
</p>

Cordova Background Plugin [![npm version](https://badge.fury.io/js/cordova-plugin-background-mode.svg)](http://badge.fury.io/js/cordova-plugin-background-mode) [![Build Status](https://travis-ci.org/katzer/cordova-plugin-background-mode.svg?branch=master)](https://travis-ci.org/katzer/cordova-plugin-background-mode) [![codebeat badge](https://codebeat.co/badges/49709283-b313-4ced-8630-f520baaec7b5)](https://codebeat.co/projects/github-com-katzer-cordova-plugin-background-mode)
Cordova Background Plugin iOS Fix [![npm version](https://badge.fury.io/js/cordova-plugin-background-mode.svg)](http://badge.fury.io/js/cordova-plugin-background-mode) [![Build Status](https://travis-ci.org/katzer/cordova-plugin-background-mode.svg?branch=master)](https://travis-ci.org/katzer/cordova-plugin-background-mode) [![codebeat badge](https://codebeat.co/badges/49709283-b313-4ced-8630-f520baaec7b5)](https://codebeat.co/projects/github-com-katzer-cordova-plugin-background-mode)
Implemented ios 12.2 fix
=========================
[cordova-plugin-background-mode](https://github.com/katzer/cordova-plugin-background-mode) fork. Fixed iOS crashes

Plugin for the [Cordova][cordova] framework to perform infinite background execution.

Expand All @@ -27,21 +29,10 @@ Use the plugin by your own risk!
## Installation
The plugin can be installed via [Cordova-CLI][CLI] and is publicly available on [NPM][npm].

Execute from the projects root folder:

$ cordova plugin add cordova-plugin-background-mode

Or install a specific version:

$ cordova plugin add de.appplant.cordova.plugin.background-mode@VERSION

Or install the latest head version:

$ cordova plugin add https://github.com/katzer/cordova-plugin-background-mode.git

Or install from local source:

$ cordova plugin add cordova-plugin-background-mode --searchpath <path>
$ cordova plugin add https://github.com/thompsd3/cordova-plugin-background-mode.git


## Usage
Expand Down Expand Up @@ -91,6 +82,16 @@ cordova.plugins.backgroundMode.un('EVENT', function);
```


## iOS specifics

### Update MainController (hacky for now until I can integrate into plugin)
Further information can be found in this post https://stackoverflow.com/questions/9660488/ios-avaudioplayer-doesnt-continue-to-next-song-while-in-background

You need this code in either your first view controller's init or viewDidLoad method:
```c
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
```

## Android specifics

### Transit between application states
Expand Down Expand Up @@ -205,4 +206,4 @@ Made with :yum: from Leipzig
[changelog]: CHANGELOG.md
[apache2_license]: http://opensource.org/licenses/Apache-2.0
[appplant]: http://appplant.de
[meshfields]: http://meshfields.de
[meshfields]: http://meshfields.de
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordova-plugin-background-mode",
"version": "0.7.3",
"description": "Prevent apps from going to sleep in background.",
"version": "0.7.5",
"description": "Prevent apps from going to sleep in background. iOS fix.",
"cordova": {
"id": "cordova-plugin-background-mode",
"platforms": [
Expand All @@ -12,7 +12,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/katzer/cordova-plugin-background-mode.git"
"url": "git+https://github.com/thompsd3/cordova-plugin-background-mode.git"
},
"keywords": [
"appplant",
Expand All @@ -25,17 +25,17 @@
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
"version": ">=5.0.0"
},
{
"name": "android-sdk",
"version": ">=16"
"version": ">=21"
}
],
"author": "Sebastián Katzer",
"author": "Donnie Thompson",
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/katzer/cordova-plugin-background-mode/issues"
"url": "https://github.com/thompsd3/cordova-plugin-background-mode/issues"
},
"homepage": "https://github.com/katzer/cordova-plugin-background-mode#readme"
"homepage": "https://github.com/thompsd3/cordova-plugin-background-mode#readme"
}
13 changes: 7 additions & 6 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,25 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-background-mode"
version="0.7.3">

version="0.7.8">
<name>BackgroundMode</name>

<description>Prevent apps from going to sleep in background.</description>
<description>Prevent apps from going to sleep in background. iOS fix.</description>

<repo>https://github.com/katzer/cordova-plugin-background-mode.git</repo>
<repo>https://github.com/thompsd3/cordova-plugin-background-mode.git</repo>

<keywords>appplant, background</keywords>

<license>Apache 2.0</license>

<author>Sebastián Katzer</author>
<author>Donnie Thompson</author>

<!-- dependencies -->
<dependency id="cordova-plugin-device" />

<!-- cordova -->
<engines>
<engine name="cordova" version=">=3.0.0" />
<engine name="cordova" version=">=5.0.0" />
<engine name="android-sdk" version=">=16" />
</engines>

Expand Down Expand Up @@ -76,6 +75,8 @@

<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
</config-file>

<source-file
Expand Down
1 change: 1 addition & 0 deletions src/ios/APPBackgroundMode.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ - (void) configureAudioSession
// Play music even in background and dont stop playing music
// even another app starts playing sound
[session setCategory:AVAudioSessionCategoryPlayback
withOptions:AVAudioSessionCategoryOptionMixWithOthers
error:NULL];

// Active the audio session
Expand Down