Connect to App Services - Flutter SDK
The App
client is the interface to the Atlas App Services
backend. It provides access to the authentication and Device Sync.
Before You Begin
Access the App Client
Create an AppConfiguration object with your App's App ID as the argument.
Create an App with the
AppConfiguration
you just created. You use thisApp
instance to access App Services features throughout your client application.
final appConfig = AppConfiguration(APP_ID); final app = App(appConfig);
Note
You can create multiple App
instances to connect to multiple
Apps or to the same App with different configurations. All
App
instances that share the same App ID use the same underlying
connection.
Advanced Configuration
You can add optional arguments to the AppConfiguration
for more granular control
of your App
client. You may want to add things like custom timeouts
for connections or keys for local metadata encryption.
To learn about the available configuration options, refer to the
AppConfiguration reference documentation.
final appConfig = AppConfiguration(APP_ID, defaultRequestTimeout: const Duration(seconds: 120), localAppVersion: '2.0' // ... see reference docs for all available configuration options );
Note
Connect Using Android 7 or Older
The default HTTP client included with the Realm Flutter SDK does not work
for apps running on Android 7 or older. To work around this, you must add
a custom HTTP client to your AppConfiguration
. To learn more,
refer to Connect to App Services Using Android 7 or Older.