NearbyIOSService class
IOS implementation for NearbyService.
Uses NearbyServiceIOSPlatform to perform actions. Connects to the device by subscribing to messages from the selected device by identifier.
- Inheritance
-
- Object
- NearbyService
- NearbyIOSService
- Available extensions
Constructors
Properties
- android → NearbyAndroidService?
-
Returns NearbyService cast as NearbyAndroidService if the current
platform is Android. Otherwise, returns null.
latefinalinherited
-
communicationChannelState
→ ValueListenable<
CommunicationChannelState> -
A value to determine the communication channel's status.
no setteroverride
- communicationChannelStateValue → CommunicationChannelState
-
A value to determine the communication channel's status.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- ios → NearbyIOSService?
-
Returns NearbyService cast as NearbyIOSService if the current
platform is IOS. Otherwise, returns null.
latefinalinherited
-
isBrowser
→ ValueListenable<
bool> -
Determines whether the current device is a Browser or Advertiser.
no setter
- isBrowserValue → bool
-
Determines whether the current device is a Browser or Advertiser.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
NearbyDevice device) → Future< bool> -
Connects to the
device
on the P2P network.override -
connectById(
String deviceId) → Future< bool> -
Connects to the
deviceId
on the P2P network.override -
disconnect(
[NearbyDevice? device]) → Future< bool> -
Disconnects from the
device
on the P2P network.override -
disconnectById(
[String? deviceId]) → Future< bool> -
Disconnects from the
deviceId
on the P2P network.override -
discover(
) → Future< bool> -
Starts discovery on the local P2P network.
override
-
endCommunicationChannel(
) → FutureOr< bool> -
Stops listening for messages from previously passed device with
NearbyCommunicationChannelData.connectedDeviceId.
override
-
getCommunicationChannelStateStream(
) → Stream< CommunicationChannelState> -
A stream with values of CommunicationChannelState to determine the communication channel's status.
override
-
getConnectedDeviceStream(
NearbyDevice device) → Stream< NearbyDevice?> -
Returns the constantly updating NearbyDevice you are currently connected to.
If it returns null, then there is no connection at the moment.
inherited
-
getConnectedDeviceStreamById(
String deviceId) → Stream< NearbyDevice?> -
Returns the constantly updating NearbyDevice you are currently connected to.
If it returns null, then there is no connection at the moment.
inherited
-
getCurrentDeviceInfo(
) → Future< NearbyDeviceInfo?> -
Getting info about the current device in P2P scope.
inherited
-
getIsBrowserStream(
) → Stream< bool> - Stream that determines whether the current device is a Browser or Advertiser.
-
getPeers(
) → Future< List< NearbyDevice> > -
A single retrieval of the current list of devices in a P2P network.
inherited
-
getPeersStream(
) → Stream< List< NearbyDevice> > -
Returns a constantly updating list of NearbyDevice that
the platform-specific service has found at each point in time.
inherited
-
getPlatformModel(
) → Future< String?> -
Gets model of current device.
inherited
-
getPlatformVersion(
) → Future< String?> -
Gets version of current platform.
inherited
-
getSavedDeviceName(
) → Future< String?> - If you want to ask the user to change the name on the network, you can retrieve the name previously saved in UserDefaults using this method.
-
initialize(
{NearbyInitializeData data = const NearbyInitializeData()}) → Future< bool> -
Initializes MCNearbyServiceAdvertiser
and MCNearbyServiceBrowser
to allow this device to be both.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openServicesSettings(
) → Future< void> -
Since Wi-fi must be enabled to use the plugin in Android,
openServicesSettings can be used to redirect the user to the Wi-fi
service settings on Android.
inherited
-
send(
OutgoingNearbyMessage< NearbyMessageContent> message) → Future<bool> -
Sends OutgoingNearbyMessage to OutgoingNearbyMessage.receiver via
IOS platform.
override
-
setIsBrowser(
{required bool value}) → void -
Changes the isBrowserValue to the passed
value
. -
startCommunicationChannel(
NearbyCommunicationChannelData data) → FutureOr< bool> -
Starts listening for messages from device with
NearbyCommunicationChannelData.connectedDeviceId.
override
-
stopDiscovery(
) → Future< bool> -
Slops discovery on the local P2P network.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited