Skip to content

Commit bb4aec5

Browse files
authored
Merge pull request #843 from transistorsoft/release-3.2.2
Release 3.2.2
2 parents 2e4a988 + fb396a6 commit bb4aec5

File tree

43 files changed

+208
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+208
-157
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Change Log
22

3+
## [3.2.2] - 2019-09-18
4+
- [Changed] Android: move more location-handling code into background-threads to help mitigate against ANR referencing `Context.startForegroundService`
5+
- [Changed] Android: If BackgroundGeolocation adapter is instantiated headless and is enabled, force ActivityRecognitionService to start.
6+
- [Added] Add `mock` to `locationTemplate` data.
7+
- [Changed] Android now hosts its own `proguard-rules.pro`. See Android setup docs for new integration of plugin's required Proguard Rules into your app.
8+
Replace `@available` macro with `SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO`.
9+
- [Fixed] iOS 13 preventSuspend was not working with iOS 13. iOS has once again decreased the max time for UIApplication beginBackgroundTask from 180s down to 30s.
10+
- [Changed] Upgrade `android-logback` dependency to `2.0.0`
11+
- [Changed] Android: move some plugin initialization into background-threads (eg: `performLogCleanup`) to help mitigate against ANR "`Context.startForegroundService` did not then call `Service.startForeground`".
12+
- [Fixed] Android Initial headless events can be missed when app booted due to motion transition event.
13+
- [Fixed] Android crash with EventBus `Subscriber already registered error`.
14+
- [Fixed] iOS `Crash: [TSHttpService postBatch:error:] + 6335064 (TSHttpService.m:253)`
15+
- [Changed] Minor changes to `build.gradle`: fetch `minSdkVersion` from `ext` instead of hard-coding, use `implementation` with `react` instead of `compileOnly`.
16+
317
## [3.2.0] - 2019-08-16
418
- [Added] iOS 13 support.
519
- [Added] Auto-linking support. Do not use `react-native link` anymore. See the Setup docs for Android and iOS. Before installing `3.2.0`, first `react-native unlink` both `background-geolocation` and `background-fetch`.

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,26 @@ $ npm install react-native-background-geolocation --save
6565

6666
## :large_blue_diamond: Setup Guides
6767

68-
## iOS
69-
7068
### `react-native >= 0.60`
7169

70+
### iOS
7271
- [Auto-linking Setup](help/INSTALL-IOS-AUTO.md)
7372

73+
### Android
74+
- [Auto-linking Setup](help/INSTALL-ANDROID-AUTO.md)
75+
76+
------------------------------------------------------------------------
77+
7478
### `react-native < 0.60`
7579

80+
### iOS
7681
- [`react-native link` Setup](help/INSTALL-IOS-RNPM.md) (**recommended**)
7782
- [Cocoapods](help/INSTALL-IOS-COCOAPODS.md)
7883
- [Manual Setup](help/INSTALL-IOS.md)
7984

80-
## Android
81-
82-
### `react-native >= 0.60`
83-
84-
- [Auto-linking Setup](help/INSTALL-ANDROID-AUTO.md)
85-
86-
### `react-native < 0.60`
87-
88-
* [`react-native link` Setup](help/INSTALL-ANDROID-RNPM.md) (**recommended**)
89-
* [Manual Setup](help/INSTALL-ANDROID.md)
85+
### Android
86+
- [`react-native link` Setup](help/INSTALL-ANDROID-RNPM.md) (**recommended**)
87+
- [Manual Setup](help/INSTALL-ANDROID.md)
9088

9189

9290
## :large_blue_diamond: Configure your license
@@ -180,7 +178,6 @@ export default class App extends Component {
180178
// 2. Execute #ready method (required)
181179
//
182180
BackgroundGeolocation.ready({
183-
reset: true,
184181
// Geolocation Config
185182
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
186183
distanceFilter: 10,
@@ -238,8 +235,6 @@ export default class App extends Component {
238235

239236
```
240237

241-
:information_source: **NOTE:** The configuration **`{}`** provided to the `#ready` method is applied **only** when your app is **first booted** &mdash; for every launch thereafter, the plugin will automatically load the last known configuration from persistant storage. If you wish to **force** the `#ready` method to *always* apply the supplied config `{}`, you can specify **`reset: true`**
242-
243238
```javascript
244239
BackgroundGeolocation.ready({
245240
reset: true, // <-- true to always apply the supplied config
@@ -249,7 +244,7 @@ BackgroundGeolocation.ready({
249244
});
250245
```
251246

252-
:warning: Do not execute *any* API method which will require accessing location-services until the callback to **`#ready*` executes (eg: `#getCurrentPosition`, `#watchPosition`, `#start`).
247+
:warning: Do not execute *any* API method which will require accessing location-services until the callback to **`#ready`** executes (eg: `#getCurrentPosition`, `#watchPosition`, `#start`).
253248

254249
### Promise API
255250

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ android {
1919
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
2020

2121
defaultConfig {
22-
minSdkVersion 16
22+
minSdkVersion safeExtGet('minSdkVersion', 16)
2323
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
2424
versionCode 1
2525
versionName "1.0"
@@ -43,7 +43,7 @@ dependencies {
4343
def androidPermissionsVersion = safeExtGet('androidPermissionsVersion', DEFAULT_ANDROID_PERMISSIONS_VERSION)
4444
def eventBusVersion = safeExtGet('eventBusVersion', DEFAULT_EVENTBUS_VERSION)
4545

46-
compileOnly 'com.facebook.react:react-native:+'
46+
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
4747
// tslocationmanager.aar
4848
implementation fileTree(include: ['*.aar'], dir: 'libs')
4949

@@ -52,6 +52,6 @@ dependencies {
5252
implementation "org.greenrobot:eventbus:$eventBusVersion"
5353
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
5454
implementation 'org.slf4j:slf4j-api:1.7.25'
55-
implementation 'com.github.tony19:logback-android:1.3.0-2'
55+
implementation 'com.github.tony19:logback-android:2.0.0'
5656
implementation "com.intentfilter:android-permissions:$androidPermissionsVersion"
5757
}

android/proguard-rules.pro

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-keepnames class com.facebook.react.ReactActivity
2+
-keepnames class com.transistorsoft.rnbackgroundgeolocation.RNBackgroundGeolocation
3+
4+
# BackgroundGeolocation lib tslocationmanager.aar is *already* proguarded
5+
-keep class com.transistorsoft.** { *; }
6+
-dontwarn com.transistorsoft.**
7+
8+
# BackgroundGeolocation (EventBus)
9+
-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent {
10+
<init>(java.lang.Throwable);
11+
}
12+
-keepattributes *Annotation*
13+
-keepclassmembers class ** {
14+
@org.greenrobot.eventbus.Subscribe <methods>;
15+
}
16+
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
17+
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
18+
<init>(java.lang.Throwable);
19+
}
20+
21+
# logback
22+
-keep class ch.qos.** { *; }
23+
-keep class org.slf4j.** { *; }
24+
-dontwarn ch.qos.logback.core.net.*
25+
26+
# OkHttp3
27+
-dontwarn okio.**
28+
-dontwarn okhttp3.**
29+
-dontwarn javax.annotation.**
30+
-dontwarn org.conscrypt.**
31+
# A resource is loaded with a relative path so the package of this class must be preserved.
32+
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
33+

docs/classes/_react_native_background_geolocation_.backgroundgeolocation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="state loading">Preparing search index...</li>
2424
<li class="state failure">The search index is not available</li>
2525
</ul>
26-
<a href="../globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.0</span>
26+
<a href="../globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.2</span>
2727
</div>
2828
<div class="" id="tsd-widgets">
2929
<a class="github" href="https://github.com/transistorsoft/react-native-background-geolocation">Github</a>
@@ -2296,7 +2296,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> get<wbr>State</h3>
22962296
</div>
22972297
<dl class="tsd-comment-tags">
22982298
<dt class="tsd-comment-tag-example">example</dt>
2299-
<dd><pre><code class="language-javascript"><span class="hljs-keyword">let</span> state = <span class="hljs-keyword">await</span> BackgroundGeolocation.state();
2299+
<dd><pre><code class="language-javascript"><span class="hljs-keyword">let</span> state = <span class="hljs-keyword">await</span> BackgroundGeolocation.getState();
23002300
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[state] '</span>, state.enabled, state.trackingMode);</code></pre>
23012301
</dd>
23022302
</dl>

docs/globals.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="state loading">Preparing search index...</li>
2424
<li class="state failure">The search index is not available</li>
2525
</ul>
26-
<a href="globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.0</span>
26+
<a href="globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.2</span>
2727
</div>
2828
<div class="" id="tsd-widgets">
2929
<a class="github" href="https://github.com/transistorsoft/react-native-background-geolocation">Github</a>

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="state loading">Preparing search index...</li>
2424
<li class="state failure">The search index is not available</li>
2525
</ul>
26-
<a href="globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.0</span>
26+
<a href="globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.2</span>
2727
</div>
2828
<div class="" id="tsd-widgets">
2929
<a class="github" href="https://github.com/transistorsoft/react-native-background-geolocation">Github</a>

docs/interfaces/_react_native_background_geolocation_.battery.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="state loading">Preparing search index...</li>
2424
<li class="state failure">The search index is not available</li>
2525
</ul>
26-
<a href="../globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.0</span>
26+
<a href="../globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.2</span>
2727
</div>
2828
<div class="" id="tsd-widgets">
2929
<a class="github" href="https://github.com/transistorsoft/react-native-background-geolocation">Github</a>

docs/interfaces/_react_native_background_geolocation_.config.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<li class="state loading">Preparing search index...</li>
2424
<li class="state failure">The search index is not available</li>
2525
</ul>
26-
<a href="../globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.0</span>
26+
<a href="../globals.html" class="title">[API Docs] React Native Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 3.2.2</span>
2727
</div>
2828
<div class="" id="tsd-widgets">
2929
<a class="github" href="https://github.com/transistorsoft/react-native-background-geolocation">Github</a>
@@ -2144,6 +2144,11 @@ <h3 id="template-tags">Template Tags</h3>
21442144
<td><code>Boolean</code></td>
21452145
<td>Is device plugged in?</td>
21462146
</tr>
2147+
<tr>
2148+
<td><code>mock</code></td>
2149+
<td><code>Boolean</code></td>
2150+
<td><code>true</code> when location was recorded from a Mock location app.</td>
2151+
</tr>
21472152
</tbody></table>
21482153
<h3 id="-see-also-">ℹ️ See also:</h3>
21492154
<ul>

0 commit comments

Comments
 (0)