diff --git a/CHANGELOG.md b/CHANGELOG.md
index e4a5bbd..d388144 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 0.2.0
+
+**!! BREAKING CHANGES !!**
+
+- Add support for macOS
+- Renamed iOS-specific elements to Darwin to support both iOS and macOS:
+ - API: `iosDeviceName` renamed to `darwinDeviceName` in `NearbyInitializeData`
+ - API: `NearbyIOSDevice` renamed to `NearbyDarwinDevice`
+ - API: `NearbyIOSService` renamed to `NearbyDarwinService`
+ - API: `NearbyServiceIOSExceptionMapper` renamed to `NearbyServiceDarwinExceptionMapper`
+ - Access: `.ios` property renamed to `.darwin`
+
## 0.1.3
- [Android]: Use intent to get peers when requestPeers() returns empty
diff --git a/README.md b/README.md
index f2f6dad..3ca9f59 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,8 @@ Nearby Service Flutter Plugin is used to create connections in a P2P network.
The plugin supports sending text messages and files. With it,
you can easily create any kind of information sharing application **without Internet connection**.
-The package does not support communication between Android and IOS devices, the connection is available for
-**Android-Android** and **IOS-IOS** relations.
+The package does not support communication between Android and IOS/macOS (Darwin) devices, the connection is available for
+**Android-Android** and **Darwin-Darwin** relations.
Your feedback and suggestions would be greatly
appreciated! [You can leave your opinion here](https://forms.gle/FbAtW2dG5RYCxb1DA)
@@ -32,11 +32,11 @@ Or find the GIF demo at the end of the README:
- [About](#about)
- [Android](#about-android-plugin)
- - [IOS](#about-ios-plugin)
+ - [IOS and macOS](#about-ios-and-macos-plugin)
- [Features](#features)
- [Setup](#setup)
- [Android](#android-setup)
- - [IOS](#ios-setup)
+ - [IOS and macOS](#ios-and-macos-setup)
- [Usage](#usage)
- [Data sharing](#data-sharing)
- [Text messages](#text-messages)
@@ -44,6 +44,9 @@ Or find the GIF demo at the end of the README:
- [Exceptions](#exceptions)
- [Additional options](#additional-options)
- [Demo](#demo)
+- [Migration Guide](#migration-guide)
+ - [Migrating from v0.1.0 to v0.2.0](#migrating-from-v010-to-v020)
+
## About
> A peer-to-peer (P2P) network is a decentralized network architecture in which each participant, called a peer, can act
@@ -65,14 +68,14 @@ To check permissions and Wi-fi status, the
- `checkWifiService()` (Android only): returns true if Wi-fi is enabled
- `requestPermissions()` (Android only): requests permissions for location and nearby devices and returns true if
granted
-- `openServicesSettings()`: opens Wi-fi settings for Android and general settings for iOS
+- `openServicesSettings()`: opens Wi-fi settings for Android and general settings for iOS and macOS
> Testing the plugin **is not possible** on Android emulators, as they usually do not contain the Wi-fi Direct function
> in general! Use physical devices for that.
-### About IOS Plugin
+### About IOS and macOS Plugin
-For IOS, the P2P connection is implemented through the `Multipeer Connectivity` framework.
+For IOS and macOS, the P2P connection is implemented through the `Multipeer Connectivity` framework.
This framework **automatically selects** the best network technology depending on the situation—using **Wi-Fi**
if both devices are on the same network, or using **peer-to-peer Wi-Fi** or **Bluetooth** otherwise.
@@ -85,8 +88,8 @@ the `nearby_service` plugin to open the settings and prompt the user to turn Wi-
- **Device Preparation**
- Requesting permissions to use Wi-Fi Direct (Android only)
- Checking Wi-Fi status (Android only)
- - Opening settings to enable Wi-Fi (Android and iOS)
- - Role selection - Browser or Advertiser (IOS only)
+ - Opening settings to enable Wi-Fi (Android and IOS/macOS)
+ - Role selection - Browser or Advertiser (IOS and macOS only)
- **Connecting to the Device from a P2P Network**
- Listening for discovered devices (peers)
@@ -110,9 +113,9 @@ the `nearby_service` plugin to open the settings and prompt the user to turn Wi-
All necessary Android permissions are already in the **AndroidManifest.xml** of the plugin,
so you don't need to add anything **to work with p2p network**.
-### IOS setup
+### IOS and macOS setup
-For IOS, you need to add the following values to **Info.plist**:
+For IOS and macOS, you need to add the following values to **Info.plist**:
```
NSBonjourServices
@@ -161,11 +164,11 @@ For IOS, you need to add the following values to **Info.plist**:
> final _nearbyService = NearbyService.getInstance();
> _nearbyService.android..
> ```
-> For IOS:
+> For IOS and macOS:
>
> ```dart
> final _nearbyService = NearbyService.getInstance();
-> _nearbyService.ios..
+> _nearbyService.darwin..
> ```
1. Import the package:
@@ -185,9 +188,9 @@ final _nearbyService = NearbyService.getInstance();
```dart
// You can change the device name on a P2P network only for iOS.
-// Optionally pass the [iosDeviceName].
+// Optionally pass the [darwinDeviceName].
await _nearbyService.initialize(
- data: NearbyInitializeData(iosDeviceName: iosDeviceName),
+ data: NearbyInitializeData(darwinDeviceName: darwinDeviceName),
);
```
@@ -207,9 +210,9 @@ if (isWifiEnabled ?? false) {
}
```
-**Extra step for IOS:** ask the user to choose whether they are a Browser or Advertiser:
+**Extra step for IOS and macOS:** ask the user to choose whether they are a Browser or Advertiser:
-> In IOS Multipeer Connectivity, there are 2 roles for the discovery process and connection between devices: **browser**
+> In IOS and macOS Multipeer Connectivity, there are 2 roles for the discovery process and connection between devices: **browser**
> and **advertiser**.
>
> **Browser**: This component discovers nearby devices that report their availability. It is
@@ -221,7 +224,7 @@ if (isWifiEnabled ?? false) {
The code for selecting a role:
```dart
-_nearbyService.ios?.setIsBrowser(value: isBrowser);
+_nearbyService.darwin?.setIsBrowser(value: isBrowser);
// go to the starting discovery step
```
@@ -243,7 +246,7 @@ _nearbyService.getPeersStream().listen((event) => peers = event);
6. Each of the peers is a `NearbyDevice` and you can connect to it:
> Remember that when used on the Android platform, you can only pass `NearbyAndroidDevice` to the `connect()` method.
-> Similarly for iOS, `NearbyIOSDevice`. Devices automatically come from the discovery state in the correct type, so you
+> Similarly for iOS and macOS, `NearbyDarwinDevice`. Devices automatically come from the discovery state in the correct type, so you
> just need to use the received data.
```dart
@@ -270,7 +273,7 @@ _connectedDeviceSubscription = _nearbyService.getConnectedDeviceStream(device).l
```
8. Once you have connected over a P2P network, you still need to create a **communication channel** to transfer data.
- For Android, this is a **socket** embedded in `NearbyService`, for iOS it's a setup to listen to messages and
+ For Android, this is a **socket** embedded in `NearbyService`, for iOS and macOS it's a setup to listen to messages and
resources from the desired device. There is a method `startCommunicationChannel()` for this purpose. You should pass
to it listeners for messages and resources received from the connected device. There can only be one communication
channel, if you create a new one, the previous one will be **cancelled**.
@@ -541,4 +544,63 @@ the Android platform
### IOS
-
\ No newline at end of file
+
+
+## Migration Guide
+
+### Migrating from v0.1.0 to v0.2.0
+
+Version 0.2.0 adds support for macOS but introduces breaking changes to accommodate the unified Darwin platform (iOS and macOS).
+
+#### API Changes
+
+1. **Property Renaming**
+ - `.ios` property has been renamed to `.darwin`
+ ```dart
+ // Before (v0.1.0)
+ _nearbyService.ios?.setIsBrowser(value: isBrowser);
+
+ // After (v0.2.0)
+ _nearbyService.darwin?.setIsBrowser(value: isBrowser);
+ ```
+
+2. **Class Renaming**
+ - `NearbyIOSDevice` has been renamed to `NearbyDarwinDevice`
+ - `NearbyIOSService` has been renamed to `NearbyDarwinService`
+ - `NearbyServiceIOSExceptionMapper` has been renamed to `NearbyServiceDarwinExceptionMapper`
+
+3. **Parameter Renaming in NearbyInitializeData**
+ - `iosDeviceName` has been renamed to `darwinDeviceName`
+ ```dart
+ // Before (v0.1.0)
+ await _nearbyService.initialize(
+ data: NearbyInitializeData(iosDeviceName: deviceName),
+ );
+
+ // After (v0.2.0)
+ await _nearbyService.initialize(
+ data: NearbyInitializeData(darwinDeviceName: deviceName),
+ );
+ ```
+
+#### Assert Statements
+
+If you have assertions in your code that check for specific types, make sure to update them:
+
+```dart
+// Before (v0.1.0)
+assert(
+ device is NearbyIOSDevice,
+ 'The Nearby IOS Service can only work with the NearbyIOSDevice'
+);
+
+// After (v0.2.0)
+assert(
+ device is NearbyDarwinDevice,
+ 'The Nearby Darwin Service can only work with the NearbyDarwinDevice'
+);
+```
+
+#### Flutter Configuration
+
+If you're developing a plugin based on `nearby_service`, note that the `pubspec.yaml` now uses `sharedDarwinSource: true` to share code between iOS and macOS platforms.
\ No newline at end of file
diff --git a/ios/.gitignore b/darwin/.gitignore
similarity index 100%
rename from ios/.gitignore
rename to darwin/.gitignore
diff --git a/ios/Assets/.gitkeep b/darwin/Assets/.gitkeep
similarity index 100%
rename from ios/Assets/.gitkeep
rename to darwin/Assets/.gitkeep
diff --git a/ios/Classes/Models/NearbyCommand.swift b/darwin/Classes/Models/NearbyCommand.swift
similarity index 100%
rename from ios/Classes/Models/NearbyCommand.swift
rename to darwin/Classes/Models/NearbyCommand.swift
diff --git a/ios/Classes/Models/NearbyDevice.swift b/darwin/Classes/Models/NearbyDevice.swift
similarity index 100%
rename from ios/Classes/Models/NearbyDevice.swift
rename to darwin/Classes/Models/NearbyDevice.swift
diff --git a/ios/Classes/Models/NearbyMessage.swift b/darwin/Classes/Models/NearbyMessage.swift
similarity index 100%
rename from ios/Classes/Models/NearbyMessage.swift
rename to darwin/Classes/Models/NearbyMessage.swift
diff --git a/ios/Classes/Models/NearbyMessageContent.swift b/darwin/Classes/Models/NearbyMessageContent.swift
similarity index 100%
rename from ios/Classes/Models/NearbyMessageContent.swift
rename to darwin/Classes/Models/NearbyMessageContent.swift
diff --git a/ios/Classes/Models/NearbySession.swift b/darwin/Classes/Models/NearbySession.swift
similarity index 100%
rename from ios/Classes/Models/NearbySession.swift
rename to darwin/Classes/Models/NearbySession.swift
diff --git a/ios/Classes/Models/NearbyUserInfo.swift b/darwin/Classes/Models/NearbyUserInfo.swift
similarity index 100%
rename from ios/Classes/Models/NearbyUserInfo.swift
rename to darwin/Classes/Models/NearbyUserInfo.swift
diff --git a/ios/Classes/NearbyManager.swift b/darwin/Classes/NearbyManager.swift
similarity index 96%
rename from ios/Classes/NearbyManager.swift
rename to darwin/Classes/NearbyManager.swift
index 5688e90..c0b40da 100644
--- a/ios/Classes/NearbyManager.swift
+++ b/darwin/Classes/NearbyManager.swift
@@ -1,5 +1,11 @@
import Foundation
+#if os(iOS)
import Flutter
+import UIKit
+#elseif os(macOS)
+import FlutterMacOS
+import AppKit
+#endif
import MultipeerConnectivity
class NearbyManager: NSObject {
@@ -36,11 +42,17 @@ class NearbyManager: NSObject {
}
func openServicesSettings(result: @escaping FlutterResult) {
+ #if os(iOS)
if let url = URL(string:UIApplication.openSettingsURLString) {
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
+ #elseif os(macOS)
+ if let url = URL(string: "x-apple.systempreferences:com.apple.preference.sharing") {
+ NSWorkspace.shared.open(url)
+ }
+ #endif
result(true)
}
diff --git a/ios/Classes/NearbyNotificationReceiver.swift b/darwin/Classes/NearbyNotificationReceiver.swift
similarity index 97%
rename from ios/Classes/NearbyNotificationReceiver.swift
rename to darwin/Classes/NearbyNotificationReceiver.swift
index aef686a..653065d 100644
--- a/ios/Classes/NearbyNotificationReceiver.swift
+++ b/darwin/Classes/NearbyNotificationReceiver.swift
@@ -6,7 +6,11 @@
//
import Foundation
+#if os(iOS)
import Flutter
+#elseif os(macOS)
+import FlutterMacOS
+#endif
extension NearbyServicePlugin {
diff --git a/ios/Classes/NearbyServicePlugin.swift b/darwin/Classes/NearbyServicePlugin.swift
similarity index 86%
rename from ios/Classes/NearbyServicePlugin.swift
rename to darwin/Classes/NearbyServicePlugin.swift
index fb2ab54..7bed420 100644
--- a/ios/Classes/NearbyServicePlugin.swift
+++ b/darwin/Classes/NearbyServicePlugin.swift
@@ -1,6 +1,12 @@
+#if os(iOS)
import Flutter
-import MultipeerConnectivity
import UIKit
+#elseif os(macOS)
+import FlutterMacOS
+import AppKit
+import Foundation
+#endif
+import MultipeerConnectivity
public class NearbyServicePlugin: NSObject, FlutterPlugin{
@@ -15,17 +21,24 @@ public class NearbyServicePlugin: NSObject, FlutterPlugin{
}
public static func register(with registrar: FlutterPluginRegistrar) {
+ // Workaround for https://github.com/flutter/flutter/issues/118103.
+ #if os(iOS)
+ let messenger = registrar.messenger()
+ #else
+ let messenger = registrar.messenger
+ #endif
+
let channel = FlutterMethodChannel(
name: "nearby_service",
- binaryMessenger: registrar.messenger()
+ binaryMessenger: messenger
)
let nearbyPeersChannel = FlutterEventChannel(
name: "nearby_service_peers",
- binaryMessenger: registrar.messenger()
+ binaryMessenger: messenger
)
let connectedDeviceChannel = FlutterEventChannel(
name: "nearby_service_connected_device",
- binaryMessenger: registrar.messenger()
+ binaryMessenger: messenger
)
let nearbyPeersStreamHandler = NearbyPeersStreamHandler()
nearbyPeersChannel.setStreamHandler(nearbyPeersStreamHandler)
@@ -62,9 +75,17 @@ public class NearbyServicePlugin: NSObject, FlutterPlugin{
switch call.method {
case "getPlatformVersion":
+ #if os(iOS)
result("iOS " + UIDevice.current.systemVersion)
+ #elseif os(macOS)
+ result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString)
+ #endif
case "getPlatformModel":
+ #if os(iOS)
result(UIDevice.current.name)
+ #elseif os(macOS)
+ result(Host.current().localizedName ?? "Mac")
+ #endif
case "initialize":
manager.initialize(for: getArgument(for: "deviceName", call: call), result: result)
case "getSavedDeviceName":
diff --git a/ios/Classes/Store/NearbyDevicesStore.swift b/darwin/Classes/Store/NearbyDevicesStore.swift
similarity index 100%
rename from ios/Classes/Store/NearbyDevicesStore.swift
rename to darwin/Classes/Store/NearbyDevicesStore.swift
diff --git a/ios/Classes/Store/NearbyFilesStore.swift b/darwin/Classes/Store/NearbyFilesStore.swift
similarity index 100%
rename from ios/Classes/Store/NearbyFilesStore.swift
rename to darwin/Classes/Store/NearbyFilesStore.swift
diff --git a/ios/Classes/Store/NearbyRequestsStore.swift b/darwin/Classes/Store/NearbyRequestsStore.swift
similarity index 100%
rename from ios/Classes/Store/NearbyRequestsStore.swift
rename to darwin/Classes/Store/NearbyRequestsStore.swift
diff --git a/ios/Classes/StreamHandler/ConnectedDeviceStreamHandler.swift b/darwin/Classes/StreamHandler/ConnectedDeviceStreamHandler.swift
similarity index 95%
rename from ios/Classes/StreamHandler/ConnectedDeviceStreamHandler.swift
rename to darwin/Classes/StreamHandler/ConnectedDeviceStreamHandler.swift
index cad0432..63e678e 100644
--- a/ios/Classes/StreamHandler/ConnectedDeviceStreamHandler.swift
+++ b/darwin/Classes/StreamHandler/ConnectedDeviceStreamHandler.swift
@@ -1,4 +1,8 @@
+#if os(iOS)
import Flutter
+#elseif os(macOS)
+import FlutterMacOS
+#endif
import MultipeerConnectivity
class ConnectedDeviceStreamHandler: NSObject, FlutterStreamHandler {
diff --git a/ios/Classes/StreamHandler/NearbyPeersStreamHandler.swift b/darwin/Classes/StreamHandler/NearbyPeersStreamHandler.swift
similarity index 94%
rename from ios/Classes/StreamHandler/NearbyPeersStreamHandler.swift
rename to darwin/Classes/StreamHandler/NearbyPeersStreamHandler.swift
index afba29d..0111c63 100644
--- a/ios/Classes/StreamHandler/NearbyPeersStreamHandler.swift
+++ b/darwin/Classes/StreamHandler/NearbyPeersStreamHandler.swift
@@ -1,4 +1,8 @@
+#if os(iOS)
import Flutter
+#elseif os(macOS)
+import FlutterMacOS
+#endif
class NearbyPeersStreamHandler: NSObject, FlutterStreamHandler {
private var eventSink: FlutterEventSink?
diff --git a/ios/Classes/Utils/Archiver.swift b/darwin/Classes/Utils/Archiver.swift
similarity index 100%
rename from ios/Classes/Utils/Archiver.swift
rename to darwin/Classes/Utils/Archiver.swift
diff --git a/ios/Classes/Utils/Constants.swift b/darwin/Classes/Utils/Constants.swift
similarity index 100%
rename from ios/Classes/Utils/Constants.swift
rename to darwin/Classes/Utils/Constants.swift
diff --git a/ios/Classes/Utils/Logger.swift b/darwin/Classes/Utils/Logger.swift
similarity index 100%
rename from ios/Classes/Utils/Logger.swift
rename to darwin/Classes/Utils/Logger.swift
diff --git a/darwin/Classes/Utils/MyDeviceDataGenerator.swift b/darwin/Classes/Utils/MyDeviceDataGenerator.swift
new file mode 100644
index 0000000..973e0c9
--- /dev/null
+++ b/darwin/Classes/Utils/MyDeviceDataGenerator.swift
@@ -0,0 +1,80 @@
+import Foundation
+import MultipeerConnectivity
+#if os(iOS)
+import UIKit
+#elseif os(macOS)
+import AppKit
+import Foundation
+#endif
+
+
+class MyDeviceDataGenerator {
+ static func generate(name: String?) -> NearbyDevice {
+ return NearbyDevice(
+ peerID: getPeerID(),
+ name: getNameArchived(or: name),
+ deviceType: getDeviceType(),
+ os: getOSName(),
+ osVersion: getOSVersion()
+ )
+ }
+
+ static private func getDeviceType() -> String {
+ #if os(iOS)
+ return UIDevice.current.model
+ #elseif os(macOS)
+ return "Mac"
+ #endif
+ }
+
+ static private func getOSName() -> String {
+ #if os(iOS)
+ return UIDevice.current.systemName
+ #elseif os(macOS)
+ return "macOS"
+ #endif
+ }
+
+ static private func getOSVersion() -> String {
+ #if os(iOS)
+ return UIDevice.current.systemVersion
+ #elseif os(macOS)
+ return ProcessInfo.processInfo.operatingSystemVersionString
+ #endif
+ }
+ static private func getPeerID() -> MCPeerID {
+ if let archivedPeerID = Archiver.getPeerID() {
+ return archivedPeerID
+ } else {
+ let deviceName: String
+ #if os(iOS)
+ deviceName = UIDevice.current.name
+ #elseif os(macOS)
+ deviceName = Host.current().localizedName ?? "Mac"
+ #endif
+
+ let peerID = MCPeerID(
+ displayName: deviceName.replacingOccurrences(of: " ", with: "_")
+ + "_"
+ + String(Int.random(in: 1000..<50000))
+ )
+ Archiver.savePeerID(for: peerID)
+ return peerID
+ }
+ }
+ static private func getNameArchived(or name: String?) -> String {
+ let archivedName = Archiver.getName()
+ if let newName = name {
+ if (archivedName != newName) {
+ Archiver.saveName(for: newName)
+ }
+ return newName
+ }
+ #if os(iOS)
+ return archivedName ?? UIDevice.current.name
+ #elseif os(macOS)
+ return archivedName ?? (Host.current().localizedName ?? "Mac")
+ #endif
+ }
+
+}
diff --git a/ios/nearby_service.podspec b/darwin/nearby_service.podspec
similarity index 85%
rename from ios/nearby_service.podspec
rename to darwin/nearby_service.podspec
index 4fefd73..8527301 100644
--- a/ios/nearby_service.podspec
+++ b/darwin/nearby_service.podspec
@@ -14,8 +14,10 @@ A new Flutter plugin project.
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
- s.dependency 'Flutter'
- s.platform = :ios, '12.0'
+ s.ios.dependency 'Flutter'
+ s.osx.dependency 'FlutterMacOS'
+ s.ios.deployment_target = '12.0'
+ s.osx.deployment_target = '10.14'
# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 2eff517..dffc1b3 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -38,6 +38,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
+ enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
diff --git a/example/lib/components/ios_role_selector.dart b/example/lib/components/darwin_role_selector.dart
similarity index 61%
rename from example/lib/components/ios_role_selector.dart
rename to example/lib/components/darwin_role_selector.dart
index bbdeff9..c95dc5c 100644
--- a/example/lib/components/ios_role_selector.dart
+++ b/example/lib/components/darwin_role_selector.dart
@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
-class IOSRoleSelector extends StatelessWidget {
- const IOSRoleSelector({
+class DarwinRoleSelector extends StatelessWidget {
+ const DarwinRoleSelector({
super.key,
- required this.isIosBrowser,
+ required this.isDarwinBrowser,
required this.onSelect,
});
- final bool isIosBrowser;
+ final bool isDarwinBrowser;
final ValueChanged onSelect;
@override
@@ -17,11 +17,11 @@ class IOSRoleSelector extends StatelessWidget {
children: [
Center(
child: Text(
- 'You are ${isIosBrowser ? 'Browser' : 'Advertiser'}',
+ 'You are ${isDarwinBrowser ? 'Browser' : 'Advertiser'}',
),
),
Switch(
- value: isIosBrowser,
+ value: isDarwinBrowser,
onChanged: onSelect,
),
],
diff --git a/example/lib/components/peer_widget.dart b/example/lib/components/peer_widget.dart
index b476a16..5808e20 100644
--- a/example/lib/components/peer_widget.dart
+++ b/example/lib/components/peer_widget.dart
@@ -5,13 +5,13 @@ class PeerWidget extends StatelessWidget {
const PeerWidget({
super.key,
required this.device,
- required this.isIosBrowser,
+ required this.isDarwinBrowser,
required this.onConnect,
required this.communicationChannelState,
});
final NearbyDevice device;
- final bool isIosBrowser;
+ final bool isDarwinBrowser;
final ValueChanged onConnect;
final CommunicationChannelState communicationChannelState;
@@ -28,7 +28,7 @@ class PeerWidget extends StatelessWidget {
return ListTile(
title: Text(
- '${isIosBrowser ? 'Found device' : 'Pending invitation'} | ${device.info.displayName} | $status',
+ '${isDarwinBrowser ? 'Found device' : 'Pending invitation'} | ${device.info.displayName} | $status',
),
onTap: canTap ? () => onConnect(device) : null,
tileColor: Colors.blueAccent,
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 802a85d..ef44ae0 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -10,7 +10,7 @@ import 'package:nearby_service/nearby_service.dart';
/// see https://github.com/ksenia312/nearby_service/blob/main/example/lib/.
import 'components/connected_device_view.dart';
import 'components/files_messaging_view.dart';
-import 'components/ios_role_selector.dart';
+import 'components/darwin_role_selector.dart';
import 'components/peer_widget.dart';
import 'components/text_messaging_view.dart';
import 'utils/app_snack_bar.dart';
@@ -64,8 +64,8 @@ class _AppBodyState extends State {
AppState _state = AppState.idle;
- /// Browser OR Advertiser for IOS
- bool _isIosBrowser = true;
+ /// Browser OR Advertiser for IOS/MacOS
+ bool _isDarwinBrowser = true;
/// List of discovered devices
List _peers = [];
@@ -98,10 +98,10 @@ class _AppBodyState extends State {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
- if (Platform.isIOS)
- IOSRoleSelector(
- isIosBrowser: _isIosBrowser,
- onSelect: (value) => setState(() => _isIosBrowser = value),
+ if (Platform.isIOS || Platform.isMacOS)
+ DarwinRoleSelector(
+ isDarwinBrowser: _isDarwinBrowser,
+ onSelect: (value) => setState(() => _isDarwinBrowser = value),
),
ElevatedButton(
onPressed: _startProcess,
@@ -112,13 +112,13 @@ class _AppBodyState extends State {
} else if (_state == AppState.discovering) {
return ListView(
children: [
- if (Platform.isIOS)
- Text('You are ${_isIosBrowser ? 'Browser' : 'Advertiser'}'),
+ if (Platform.isIOS || Platform.isMacOS)
+ Text('You are ${_isDarwinBrowser ? 'Browser' : 'Advertiser'}'),
if (_peers.isEmpty) const Text('Searching for peers...'),
..._peers.map(
(e) => PeerWidget(
device: e,
- isIosBrowser: _isIosBrowser,
+ isDarwinBrowser: _isDarwinBrowser,
onConnect: _connect,
communicationChannelState: _communicationChannelState,
),
@@ -176,8 +176,8 @@ class _AppBodyState extends State {
final isGranted = await _nearbyService.android?.requestPermissions();
final wifiEnabled = await _nearbyService.android?.checkWifiService();
return (isGranted ?? false) && (wifiEnabled ?? false);
- } else if (Platform.isIOS) {
- _nearbyService.ios?.setIsBrowser(value: _isIosBrowser);
+ } else if (Platform.isIOS || Platform.isMacOS) {
+ _nearbyService.darwin?.setIsBrowser(value: _isDarwinBrowser);
return true;
} else {
return false;
diff --git a/example/macos/.gitignore b/example/macos/.gitignore
new file mode 100644
index 0000000..746adbb
--- /dev/null
+++ b/example/macos/.gitignore
@@ -0,0 +1,7 @@
+# Flutter-related
+**/Flutter/ephemeral/
+**/Pods/
+
+# Xcode-related
+**/dgph
+**/xcuserdata/
diff --git a/example/macos/Flutter/Flutter-Debug.xcconfig b/example/macos/Flutter/Flutter-Debug.xcconfig
new file mode 100644
index 0000000..4b81f9b
--- /dev/null
+++ b/example/macos/Flutter/Flutter-Debug.xcconfig
@@ -0,0 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
+#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/example/macos/Flutter/Flutter-Release.xcconfig b/example/macos/Flutter/Flutter-Release.xcconfig
new file mode 100644
index 0000000..5caa9d1
--- /dev/null
+++ b/example/macos/Flutter/Flutter-Release.xcconfig
@@ -0,0 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
+#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift
new file mode 100644
index 0000000..7960a9c
--- /dev/null
+++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -0,0 +1,16 @@
+//
+// Generated file. Do not edit.
+//
+
+import FlutterMacOS
+import Foundation
+
+import file_picker
+import nearby_service
+import path_provider_foundation
+
+func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
+ FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
+ NearbyServicePlugin.register(with: registry.registrar(forPlugin: "NearbyServicePlugin"))
+ PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
+}
diff --git a/example/macos/Podfile b/example/macos/Podfile
new file mode 100644
index 0000000..29c8eb3
--- /dev/null
+++ b/example/macos/Podfile
@@ -0,0 +1,42 @@
+platform :osx, '10.14'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+ 'Debug' => :debug,
+ 'Profile' => :release,
+ 'Release' => :release,
+}
+
+def flutter_root
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
+ unless File.exist?(generated_xcode_build_settings_path)
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
+ end
+
+ File.foreach(generated_xcode_build_settings_path) do |line|
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
+ return matches[1].strip if matches
+ end
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_macos_podfile_setup
+
+target 'Runner' do
+ use_frameworks!
+
+ flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
+ target 'RunnerTests' do
+ inherit! :search_paths
+ end
+end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ flutter_additional_macos_build_settings(target)
+ end
+end
diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..a2d3aad
--- /dev/null
+++ b/example/macos/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,801 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;
+ buildPhases = (
+ 33CC111E2044C6BF0003C045 /* ShellScript */,
+ );
+ dependencies = (
+ );
+ name = "Flutter Assemble";
+ productName = FLX;
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ 0F4B7C1291D15328FFC17F2E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C5B5473A7397420B3456EA5 /* Pods_Runner.framework */; };
+ 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
+ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
+ 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
+ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
+ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
+ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
+ 5476ADD369013E5E7CF99F20 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D418F6B4CCCBA46C47D928EF /* Pods_RunnerTests.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 33CC10EC2044A3C60003C045;
+ remoteInfo = Runner;
+ };
+ 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 33CC111A2044C6BA0003C045;
+ remoteInfo = FLX;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 33CC110E2044A8840003C045 /* Bundle Framework */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Bundle Framework";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 05DA3310FA13FBBD78F80618 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
+ 1C5B5473A7397420B3456EA5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
+ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; };
+ 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; };
+ 33CC10ED2044A3C60003C045 /* nearby_service_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = nearby_service_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; };
+ 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
+ 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; };
+ 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; };
+ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; };
+ 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; };
+ 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; };
+ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
+ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
+ 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
+ 41361B6F0E9B90671AA45D51 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
+ 62AE50A2904E73D63FFE9BAE /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; };
+ 7D3E39BE7E611D3745CE286E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
+ B55C137711990F29DB54A6B1 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ D418F6B4CCCBA46C47D928EF /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ F651A40A892E4F4398EDC4DD /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 331C80D2294CF70F00263BE5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5476ADD369013E5E7CF99F20 /* Pods_RunnerTests.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 33CC10EA2044A3C60003C045 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0F4B7C1291D15328FFC17F2E /* Pods_Runner.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 331C80D6294CF71000263BE5 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ 331C80D7294CF71000263BE5 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ sourceTree = "";
+ };
+ 33BA886A226E78AF003329D5 /* Configs */ = {
+ isa = PBXGroup;
+ children = (
+ 33E5194F232828860026EE4D /* AppInfo.xcconfig */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */,
+ );
+ path = Configs;
+ sourceTree = "";
+ };
+ 33CC10E42044A3C60003C045 = {
+ isa = PBXGroup;
+ children = (
+ 33FAB671232836740065AC1E /* Runner */,
+ 33CEB47122A05771004F2AC0 /* Flutter */,
+ 331C80D6294CF71000263BE5 /* RunnerTests */,
+ 33CC10EE2044A3C60003C045 /* Products */,
+ D73912EC22F37F3D000D13A0 /* Frameworks */,
+ DE27014E33A270E24A2A9C30 /* Pods */,
+ );
+ sourceTree = "";
+ };
+ 33CC10EE2044A3C60003C045 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 33CC10ED2044A3C60003C045 /* nearby_service_example.app */,
+ 331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 33CC11242044D66E0003C045 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 33CC10F22044A3C60003C045 /* Assets.xcassets */,
+ 33CC10F42044A3C60003C045 /* MainMenu.xib */,
+ 33CC10F72044A3C60003C045 /* Info.plist */,
+ );
+ name = Resources;
+ path = ..;
+ sourceTree = "";
+ };
+ 33CEB47122A05771004F2AC0 /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
+ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
+ 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
+ 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
+ );
+ path = Flutter;
+ sourceTree = "";
+ };
+ 33FAB671232836740065AC1E /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 33CC10F02044A3C60003C045 /* AppDelegate.swift */,
+ 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
+ 33E51913231747F40026EE4D /* DebugProfile.entitlements */,
+ 33E51914231749380026EE4D /* Release.entitlements */,
+ 33CC11242044D66E0003C045 /* Resources */,
+ 33BA886A226E78AF003329D5 /* Configs */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+ D73912EC22F37F3D000D13A0 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1C5B5473A7397420B3456EA5 /* Pods_Runner.framework */,
+ D418F6B4CCCBA46C47D928EF /* Pods_RunnerTests.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ DE27014E33A270E24A2A9C30 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ B55C137711990F29DB54A6B1 /* Pods-Runner.debug.xcconfig */,
+ F651A40A892E4F4398EDC4DD /* Pods-Runner.release.xcconfig */,
+ 7D3E39BE7E611D3745CE286E /* Pods-Runner.profile.xcconfig */,
+ 62AE50A2904E73D63FFE9BAE /* Pods-RunnerTests.debug.xcconfig */,
+ 05DA3310FA13FBBD78F80618 /* Pods-RunnerTests.release.xcconfig */,
+ 41361B6F0E9B90671AA45D51 /* Pods-RunnerTests.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 331C80D4294CF70F00263BE5 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ 6FE07F3FABAF18F6820D0E9E /* [CP] Check Pods Manifest.lock */,
+ 331C80D1294CF70F00263BE5 /* Sources */,
+ 331C80D2294CF70F00263BE5 /* Frameworks */,
+ 331C80D3294CF70F00263BE5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 331C80DA294CF71000263BE5 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 33CC10EC2044A3C60003C045 /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 186E5BC05311BECEE39ECEE7 /* [CP] Check Pods Manifest.lock */,
+ 33CC10E92044A3C60003C045 /* Sources */,
+ 33CC10EA2044A3C60003C045 /* Frameworks */,
+ 33CC10EB2044A3C60003C045 /* Resources */,
+ 33CC110E2044A8840003C045 /* Bundle Framework */,
+ 3399D490228B24CF009A79C7 /* ShellScript */,
+ AC1DF64D0F7BD700BC79A81B /* [CP] Embed Pods Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 33CC11202044C79F0003C045 /* PBXTargetDependency */,
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 33CC10ED2044A3C60003C045 /* nearby_service_example.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 33CC10E52044A3C60003C045 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastSwiftUpdateCheck = 0920;
+ LastUpgradeCheck = 1510;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 331C80D4294CF70F00263BE5 = {
+ CreatedOnToolsVersion = 14.0;
+ TestTargetID = 33CC10EC2044A3C60003C045;
+ };
+ 33CC10EC2044A3C60003C045 = {
+ CreatedOnToolsVersion = 9.2;
+ LastSwiftMigration = 1100;
+ ProvisioningStyle = Automatic;
+ SystemCapabilities = {
+ com.apple.Sandbox = {
+ enabled = 1;
+ };
+ };
+ };
+ 33CC111A2044C6BA0003C045 = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Manual;
+ };
+ };
+ };
+ buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 33CC10E42044A3C60003C045;
+ productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 33CC10EC2044A3C60003C045 /* Runner */,
+ 331C80D4294CF70F00263BE5 /* RunnerTests */,
+ 33CC111A2044C6BA0003C045 /* Flutter Assemble */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 331C80D3294CF70F00263BE5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 33CC10EB2044A3C60003C045 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
+ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 186E5BC05311BECEE39ECEE7 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 3399D490228B24CF009A79C7 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
+ };
+ 33CC111E2044C6BF0003C045 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ Flutter/ephemeral/FlutterInputs.xcfilelist,
+ );
+ inputPaths = (
+ Flutter/ephemeral/tripwire,
+ );
+ outputFileListPaths = (
+ Flutter/ephemeral/FlutterOutputs.xcfilelist,
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
+ };
+ 6FE07F3FABAF18F6820D0E9E /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ AC1DF64D0F7BD700BC79A81B /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 331C80D1294CF70F00263BE5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 33CC10E92044A3C60003C045 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
+ 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
+ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 33CC10EC2044A3C60003C045 /* Runner */;
+ targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */;
+ };
+ 33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
+ targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 33CC10F42044A3C60003C045 /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 33CC10F52044A3C60003C045 /* Base */,
+ );
+ name = MainMenu.xib;
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 331C80DB294CF71000263BE5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 62AE50A2904E73D63FFE9BAE /* Pods-RunnerTests.debug.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.xenikii.nearbyServiceExample.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nearby_service_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/nearby_service_example";
+ };
+ name = Debug;
+ };
+ 331C80DC294CF71000263BE5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 05DA3310FA13FBBD78F80618 /* Pods-RunnerTests.release.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.xenikii.nearbyServiceExample.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nearby_service_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/nearby_service_example";
+ };
+ name = Release;
+ };
+ 331C80DD294CF71000263BE5 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 41361B6F0E9B90671AA45D51 /* Pods-RunnerTests.profile.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.xenikii.nearbyServiceExample.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nearby_service_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/nearby_service_example";
+ };
+ name = Profile;
+ };
+ 338D0CE9231458BD00FA5F75 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = macosx;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ };
+ name = Profile;
+ };
+ 338D0CEA231458BD00FA5F75 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Profile;
+ };
+ 338D0CEB231458BD00FA5F75 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Manual;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Profile;
+ };
+ 33CC10F92044A3C60003C045 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ };
+ name = Debug;
+ };
+ 33CC10FA2044A3C60003C045 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = macosx;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ };
+ name = Release;
+ };
+ 33CC10FC2044A3C60003C045 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 33CC10FD2044A3C60003C045 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
+ 33CC111C2044C6BA0003C045 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Manual;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 33CC111D2044C6BA0003C045 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 331C80DB294CF71000263BE5 /* Debug */,
+ 331C80DC294CF71000263BE5 /* Release */,
+ 331C80DD294CF71000263BE5 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 33CC10F92044A3C60003C045 /* Debug */,
+ 33CC10FA2044A3C60003C045 /* Release */,
+ 338D0CE9231458BD00FA5F75 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 33CC10FC2044A3C60003C045 /* Debug */,
+ 33CC10FD2044A3C60003C045 /* Release */,
+ 338D0CEA231458BD00FA5F75 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 33CC111C2044C6BA0003C045 /* Debug */,
+ 33CC111D2044C6BA0003C045 /* Release */,
+ 338D0CEB231458BD00FA5F75 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 33CC10E52044A3C60003C045 /* Project object */;
+}
diff --git a/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..dcb4b2e
--- /dev/null
+++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/example/macos/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..21a3cc1
--- /dev/null
+++ b/example/macos/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/example/macos/Runner/AppDelegate.swift b/example/macos/Runner/AppDelegate.swift
new file mode 100644
index 0000000..b3c1761
--- /dev/null
+++ b/example/macos/Runner/AppDelegate.swift
@@ -0,0 +1,13 @@
+import Cocoa
+import FlutterMacOS
+
+@main
+class AppDelegate: FlutterAppDelegate {
+ override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
+ return true
+ }
+
+ override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
+ return true
+ }
+}
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..a2ec33f
--- /dev/null
+++ b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,68 @@
+{
+ "images" : [
+ {
+ "size" : "16x16",
+ "idiom" : "mac",
+ "filename" : "app_icon_16.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "16x16",
+ "idiom" : "mac",
+ "filename" : "app_icon_32.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "32x32",
+ "idiom" : "mac",
+ "filename" : "app_icon_32.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "32x32",
+ "idiom" : "mac",
+ "filename" : "app_icon_64.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "128x128",
+ "idiom" : "mac",
+ "filename" : "app_icon_128.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "128x128",
+ "idiom" : "mac",
+ "filename" : "app_icon_256.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "256x256",
+ "idiom" : "mac",
+ "filename" : "app_icon_256.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "256x256",
+ "idiom" : "mac",
+ "filename" : "app_icon_512.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "512x512",
+ "idiom" : "mac",
+ "filename" : "app_icon_512.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "512x512",
+ "idiom" : "mac",
+ "filename" : "app_icon_1024.png",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
new file mode 100644
index 0000000..82b6f9d
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
new file mode 100644
index 0000000..13b35eb
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
new file mode 100644
index 0000000..0a3f5fa
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
new file mode 100644
index 0000000..bdb5722
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
new file mode 100644
index 0000000..f083318
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
new file mode 100644
index 0000000..326c0e7
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ
diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
new file mode 100644
index 0000000..2f1632c
Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ
diff --git a/example/macos/Runner/Base.lproj/MainMenu.xib b/example/macos/Runner/Base.lproj/MainMenu.xib
new file mode 100644
index 0000000..80e867a
--- /dev/null
+++ b/example/macos/Runner/Base.lproj/MainMenu.xib
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/macos/Runner/Configs/AppInfo.xcconfig b/example/macos/Runner/Configs/AppInfo.xcconfig
new file mode 100644
index 0000000..885ee5f
--- /dev/null
+++ b/example/macos/Runner/Configs/AppInfo.xcconfig
@@ -0,0 +1,14 @@
+// Application-level settings for the Runner target.
+//
+// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
+// future. If not, the values below would default to using the project name when this becomes a
+// 'flutter create' template.
+
+// The application's name. By default this is also the title of the Flutter window.
+PRODUCT_NAME = nearby_service_example
+
+// The application's bundle identifier
+PRODUCT_BUNDLE_IDENTIFIER = com.xenikii.nearbyServiceExample
+
+// The copyright displayed in application information
+PRODUCT_COPYRIGHT = Copyright © 2025 com.xenikii. All rights reserved.
diff --git a/example/macos/Runner/Configs/Debug.xcconfig b/example/macos/Runner/Configs/Debug.xcconfig
new file mode 100644
index 0000000..36b0fd9
--- /dev/null
+++ b/example/macos/Runner/Configs/Debug.xcconfig
@@ -0,0 +1,2 @@
+#include "../../Flutter/Flutter-Debug.xcconfig"
+#include "Warnings.xcconfig"
diff --git a/example/macos/Runner/Configs/Release.xcconfig b/example/macos/Runner/Configs/Release.xcconfig
new file mode 100644
index 0000000..dff4f49
--- /dev/null
+++ b/example/macos/Runner/Configs/Release.xcconfig
@@ -0,0 +1,2 @@
+#include "../../Flutter/Flutter-Release.xcconfig"
+#include "Warnings.xcconfig"
diff --git a/example/macos/Runner/Configs/Warnings.xcconfig b/example/macos/Runner/Configs/Warnings.xcconfig
new file mode 100644
index 0000000..42bcbf4
--- /dev/null
+++ b/example/macos/Runner/Configs/Warnings.xcconfig
@@ -0,0 +1,13 @@
+WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
+GCC_WARN_UNDECLARED_SELECTOR = YES
+CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
+CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
+CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
+CLANG_WARN_PRAGMA_PACK = YES
+CLANG_WARN_STRICT_PROTOTYPES = YES
+CLANG_WARN_COMMA = YES
+GCC_WARN_STRICT_SELECTOR_MATCH = YES
+CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
+CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
+GCC_WARN_SHADOW = YES
+CLANG_WARN_UNREACHABLE_CODE = YES
diff --git a/example/macos/Runner/DebugProfile.entitlements b/example/macos/Runner/DebugProfile.entitlements
new file mode 100644
index 0000000..0eaccf1
--- /dev/null
+++ b/example/macos/Runner/DebugProfile.entitlements
@@ -0,0 +1,16 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.files.user-selected.read-write
+
+ com.apple.security.network.client
+
+ com.apple.security.network.server
+
+
+
diff --git a/example/macos/Runner/Info.plist b/example/macos/Runner/Info.plist
new file mode 100644
index 0000000..a1c00b5
--- /dev/null
+++ b/example/macos/Runner/Info.plist
@@ -0,0 +1,46 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSMinimumSystemVersion
+ $(MACOSX_DEPLOYMENT_TARGET)
+ NSHumanReadableCopyright
+ $(PRODUCT_COPYRIGHT)
+ NSMainNibFile
+ MainMenu
+ NSPrincipalClass
+ NSApplication
+
+ LSSupportsOpeningDocumentsInPlace
+
+ UIFileSharingEnabled
+
+ NSBonjourServices
+
+ _mp-connection._tcp
+
+ UIRequiresPersistentWiFi
+
+ NSLocalNetworkUsageDescription
+ [Your description here]
+
+
+
\ No newline at end of file
diff --git a/example/macos/Runner/MainFlutterWindow.swift b/example/macos/Runner/MainFlutterWindow.swift
new file mode 100644
index 0000000..3cc05eb
--- /dev/null
+++ b/example/macos/Runner/MainFlutterWindow.swift
@@ -0,0 +1,15 @@
+import Cocoa
+import FlutterMacOS
+
+class MainFlutterWindow: NSWindow {
+ override func awakeFromNib() {
+ let flutterViewController = FlutterViewController()
+ let windowFrame = self.frame
+ self.contentViewController = flutterViewController
+ self.setFrame(windowFrame, display: true)
+
+ RegisterGeneratedPlugins(registry: flutterViewController)
+
+ super.awakeFromNib()
+ }
+}
diff --git a/example/macos/Runner/Release.entitlements b/example/macos/Runner/Release.entitlements
new file mode 100644
index 0000000..85c03d7
--- /dev/null
+++ b/example/macos/Runner/Release.entitlements
@@ -0,0 +1,14 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.files.user-selected.read-write
+
+ com.apple.security.network.client
+
+ com.apple.security.network.server
+
+
+
diff --git a/example/macos/RunnerTests/RunnerTests.swift b/example/macos/RunnerTests/RunnerTests.swift
new file mode 100644
index 0000000..61f3bd1
--- /dev/null
+++ b/example/macos/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Cocoa
+import FlutterMacOS
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/example_full/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example_full/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 8e3ca5d..15cada4 100644
--- a/example_full/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example_full/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -59,6 +59,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
+ enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
diff --git a/example_full/lib/domain/app_service.dart b/example_full/lib/domain/app_service.dart
index 795b957..2729149 100644
--- a/example_full/lib/domain/app_service.dart
+++ b/example_full/lib/domain/app_service.dart
@@ -17,7 +17,7 @@ class AppService extends ChangeNotifier {
NearbyConnectionAndroidInfo? _connectionAndroidInfo;
CommunicationChannelState _communicationChannelState =
CommunicationChannelState.notConnected;
- bool _isIOSBrowser = true;
+ bool _isDarwinBrowser = true;
String platformVersion = 'Unknown';
String platformModel = 'Unknown';
@@ -40,17 +40,17 @@ class AppService extends ChangeNotifier {
notifyListeners();
}
- Future getSavedIOSDeviceName() async {
- return (await _nearbyService.ios?.getSavedDeviceName()) ?? platformModel;
+ Future getSavedDarwinDeviceName() async {
+ return (await _nearbyService.darwin?.getSavedDeviceName()) ?? platformModel;
}
- Future initialize(String? iosDeviceName) async {
+ Future initialize(String? darwinDeviceName) async {
try {
await _nearbyService.initialize(
- data: NearbyInitializeData(iosDeviceName: iosDeviceName),
+ data: NearbyInitializeData(darwinDeviceName: darwinDeviceName),
);
- _nearbyService.ios?.getIsBrowserStream().listen((event) {
- _isIOSBrowser = event;
+ _nearbyService.darwin?.getIsBrowserStream().listen((event) {
+ _isDarwinBrowser = event;
});
startListeningCommunicationChannelState();
updateState(
@@ -97,7 +97,7 @@ class AppService extends ChangeNotifier {
}
void setIsBrowser({required bool value}) {
- _nearbyService.ios?.setIsBrowser(value: value);
+ _nearbyService.darwin?.setIsBrowser(value: value);
updateState(AppState.readyToDiscover);
}
@@ -213,8 +213,8 @@ extension GettersExtension on AppService {
CommunicationChannelState get communicationChannelState =>
_communicationChannelState;
- bool get isIOSBrowser {
- return _isIOSBrowser;
+ bool get isDarwinBrowser {
+ return _isDarwinBrowser;
}
bool? get isAndroidGroupOwner {
diff --git a/example_full/lib/domain/app_state.dart b/example_full/lib/domain/app_state.dart
index a9608c3..67121ae 100644
--- a/example_full/lib/domain/app_state.dart
+++ b/example_full/lib/domain/app_state.dart
@@ -23,7 +23,7 @@ enum AppState {
AppState.connected,
AppState.communicationChannelCreated,
];
- static final List iosSteps = [
+ static final List darwinSteps = [
AppState.idle,
AppState.selectClientType,
AppState.readyToDiscover,
@@ -36,7 +36,7 @@ enum AppState {
static final List steps = [
if (Platform.isAndroid) ...androidSteps,
- if (Platform.isIOS) ...iosSteps,
+ if (Platform.isIOS || Platform.isMacOS) ...darwinSteps,
];
int get step {
diff --git a/example_full/lib/presentation/components/device_preview.dart b/example_full/lib/presentation/components/device_preview.dart
index 99905e5..ac12a37 100644
--- a/example_full/lib/presentation/components/device_preview.dart
+++ b/example_full/lib/presentation/components/device_preview.dart
@@ -46,8 +46,8 @@ class DevicePreview extends StatelessWidget {
final status = Text(
device.byPlatform(
onAny: (d) => d.status.name,
- onIOS: (d) =>
- context.select((v) => v.isIOSBrowser)
+ onDarwin: (d) =>
+ context.select((v) => v.isDarwinBrowser)
? "Peer found | ${d.status.name}"
: "Pending invitation | ${d.status.name}",
) ??
diff --git a/example_full/lib/presentation/components/info_panel.dart b/example_full/lib/presentation/components/info_panel.dart
index 1a7a5ac..8c952c9 100644
--- a/example_full/lib/presentation/components/info_panel.dart
+++ b/example_full/lib/presentation/components/info_panel.dart
@@ -53,10 +53,10 @@ class InfoPanel extends StatelessWidget {
label: 'Communication channel state',
value: service.communicationChannelState.previewName,
),
- if (Platform.isIOS)
+ if (Platform.isIOS || Platform.isMacOS)
_InfoChip(
label: 'Role',
- value: service.isIOSBrowser
+ value: service.isDarwinBrowser
? 'You are going to find your friend'
: 'You are waiting for another user to connect',
),
@@ -94,7 +94,8 @@ class AdditionalInfoPanel extends StatelessWidget {
label: 'Model',
value: service.platformModel,
),
- if (service.currentDeviceInfo != null && Platform.isIOS)
+ if (service.currentDeviceInfo != null &&
+ (Platform.isIOS || Platform.isMacOS))
_InfoChip(
label: 'Device P2P ID',
value: service.currentDeviceInfo!.id,
diff --git a/example_full/lib/presentation/view/idle_view.dart b/example_full/lib/presentation/view/idle_view.dart
index e780884..db3afac 100644
--- a/example_full/lib/presentation/view/idle_view.dart
+++ b/example_full/lib/presentation/view/idle_view.dart
@@ -19,7 +19,7 @@ class _IdleViewState extends State {
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
- context.read().getSavedIOSDeviceName().then((value) {
+ context.read().getSavedDarwinDeviceName().then((value) {
controller.text = value;
controller.selection = TextSelection.collapsed(offset: value.length);
setState(() {
@@ -56,7 +56,7 @@ class _IdleViewState extends State {
return Center(
child: Column(
children: [
- if (Platform.isIOS)
+ if (Platform.isIOS || Platform.isMacOS)
Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: TextFormField(
diff --git a/example_full/lib/presentation/view/ready_view.dart b/example_full/lib/presentation/view/ready_view.dart
index e2801c8..4d57408 100644
--- a/example_full/lib/presentation/view/ready_view.dart
+++ b/example_full/lib/presentation/view/ready_view.dart
@@ -19,7 +19,7 @@ class ReadyView extends StatelessWidget {
title: 'Start discover peers',
),
const SizedBox(height: 10),
- if (Platform.isIOS)
+ if (Platform.isIOS || Platform.isMacOS)
ActionButton(
onTap: () {
context.read().updateState(AppState.selectClientType);
diff --git a/example_full/lib/presentation/view/streaming_peers_view.dart b/example_full/lib/presentation/view/streaming_peers_view.dart
index f871c27..40647b0 100644
--- a/example_full/lib/presentation/view/streaming_peers_view.dart
+++ b/example_full/lib/presentation/view/streaming_peers_view.dart
@@ -34,8 +34,8 @@ class _PeersBody extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Selector(
- selector: (context, service) => service.isIOSBrowser,
- builder: (context, isIOSBrowser, _) {
+ selector: (context, service) => service.isDarwinBrowser,
+ builder: (context, isDarwinBrowser, _) {
return Selector?>(
selector: (context, service) => service.peers,
builder: (context, peers, _) {
@@ -55,7 +55,7 @@ class _PeersBody extends StatelessWidget {
],
)
: Text(
- Platform.isAndroid || isIOSBrowser
+ Platform.isAndroid || isDarwinBrowser
? 'No one here ('
: "Wait until someone invites you!",
textAlign: TextAlign.center,
diff --git a/example_full/macos/.gitignore b/example_full/macos/.gitignore
new file mode 100644
index 0000000..746adbb
--- /dev/null
+++ b/example_full/macos/.gitignore
@@ -0,0 +1,7 @@
+# Flutter-related
+**/Flutter/ephemeral/
+**/Pods/
+
+# Xcode-related
+**/dgph
+**/xcuserdata/
diff --git a/example_full/macos/Flutter/Flutter-Debug.xcconfig b/example_full/macos/Flutter/Flutter-Debug.xcconfig
new file mode 100644
index 0000000..4b81f9b
--- /dev/null
+++ b/example_full/macos/Flutter/Flutter-Debug.xcconfig
@@ -0,0 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
+#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/example_full/macos/Flutter/Flutter-Release.xcconfig b/example_full/macos/Flutter/Flutter-Release.xcconfig
new file mode 100644
index 0000000..5caa9d1
--- /dev/null
+++ b/example_full/macos/Flutter/Flutter-Release.xcconfig
@@ -0,0 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
+#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/example_full/macos/Flutter/GeneratedPluginRegistrant.swift b/example_full/macos/Flutter/GeneratedPluginRegistrant.swift
new file mode 100644
index 0000000..7960a9c
--- /dev/null
+++ b/example_full/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -0,0 +1,16 @@
+//
+// Generated file. Do not edit.
+//
+
+import FlutterMacOS
+import Foundation
+
+import file_picker
+import nearby_service
+import path_provider_foundation
+
+func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
+ FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
+ NearbyServicePlugin.register(with: registry.registrar(forPlugin: "NearbyServicePlugin"))
+ PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
+}
diff --git a/example_full/macos/Podfile b/example_full/macos/Podfile
new file mode 100644
index 0000000..29c8eb3
--- /dev/null
+++ b/example_full/macos/Podfile
@@ -0,0 +1,42 @@
+platform :osx, '10.14'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+ 'Debug' => :debug,
+ 'Profile' => :release,
+ 'Release' => :release,
+}
+
+def flutter_root
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
+ unless File.exist?(generated_xcode_build_settings_path)
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
+ end
+
+ File.foreach(generated_xcode_build_settings_path) do |line|
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
+ return matches[1].strip if matches
+ end
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_macos_podfile_setup
+
+target 'Runner' do
+ use_frameworks!
+
+ flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
+ target 'RunnerTests' do
+ inherit! :search_paths
+ end
+end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ flutter_additional_macos_build_settings(target)
+ end
+end
diff --git a/example_full/macos/Runner.xcodeproj/project.pbxproj b/example_full/macos/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..c12fd2f
--- /dev/null
+++ b/example_full/macos/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,801 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;
+ buildPhases = (
+ 33CC111E2044C6BF0003C045 /* ShellScript */,
+ );
+ dependencies = (
+ );
+ name = "Flutter Assemble";
+ productName = FLX;
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ 2353C4291C9AED02BB274670 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99EDFD27D824FF6BBDE81D4B /* Pods_RunnerTests.framework */; };
+ 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
+ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
+ 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
+ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
+ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
+ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
+ 87E45F304548FB6ABDF80A4F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 882EA6E05688893D20890B3A /* Pods_Runner.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 33CC10EC2044A3C60003C045;
+ remoteInfo = Runner;
+ };
+ 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 33CC111A2044C6BA0003C045;
+ remoteInfo = FLX;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 33CC110E2044A8840003C045 /* Bundle Framework */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Bundle Framework";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 30B362970A6096735EB87C11 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
+ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; };
+ 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; };
+ 335C1F00C28981BA022E54EC /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
+ 33CC10ED2044A3C60003C045 /* nearby_service_example_full.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = nearby_service_example_full.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; };
+ 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
+ 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; };
+ 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; };
+ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; };
+ 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; };
+ 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; };
+ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
+ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
+ 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
+ 3BB6968D6620F22DCD0F7655 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ 428A65A05004DE0778EC2F84 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; };
+ 882EA6E05688893D20890B3A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
+ 99EDFD27D824FF6BBDE81D4B /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ DE82F26238015E3CE20A079B /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
+ EB02922EF3613DEDA1987E67 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 331C80D2294CF70F00263BE5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 2353C4291C9AED02BB274670 /* Pods_RunnerTests.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 33CC10EA2044A3C60003C045 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 87E45F304548FB6ABDF80A4F /* Pods_Runner.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 331C80D6294CF71000263BE5 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ 331C80D7294CF71000263BE5 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ sourceTree = "";
+ };
+ 33BA886A226E78AF003329D5 /* Configs */ = {
+ isa = PBXGroup;
+ children = (
+ 33E5194F232828860026EE4D /* AppInfo.xcconfig */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */,
+ );
+ path = Configs;
+ sourceTree = "";
+ };
+ 33CC10E42044A3C60003C045 = {
+ isa = PBXGroup;
+ children = (
+ 33FAB671232836740065AC1E /* Runner */,
+ 33CEB47122A05771004F2AC0 /* Flutter */,
+ 331C80D6294CF71000263BE5 /* RunnerTests */,
+ 33CC10EE2044A3C60003C045 /* Products */,
+ D73912EC22F37F3D000D13A0 /* Frameworks */,
+ DBD5FBF201F060D67EF349A4 /* Pods */,
+ );
+ sourceTree = "";
+ };
+ 33CC10EE2044A3C60003C045 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 33CC10ED2044A3C60003C045 /* nearby_service_example_full.app */,
+ 331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 33CC11242044D66E0003C045 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 33CC10F22044A3C60003C045 /* Assets.xcassets */,
+ 33CC10F42044A3C60003C045 /* MainMenu.xib */,
+ 33CC10F72044A3C60003C045 /* Info.plist */,
+ );
+ name = Resources;
+ path = ..;
+ sourceTree = "";
+ };
+ 33CEB47122A05771004F2AC0 /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
+ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
+ 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
+ 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
+ );
+ path = Flutter;
+ sourceTree = "";
+ };
+ 33FAB671232836740065AC1E /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 33CC10F02044A3C60003C045 /* AppDelegate.swift */,
+ 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
+ 33E51913231747F40026EE4D /* DebugProfile.entitlements */,
+ 33E51914231749380026EE4D /* Release.entitlements */,
+ 33CC11242044D66E0003C045 /* Resources */,
+ 33BA886A226E78AF003329D5 /* Configs */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+ D73912EC22F37F3D000D13A0 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 882EA6E05688893D20890B3A /* Pods_Runner.framework */,
+ 99EDFD27D824FF6BBDE81D4B /* Pods_RunnerTests.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ DBD5FBF201F060D67EF349A4 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 30B362970A6096735EB87C11 /* Pods-Runner.debug.xcconfig */,
+ 428A65A05004DE0778EC2F84 /* Pods-Runner.release.xcconfig */,
+ 3BB6968D6620F22DCD0F7655 /* Pods-Runner.profile.xcconfig */,
+ 335C1F00C28981BA022E54EC /* Pods-RunnerTests.debug.xcconfig */,
+ EB02922EF3613DEDA1987E67 /* Pods-RunnerTests.release.xcconfig */,
+ DE82F26238015E3CE20A079B /* Pods-RunnerTests.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 331C80D4294CF70F00263BE5 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ 4C771073957ABB1E6830A276 /* [CP] Check Pods Manifest.lock */,
+ 331C80D1294CF70F00263BE5 /* Sources */,
+ 331C80D2294CF70F00263BE5 /* Frameworks */,
+ 331C80D3294CF70F00263BE5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 331C80DA294CF71000263BE5 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 33CC10EC2044A3C60003C045 /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 1B8287FF2E5097B9E5AEB54F /* [CP] Check Pods Manifest.lock */,
+ 33CC10E92044A3C60003C045 /* Sources */,
+ 33CC10EA2044A3C60003C045 /* Frameworks */,
+ 33CC10EB2044A3C60003C045 /* Resources */,
+ 33CC110E2044A8840003C045 /* Bundle Framework */,
+ 3399D490228B24CF009A79C7 /* ShellScript */,
+ C0AFCFDB3C0E356BCE410344 /* [CP] Embed Pods Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 33CC11202044C79F0003C045 /* PBXTargetDependency */,
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 33CC10ED2044A3C60003C045 /* nearby_service_example_full.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 33CC10E52044A3C60003C045 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastSwiftUpdateCheck = 0920;
+ LastUpgradeCheck = 1510;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 331C80D4294CF70F00263BE5 = {
+ CreatedOnToolsVersion = 14.0;
+ TestTargetID = 33CC10EC2044A3C60003C045;
+ };
+ 33CC10EC2044A3C60003C045 = {
+ CreatedOnToolsVersion = 9.2;
+ LastSwiftMigration = 1100;
+ ProvisioningStyle = Automatic;
+ SystemCapabilities = {
+ com.apple.Sandbox = {
+ enabled = 1;
+ };
+ };
+ };
+ 33CC111A2044C6BA0003C045 = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Manual;
+ };
+ };
+ };
+ buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 33CC10E42044A3C60003C045;
+ productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 33CC10EC2044A3C60003C045 /* Runner */,
+ 331C80D4294CF70F00263BE5 /* RunnerTests */,
+ 33CC111A2044C6BA0003C045 /* Flutter Assemble */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 331C80D3294CF70F00263BE5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 33CC10EB2044A3C60003C045 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
+ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 1B8287FF2E5097B9E5AEB54F /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 3399D490228B24CF009A79C7 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
+ };
+ 33CC111E2044C6BF0003C045 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ Flutter/ephemeral/FlutterInputs.xcfilelist,
+ );
+ inputPaths = (
+ Flutter/ephemeral/tripwire,
+ );
+ outputFileListPaths = (
+ Flutter/ephemeral/FlutterOutputs.xcfilelist,
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
+ };
+ 4C771073957ABB1E6830A276 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ C0AFCFDB3C0E356BCE410344 /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 331C80D1294CF70F00263BE5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 33CC10E92044A3C60003C045 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
+ 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
+ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 33CC10EC2044A3C60003C045 /* Runner */;
+ targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */;
+ };
+ 33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
+ targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 33CC10F42044A3C60003C045 /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 33CC10F52044A3C60003C045 /* Base */,
+ );
+ name = MainMenu.xib;
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 331C80DB294CF71000263BE5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 335C1F00C28981BA022E54EC /* Pods-RunnerTests.debug.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.nearbyServiceExampleFull.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nearby_service_example_full.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/nearby_service_example_full";
+ };
+ name = Debug;
+ };
+ 331C80DC294CF71000263BE5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = EB02922EF3613DEDA1987E67 /* Pods-RunnerTests.release.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.nearbyServiceExampleFull.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nearby_service_example_full.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/nearby_service_example_full";
+ };
+ name = Release;
+ };
+ 331C80DD294CF71000263BE5 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = DE82F26238015E3CE20A079B /* Pods-RunnerTests.profile.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.nearbyServiceExampleFull.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nearby_service_example_full.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/nearby_service_example_full";
+ };
+ name = Profile;
+ };
+ 338D0CE9231458BD00FA5F75 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = macosx;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ };
+ name = Profile;
+ };
+ 338D0CEA231458BD00FA5F75 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Profile;
+ };
+ 338D0CEB231458BD00FA5F75 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Manual;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Profile;
+ };
+ 33CC10F92044A3C60003C045 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ };
+ name = Debug;
+ };
+ 33CC10FA2044A3C60003C045 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = macosx;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ };
+ name = Release;
+ };
+ 33CC10FC2044A3C60003C045 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 33CC10FD2044A3C60003C045 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
+ 33CC111C2044C6BA0003C045 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Manual;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 33CC111D2044C6BA0003C045 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 331C80DB294CF71000263BE5 /* Debug */,
+ 331C80DC294CF71000263BE5 /* Release */,
+ 331C80DD294CF71000263BE5 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 33CC10F92044A3C60003C045 /* Debug */,
+ 33CC10FA2044A3C60003C045 /* Release */,
+ 338D0CE9231458BD00FA5F75 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 33CC10FC2044A3C60003C045 /* Debug */,
+ 33CC10FD2044A3C60003C045 /* Release */,
+ 338D0CEA231458BD00FA5F75 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 33CC111C2044C6BA0003C045 /* Debug */,
+ 33CC111D2044C6BA0003C045 /* Release */,
+ 338D0CEB231458BD00FA5F75 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 33CC10E52044A3C60003C045 /* Project object */;
+}
diff --git a/example_full/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example_full/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/example_full/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/example_full/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example_full/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..f2d385e
--- /dev/null
+++ b/example_full/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example_full/macos/Runner.xcworkspace/contents.xcworkspacedata b/example_full/macos/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..21a3cc1
--- /dev/null
+++ b/example_full/macos/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/example_full/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example_full/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/example_full/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/example_full/macos/Runner/AppDelegate.swift b/example_full/macos/Runner/AppDelegate.swift
new file mode 100644
index 0000000..b3c1761
--- /dev/null
+++ b/example_full/macos/Runner/AppDelegate.swift
@@ -0,0 +1,13 @@
+import Cocoa
+import FlutterMacOS
+
+@main
+class AppDelegate: FlutterAppDelegate {
+ override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
+ return true
+ }
+
+ override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
+ return true
+ }
+}
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..a2ec33f
--- /dev/null
+++ b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,68 @@
+{
+ "images" : [
+ {
+ "size" : "16x16",
+ "idiom" : "mac",
+ "filename" : "app_icon_16.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "16x16",
+ "idiom" : "mac",
+ "filename" : "app_icon_32.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "32x32",
+ "idiom" : "mac",
+ "filename" : "app_icon_32.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "32x32",
+ "idiom" : "mac",
+ "filename" : "app_icon_64.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "128x128",
+ "idiom" : "mac",
+ "filename" : "app_icon_128.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "128x128",
+ "idiom" : "mac",
+ "filename" : "app_icon_256.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "256x256",
+ "idiom" : "mac",
+ "filename" : "app_icon_256.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "256x256",
+ "idiom" : "mac",
+ "filename" : "app_icon_512.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "512x512",
+ "idiom" : "mac",
+ "filename" : "app_icon_512.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "512x512",
+ "idiom" : "mac",
+ "filename" : "app_icon_1024.png",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
new file mode 100644
index 0000000..82b6f9d
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
new file mode 100644
index 0000000..13b35eb
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
new file mode 100644
index 0000000..0a3f5fa
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
new file mode 100644
index 0000000..bdb5722
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
new file mode 100644
index 0000000..f083318
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
new file mode 100644
index 0000000..326c0e7
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ
diff --git a/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
new file mode 100644
index 0000000..2f1632c
Binary files /dev/null and b/example_full/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ
diff --git a/example_full/macos/Runner/Base.lproj/MainMenu.xib b/example_full/macos/Runner/Base.lproj/MainMenu.xib
new file mode 100644
index 0000000..80e867a
--- /dev/null
+++ b/example_full/macos/Runner/Base.lproj/MainMenu.xib
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example_full/macos/Runner/Configs/AppInfo.xcconfig b/example_full/macos/Runner/Configs/AppInfo.xcconfig
new file mode 100644
index 0000000..0f187dd
--- /dev/null
+++ b/example_full/macos/Runner/Configs/AppInfo.xcconfig
@@ -0,0 +1,14 @@
+// Application-level settings for the Runner target.
+//
+// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
+// future. If not, the values below would default to using the project name when this becomes a
+// 'flutter create' template.
+
+// The application's name. By default this is also the title of the Flutter window.
+PRODUCT_NAME = nearby_service_example_full
+
+// The application's bundle identifier
+PRODUCT_BUNDLE_IDENTIFIER = com.example.nearbyServiceExampleFull
+
+// The copyright displayed in application information
+PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved.
diff --git a/example_full/macos/Runner/Configs/Debug.xcconfig b/example_full/macos/Runner/Configs/Debug.xcconfig
new file mode 100644
index 0000000..36b0fd9
--- /dev/null
+++ b/example_full/macos/Runner/Configs/Debug.xcconfig
@@ -0,0 +1,2 @@
+#include "../../Flutter/Flutter-Debug.xcconfig"
+#include "Warnings.xcconfig"
diff --git a/example_full/macos/Runner/Configs/Release.xcconfig b/example_full/macos/Runner/Configs/Release.xcconfig
new file mode 100644
index 0000000..dff4f49
--- /dev/null
+++ b/example_full/macos/Runner/Configs/Release.xcconfig
@@ -0,0 +1,2 @@
+#include "../../Flutter/Flutter-Release.xcconfig"
+#include "Warnings.xcconfig"
diff --git a/example_full/macos/Runner/Configs/Warnings.xcconfig b/example_full/macos/Runner/Configs/Warnings.xcconfig
new file mode 100644
index 0000000..42bcbf4
--- /dev/null
+++ b/example_full/macos/Runner/Configs/Warnings.xcconfig
@@ -0,0 +1,13 @@
+WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
+GCC_WARN_UNDECLARED_SELECTOR = YES
+CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
+CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
+CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
+CLANG_WARN_PRAGMA_PACK = YES
+CLANG_WARN_STRICT_PROTOTYPES = YES
+CLANG_WARN_COMMA = YES
+GCC_WARN_STRICT_SELECTOR_MATCH = YES
+CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
+CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
+GCC_WARN_SHADOW = YES
+CLANG_WARN_UNREACHABLE_CODE = YES
diff --git a/example_full/macos/Runner/DebugProfile.entitlements b/example_full/macos/Runner/DebugProfile.entitlements
new file mode 100644
index 0000000..0eaccf1
--- /dev/null
+++ b/example_full/macos/Runner/DebugProfile.entitlements
@@ -0,0 +1,16 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.files.user-selected.read-write
+
+ com.apple.security.network.client
+
+ com.apple.security.network.server
+
+
+
diff --git a/example_full/macos/Runner/Info.plist b/example_full/macos/Runner/Info.plist
new file mode 100644
index 0000000..a1c00b5
--- /dev/null
+++ b/example_full/macos/Runner/Info.plist
@@ -0,0 +1,46 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSMinimumSystemVersion
+ $(MACOSX_DEPLOYMENT_TARGET)
+ NSHumanReadableCopyright
+ $(PRODUCT_COPYRIGHT)
+ NSMainNibFile
+ MainMenu
+ NSPrincipalClass
+ NSApplication
+
+ LSSupportsOpeningDocumentsInPlace
+
+ UIFileSharingEnabled
+
+ NSBonjourServices
+
+ _mp-connection._tcp
+
+ UIRequiresPersistentWiFi
+
+ NSLocalNetworkUsageDescription
+ [Your description here]
+
+
+
\ No newline at end of file
diff --git a/example_full/macos/Runner/MainFlutterWindow.swift b/example_full/macos/Runner/MainFlutterWindow.swift
new file mode 100644
index 0000000..3cc05eb
--- /dev/null
+++ b/example_full/macos/Runner/MainFlutterWindow.swift
@@ -0,0 +1,15 @@
+import Cocoa
+import FlutterMacOS
+
+class MainFlutterWindow: NSWindow {
+ override func awakeFromNib() {
+ let flutterViewController = FlutterViewController()
+ let windowFrame = self.frame
+ self.contentViewController = flutterViewController
+ self.setFrame(windowFrame, display: true)
+
+ RegisterGeneratedPlugins(registry: flutterViewController)
+
+ super.awakeFromNib()
+ }
+}
diff --git a/example_full/macos/Runner/Release.entitlements b/example_full/macos/Runner/Release.entitlements
new file mode 100644
index 0000000..85c03d7
--- /dev/null
+++ b/example_full/macos/Runner/Release.entitlements
@@ -0,0 +1,14 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.files.user-selected.read-write
+
+ com.apple.security.network.client
+
+ com.apple.security.network.server
+
+
+
diff --git a/example_full/macos/RunnerTests/RunnerTests.swift b/example_full/macos/RunnerTests/RunnerTests.swift
new file mode 100644
index 0000000..61f3bd1
--- /dev/null
+++ b/example_full/macos/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Cocoa
+import FlutterMacOS
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/ios/Classes/Utils/MyDeviceDataGenerator.swift b/ios/Classes/Utils/MyDeviceDataGenerator.swift
deleted file mode 100644
index 1f6b980..0000000
--- a/ios/Classes/Utils/MyDeviceDataGenerator.swift
+++ /dev/null
@@ -1,39 +0,0 @@
-import Foundation
-import MultipeerConnectivity
-
-
-class MyDeviceDataGenerator {
- static func generate(name: String?) -> NearbyDevice {
- return NearbyDevice(
- peerID: getPeerID(),
- name: getNameArchived(or: name),
- deviceType: UIDevice.current.model,
- os: UIDevice.current.systemName,
- osVersion: UIDevice.current.systemVersion
- )
- }
- static private func getPeerID() -> MCPeerID {
- if let archivedPeerID = Archiver.getPeerID() {
- return archivedPeerID
- } else {
- let peerID = MCPeerID(
- displayName: UIDevice.current.name.replacingOccurrences(of: " ", with: "_")
- + "_"
- + String(Int.random(in: 1000..<50000))
- )
- Archiver.savePeerID(for: peerID)
- return peerID
- }
- }
- static private func getNameArchived(or name: String?) -> String {
- let archivedName = Archiver.getName()
- if let newName = name {
- if (archivedName != newName) {
- Archiver.saveName(for: newName)
- }
- return newName
- }
- return archivedName ?? UIDevice.current.name
- }
-
-}
diff --git a/lib/nearby_service.dart b/lib/nearby_service.dart
index f506455..8be7567 100644
--- a/lib/nearby_service.dart
+++ b/lib/nearby_service.dart
@@ -18,7 +18,7 @@ export 'src/interface/interface.dart';
/// The main tool for working with a P2P network.
/// Implementations:
/// * for Android - [NearbyAndroidService]
-/// * for IOS - [NearbyIOSService]
+/// * for Darwin - [NearbyDarwinService]
///
/// **The plugin is not supported for other platforms yet**
///
@@ -37,9 +37,9 @@ abstract class NearbyService {
if (Platform.isAndroid) {
Logger.debug('Created Nearby Android Service');
return NearbyAndroidService();
- } else if (Platform.isIOS) {
- Logger.debug('Created Nearby IOS Service');
- return NearbyIOSService();
+ } else if (Platform.isIOS || Platform.isMacOS) {
+ Logger.debug('Created Nearby Darwin Service');
+ return NearbyDarwinService();
} else {
throw NearbyServiceException.unsupportedPlatform(
caller: 'getInstance()',
@@ -48,11 +48,11 @@ abstract class NearbyService {
}
///
- /// Returns [NearbyService] cast as [NearbyIOSService] if the current
- /// platform is IOS. Otherwise, returns null.
+ /// Returns [NearbyService] cast as [NearbyDarwinService] if the current
+ /// platform is IOS or MacOS. Otherwise, returns null.
///
- late final NearbyIOSService? ios = get(
- onIOS: (e) => e,
+ late final NearbyDarwinService? darwin = get(
+ onDarwin: (e) => e,
);
///
@@ -193,8 +193,8 @@ abstract class NearbyService {
///
/// Starts searching for devices using a platform-specific service.
///
- /// Note that the [NearbyIOSService] implementation starts **browsing** or
- /// **advertising** depending on the [NearbyIOSService.isBrowserValue].
+ /// Note that the [NearbyDarwinService] implementation starts **browsing** or
+ /// **advertising** depending on the [NearbyDarwinService.isBrowserValue].
///
/// On Android can throw mapped from native platform exceptions:
/// 1. [NearbyServiceBusyException]
@@ -208,8 +208,8 @@ abstract class NearbyService {
///
/// Stops searching for devices using a platform-specific service.
///
- /// Note that the [NearbyIOSService] implementation stops **browsing** or
- /// **advertising** depending on the [NearbyIOSService.isBrowserValue].
+ /// Note that the [NearbyDarwinService] implementation stops **browsing** or
+ /// **advertising** depending on the [NearbyDarwinService.isBrowserValue].
///
/// On Android can throw mapped from native platform exceptions:
/// 1. [NearbyServiceBusyException]
@@ -223,10 +223,10 @@ abstract class NearbyService {
///
/// Connects to passed [device] using a platform-specific service.
///
- /// Note that the [NearbyIOSService] implementation **invites** or
- /// **accepts invite** depending on the [NearbyIOSService.isBrowser].
+ /// Note that the [NearbyDarwinService] implementation **invites** or
+ /// **accepts invite** depending on the [NearbyDarwinService.isBrowser].
///
- /// Note that if [Platform.isIOS] == true, [NearbyIOSDevice] should be passed.
+ /// Note that if [Platform.isIOS] == true, [NearbyDarwinDevice] should be passed.
/// If [Platform.isAndroid] == true, [NearbyAndroidDevice] should be passed.
///
/// On Android can throw mapped from native platform exceptions:
@@ -242,10 +242,10 @@ abstract class NearbyService {
///
/// Connects to passed [deviceId] using a platform-specific service.
///
- /// Note that the [NearbyIOSService] implementation **invites** or
- /// **accepts invite** depending on the [NearbyIOSService.isBrowserValue].
+ /// Note that the [NearbyDarwinService] implementation **invites** or
+ /// **accepts invite** depending on the [NearbyDarwinService.isBrowserValue].
///
- /// Note that if [Platform.isIOS] == true, [NearbyIOSDevice] should be passed.
+ /// Note that if [Platform.isIOS] == true, [NearbyDarwinDevice] should be passed.
/// If [Platform.isAndroid] == true, [NearbyAndroidDevice] should be passed.
///
/// On Android can throw mapped from native platform exceptions:
@@ -260,7 +260,7 @@ abstract class NearbyService {
///
/// Disconnects from passed [device] using a platform-specific service.
///
- /// Note that if [Platform.isIOS] == true, [NearbyIOSDevice] should be passed.
+ /// Note that if [Platform.isIOS] == true, [NearbyDarwinDevice] should be passed.
/// If [Platform.isAndroid] == true, [NearbyAndroidDevice] should be passed.
///
/// On Android can throw mapped from native platform exceptions:
@@ -277,7 +277,7 @@ abstract class NearbyService {
///
/// Disconnects from passed [deviceId] using a platform-specific service.
///
- /// Note that if [Platform.isIOS] == true, [NearbyIOSDevice] should be passed.
+ /// Note that if [Platform.isIOS] or [Platform.isMacOS] == true, [NearbyDarwinDevice] should be passed.
/// If [Platform.isAndroid] == true, [NearbyAndroidDevice] should be passed.
///
/// On Android can throw mapped from native platform exceptions:
@@ -338,28 +338,28 @@ extension NearbyServiceGetterExtension on NearbyService {
/// * The [onAndroid] callback returns this instance of [NearbyService],
/// cast as [NearbyAndroidService] if [Platform.isAndroid] is true.
///
- /// * The [onIOS] callback returns this instance of [NearbyService],
- /// cast as [NearbyIOSService] if [Platform.isIOS] is true.
+ /// * The [onDarwin] callback returns this instance of [NearbyService],
+ /// cast as [NearbyDarwinService] if [Platform.isIOS] or [Platform.isMacOS] is true.
///
/// * The [onAny] callback returns this instance of [NearbyService] with
- /// no casting if both [Platform.isAndroid] and [Platform.isIOS] are false.
+ /// no casting if both [Platform.isAndroid] and [Platform.isIOS] or [Platform.isMacOS] are false.
///
/// **Note: any of the callbacks must not be null!**
///
T? get({
T Function(NearbyAndroidService)? onAndroid,
- T Function(NearbyIOSService)? onIOS,
+ T Function(NearbyDarwinService)? onDarwin,
T Function(NearbyService)? onAny,
}) {
assert(
- onAndroid != null || onIOS != null || onAny != null,
- 'You should provide at least one of (onAndroid, onIOS, onAny)',
+ onAndroid != null || onDarwin != null || onAny != null,
+ 'You should provide at least one of (onAndroid, onDarwin, onAny)',
);
if (this is NearbyAndroidService && onAndroid != null) {
return onAndroid(this as NearbyAndroidService);
}
- if (this is NearbyIOSService && onIOS != null) {
- return onIOS(this as NearbyIOSService);
+ if (this is NearbyDarwinService && onDarwin != null) {
+ return onDarwin(this as NearbyDarwinService);
}
if (onAny != null) {
return onAny(this);
diff --git a/lib/src/base/nearby_device_base.dart b/lib/src/base/nearby_device_base.dart
index 2c809d2..0a6ddf1 100644
--- a/lib/src/base/nearby_device_base.dart
+++ b/lib/src/base/nearby_device_base.dart
@@ -46,19 +46,19 @@ abstract base class NearbyDevice {
/// * The [onAndroid] callback returns this instance of [NearbyDevice],
/// cast as [NearbyAndroidDevice] if [Platform.isAndroid] is true.
///
- /// * The [onIOS] callback returns this instance of [NearbyDevice],
- /// cast as [NearbyIOSDevice] if [Platform.isIOS] is true.
+ /// * The [onDarwin] callback returns this instance of [NearbyDevice],
+ /// cast as [NearbyDarwinDevice] if [Platform.isIOS] or [Platform.isMacOS] is true.
///
/// * The [onAny] callback returns this instance of [NearbyDevice] with
- /// no casting if both [Platform.isAndroid] and [Platform.isIOS] are false.
+ /// no casting if both [Platform.isAndroid] and [Platform.isIOS] or [Platform.isMacOS] are false.
///
T? byPlatform({
T Function(NearbyDevice)? onAny,
T Function(NearbyAndroidDevice)? onAndroid,
- T Function(NearbyIOSDevice)? onIOS,
+ T Function(NearbyDarwinDevice)? onDarwin,
}) {
- if (this is NearbyIOSDevice && onIOS != null) {
- return onIOS(this as NearbyIOSDevice);
+ if (this is NearbyDarwinDevice && onDarwin != null) {
+ return onDarwin(this as NearbyDarwinDevice);
} else if (this is NearbyAndroidDevice && onAndroid != null) {
return onAndroid(this as NearbyAndroidDevice);
} else {
diff --git a/lib/src/interface/nearby_device_mapper.dart b/lib/src/interface/nearby_device_mapper.dart
index a5d236a..a8d1b7e 100644
--- a/lib/src/interface/nearby_device_mapper.dart
+++ b/lib/src/interface/nearby_device_mapper.dart
@@ -13,7 +13,7 @@ abstract interface class NearbyDeviceMapper {
if (Platform.isAndroid) {
return NearbyAndroidMapper();
}
- if (Platform.isIOS) {
+ if (Platform.isIOS || Platform.isMacOS) {
return NearbyIOSMapper();
}
diff --git a/lib/src/interface/nearby_service_exception_mapper.dart b/lib/src/interface/nearby_service_exception_mapper.dart
index e96c520..3c61147 100644
--- a/lib/src/interface/nearby_service_exception_mapper.dart
+++ b/lib/src/interface/nearby_service_exception_mapper.dart
@@ -8,8 +8,8 @@ abstract class NearbyServiceExceptionMapper {
static NearbyServiceExceptionMapper get instance {
if (Platform.isAndroid) {
return NearbyServiceAndroidExceptionMapper();
- } else if (Platform.isIOS) {
- return NearbyServiceIOSExceptionMapper();
+ } else if (Platform.isIOS || Platform.isMacOS) {
+ return NearbyServiceDarwinExceptionMapper();
}
throw NearbyServiceException.unsupportedPlatform(
caller: 'NearbyServiceExceptionMapper',
diff --git a/lib/src/platforms/ios/model/nearby_device.dart b/lib/src/platforms/ios/model/nearby_device.dart
index bddd647..7e23f88 100644
--- a/lib/src/platforms/ios/model/nearby_device.dart
+++ b/lib/src/platforms/ios/model/nearby_device.dart
@@ -4,7 +4,7 @@ import 'package:nearby_service/src/utils/json_decoder.dart';
///
/// A device on a P2P network obtained from the IOS platform.
///
-final class NearbyIOSDevice extends NearbyDevice {
+final class NearbyDarwinDevice extends NearbyDevice {
///
/// A class representing an IOS device on a P2P network.
///
@@ -13,7 +13,7 @@ final class NearbyIOSDevice extends NearbyDevice {
///
/// [MCPeerID](https://developer.apple.com/documentation/multipeerconnectivity/mcpeerid) is an identifier on the local network for IOS.
///
- NearbyIOSDevice({
+ NearbyDarwinDevice({
required super.info,
required super.status,
this.os,
@@ -22,10 +22,10 @@ final class NearbyIOSDevice extends NearbyDevice {
});
///
- /// Gets [NearbyIOSDevice] from [Map].
+ /// Gets [NearbyDarwinDevice] from [Map].
///
- factory NearbyIOSDevice.fromJson(Map? json) {
- return NearbyIOSDevice(
+ factory NearbyDarwinDevice.fromJson(Map? json) {
+ return NearbyDarwinDevice(
info: NearbyDeviceInfo.fromJson(json),
deviceType: json?["deviceType"],
os: json?["os"],
@@ -53,7 +53,7 @@ final class NearbyIOSDevice extends NearbyDevice {
bool operator ==(Object other) =>
identical(this, other) ||
super == other &&
- other is NearbyIOSDevice &&
+ other is NearbyDarwinDevice &&
runtimeType == other.runtimeType &&
os == other.os &&
osVersion == other.osVersion &&
@@ -78,7 +78,7 @@ class NearbyIOSMapper implements NearbyDeviceMapper {
final decoded = JSONDecoder.decodeList(value);
return [
...?decoded?.map(
- (e) => NearbyIOSDevice.fromJson(JSONDecoder.decodeMap(e)),
+ (e) => NearbyDarwinDevice.fromJson(JSONDecoder.decodeMap(e)),
),
];
}
@@ -88,6 +88,6 @@ class NearbyIOSMapper implements NearbyDeviceMapper {
final decoded = JSONDecoder.decodeMap(value);
if (decoded == null) return null;
- return NearbyIOSDevice.fromJson(decoded);
+ return NearbyDarwinDevice.fromJson(decoded);
}
}
diff --git a/lib/src/platforms/ios/nearby_ios_service.dart b/lib/src/platforms/ios/nearby_ios_service.dart
index 8b35a5d..9c6977c 100644
--- a/lib/src/platforms/ios/nearby_ios_service.dart
+++ b/lib/src/platforms/ios/nearby_ios_service.dart
@@ -13,7 +13,7 @@ import 'package:nearby_service/src/utils/stream_mapper.dart';
/// Connects to the device by subscribing to messages from the selected
/// device by identifier.
///
-class NearbyIOSService extends NearbyService {
+class NearbyDarwinService extends NearbyService {
final _isBrowser = NearbyServiceListenable(initialValue: true);
final _communicationChannelState =
@@ -68,7 +68,7 @@ class NearbyIOSService extends NearbyService {
/// The name of the device on the network can be
/// specified on initialization via the parameter [data].
///
- /// [NearbyInitializeData.iosDeviceName] will be passed to the platform as initial
+ /// [NearbyInitializeData.darwinDeviceName] will be passed to the platform as initial
/// name. If a new name is not passed, the previous name stored
/// in [UserDefaults](https://developer.apple.com/documentation/foundation/userdefaults)
/// will be used. If there is no saved name, `UIDevice.current.name` will be used.
@@ -78,13 +78,13 @@ class NearbyIOSService extends NearbyService {
NearbyInitializeData data = const NearbyInitializeData(),
}) async {
final result = await NearbyServiceIOSPlatform.instance.initialize(
- data.iosDeviceName,
+ data.darwinDeviceName,
);
_logResult(
result,
- onSuccess: 'Initialized ${data.iosDeviceName}',
- onError: 'Failed to initialize ${data.iosDeviceName}',
+ onSuccess: 'Initialized ${data.darwinDeviceName}',
+ onError: 'Failed to initialize ${data.darwinDeviceName}',
);
return result;
}
@@ -134,7 +134,7 @@ class NearbyIOSService extends NearbyService {
/// Invites [device] if [isBrowserValue] is true.
/// Accepts invite from [device] if [isBrowserValue] is false.
///
- /// Note! Requires [NearbyIOSDevice] to be passed.
+ /// Note! Requires [NearbyDarwinDevice] to be passed.
@Deprecated('Use connectById instead')
@override
Future connect(NearbyDevice device) async {
@@ -167,7 +167,7 @@ class NearbyIOSService extends NearbyService {
///
/// Disconnects from the [device] on the P2P network.
///
- /// Note! Requires [NearbyIOSDevice] to be passed.
+ /// Note! Requires [NearbyDarwinDevice] to be passed.
///
@Deprecated('Use disconnectById instead')
@override
@@ -290,7 +290,7 @@ class NearbyIOSService extends NearbyService {
/// [UserDefaults](https://developer.apple.com/documentation/foundation/userdefaults) using this method.
///
/// Changing the name on the network is only available for IOS,
- /// so the [NearbyIOSService] only can be used for that.
+ /// so the [NearbyDarwinService] only can be used for that.
///
Future getSavedDeviceName() {
return NearbyServiceIOSPlatform.instance.getSavedDeviceName();
@@ -322,8 +322,8 @@ class NearbyIOSService extends NearbyService {
void _requireIOSDevice(NearbyDevice device) {
assert(
- device is NearbyIOSDevice,
- 'The Nearby IOS Service can only work with the NearbyIOSDevice and not with ${device.runtimeType}',
+ device is NearbyDarwinDevice,
+ 'The Nearby IOS Service can only work with the NearbyDarwinDevice and not with ${device.runtimeType}',
);
}
}
diff --git a/lib/src/platforms/ios/utils/mapper.dart b/lib/src/platforms/ios/utils/mapper.dart
index 29354e0..d713063 100644
--- a/lib/src/platforms/ios/utils/mapper.dart
+++ b/lib/src/platforms/ios/utils/mapper.dart
@@ -2,7 +2,7 @@
import 'package:nearby_service/nearby_service.dart';
import 'package:nearby_service/src/interface/nearby_service_exception_mapper.dart';
-class NearbyServiceIOSExceptionMapper extends NearbyServiceExceptionMapper {
+class NearbyServiceDarwinExceptionMapper extends NearbyServiceExceptionMapper {
@override
bool canMap(String error) {
return IOSFailureCodes.values.any((element) => element.name == error);
diff --git a/lib/src/types/initialize_data.dart b/lib/src/types/initialize_data.dart
index fedd4bd..95bf889 100644
--- a/lib/src/types/initialize_data.dart
+++ b/lib/src/types/initialize_data.dart
@@ -8,10 +8,10 @@ class NearbyInitializeData {
/// There is an option to pass the device name to IOS [iosDeviceName].
/// For Android platform changing device name in P2P network is not supported.
///
- const NearbyInitializeData({this.iosDeviceName});
+ const NearbyInitializeData({this.darwinDeviceName});
///
/// The device name for IOS on the P2P network.
///
- final String? iosDeviceName;
+ final String? darwinDeviceName;
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 9a05687..93efdd4 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: nearby_service
description: Nearby Service Flutter Plugin is used to create connections in a P2P network. Supports sending text messages and files.
-version: 0.1.3
+version: 0.2.0
homepage: https://github.com/ksenia312/nearby_service
repository: https://github.com/ksenia312/nearby_service
@@ -28,3 +28,7 @@ flutter:
pluginClass: NearbyServicePlugin
ios:
pluginClass: NearbyServicePlugin
+ sharedDarwinSource: true
+ macos:
+ pluginClass: NearbyServicePlugin
+ sharedDarwinSource: true