diff --git a/README.md b/README.md index 8111a0439a..73902084d6 100644 --- a/README.md +++ b/README.md @@ -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() { @@ -146,4 +146,16 @@ class _MyAppState extends State { } } ``` -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 +- 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. diff --git a/packages/amplify_analytics_pinpoint/example/lib/main.dart b/packages/amplify_analytics_pinpoint/example/lib/main.dart index 542df99219..a0224801e4 100644 --- a/packages/amplify_analytics_pinpoint/example/lib/main.dart +++ b/packages/amplify_analytics_pinpoint/example/lib/main.dart @@ -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'; @@ -38,21 +37,12 @@ class _MyAppState extends State { 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(() { diff --git a/packages/amplify_analytics_pinpoint/lib/amplify_analytics_pinpoint.dart b/packages/amplify_analytics_pinpoint/lib/amplify_analytics_pinpoint.dart index 4f63fb1edb..2f0b0687ab 100644 --- a/packages/amplify_analytics_pinpoint/lib/amplify_analytics_pinpoint.dart +++ b/packages/amplify_analytics_pinpoint/lib/amplify_analytics_pinpoint.dart @@ -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(); diff --git a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsEvent.dart b/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsEvent.dart deleted file mode 100644 index 16ba937823..0000000000 --- a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsEvent.dart +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -import 'package:amplify_analytics_plugin_interface/analytics_plugin_interface.dart'; - -class PinpointAnalyticsEvent extends AnalyticsEvent { - PinpointAnalyticsEvent(String name) : super(name); -} diff --git a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsProperties.dart b/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsProperties.dart deleted file mode 100644 index b17143ebe6..0000000000 --- a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsProperties.dart +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -import 'package:amplify_analytics_plugin_interface/analytics_plugin_interface.dart'; - -class PinpointAnalyticsProperties extends AnalyticsProperties { - PinpointAnalyticsProperties() : super(); -} diff --git a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsUserProfile.dart b/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsUserProfile.dart deleted file mode 100644 index b2ba9b494d..0000000000 --- a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsUserProfile.dart +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -import 'package:amplify_analytics_plugin_interface/analytics_plugin_interface.dart'; - -class PinpointAnalyticsUserProfile extends AnalyticsUserProfile { - PinpointAnalyticsUserProfile() : super(); -} diff --git a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsUserProfileLocation.dart b/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsUserProfileLocation.dart deleted file mode 100644 index 1be736356d..0000000000 --- a/packages/amplify_analytics_pinpoint/lib/src/PinpointAnalytics/PinpointAnalyticsUserProfileLocation.dart +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -import 'package:amplify_analytics_plugin_interface/analytics_plugin_interface.dart'; - -class PinpointAnalyticsUserProfileLocation - extends AnalyticsUserProfileLocation { - PinpointAnalyticsUserProfileLocation() : super(); -} diff --git a/packages/amplify_analytics_pinpoint/lib/src/types.dart b/packages/amplify_analytics_pinpoint/lib/src/types.dart deleted file mode 100644 index 1b0e6579d6..0000000000 --- a/packages/amplify_analytics_pinpoint/lib/src/types.dart +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -export 'PinpointAnalytics/PinpointAnalyticsEvent.dart'; -export 'PinpointAnalytics/PinpointAnalyticsProperties.dart'; -export 'PinpointAnalytics/PinpointAnalyticsUserProfile.dart'; -export 'PinpointAnalytics/PinpointAnalyticsUserProfileLocation.dart';