Skip to content

Commit a8dad3c

Browse files
authored
Merge pull request #85 from ActivitySpaceProject/hotfix/no-ref/ios-fix
Changes implemented to resolve issues with ios devices.
2 parents 93ef6e7 + 22ebaab commit a8dad3c

File tree

6 files changed

+48
-20
lines changed

6 files changed

+48
-20
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTracking</key>
6+
<false/>
7+
8+
<key>NSPrivacyAccessedAPITypes</key>
9+
<array>
10+
<!-- [1] background_fetch: UserDefaults -->
11+
<dict>
12+
<key>NSPrivacyAccessedAPIType</key>
13+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
14+
15+
<key>NSPrivacyAccessedAPITypeReasons</key>
16+
<array>
17+
<string>CA92.1</string>
18+
</array>
19+
</dict>
20+
</array>
21+
</dict>
22+
</plist>

Space_Mapper/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Space_Mapper/ios/Runner/Info.plist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
<key>BGTaskSchedulerPermittedIdentifiers</key>
66
<array>
77
<string>com.transistorsoft.fetch</string>
8+
<string>com.transistorsoft.spacemapper</string>
89
</array>
910
<key>CADisableMinimumFrameDurationOnPhone</key>
1011
<true/>
1112
<key>CFBundleDevelopmentRegion</key>
1213
<string>$(DEVELOPMENT_LANGUAGE)</string>
14+
<key>CFBundleDisplayName</key>
15+
<string>Space Mapper</string>
1316
<key>CFBundleExecutable</key>
1417
<string>$(EXECUTABLE_NAME)</string>
1518
<key>CFBundleIdentifier</key>
1619
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1720
<key>CFBundleInfoDictionaryVersion</key>
1821
<string>6.0</string>
19-
<key>CFBundleDisplayName</key>
20-
<string>Space Mapper</string>
2122
<key>CFBundleName</key>
2223
<string>Space Mapper</string>
2324
<key>CFBundlePackageType</key>

Space_Mapper/lib/ui/home_view.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class HomeViewState extends State<HomeView>
156156

157157
// Configure BackgroundFetch (not required by BackgroundGeolocation).
158158
void _configureBackgroundFetch() async {
159+
print("test 6");
159160
BackgroundFetch.configure(
160161
BackgroundFetchConfig(
161162
minimumFetchInterval: 15,
@@ -168,7 +169,7 @@ class HomeViewState extends State<HomeView>
168169
requiresDeviceIdle: false,
169170
requiredNetworkType: NetworkType.NONE), (String taskId) async {
170171
print("[BackgroundFetch] received event $taskId");
171-
172+
print("test 7");
172173
SharedPreferences prefs = await SharedPreferences.getInstance();
173174
int count = 0;
174175
if (prefs.get("fetch-count") != null) {
@@ -177,28 +178,29 @@ class HomeViewState extends State<HomeView>
177178
prefs.setInt("fetch-count", ++count);
178179
print('[BackgroundFetch] count: $count');
179180

181+
//If condition below commented out by Otis, not sure how or why taskId would have this value
182+
//if (taskId == 'flutter_background_fetch') {
180183
// Test scheduling a custom-task in fetch event.
181-
182-
if (taskId == 'flutter_background_fetch') {
183-
BackgroundFetch.scheduleTask(TaskConfig(
184-
taskId: "com.transistorsoft.customtask",
185-
delay: 5000,
186-
periodic: false,
187-
forceAlarmManager: true,
188-
stopOnTerminate: false,
189-
enableHeadless: true));
190-
}
184+
BackgroundFetch.scheduleTask(TaskConfig(
185+
taskId: "com.transistorsoft.spacemapper",
186+
delay: 5000,
187+
periodic: false,
188+
forceAlarmManager: true,
189+
stopOnTerminate: false,
190+
enableHeadless: true));
191+
//}
191192
BackgroundFetch.finish(taskId);
192193
});
193-
194+
/*
194195
// Test scheduling a custom-task.
195196
BackgroundFetch.scheduleTask(TaskConfig(
196-
taskId: "com.transistorsoft.customtask",
197+
taskId: "com.transistorsoft.spacemapper",
197198
delay: 10000,
198199
periodic: false,
199200
forceAlarmManager: true,
200201
stopOnTerminate: false,
201202
enableHeadless: true));
203+
*/
202204
}
203205

204206
void _onClickEnable(enabled) async {

Space_Mapper/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ packages:
4545
dependency: "direct main"
4646
description:
4747
name: background_fetch
48-
sha256: f70b28a0f7a3156195e9742229696f004ea3bf10f74039b7bf4c78a74fbda8a4
48+
sha256: b5c298c911bc2ce41152668bc72eb0488f0665d75bc6d1e69e7d8367763eddcd
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.2.1"
51+
version: "1.3.5"
5252
boolean_selector:
5353
dependency: transitive
5454
description:
@@ -1178,5 +1178,5 @@ packages:
11781178
source: hosted
11791179
version: "3.1.2"
11801180
sdks:
1181-
dart: ">=3.1.0-185.0.dev <=3.3.0"
1182-
flutter: ">=3.10.0"
1181+
dart: ">=3.1.0 <=3.3.0"
1182+
flutter: ">=3.13.0"

Space_Mapper/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
sdk: flutter
2525
flutter_background_geolocation: ^4.3.0
2626
shared_preferences: ^2.0.8
27-
background_fetch: ^1.0.1
27+
background_fetch: ^1.3.5
2828
http: ^0.13.4
2929
flutter_map: ^0.14.0
3030
webview_flutter: ^2.8.0

0 commit comments

Comments
 (0)