Skip to content

Commit

Permalink
feat: Flutter V2 Gen1 Docs Update (#7499)
Browse files Browse the repository at this point in the history
* chore: analytics transfer

* chore: authentication transfer from current to prev

* chore: API transfer v1 from current to previous

* chore: Storage and functions v1 transfer from current to prev

* chore: transfer push notifications v1 docs from current to prev

* chore: transfer existing resources v1 from current to prev

* chore: transfer datastore v1 from current to prev

* [Gen 2][Bugfix] Update the flutter mobile support doc. (#7245)

* Update the flutter mobile support doc.

* Add file name.

* Add Safe Area.

* chore: change link and maintenance call out from v0 to v1

* chore: update flutter storage apis (#7326)

* chore: update flutter v2 migration guide (#7327)

* chore: update flutter v2 docs to use plugin options (#7336)

* chore: add multi auth back to v1 previous (#7335)

* StoragePath Documentation for Gen1 (#7279)

* storage: update swift storage with storage path

* chore: update swift storage docs with storage path

* chore: update storage getting started content

* chore: add callout warning to file access level

* chore: update gen2 callout

* chore: convert fragments to inline filter

* update storage path example

* Android Gen2 Storage

* remove upload from getting started

* Add Using Storagepath

* add content to storage path page

* Expand storagepath

* improve doc

* update callout message

* modify file access level callout

* add accidental remove

* gramatical issues

* Update src/pages/[platform]/build-a-backend/storage/download/index.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Update src/pages/[platform]/build-a-backend/storage/upload/index.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Update src/pages/[platform]/build-a-backend/storage/storagepath/index.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Update src/pages/[platform]/build-a-backend/storage/list/index.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Update src/pages/[platform]/build-a-backend/storage/remove/index.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Bump Android version

---------

Co-authored-by: Tuan Pham <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>

* chore: add kotlin update to docs and formatting changes for flutter (#7023)

* chore: add kotlin update to docs and formatting changes for new flutter build.gradle creation

* chore: remove steps for apps created with flutter 3.16 and earlier

* chore: apply suggestions from code review

Co-authored-by: Muhammed Salih Guler <[email protected]>

* Chore: Removed v0 flutter fragments (#7349)

* chore: remove v0 flutter fragment

* chore: remove move flutter fragment

* chore: remove the move page from the directory and remove move from pages completely

* chore: fix broken links by adding inline filters (#7356)

* chore: fix broken links by adding inline filters

* chore: remove the line instead of use InlineFilter since flutter is the only platform with this page

* chore: remove getting started link under storage subheading that was being used as a placeholder

* chore: added filter to fix broken link (#7382)

* chore: remove move from directory

* chore: fix gen1 v1 authentication section

* chore: fixed flutter v1 gen1 docs

* chore: fix v1 rest api gen 1

* chore: fix storage and functions v1 gen 1 and

* chore: fix datastore v1 gen1

* chore: cleanup broken links

* chore: add maintenance banner to all push notification pages

* chore: add maintenance banner on all sub headings

* chore: add missing maintenance banners to auth section

* chore: add existing resources section

* chore: remove duplicated paragraph in auth section and updated callout on remember a device

* chore: fix code snippet in graphql authorization modes section

* chore: fix code snippets in rest api section

* chore: fix function links flutter v1 gen 1

* chore: fix storage snippets

* chore: fix childnodes for best practices and existing aws resources

* chore: fixed looking for legacy docs links

* chore: fixed here links in configure storage

* chore: fix configure amplify cli links

* chore: fix tools links

* chore: fix android pages

* chore: update pubspec.yaml snippets to use the new version of flutter

* chore: fix inline filters for swift v1 pages

* chore: update storage v2 snippets to use path

* chore: add storage path for flutter (#7536)

* chore: remove environment section of pubspec snippets

* chore: flutter v2 cleanup (#7545)

* chore: address upgrade guide comments

* chore: remove references to flutter version

* fix: correct the sendUserAttributeConfirmationCode API name (#7547)

* fix: added custom primary key migration

* fix: CPK table verbiage

* chore: fix typo in admin_actions name, use one header for all platforms for graphql advanced workflows, fix formatting for inline filter in existing resources

* chore: remove duplicate pages that don't exist on gen2 and edit paths

* Flutter v2 gen2 remove pages (#7579)

* chore: remove pages ported from gen1 current to gen1 prev

* chore: fix flutter v2 PN docs (#7580)

* chore: refactor push notification docs

* chore: remove dup notification fragments

* chore: remove `/lib/` references

* chore: update references to `prev`

* chore: update analytics enable example

* chore: remove references to min flutter version

* chore: fix path typos

* chore: change existing resources link to the correct page

* chore: move set up cli link to current since it doesn't exist on prev

* chore: add flutter back into platforms export in the under the hood and existing platform pages

* chore: addressed comments regarding removing split up context between… (#7585)

* chore: addressed comments regarding removing split up context between platforms, changing headers, removing unnecessary fragments

* Flutter v2 gen2 comment fixes (#7598)

* chore: remove callout that should be in migration guide

* chore: remove unnecessary code snippet that originates from vCurrent

* chore: fix incorrect references to vCurrent fragments inside vPrev pages

* chore: remove unnecessary line for flutter custom challenge in both prev and current

* chore: make function public in prev and current

* chore: remove "suppports-only-mobile"

* chore: remove unnecessary inline filters and put back an upload fragment

* chore: remove unnecessary inline filter from graphql link

* chore: remove unintentionally added line

* chore: move flutter back to the top of the platforms list

* chore: delete before you begin snippet for grapql vprev

* chore: add picture back in to vprev flutter storage page

* chore: revert flutter import changes back to original

* chore: clean up preReq snippets

* chore: add title="Terminal" showLineNumbers={false} to terminal snippets

* chore: revert changes that are out of scope

* chore: revert removal of inline filter and addition of white space

* chore: revert changes that removed before you begin snippet

* chore: revert change to wording

* Apply suggestions from code review

Co-authored-by: Jordan Nelson <[email protected]>

* chore: revert white space changes

* chore: revert bash back to console

* chore: remove inline filters and add fragment back in

* chore: add statement about models back in

* chore: remove unused "datastore coming soon" file

* chore: remove callout

* chore: revert user pool capitalization changes: out of scope

* chore: change the order of query data beginsWith back to original

* chore: remove callouts

* chore: revert spacing change

* chore: fixes for auth category (#7612)

* chore: flutter v2 storage fixes (#7615)

* chore: add missing code snippets for storage

* chore: filter out content for flutter

* Update src/fragments/lib-v1/auth/native_common/user_attributes/common.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Flutter v2 fix analytics (#7618)

* chore: add missing snippet in identify user

* chore: remove flutter from javascript canonical objects

* chore: delete unused fragment

* chore: remove canonicalObjects that were added

* chore: update a link in v1 to point to prev instead of vCurreent

* chore: revert changes in mutate-data file and fix formatting

* Update src/fragments/lib-v1/datastore/flutter/sync/50-selectiveSync.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* Update src/fragments/lib-v1/storage/existing-resources.mdx

Co-authored-by: Jordan Nelson <[email protected]>

* chore: revert out of scope changes

* chore: update storage import existing resource

* chore: remove changes to js only files

* chore: clean up gen 2 pre-req

* chore: remove link to platform setup guide in gen 2

* chore: update pre-reqs and getting started

---------

Co-authored-by: Muhammed Salih Guler <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>
Co-authored-by: NikaHsn <[email protected]>
Co-authored-by: Tyler Roach <[email protected]>
Co-authored-by: Tuan Pham <[email protected]>
Co-authored-by: Elijah Quartey <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>
  • Loading branch information
8 people authored May 21, 2024
1 parent 0978549 commit 0926392
Show file tree
Hide file tree
Showing 274 changed files with 4,344 additions and 2,111 deletions.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@
"resolver's",
"resourcename",
"Resources.S3Bucket.Properties.BucketName",
"respectprimarykeyattributesonconnectionfield",
"RESTAPI",
"RESTENDPOINT",
"resubscription",
Expand Down
7 changes: 6 additions & 1 deletion redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -10178,5 +10178,10 @@
"source": "/gen1/react/reference/cli-commands/",
"target": "/gen1/react/tools/cli/commands/",
"status": "301"
}
},
{
"source": "/gen1/flutter/build-a-backend/storage/move/",
"target": "/gen1/flutter/prev/build-a-backend/storage/move/",
"status": "301"
}
]
2 changes: 1 addition & 1 deletion src/components/Breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const overrides = {
'/gen1/javascript/prev': 'V5',
'/gen1/swift/prev': 'V1',
'/gen1/android/prev': 'V1',
'/gen1/flutter/prev': 'V0',
'/gen1/flutter/prev': 'V1',
'/gen1/react/prev': 'V5',
'/gen1/react-native/prev': 'V5',
'/gen1/angular/prev': 'V5',
Expand Down
6 changes: 0 additions & 6 deletions src/constants/feature-lists-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@ const featureListData = {
'Upload and download files to and from cloud storage with advanced controls like pausing and resuming upload operations.',
linkText: 'Upload and Download files',
link: 'build-a-backend/storage/upload/'
},
{
content:
'Manage content through APIs for listing, accessing, and manipulating files. Set file permission levels, configure automatic events and triggers, and more.',
linkText: 'Advanced file operations and access control',
link: 'build-a-backend/storage/configure-access/'
}
],
heading: 'Storage'
Expand Down
4 changes: 2 additions & 2 deletions src/data/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export const PLATFORM_VERSIONS = {
current: 'v2'
},
flutter: {
prev: 'v0',
current: 'v1'
prev: 'v1',
current: 'v2'
},
javascript: {
prev: 'v5',
Expand Down
6 changes: 3 additions & 3 deletions src/directory/directory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,9 +1284,6 @@ export const directory = {
{
path: 'src/pages/gen1/[platform]/build-a-backend/storage/copy/index.mdx'
},
{
path: 'src/pages/gen1/[platform]/build-a-backend/storage/move/index.mdx'
},
{
path: 'src/pages/gen1/[platform]/build-a-backend/storage/remove/index.mdx'
},
Expand Down Expand Up @@ -2362,6 +2359,9 @@ export const directory = {
{
path: 'src/pages/gen1/[platform]/prev/build-a-backend/storage/copy/index.mdx'
},
{
path: 'src/pages/gen1/[platform]/prev/build-a-backend/storage/move/index.mdx'
},
{
path: 'src/pages/gen1/[platform]/prev/build-a-backend/storage/remove/index.mdx'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
- [Install and configure Amplify CLI](/gen1/[platform]/tools/cli/start/set-up-cli/)
- A Flutter application targeting Flutter SDK >= 2.10.0 (stable version) with Amplify libraries integrated
- An iOS configuration targeting at least iOS 11.0
- An Android configuration targeting at least Android API level 21 (Android 5.0) or above
- For a full example please follow the [project setup walkthrough](/gen1/[platform]/prev/start/project-setup/create-application/)
* [Install and configure Amplify CLI](/gen1/[platform]/tools/cli/start/set-up-cli/)

Amplify Flutter requires a minimum target platform for iOS (13.0), Android (API level 24), and macOS (10.15). Additional setup is required for some target platforms. Please see the [platform setup](/gen1/[platform]/prev/start/project-setup/platform-setup/) guide for more details on platform specific setup.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ In your Flutter project directory, open **pubspec.yaml**.
Add Analytics by adding these libraries into your dependencies block:

```yaml
environment:
sdk: '>=2.15.0 <3.0.0'

dependencies:
# Should already be added during Project Setup walkthrough
amplify_flutter: ^0.6.0

# Add these lines in `dependencies` if you have not added it earlier during the Project Setup
amplify_auth_cognito: ^0.6.0
amplify_analytics_pinpoint: ^0.6.0
amplify_analytics_pinpoint: ^1.0.0
amplify_auth_cognito: ^1.0.0
amplify_flutter: ^1.0.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Future<void> _configureAmplify() async {
}
```

<Callout>

When running your app on macOS you will need to enable keychain sharing in Xcode, as described in the [Project setup guide](/gen1/[platform]/prev/start/project-setup/platform-setup/#enable-keychain).

</Callout>

Make sure that the `amplifyconfiguration.dart` file generated in the project setup is included and sent to `Amplify.configure`:

```dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To record an event, create an `AnalyticsEvent` and call `Amplify.Analytics.recor
Future<void> trackEventsWithProperties() async {
final event = AnalyticsEvent('test');
event.properties
event.customProperties
..addBoolProperty('boolKey', true)
..addDoubleProperty('doubleKey', 10)
..addIntProperty('intKey', 10)
Expand Down
42 changes: 24 additions & 18 deletions src/fragments/lib-v1/analytics/flutter/identifyuser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This call sends information that you have specified about a user to Amazon Pinpo

You can get the current user's ID from the Amplify Auth category as shown per the Auth category documentation. Be sure to have it ready before you set it as shown below (Check out the [Authentication Getting Started](/gen1/[platform]/prev/build-a-backend/auth/set-up-auth/) guide for detailed explanation).

If you have asked for location access and received permission, you can also provide that in `AnalyticsUserProfileLocation`.
If you have asked for location access and received permission, you can also provide that in `UserProfileLocation`

```dart
Future<void> addAnalyticsWithLocation({
Expand All @@ -12,27 +12,33 @@ Future<void> addAnalyticsWithLocation({
required String phoneNumber,
required int age,
}) async {
final location = AnalyticsUserProfileLocation()
..latitude = 47.606209
..longitude = -122.332069
..postalCode = '98122'
..city = 'Seattle'
..region = 'WA'
..country = 'USA';
final properties = AnalyticsProperties()
..addStringProperty('phoneNumber', phoneNumber)
..addIntProperty('age', age);
final userProfile = AnalyticsUserProfile()
..name = name
..email = email
..location = location
..properties = properties;
final userProfile = UserProfile(
name: name,
email: email,
location: const UserProfileLocation(
latitude: 47.606209,
longitude: -122.332069,
postalCode: '98122',
city: 'Seattle',
region: 'WA',
country: 'USA',
),
customProperties: CustomProperties()
..addStringProperty('phoneNumber', phoneNumber)
..addIntProperty('age', age),
);
await Amplify.Analytics.identifyUser(
userId: userId,
userProfile: userProfile,
);
}
```

Sending user information allows you to associate a user to their user profile and activities or actions in your app. The user's actions and attributes can also tracked across devices and platforms by using the same `userId`.

Some scenarios for identifying a user and their associated app activities are:
* When a user completes app sign up
* When a user completes sign in process
* When a user launches your app
* When a user modifies or updates their user profile
43 changes: 39 additions & 4 deletions src/fragments/lib-v1/analytics/flutter/record.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ The Amplify analytics plugin also makes it easy to record custom events within t
Future<void> recordCustomEvent() async {
final event = AnalyticsEvent('PasswordReset');
event.properties
event.customProperties
..addStringProperty('Channel', 'SMS')
..addBoolProperty('Successful', true);
// You can also add the properties one by one like the following
event.properties.addIntProperty('ProcessDuration', 792);
event.properties.addDoubleProperty('doubleKey', 120.3);
event.customProperties.addIntProperty('ProcessDuration', 792);
event.customProperties.addDoubleProperty('doubleKey', 120.3);
await Amplify.Analytics.recordEvent(event: event);
}
Expand All @@ -28,6 +28,33 @@ However, it can take upwards of 30 minutes for the event to display in the Filte

## Flush events

Events have default configuration to flush out to the network every 30 seconds. If you would like to change this, update `amplifyconfiguration.dart` with the value in milliseconds you would like for `autoFlushEventsInterval`. This configuration will flush events every 10 seconds:

```json
{
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"analytics": {
"plugins": {
"awsPinpointAnalyticsPlugin": {
"pinpointAnalytics": {
"appId": "AppID",
"region": "Region"
},
"pinpointTargeting": {
"region": "Region"
},
"autoFlushEventsInterval": 10
}
}
}
}
```

> **Note**
>
> Setting `autoFlushEventsInterval` to 0 will **disable** the automatic flush of events and you will be responsible for submitting them.
To manually flush events, call:

```dart
Expand All @@ -40,7 +67,7 @@ You can register global properties which will be sent along with all invocations

```dart
Future<void> registerGlobalProperties() async {
final properties = AnalyticsProperties()
final properties = CustomProperties()
..addStringProperty('AppStyle', 'DarkMode');
await Amplify.Analytics.registerGlobalProperties(
globalProperties: properties,
Expand All @@ -57,3 +84,11 @@ Future<void> unregisterGlobalProperties() async {
);
}
```

Furthermore, you can remove all global properties by calling `unregisterGlobalProperties` without `propertyNames`:

```dart
Future<void> unregisterAllGlobalProperties() async {
await Amplify.Analytics.unregisterGlobalProperties();
}
```
6 changes: 6 additions & 0 deletions src/fragments/lib-v1/auth/android/signin/20_confirmSignUp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ RxAmplify.Auth.confirmSignUp("username", "the code you received via email")

</Block>
</BlockSwitcher>

You will know the sign up flow is complete if you see the following in your console window:

```console
Confirm signUp succeeded
```
6 changes: 6 additions & 0 deletions src/fragments/lib-v1/auth/android/signin/30_signIn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ RxAmplify.Auth.signIn("username", "password")

</Block>
</BlockSwitcher>

You will know the sign in flow is complete if you see the following in your console window:

```console
Sign in succeeded
```
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ import flutter13 from '/src/fragments/lib-v1/auth/flutter/device_features/40_tra

When using the federated OAuth flow with Cognito User Pools, the [device tracking and remembering](https://aws.amazon.com/blogs/mobile/tracking-and-remembering-devices-using-amazon-cognito-your-user-pools/) features are currently not available within the library.

<Fragments fragments={{ flutter: flutter13 }} />
<Fragments fragments={{ flutter: flutter13 }} />
Loading

0 comments on commit 0926392

Please sign in to comment.