LocalitySocialCloud class
Static Methods
-
auth(String userName, String password)
→ Future<LoggedInUserOrError>
-
Authenticates the user, registering or logging them in with
userName and password.
-
configure({required String appId, required String appSecret})
→ void
-
Configures the app with the required
appId and appSecret.
-
connect(LoggedInUser loggedInUser)
→ Future<void>
-
Establishes a connection using the
loggedInUser's access token.
-
discoverUsers()
→ DiscoverUsers
-
Initiates user discovery through the Pub/Sub system.
-
getAppID()
→ String
-
Retrieves the configured app ID.
-
getAppSecret()
→ String
-
Retrieves the configured app secret.
-
makeGeoChannel({required String channel, required Map<String, dynamic> metadata, ChaCha20Key? chaCha20Key})
→ GeoChannel
-
-
startInTestMode({EventSink? customEventSink, List<PubSub>? initialPubSubs})
→ LocalitySocialCloud
-
Starts the Social Cloud in the test mode.
The returning Social Cloud will have a mock user.
Events will not be synchronized across devices and not be sent to the server in the test mode.
Usually, events get confirmed by the server before being released by social cloud.
In test mode, you receive the events right away without a trip to the server.
You can also pass your custom event sink that can be used for tests.
If you pass your custom event sink, the PubSubs will NOT receive events, but instead, the events
will flow to the event sink you gave.
-
supervise(PubSub pubSub, {ChaCha20Key? key})
→ void
-
Supervise a PubSub to connect to the Locality Social Cloud, optionally using a
ChaCha20Key for encryption.
This will ensure that the connection status is properly managed.
-
up({required String appId, required String appSecret, required String username, required String password, List<PubSub>? initialPubSubs, ChaCha20Key? initialPubSubsKey, dynamic onError(AuthError authError)?})
→ Future<LocalitySocialCloud>?
-
Completely and utterly start the social cloud. You may pass initialPubSubs with initialPubSubKeys or
use the static supervise method to supervise your PubSubs.