Skip to content

Commit

Permalink
Update wording and fix tab formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cbullinger committed May 8, 2024
1 parent f558680 commit 9e5a999
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 126 deletions.
206 changes: 117 additions & 89 deletions source/sdk/flutter/install.txt
Expand Up @@ -26,18 +26,17 @@ Prerequisites
-------------

To get started with the Atlas Device SDK for Flutter, you need to install
Flutter or Dart:
the following, depending on the type of app you are developing:

- For Flutter or Dart apps, install Flutter in your development environment.
Note that the Flutter installation includes the full Dart SDK. To learn
how, refer to the official `Flutter Installation Guide
<https://docs.flutter.dev/get-started/install>`__.
- For Flutter or Dart apps, install Flutter with Dart in your development environment.
The Flutter installation includes Dart. To learn how, refer to the official
`Flutter Installation Guide <https://docs.flutter.dev/get-started/install>`__.

- For standalone Dart apps, you can choose install Dart in your development
environment without Flutter. To learn how, refer to the official `Dart
Installation Guide <https://dart.dev/get-dart>`__.
- For standalone Dart apps, you can install Dart in your development
environment without Flutter. To learn how, refer to the official
`Dart Installation Guide <https://dart.dev/get-dart>`__.

The latest version of the Device SDK for Flutter requires the following:
The latest version of the Flutter SDK requires the following minimum versions:

- Flutter version 3.19.0 or later.
- Dart version 3.3.0 or later.
Expand All @@ -64,8 +63,8 @@ The Flutter SDK supports the following platforms:
.. _flutter-install-steps:
.. _dart-install-steps:

Installation
------------
Install the SDK
---------------

The Atlas Device SDK for Flutter has two packages available to install,
depending on whether you are developing a Flutter or Dart standalone app:
Expand All @@ -79,8 +78,7 @@ where otherwise noted.

.. tip:: Atlas Device SDK and Realm

The SDK uses Realm Core database for device data persistence. When you
install the Kotlin SDK, the package names reflect Realm naming.
The Flutter SDK uses Realm Core database for device data persistence. When you install the Flutter SDK, the package names reflect Realm naming.

.. procedure::

Expand All @@ -93,7 +91,7 @@ where otherwise noted.

To create a Flutter project, run the following commands:

.. code-block::
.. code-block:: bash

flutter create <app_name>
cd <app_name>
Expand All @@ -106,7 +104,7 @@ where otherwise noted.

To create a Dart project, run the following commands:

.. code-block::
.. code-block:: bash

dart create <app_name>
cd <app_name>
Expand All @@ -122,9 +120,9 @@ where otherwise noted.
.. tab:: Flutter
:tabid: flutter

To add the SDK to your project, run the following command:
To add the Flutter SDK to your project, run the following command:

.. code-block::
.. code-block:: bash

flutter pub add realm

Expand All @@ -139,12 +137,23 @@ where otherwise noted.
dependencies:
realm: <latest_version>

.. tab:: Standalone Dart
:tabid: dart
.. note:: Using Networking in your macOS App

If you are developing with the Flutter SDK in the macOS App
Sandbox and require network access, you must enable network
entitlements in your app. By default, network requests are
not allowed due to built-in macOS security settings.

To use networking in your macOS app, you must change your app's
macOS network entitlements. To learn how, refer to
:ref:`flutter-macos-development`.

.. tab:: Standalone Dart
:tabid: dart

To add the SDK to your project, run the following command:
To add the SDK to your project, run the following command:

.. code-block::
.. code-block:: bash

dart pub add realm_dart

Expand All @@ -162,7 +171,7 @@ where otherwise noted.

After the package is added, run the following command to install it:

.. code-block::
.. code-block:: bash

dart run realm_dart install

Expand All @@ -171,13 +180,14 @@ where otherwise noted.

.. step:: Import the Package into Files

To use the SDK in your app, import the package into any files where you
will use it:

.. tabs::

.. tab:: Flutter
:tabid: flutter

To use the Flutter SDK within your app, import the package into files where you will use it:

.. code-block:: dart
:caption: ExampleFile.dart

Expand All @@ -186,96 +196,105 @@ where otherwise noted.
.. tab:: Standalone Dart
:tabid: dart

To use the SDK within your Dart app, import the package into files where you will use it:

.. code-block:: dart
:caption: ExampleFile.dart

import 'package:realm_dart/realm.dart';

.. note:: Using Networking in your macOS App
.. _flutter-update-package:

If you are developing with the Flutter SDK in the macOS App Sandbox,
network requests do *not* work by default. This is due to the built-in macOS
security settings.
Update the Package Version
--------------------------

To use networking in your macOS app, you must change your app's macOS network
entitlements. To learn how, refer to :ref:`flutter-macos-development`.
To change the version of the SDK in your project, perform the following steps,
depending on whether you are using the ``realm`` or ``realm_dart`` package:

.. _flutter-update-package:
.. procedure::

Update Package Version
----------------------
.. step:: Update the ``pubspec.yaml`` File

.. include:: /includes/flutter-v2-breaking-change.rst
Update the package version in your :file:`pubspec.yaml` file dependencies.

To change the version of the SDK in your project, perform the following steps,
depending on whether you have a Flutter or Dart standalone app:
.. tabs::

.. tabs::
.. tab:: Flutter
:tabid: flutter

.. tab:: Flutter
:tabid: flutter
.. code-block:: yaml
:caption: pubspec.yaml

#. Add the new SDK version to your :file:`pubspec.yaml` file.
dependencies:
realm: <updated_version>

.. code-block:: yaml
:caption: pubspec.yaml
.. tab:: Dart Standalone
:tabid: dart

dependencies:
realm: <updated_version>
.. code-block:: yaml
:caption: pubspec.yaml

dependencies:
realm_dart: <updated_version>

.. step:: Install the Updated Package

.. tabs::

.. tab:: Flutter
:tabid: flutter

Run the following command to install the updated version:

#. Install the updated version.
.. code-block:: yaml
:caption: pubspec.yaml

.. code-block::
dependencies:
realm: <updated_version>

flutter pub upgrade realm
.. tab:: Dart Standalone
:tabid: dart

#. Regenerate your object models.
Run the following command to install the updated version:

.. code-block::
.. code-block:: bash

dart run realm generate
dart pub upgrade realm_dart

These steps should make the updated SDK version work in your application.
If issues persist, you can delete the application from your linked client and
restart it. Note that this will also delete all data stored in the database
on that client.
Then, run the following command to install the updated SDK's native
binaries:

.. tab:: Dart Standalone
:tabid: dart
.. code-block:: bash

#. Add the new SDK version to your :file:`pubspec.yaml` file.
dart run realm_dart install

.. code-block:: yaml
:caption: pubspec.yaml
.. step:: Regenerate Object Models

dependencies:
realm_dart: <updated_version>
.. tabs::

#. Install the updated version.
.. tab:: Flutter
:tabid: flutter

.. code-block::
.. code-block:: bash

dart pub upgrade realm_dart
dart run realm generate

#. Install the updated SDK's native binaries.
.. tab:: Dart Standalone
:tabid: dart

.. code-block::
.. code-block:: bash

dart run realm_dart install
dart run realm_dart generate

#. Regenerate your object models.
.. include:: /includes/flutter-v2-breaking-change.rst

.. code-block::
Troubleshooting
~~~~~~~~~~~~~~~

dart run realm_dart generate
If you have issues using the updated SDK version in your application, you can
delete the ``.realm`` database file created by the SDK, and restart the
application. Note that deleting the ``.realm`` file also deletes all data stored
in the database on that client.

These steps should make the updated SDK version work in your application.
If issues persist, delete the ``.realm`` database file created by the SDK,
and restart the application.
Note that deleting the ``.realm`` file also deletes all data stored in
the database on that client.
For more information, refer to :ref:`flutter-delete-realm`.

.. _flutter-apple-privacy-manifest:

Expand All @@ -284,18 +303,21 @@ Apple Privacy Manifest

.. versionadded:: 2.2.0

Apple requires apps that use required reason APIs to provide details about the
SDK's data collection and use practices when submitting new apps or app updates
to the App Store. For more details about Apple's requirements, refer to
:apple:`support/third-party-SDK-requirements/` on the Apple Developer website.
Apple requires any apps or third-party SDKs that use *required reasons APIs*
to provide a privacy manifest containing details about their data collection
and use practices. The bundled manifest file must be included when submitting
new apps or app updates to the Apple App Store. For more details about these
requirements, refer to
:apple:`Upcoming third-party SDK requirements <support/third-party-SDK-requirements/>`
on the Apple Developer website.

Starting in Flutter SDK version 2.2.0, the SDK ships with a privacy manifest for
``iOS`` and ``macOS`` environments, contained in the ``realm`` package. Both
privacy manifests contain Apple's required API disclosures and the reasons for
using those APIs.

You can view the privacy manifests in the package or the ``realm-dart``
GitHub repository:
You can view these privacy manifests in the SDK package or directly in the
``realm-dart`` GitHub repository:

- ``iOS``:
`https://github.com/realm/realm-dart/blob/main/packages/realm/ios/Resources/PrivacyInfo.xcprivacy
Expand All @@ -309,15 +331,21 @@ The Flutter SDK does *not*:
- Include analytics code in builds for the App Store.
- Log into Atlas on its own behalf.

If you write an app that uses any App Services functionality, you may need to
add additional disclosures to your app's privacy manifest detailing your data
collection and use practices when using these APIs.
For example, if your app :ref:`initializes an App client
<flutter-access-the-app-client>` to:
.. important:: Additional Disclosures May Be Required for App Services

The Flutter SDK privacy manifest does *not* include disclosures for App
Services APIs.

If your app uses any Atlas App Services functionality, such as user
authentication or Device Sync, you may need to provide additional disclosures
that detail your data collection and use practices when using these APIs.
For example, if your app
:ref:`initializes an App client <flutter-access-the-app-client>` to:

- :ref:`Call an Atlas Function <flutter-call-function>`
- :ref:`Authenticate and manage users <flutter-work-with-users>`
- :ref:`Open a synced database <flutter-open-synced-realm>`

For more information, refer to Apple's
:apple:`documentation/bundleresources/privacy_manifest_files` documentation.
:apple:`Privacy Manifest Files <documentation/bundleresources/privacy_manifest_files>`
documentation.
8 changes: 8 additions & 0 deletions source/sdk/flutter/realm-database/realm-files/delete.txt
Expand Up @@ -4,6 +4,14 @@
Delete a Realm File - Flutter SDK
=================================

.. meta::
:description: Delete the local realm files from disk.
:keywords: code example

.. facet::
:name: genre
:values: tutorial

.. contents:: On this page
:local:
:backlinks: none
Expand Down

0 comments on commit 9e5a999

Please sign in to comment.