Skip to content

Commit 3bcf259

Browse files
Examples: fix write error on macOS due to missing macosApplicationGroup.
1 parent b69a688 commit 3bcf259

File tree

9 files changed

+40
-20
lines changed

9 files changed

+40
-20
lines changed

objectbox/example/flutter/objectbox_demo/lib/objectbox.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ class ObjectBox {
3131
// On mobile this is typically fine, as each app has its own directory
3232
// structure.
3333

34+
// Note: set macosApplicationGroup for sandboxed macOS applications, see the
35+
// info boxes at https://docs.objectbox.io/getting-started for details.
36+
3437
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
3538
final store = await openStore(
36-
directory: p.join(
37-
(await getApplicationDocumentsDirectory()).path, "obx-demo"));
39+
directory:
40+
p.join((await getApplicationDocumentsDirectory()).path, "obx-demo"),
41+
macosApplicationGroup: "objectbox.demo");
3842
return ObjectBox._create(store);
3943
}
4044

objectbox/example/flutter/objectbox_demo/macos/Runner/DebugProfile.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<true/>
99
<key>com.apple.security.network.server</key>
1010
<true/>
11-
<key>com.apple.security.application-groups</key>
12-
<array>
13-
<string>objectbox.demo</string>
14-
</array>
11+
<key>com.apple.security.application-groups</key>
12+
<array>
13+
<string>objectbox.demo</string>
14+
</array>
1515
</dict>
1616
</plist>

objectbox/example/flutter/objectbox_demo/macos/Runner/Release.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7-
<key>com.apple.security.application-groups</key>
8-
<array>
9-
<string>objectbox.demo</string>
10-
</array>
7+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>objectbox.demo</string>
10+
</array>
1111
</dict>
1212
</plist>

objectbox/example/flutter/objectbox_demo_relations/lib/objectbox.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ class ObjectBox {
4545
// On mobile this is typically fine, as each app has its own directory
4646
// structure.
4747

48+
// Note: set macosApplicationGroup for sandboxed macOS applications, see the
49+
// info boxes at https://docs.objectbox.io/getting-started for details.
50+
4851
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
4952
final store = await openStore(
5053
directory: p.join((await getApplicationDocumentsDirectory()).path,
51-
"obx-demo-relations"));
54+
"obx-demo-relations"),
55+
macosApplicationGroup: "objectbox.demo");
5256
return ObjectBox._create(store);
5357
}
5458

objectbox/example/flutter/objectbox_demo_relations/macos/Runner/DebugProfile.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
<true/>
99
<key>com.apple.security.network.server</key>
1010
<true/>
11+
<key>com.apple.security.application-groups</key>
12+
<array>
13+
<string>objectbox.demo</string>
14+
</array>
1115
</dict>
1216
</plist>

objectbox/example/flutter/objectbox_demo_relations/macos/Runner/Release.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>objectbox.demo</string>
10+
</array>
711
</dict>
812
</plist>

objectbox/example/flutter/objectbox_demo_sync/lib/objectbox.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ class ObjectBox {
3737
// On mobile this is typically fine, as each app has its own directory
3838
// structure.
3939

40+
// Note: set macosApplicationGroup for sandboxed macOS applications, see the
41+
// info boxes at https://docs.objectbox.io/getting-started for details.
42+
4043
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
4144
final store = await openStore(
4245
directory: p.join(
43-
(await getApplicationDocumentsDirectory()).path, "obx-demo-sync"));
46+
(await getApplicationDocumentsDirectory()).path, "obx-demo-sync"),
47+
macosApplicationGroup: "objectbox.demo");
4448
return ObjectBox._create(store);
4549
}
4650

objectbox/example/flutter/objectbox_demo_sync/macos/Runner/DebugProfile.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<true/>
99
<key>com.apple.security.network.server</key>
1010
<true/>
11-
<key>com.apple.security.application-groups</key>
12-
<array>
13-
<string>objectbox.demo</string>
14-
</array>
11+
<key>com.apple.security.application-groups</key>
12+
<array>
13+
<string>objectbox.demo</string>
14+
</array>
1515
</dict>
1616
</plist>

objectbox/example/flutter/objectbox_demo_sync/macos/Runner/Release.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7-
<key>com.apple.security.application-groups</key>
8-
<array>
9-
<string>objectbox.demo</string>
10-
</array>
7+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>objectbox.demo</string>
10+
</array>
1111
</dict>
1212
</plist>

0 commit comments

Comments
 (0)