Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GettingStarted #20

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ Other categories may not function as expected for Flutter projects.
6. In your main.dart file, add:

```dart
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:flutter/material.dart';
import 'package:amplify_core/amplify_core.dart';
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_analytics_plugin_interface/analytics_plugin_interface.dart';
import 'amplifyconfiguration.dart';

void main() {
Expand Down Expand Up @@ -146,4 +146,16 @@ class _MyAppState extends State<MyApp> {
}
}
```
7. From the root of your project, execute `flutter pub get` and `flutter run` from your terminal. Make sure that an Android or iOS device are already running; you can do so from Android Studio.

7. In order to get iOS builds to work do the following within Command Line:
- Go to the root of your project
Copy link
Member

@haverchuck haverchuck Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can wordsmith this in the future... our documentation should make clear that 11.0 is a requirement and leave it at that.

- Run: "rm ios/Podfile"
- Run: "flutter build ios"
- Modify ios/Podfile -> replace the second line with: "platform :ios, '11.0'

This step ensures that your flutter project is running the same ios version that our Flutter plugins are built on.



8. From the root of your project, execute `flutter pub get` and `flutter run` from your terminal.
Make sure that an Android or iOS device is already running; this can be a virutal device started from Android Studio.
18 changes: 4 additions & 14 deletions packages/amplify_analytics_pinpoint/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter/material.dart';

import 'package:amplify_core/amplify_core.dart';
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_analytics_plugin_interface/analytics_plugin_interface.dart';

import 'amplifyconfiguration.dart';

Expand Down Expand Up @@ -38,21 +37,12 @@ class _MyAppState extends State<MyApp> {
if (!mounted) return;

// Configure analytics plugin
AmplifyAnalyticsPinpointPlugin analyticsPlugin = new AmplifyAnalyticsPinpointPlugin();
amplifyInstance.addPlugin(analyticsPlugins: [analyticsPlugin]);

var isConfigured = await amplifyInstance.configure(amplifyconfig);
try {
setState(() {
_amplifyConfigured = isConfigured;
});
} catch (e) {
print(e);
}

AmplifyAnalyticsPinpointPlugin analyticsPlugin =
new AmplifyAnalyticsPinpointPlugin();
AmplifyAuthCognito authPlugin = new AmplifyAuthCognito();

amplifyInstance.addPlugin(
authPlugin: [authPlugin], analyticsPlugin: [analyticsPlugin]);
authPlugins: [authPlugin], analyticsPlugins: [analyticsPlugin]);

await amplifyInstance.configure(amplifyconfig);
setState(() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import './method_channel_amplify.dart';

export './src/types.dart';
export 'package:amplify_analytics_plugin_interface/src/types.dart';

class AmplifyAnalyticsPinpointPlugin extends AnalyticsPluginInterface {
static final Object _token = Object();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions packages/amplify_analytics_pinpoint/lib/src/types.dart

This file was deleted.