class ARNetworkingFactory (Niantic.ARDK.AR.Networking.ARNetworkingFactory)

Overview

A static Factory class to create ARNetworking instances, as well as to be notified when new ARNetworking instances are created. More…

class ARNetworkingFactory {
public:
    // properties

    ArdkEventHandler<AnyARNetworkingInitializedArgs> ARNetworkingInitialized;

    // methods

    static IARNetworking Create();
    static IARNetworking Create(IARSession session);
    static IARNetworking Create(IARSession session, IMultipeerNetworking networking);

    static IARNetworking Create(
        IARSession session,
        ServerConfiguration configuration
    );

    static IARNetworking Create(RuntimeEnvironment env);
};

Detailed Documentation

A static Factory class to create ARNetworking instances, as well as to be notified when new ARNetworking instances are created.

Properties

ArdkEventHandler<AnyARNetworkingInitializedArgs> ARNetworkingInitialized

Event called when a new AR Networking object is initialized.

Methods

static IARNetworking Create()

Create an ARNetworking appropriate for the current device.

On a mobile device, the attempted order will be LiveDevice, Remote, and finally Mock. In the Unity Editor, the attempted order will be Remote, then Mock.

This will also create an ARSession object. If an ARSession object has already been created, use the ARNetworkingFactory.Create(IARSession session) API instead.

Parameters:

stageIdentifier

The identifier used by the C++ library to connect all related components.

Returns:

The created ARNetworking, or throws if it was not possible to create a session.

static IARNetworking Create(IARSession session)

Creates a new ARNetworking for the given session.

Parameters:

session

  • The session to create a new ARNetworking for.

Returns:

The newly created ARNetworking.

static IARNetworking Create(IARSession session, IMultipeerNetworking networking)

Creates a new ARNetworking for the given session and multipeer networking.

Parameters:

session

  • The session to create a new ARNetworking for.

networking

  • An existing multipeer networking.

Returns:

The newly created ARNetworking.

static IARNetworking Create(
    IARSession session,
    ServerConfiguration configuration
)

Creates a new ARNetworking for the given session.

Parameters:

session

  • The session to create a new ARNetworking for.

configuration

  • The configuration that tells how to connect to a server.

Returns:

The newly created ARNetworking.

static IARNetworking Create(RuntimeEnvironment env)

Create an ARNetworking with the specified RuntimeEnvironment.

This will also create an ARSession object. If an ARSession object has already been created, use the ARNetworkingFactory.Create(IARSession session) API instead.

Parameters:

env

The env used to create the ARNetworking for.

Returns:

The created ARNetworking, or throws if it was not possible to create a session.