Logical Labs Multipeer Module

API Docs for: 1.0.0
Show:

Browser Class

Module: Readme

Searches (by service type) for services offered by nearby devices using infrastructure Wi-Fi, peer-to-peer Wi-Fi, and Bluetooth, and provides the ability to easily invite those devices to a Multipeer Connectivity session.

Item Index

Properties

Methods

invitePeer

(
  • params
)
Void

Available since 1.0.0

Invites a discovered peer to join a Multipeer Connectivity session.

Parameters:

  • params Object
    • peer Peer

      The peer to invite.

    • session Session

      The session you wish the invited peer to join.

    • context TiBuffer

      An arbitrary piece of data that is passed to the nearby peer. This can be used to provide further information to the user about the nature of the invitation.

    • timeout Number

      The amount of time to wait for the peer to respond to the invitation. This timeout is measured in seconds, and must be a positive value. If a negative value or zero is specified, the default timeout (30 seconds) is used.

Returns:

Void:

start

() Void

Available since 1.0.0

Starts browsing for peers.

Returns:

Void:

stop

() Void

Available since 1.0.0

Stops browsing for peers.

Returns:

Void:

Properties

peer

Peer read-only

Available since 1.0.0

The Peer object associated with this session.

serviceType

String read-only

Available since 1.0.0

The service type to browse for.

Events

error

Available since 1.0.0

This event is fired if something goes wrong with browsing.

Event Payload:

  • errorCode Number

    The error code.

  • errorDomain String

    The error domain.

  • errorDescription String

    The error description.

peerFound

Available since 1.0.0

This event is fired when a peer is found.

Event Payload:

  • peer Peer
  • discoveryInfo Object

    The info dictionary advertised by the discovered peer. For more information on the contents of this dictionary, see the documentation of the createAdvertiser function.

peerLost

Available since 1.0.0

This event is fired when a peer is lost.

Event Payload: