diff --git a/CODEOWNERS b/CODEOWNERS index 802ffe484501..2cbefae02a3a 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,22 +8,7 @@ packages/android_alarm_manager/* @bkonyi packages/android_intent/* @mklim packages/battery/* @amirh packages/camera/* @bparrishMines @mklim -packages/cloud_firestore/* @collinjackson @kroikie -packages/cloud_functions/* @collinjackson @kroikie packages/connectivity/* @cyanglaz -packages/firebase_admob/* @amirh @bparrishMines -packages/firebase_analytics/* @collinjackson @kroikie -packages/firebase_auth/* @collinjackson @kroikie -packages/firebase_core/* @collinjackson @kroikie -packages/firebase_crashlytics/* @kroikie @collinjackson -packages/firebase_database/* @collinjackson @kroikie -packages/firebase_dynamic_links/* @bparrishMines -packages/firebase_in_app_messaging/* @collinjackson -packages/firebase_messaging/* @collinjackson @kroikie -packages/firebase_ml_vision/* @bparrishMines -packages/firebase_performance/* @bparrishMines @collinjackson -packages/firebase_remote_config/* @collinjackson @kroikie -packages/firebase_storage/* @collinjackson @kroikie packages/google_maps_flutter/* @iskakaushik packages/google_sign_in/* @cyanglaz @mehmetf packages/image_picker/* @cyanglaz diff --git a/FlutterFire.md b/FlutterFire.md deleted file mode 100644 index ae039e6062d1..000000000000 --- a/FlutterFire.md +++ /dev/null @@ -1,107 +0,0 @@ -# FlutterFire - -FlutterFire is a set of [Flutter plugins](https://flutter.io/platform-plugins/) -that enable Flutter apps to use one or more [Firebase](https://firebase.google.com/) services. You can follow an example that shows how to use these plugins in the [Firebase for Flutter](https://codelabs.developers.google.com/codelabs/flutter-firebase/index.html#0) codelab. - -[Flutter](https://flutter.io) is a new mobile app SDK to help developers and -designers build modern mobile apps for iOS and Android. - -*Note*: These plugins are part of the [Flutter open source project](https://github.com/flutter). -The plugins are still under development, and some APIs might not be available yet. -[Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Available FlutterFire plugins - -| Plugin | Version | Firebase feature | Source code | -|---|---|---|---| -| [cloud_firestore][firestore_pub] | ![pub package][firestore_badge] | [Cloud Firestore][firestore_product] | [`packages/cloud_firestore`][firestore_code] | -| [cloud_functions][functions_pub] | ![pub package][functions_badge] | [Cloud Functions][functions_product] | [`packages/cloud_functions`][functions_code] | -| [firebase_admob][admob_pub] | ![pub package][admob_badge] | [Firebase AdMob][admob_product] | [`packages/firebase_admob`][admob_code] | -| [firebase_analytics][analytics_pub] | ![pub package][analytics_badge] | [Firebase Analytics][analytics_product] | [`packages/firebase_analytics`][analytics_code] | -| [firebase_auth][auth_pub] | ![pub package][auth_badge] | [Firebase Authentication][auth_product] | [`packages/firebase_auth`][auth_code] | -| [firebase_core][core_pub] | ![pub package][core_badge] | [Firebase Core][core_product] | [`packages/firebase_core`][core_code] | -| [firebase_crashlytics][crash_pub] | ![pub package][crash_badge] | [Firebase Crashlytics][crash_product] | [`packages/firebase_crashlytics`][crash_code] | -| [firebase_database][database_pub] | ![pub package][database_badge] | [Firebase Realtime Database][database_product] | [`packages/firebase_database`][database_code] | -| [firebase_dynamic_links][dynamic_links_pub] | ![pub package][dynamic_links_badge] | [Firebase Dynamic Links][dynamic_links_product] | [`packages/firebase_dynamic_links`][dynamic_links_code] | -| [in_app_messaging][in_app_messaging_pub] | ![pub package][in_app_messaging_badge] | [Firebase In-App Messaging][in_app_messaging_product] | [`packages/firebase_in_app_messaging`][in_app_messaging_code] | -| [firebase_messaging][messaging_pub] | ![pub package][messaging_badge] | [Firebase Cloud Messaging][messaging_product] | [`packages/firebase_messaging`][messaging_code] | -| [firebase_ml_vision][ml_vision_pub] | ![pub package][ml_vision_badge] | [Firebase ML Kit][ml_vision_product] | [`packages/firebase_ml_vision`][ml_vision_code] | -| [firebase_performance][performance_pub] | ![pub package][performance_badge] | [Firebase Performance Monitoring][performance_product] | [`packages/firebase_performance`][performance_code] | -| [firebase_remote_config][remote_config_pub] | ![pub package][remote_config_badge] | [Firebase Remote Config][remote_config_product] | [`packages/firebase_remote_config`][remote_config_code] | -| [firebase_storage][storage_pub] | ![pub package][storage_badge] | [Firebase Cloud Storage][storage_product] | [`packages/firebase_storage`][storage_code] | - -[admob_pub]: https://pub.dartlang.org/packages/firebase_admob -[admob_product]: https://firebase.google.com/docs/admob/ -[admob_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_admob -[admob_badge]: https://img.shields.io/pub/v/firebase_admob.svg - -[analytics_pub]: https://pub.dartlang.org/packages/firebase_analytics -[analytics_product]: https://firebase.google.com/products/analytics/ -[analytics_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics -[analytics_badge]: https://img.shields.io/pub/v/firebase_analytics.svg - -[auth_pub]: https://pub.dartlang.org/packages/firebase_auth -[auth_product]: https://firebase.google.com/products/auth/ -[auth_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_auth -[auth_badge]: https://img.shields.io/pub/v/firebase_auth.svg - -[core_pub]: https://pub.dartlang.org/packages/firebase_core -[core_product]: https://firebase.google.com/ -[core_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_core -[core_badge]: https://img.shields.io/pub/v/firebase_core.svg - -[crash_pub]: https://pub.dartlang.org/packages/firebase_crashlytics -[crash_product]: https://firebase.google.com/products/crashlytics/ -[crash_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_crashlytics -[crash_badge]: https://img.shields.io/pub/v/firebase_crashlytics.svg - -[database_pub]: https://pub.dartlang.org/packages/firebase_database -[database_product]: https://firebase.google.com/products/database/ -[database_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_database -[database_badge]: https://img.shields.io/pub/v/firebase_database.svg - -[dynamic_links_pub]: https://pub.dartlang.org/packages/firebase_dynamic_links -[dynamic_links_product]: https://firebase.google.com/products/dynamic-links/ -[dynamic_links_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_dynamic_links -[dynamic_links_badge]: https://img.shields.io/pub/v/firebase_dynamic_links.svg - -[firestore_pub]: https://pub.dartlang.org/packages/cloud_firestore -[firestore_product]: https://firebase.google.com/products/firestore/ -[firestore_code]: https://github.com/flutter/plugins/tree/master/packages/cloud_firestore -[firestore_badge]: https://img.shields.io/pub/v/cloud_firestore.svg - -[functions_pub]: https://pub.dartlang.org/packages/cloud_functions -[functions_product]: https://firebase.google.com/products/functions/ -[functions_code]: https://github.com/flutter/plugins/tree/master/packages/cloud_functions -[functions_badge]: https://img.shields.io/pub/v/cloud_functions.svg - -[in_app_messaging_pub]: https://pub.dartlang.org/packages/firebase_in_app_messaging -[in_app_messaging_product]: https://firebase.google.com/products/in-app-messaging/ -[in_app_messaging_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_in_app_messaging -[in_app_messaging_badge]: https://img.shields.io/pub/v/firebase_in_app_messaging.svg - -[messaging_pub]: https://pub.dartlang.org/packages/firebase_messaging -[messaging_product]: https://firebase.google.com/products/cloud-messaging/ -[messaging_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging -[messaging_badge]: https://img.shields.io/pub/v/firebase_messaging.svg - -[ml_vision_pub]: https://pub.dartlang.org/packages/firebase_ml_vision -[ml_vision_product]: https://firebase.google.com/products/ml-kit/ -[ml_vision_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_ml_vision -[ml_vision_badge]: https://img.shields.io/pub/v/firebase_ml_vision.svg - -[performance_pub]: https://pub.dartlang.org/packages/firebase_performance -[performance_product]: https://firebase.google.com/products/performance/ -[performance_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_performance -[performance_badge]: https://img.shields.io/pub/v/firebase_performance.svg - -[remote_config_pub]: https://pub.dartlang.org/packages/firebase_remote_config -[remote_config_product]: https://firebase.google.com/products/remote-config/ -[remote_config_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_remote_config -[remote_config_badge]: https://img.shields.io/pub/v/firebase_remote_config.svg - -[storage_pub]: https://pub.dartlang.org/packages/firebase_storage -[storage_product]: https://firebase.google.com/products/storage/ -[storage_code]: https://github.com/flutter/plugins/tree/master/packages/firebase_storage -[storage_badge]: https://img.shields.io/pub/v/firebase_storage.svg - diff --git a/README.md b/README.md index f6695a7658a6..aeb03ffa23ac 100644 --- a/README.md +++ b/README.md @@ -58,22 +58,3 @@ These are the available plugins in this repository. | [url_launcher](./packages/url_launcher/) | [![pub package](https://img.shields.io/pub/v/url_launcher.svg)](https://pub.dev/packages/url_launcher) | | [video_player](./packages/video_player/) | [![pub package](https://img.shields.io/pub/v/video_player.svg)](https://pub.dev/packages/video_player) | | [webview_flutter](./packages/webview_flutter/) | [![pub package](https://img.shields.io/pub/v/webview_flutter.svg)](https://pub.dev/packages/webview_flutter) | -| | | -| **FlutterFire Plugins** | | -| [cloud_firestore](./packages/cloud_firestore/) | [![pub package](https://img.shields.io/pub/v/cloud_firestore.svg)](https://pub.dev/packages/cloud_firestore) -| [cloud_functions](./packages/cloud_functions/) | [![pub package](https://img.shields.io/pub/v/cloud_functions.svg)](https://pub.dev/packages/cloud_functions) | -| [firebase_admob](./packages/firebase_admob/) | [![pub package](https://img.shields.io/pub/v/firebase_admob.svg)](https://pub.dev/packages/firebase_admob) | -| [firebase_analytics](./packages/firebase_analytics/) | [![pub package](https://img.shields.io/pub/v/firebase_analytics.svg)](https://pub.dev/packages/firebase_analytics) | -| [firebase_auth](./packages/firebase_auth/) | [![pub package](https://img.shields.io/pub/v/firebase_auth.svg)](https://pub.dev/packages/firebase_auth) | -| [firebase_core](./packages/firebase_core/) | [![pub package](https://img.shields.io/pub/v/firebase_core.svg)](https://pub.dev/packages/firebase_core) | -| [firebase_crashlytics](./packages/firebase_crashlytics/) | [![pub package](https://img.shields.io/pub/v/firebase_crashlytics.svg)](https://pub.dev/packages/firebase_crashlytics) | -| [firebase_database](./packages/firebase_database/) | [![pub package](https://img.shields.io/pub/v/firebase_database.svg)](https://pub.dev/packages/firebase_database) | -| [firebase_dynamic_links](./packages/firebase_dynamic_links/) | [![pub package](https://img.shields.io/pub/v/firebase_dynamic_links.svg)](https://pub.dev/packages/firebase_dynamic_links) | -| [firebase_in_app_messaging](./packages/firebase_in_app_messaging/) | [![pub package](https://img.shields.io/pub/v/firebase_in_app_messaging.svg)](https://pub.dev/packages/firebase_in_app_messaging) | -| [firebase_messaging](./packages/firebase_messaging/) | [![pub package](https://img.shields.io/pub/v/firebase_messaging.svg)](https://pub.dev/packages/firebase_messaging) | -| [firebase_ml_vision](./packages/firebase_ml_vision/) | [![pub package](https://img.shields.io/pub/v/firebase_ml_vision.svg)](https://pub.dev/packages/firebase_ml_vision) | -| [firebase_performance](./packages/firebase_performance/) | [![pub package](https://img.shields.io/pub/v/firebase_performance.svg)](https://pub.dev/packages/firebase_performance) | -| [firebase_remote_config](./packages/firebase_remote_config/) | [![pub package](https://img.shields.io/pub/v/firebase_remote_config.svg)](https://pub.dev/packages/firebase_remote_config) | -| [firebase_storage](./packages/firebase_storage/) | [![pub package](https://img.shields.io/pub/v/firebase_storage.svg)](https://pub.dev/packages/firebase_storage) | - -Learn more about [FlutterFire](https://github.com/flutter/plugins/blob/master/FlutterFire.md). diff --git a/examples/all_plugins/android/app/build.gradle b/examples/all_plugins/android/app/build.gradle index f4100d3139bd..9fbd496f70df 100644 --- a/examples/all_plugins/android/app/build.gradle +++ b/examples/all_plugins/android/app/build.gradle @@ -59,6 +59,7 @@ flutter { dependencies { testImplementation 'junit:junit:4.12' + implementation 'com.google.guava:guava:27.0.1-android' androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' api 'androidx.exifinterface:exifinterface:1.0.0' diff --git a/examples/all_plugins/android/build.gradle b/examples/all_plugins/android/build.gradle index 95bbaca8b8a5..ad6301ce2ad9 100644 --- a/examples/all_plugins/android/build.gradle +++ b/examples/all_plugins/android/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.3.1' } } diff --git a/packages/cloud_firestore/.gitignore b/packages/cloud_firestore/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/cloud_firestore/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/cloud_firestore/CHANGELOG.md b/packages/cloud_firestore/CHANGELOG.md deleted file mode 100644 index f5d647e0b9db..000000000000 --- a/packages/cloud_firestore/CHANGELOG.md +++ /dev/null @@ -1,420 +0,0 @@ -## 0.12.9 - -* New optional `includeMetadataChanges` parameter added to `DocumentReference.snapshots()` - and `Query.snapshots()` -* Fix example app crash when the `message` field was not a string -* Internal renaming of method names. - -## 0.12.8+1 - -* Add `metadata` to `QuerySnapshot`. - -## 0.12.8 - -* Updated how document ids are generated to more closely match native implementations. - -## 0.12.7+1 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.12.7 - -* Methods of `Transaction` no longer require `await`. -* Added documentation to methods of `Transaction`. -* Removed an unnecessary log on Android. -* Added an integration test for rapidly incrementing field value. - -## 0.12.6 - -* Support for `orderBy` on map fields (e.g. `orderBy('cake.flavor')`) for - `startAtDocument`, `startAfterDocument`, `endAtDocument`, and `endBeforeDocument` added. - -## 0.12.5+2 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.12.5+1 -* Added support for combining any of `Query.startAtDocument` and `Query.startAfterDocument` - with any of `Query.endAtDocument` and `Query.endBeforeDocument`. - -## 0.12.5 - -* Makes `startAtDocument`, `startAfterDocument`, `endAtDocument` and `endBeforeDocument` work - with `Query.collectionGroup` queries. -* Fixes `startAtDocument`, `startAfterDocument`, `endAtDocument` and `endBeforeDocument` to - also work with a descending order as the last explicit sort order. -* Fixed an integration test by increasing the value of `cacheSizeBytes` to a valid value. - -## 0.12.4 - -* Added support for `Query.collectionGroup`. - -## 0.12.3 - -* Added support for `cacheSizeBytes` to `Firestore.settings`. - -## 0.12.2 - -* Ensure that all channel calls to the Dart side from the Java side are done - on the UI thread. This change allows Transactions to work with upcoming - Engine restrictions, which require channel calls be made on the UI thread. - **Note** this is an Android only change, the iOS implementation was not impacted. -* Updated the Firebase reporting string to `flutter-fire-fst` to be consistent - with other reporting libraries. - -## 0.12.1 - -* Added support for `Source` to `Query.getDocuments()` and `DocumentReference.get()`. - -## 0.12.0+2 - -* Bump the minimum Flutter version to 1.5. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 0.12.0+1 - -* Send user agent to Firebase. - -## 0.12.0 - -* **Breaking change**. Fixed `CollectionReference.parent` to correctly return a `DocumentReference`. - If you were using the method previously to obtain the parent - document's id via `collectionReference.parent().id`, - you will have to use `collectionReference.parent().documentID` now. -* Added `DocumentReference.parent`. - -## 0.11.0+2 - -* Remove iOS dependency on Firebase/Database and Firebase/Auth CocoaPods. - -## 0.11.0+1 - -* Update iOS CocoaPod dependencies to '~> 6.0' to ensure support for `FieldValue.increment`. - -## 0.11.0 - -* Update Android dependencies to latest. - -## 0.10.1 - -* Support for `startAtDocument`, `startAfterDocument`, `endAtDocument`, `endBeforeDocument`. -* Added additional unit and integration tests. - -## 0.10.0 - -* Support for `FieldValue.increment`. -* Remove `FieldValue.type` and `FieldValue.value` from public API. -* Additional integration testing. - -## 0.9.13+1 - -* Added an integration test for transactions. - -## 0.9.13 - -* Remove Gradle BoM to avoid Gradle version issues. - -## 0.9.12 - -* Move Android dependency to Gradle BoM to help maintain compatibility - with other FlutterFire plugins. - -## 0.9.11 - -* Bump Android dependencies to latest. - -# 0.9.10 - -* Support for cloud_firestore running in the background on Android. -* Fixed a bug in cleanup for DocumentReference.snapshots(). -* Additional integration testing. - -## 0.9.9 - -* Remove `invokeMapMethod` calls to prevent crash. - -## 0.9.8 - -* Add metadata field to DocumentSnapshot. - -## 0.9.7+2 - -* Bump the minimum Flutter version to 1.2.0. -* Add template type parameter to `invokeMethod` calls. - -## 0.9.7+1 - -* Update README with example of getting a document. - -## 0.9.7 - -* Fixes a NoSuchMethodError when using getDocuments on iOS (introduced in 0.9.6). -* Adds a driver test for getDocuments. - -## 0.9.6 - -* On iOS, update null checking to match the recommended pattern usage in the Firebase documentation. -* Fixes a case where snapshot errors might result in plugin crash. - -## 0.9.5+2 - -* Fixing PlatformException(Error 0, null, null) which happened when a successful operation was performed. - -## 0.9.5+1 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.9.5 - -* Fix an issue on some iOS devices that results in reading incorrect dates. - -## 0.9.4 - -* No longer sends empty snapshot events on iOS when encountering errors. - -## 0.9.3 - -* Fix transactions on iOS when getting snapshot that doesn't exist. - -## 0.9.2 - -* Fix IllegalStateException errors when using transactions on Android. - -## 0.9.1 - -* Fixed Firebase multiple app support in transactions and document snapshots. - -## 0.9.0+2 - -* Remove categories. - -## 0.9.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.9.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.8.2+3 - -* Resolved "explicit self reference" and "loses accuracy" compiler warnings. - -## 0.8.2+2 - -* Clean up Android build logs. @SuppressWarnings("unchecked") - -## 0.8.2+1 - -* Avoid crash in document snapshot callback. - -## 0.8.2 - -* Added `Firestore.settings` -* Added `Timestamp` class - -## 0.8.1+1 - -* Bump Android dependencies to latest. - -## 0.8.1 - -* Fixed bug where updating arrays in with `FieldValue` always throws an Exception on Android. - -## 0.8.0 - -Note: this version depends on features available in iOS SDK versions 5.5.0 or later. -To update iOS SDK in existing projects run `pod update Firebase/Firestore`. - -* Added `Firestore.enablePersistence` -* Added `FieldValue` with all currently supported values: `arrayUnion`, `arrayRemove`, `delete` and - `serverTimestamp`. -* Added `arrayContains` argument in `Query.where` method. - -## 0.7.4 - -* Bump Android and Firebase dependency versions. - -## 0.7.3 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.7.2 - -* Fixes crash on Android if a FirebaseFirestoreException happened. - -## 0.7.1 - -* Updated iOS implementation to reflect Firebase API changes. -* Fixed bug in Transaction.get that would fail on no data. -* Fixed error in README.md code sample. - -## 0.7.0+2 - -* Update transactions example in README to add `await`. - -## 0.7.0+1 - -* Add transactions example to README. - -## 0.7.0 - -* **Breaking change**. `snapshots` is now a method instead of a getter. -* **Breaking change**. `setData` uses named arguments instead of `SetOptions`. - -## 0.6.3 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.6.2 - -* Support for BLOB data type. - -## 0.6.1 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.6.0 - -* **Breaking change**. Renamed 'getCollection()' to 'collection().' - -## 0.5.1 - -* Expose the Firebase app corresponding to a Firestore -* Expose a constructor for a Firestore with a non-default Firebase app - -## 0.5.0 - -* **Breaking change**. Move path getter to CollectionReference -* Add id getter to CollectionReference - -## 0.4.0 - -* **Breaking change**. Hide Firestore codec class from public API. -* Adjusted Flutter SDK constraint to match Flutter release with extensible - platform message codec, required already by version 0.3.1. -* Move each class into separate files - -## 0.3.2 - -* Support for batched writes. - -## 0.3.1 - -* Add GeoPoint class -* Allow for reading and writing DocumentReference, DateTime, and GeoPoint - values from and to Documents. - -## 0.3.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.2.12 - -* Fix handling of `null` document snapshots (document not exists). -* Add `DocumentSnapshot.exists`. - -## 0.2.11 -* Fix Dart 2 type errors. - -## 0.2.10 -* Fix Dart 2 type errors. - -## 0.2.9 -* Relax sdk upper bound constraint to '<2.0.0' to allow 'edge' dart sdk use. - -## 0.2.8 -* Support for Query.getDocuments - -## 0.2.7 - -* Add transaction support. - -## 0.2.6 - -* Build fixes for iOS -* Null checking in newly added Query methods - -## 0.2.5 - -* Query can now have more than one orderBy field. -* startAt, startAfter, endAt, and endBefore support -* limit support - -## 0.2.4 - -* Support for DocumentReference.documentID -* Support for CollectionReference.add - -## 0.2.3 - -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.2.2 - -* Add `get` to DocumentReference. - -## 0.2.1 - -* Fix bug on Android where removeListener is sometimes called without a handle - -## 0.2.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). -* Relaxed GMS dependency to [11.4.0,12.0[ - -## 0.1.2 - -* Support for `DocumentReference` update and merge writes -* Suppress unchecked warnings and package name warnings on Android - -## 0.1.1 - -* Added FLT prefix to iOS types. - -## 0.1.0 - -* Added reference to DocumentSnapshot -* Breaking: removed path from DocumentSnapshot -* Additional test coverage for reading collections and documents -* Fixed typo in DocumentChange documentation - -## 0.0.6 - -* Support for getCollection - -## 0.0.5 - -* Support `isNull` filtering in `Query.where` -* Fixed `DocumentChange.oldIndex` and `DocumentChange.newIndex` to be signed - integers (iOS) - -## 0.0.4 - -* Support for where clauses -* Support for deletion - -## 0.0.3 - -* Renamed package to cloud_firestore - -## 0.0.2 - -* Add path property to DocumentSnapshot - -## 0.0.1+1 - -* Update project homepage - -## 0.0.1 - -* Initial Release diff --git a/packages/cloud_firestore/LICENSE b/packages/cloud_firestore/LICENSE deleted file mode 100755 index 5b8ff6261110..000000000000 --- a/packages/cloud_firestore/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright 2017, the Chromium project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/cloud_firestore/README.md b/packages/cloud_firestore/README.md deleted file mode 100755 index c34e2fa4709e..000000000000 --- a/packages/cloud_firestore/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# Cloud Firestore Plugin for Flutter - -A Flutter plugin to use the [Cloud Firestore API](https://firebase.google.com/docs/firestore/). - -[![pub package](https://img.shields.io/pub/v/cloud_firestore.svg)](https://pub.dartlang.org/packages/cloud_firestore) - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Setup - -To use this plugin: - -1. Using the [Firebase Console](http://console.firebase.google.com/), add an Android app to your project: -Follow the assistant, download the generated google-services.json file and place it inside android/app. Next, -modify the android/build.gradle file and the android/app/build.gradle file to add the Google services plugin -as described by the Firebase assistant. Ensure that your `android/build.gradle` file contains the -`maven.google.com` as [described here](https://firebase.google.com/docs/android/setup#add_the_sdk). -1. Using the [Firebase Console](http://console.firebase.google.com/), add an iOS app to your project: -Follow the assistant, download the generated GoogleService-Info.plist file, open ios/Runner.xcworkspace -with Xcode, and within Xcode place the file inside ios/Runner. Don't follow the steps named -"Add Firebase SDK" and "Add initialization code" in the Firebase assistant. -1. Add `cloud_firestore` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). - -## Usage - -```dart -import 'package:cloud_firestore/cloud_firestore.dart'; -``` - -Adding a new `DocumentReference`: - -```dart -Firestore.instance.collection('books').document() - .setData({ 'title': 'title', 'author': 'author' }); -``` - -Binding a `CollectionReference` to a `ListView`: - -```dart -class BookList extends StatelessWidget { - @override - Widget build(BuildContext context) { - return StreamBuilder( - stream: Firestore.instance.collection('books').snapshots(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasError) - return new Text('Error: ${snapshot.error}'); - switch (snapshot.connectionState) { - case ConnectionState.waiting: return new Text('Loading...'); - default: - return new ListView( - children: snapshot.data.documents.map((DocumentSnapshot document) { - return new ListTile( - title: new Text(document['title']), - subtitle: new Text(document['author']), - ); - }).toList(), - ); - } - }, - ); - } -} -``` - -Performing a query: -```dart -Firestore.instance - .collection('talks') - .where("topic", isEqualTo: "flutter") - .snapshots() - .listen((data) => - data.documents.forEach((doc) => print(doc["title"]))); -``` - -Get a specific document: - -```dart -Firestore.instance - .collection('talks') - .document('document-name') - .get() - .then((DocumentSnapshot ds) { - // use ds as a snapshot - }); -``` - -Running a transaction: - -```dart -final DocumentReference postRef = Firestore.instance.document('posts/123'); -Firestore.instance.runTransaction((Transaction tx) async { - DocumentSnapshot postSnapshot = await tx.get(postRef); - if (postSnapshot.exists) { - await tx.update(postRef, {'likesCount': postSnapshot.data['likesCount'] + 1}); - } -}); -``` - -## Getting Started - -See the `example` directory for a complete sample app using Cloud Firestore. diff --git a/packages/cloud_firestore/android/build.gradle b/packages/cloud_firestore/android/build.gradle deleted file mode 100755 index c6198f3a37ba..000000000000 --- a/packages/cloud_firestore/android/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -def PLUGIN = "cloud_firestore"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebase.cloudfirestore' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - mavenLocal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-firestore:19.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/cloud_firestore/android/settings.gradle b/packages/cloud_firestore/android/settings.gradle deleted file mode 100755 index caf10656889a..000000000000 --- a/packages/cloud_firestore/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'cloud_firestore' diff --git a/packages/cloud_firestore/android/src/main/AndroidManifest.xml b/packages/cloud_firestore/android/src/main/AndroidManifest.xml deleted file mode 100755 index b7effa8ac694..000000000000 --- a/packages/cloud_firestore/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java b/packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java deleted file mode 100644 index e13697ab4c7d..000000000000 --- a/packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java +++ /dev/null @@ -1,900 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.cloudfirestore; - -import android.app.Activity; -import android.os.AsyncTask; -import android.util.Log; -import android.util.SparseArray; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.android.gms.tasks.Task; -import com.google.android.gms.tasks.TaskCompletionSource; -import com.google.android.gms.tasks.Tasks; -import com.google.firebase.FirebaseApp; -import com.google.firebase.Timestamp; -import com.google.firebase.firestore.Blob; -import com.google.firebase.firestore.CollectionReference; -import com.google.firebase.firestore.DocumentChange; -import com.google.firebase.firestore.DocumentReference; -import com.google.firebase.firestore.DocumentSnapshot; -import com.google.firebase.firestore.EventListener; -import com.google.firebase.firestore.FieldPath; -import com.google.firebase.firestore.FieldValue; -import com.google.firebase.firestore.FirebaseFirestore; -import com.google.firebase.firestore.FirebaseFirestoreException; -import com.google.firebase.firestore.FirebaseFirestoreSettings; -import com.google.firebase.firestore.GeoPoint; -import com.google.firebase.firestore.ListenerRegistration; -import com.google.firebase.firestore.MetadataChanges; -import com.google.firebase.firestore.Query; -import com.google.firebase.firestore.QuerySnapshot; -import com.google.firebase.firestore.SetOptions; -import com.google.firebase.firestore.Source; -import com.google.firebase.firestore.Transaction; -import com.google.firebase.firestore.WriteBatch; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugin.common.StandardMessageCodec; -import io.flutter.plugin.common.StandardMethodCodec; -import java.io.ByteArrayOutputStream; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -public class CloudFirestorePlugin implements MethodCallHandler { - - private static final String TAG = "CloudFirestorePlugin"; - private final MethodChannel channel; - private final Activity activity; - - // Handles are ints used as indexes into the sparse array of active observers - private int nextListenerHandle = 0; - private int nextBatchHandle = 0; - private final SparseArray observers = new SparseArray<>(); - private final SparseArray documentObservers = new SparseArray<>(); - private final SparseArray listenerRegistrations = new SparseArray<>(); - private final SparseArray batches = new SparseArray<>(); - private final SparseArray transactions = new SparseArray<>(); - private final SparseArray completionTasks = new SparseArray<>(); - - public static void registerWith(PluginRegistry.Registrar registrar) { - final MethodChannel channel = - new MethodChannel( - registrar.messenger(), - "plugins.flutter.io/cloud_firestore", - new StandardMethodCodec(FirestoreMessageCodec.INSTANCE)); - channel.setMethodCallHandler(new CloudFirestorePlugin(channel, registrar.activity())); - } - - private CloudFirestorePlugin(MethodChannel channel, Activity activity) { - this.channel = channel; - this.activity = activity; - } - - private FirebaseFirestore getFirestore(Map arguments) { - String appName = (String) arguments.get("app"); - return FirebaseFirestore.getInstance(FirebaseApp.getInstance(appName)); - } - - private Query getReference(Map arguments) { - if ((boolean) arguments.get("isCollectionGroup")) return getCollectionGroupReference(arguments); - else return getCollectionReference(arguments); - } - - private Query getCollectionGroupReference(Map arguments) { - String path = (String) arguments.get("path"); - return getFirestore(arguments).collectionGroup(path); - } - - private CollectionReference getCollectionReference(Map arguments) { - String path = (String) arguments.get("path"); - return getFirestore(arguments).collection(path); - } - - private DocumentReference getDocumentReference(Map arguments) { - String path = (String) arguments.get("path"); - return getFirestore(arguments).document(path); - } - - private Source getSource(Map arguments) { - String source = (String) arguments.get("source"); - switch (source) { - case "server": - return Source.SERVER; - case "cache": - return Source.CACHE; - default: - return Source.DEFAULT; - } - } - - private Object[] getDocumentValues( - Map document, List> orderBy, Map arguments) { - String documentId = (String) document.get("id"); - Map documentData = (Map) document.get("data"); - List data = new ArrayList<>(); - if (orderBy != null) { - for (List order : orderBy) { - String orderByFieldName = (String) order.get(0); - if (orderByFieldName.contains(".")) { - String[] fieldNameParts = orderByFieldName.split("\\."); - Map current = (Map) documentData.get(fieldNameParts[0]); - for (int i = 1; i < fieldNameParts.length - 1; i++) { - current = (Map) current.get(fieldNameParts[i]); - } - data.add(current.get(fieldNameParts[fieldNameParts.length - 1])); - } else { - data.add(documentData.get(orderByFieldName)); - } - } - } - data.add((boolean) arguments.get("isCollectionGroup") ? document.get("path") : documentId); - return data.toArray(); - } - - private Map parseQuerySnapshot(QuerySnapshot querySnapshot) { - if (querySnapshot == null) return new HashMap<>(); - Map data = new HashMap<>(); - List paths = new ArrayList<>(); - List> documents = new ArrayList<>(); - List> metadatas = new ArrayList<>(); - for (DocumentSnapshot document : querySnapshot.getDocuments()) { - paths.add(document.getReference().getPath()); - documents.add(document.getData()); - Map metadata = new HashMap(); - metadata.put("hasPendingWrites", document.getMetadata().hasPendingWrites()); - metadata.put("isFromCache", document.getMetadata().isFromCache()); - metadatas.add(metadata); - } - data.put("paths", paths); - data.put("documents", documents); - data.put("metadatas", metadatas); - - List> documentChanges = new ArrayList<>(); - for (DocumentChange documentChange : querySnapshot.getDocumentChanges()) { - Map change = new HashMap<>(); - String type = null; - switch (documentChange.getType()) { - case ADDED: - type = "DocumentChangeType.added"; - break; - case MODIFIED: - type = "DocumentChangeType.modified"; - break; - case REMOVED: - type = "DocumentChangeType.removed"; - break; - } - change.put("type", type); - change.put("oldIndex", documentChange.getOldIndex()); - change.put("newIndex", documentChange.getNewIndex()); - change.put("document", documentChange.getDocument().getData()); - change.put("path", documentChange.getDocument().getReference().getPath()); - Map metadata = new HashMap(); - metadata.put( - "hasPendingWrites", documentChange.getDocument().getMetadata().hasPendingWrites()); - metadata.put("isFromCache", documentChange.getDocument().getMetadata().isFromCache()); - change.put("metadata", metadata); - documentChanges.add(change); - } - data.put("documentChanges", documentChanges); - - Map metadata = new HashMap<>(); - metadata.put("hasPendingWrites", querySnapshot.getMetadata().hasPendingWrites()); - metadata.put("isFromCache", querySnapshot.getMetadata().isFromCache()); - data.put("metadata", metadata); - - return data; - } - - private Transaction getTransaction(Map arguments) { - return transactions.get((Integer) arguments.get("transactionId")); - } - - private Query getQuery(Map arguments) { - Query query = getReference(arguments); - @SuppressWarnings("unchecked") - Map parameters = (Map) arguments.get("parameters"); - if (parameters == null) return query; - @SuppressWarnings("unchecked") - List> whereConditions = (List>) parameters.get("where"); - for (List condition : whereConditions) { - String fieldName = (String) condition.get(0); - String operator = (String) condition.get(1); - Object value = condition.get(2); - if ("==".equals(operator)) { - query = query.whereEqualTo(fieldName, value); - } else if ("<".equals(operator)) { - query = query.whereLessThan(fieldName, value); - } else if ("<=".equals(operator)) { - query = query.whereLessThanOrEqualTo(fieldName, value); - } else if (">".equals(operator)) { - query = query.whereGreaterThan(fieldName, value); - } else if (">=".equals(operator)) { - query = query.whereGreaterThanOrEqualTo(fieldName, value); - } else if ("array-contains".equals(operator)) { - query = query.whereArrayContains(fieldName, value); - } else { - // Invalid operator. - } - } - @SuppressWarnings("unchecked") - Number limit = (Number) parameters.get("limit"); - if (limit != null) query = query.limit(limit.longValue()); - @SuppressWarnings("unchecked") - List> orderBy = (List>) parameters.get("orderBy"); - if (orderBy == null) return query; - for (List order : orderBy) { - String orderByFieldName = (String) order.get(0); - boolean descending = (boolean) order.get(1); - Query.Direction direction = - descending ? Query.Direction.DESCENDING : Query.Direction.ASCENDING; - query = query.orderBy(orderByFieldName, direction); - } - @SuppressWarnings("unchecked") - Map startAtDocument = (Map) parameters.get("startAtDocument"); - @SuppressWarnings("unchecked") - Map startAfterDocument = - (Map) parameters.get("startAfterDocument"); - @SuppressWarnings("unchecked") - Map endAtDocument = (Map) parameters.get("endAtDocument"); - @SuppressWarnings("unchecked") - Map endBeforeDocument = - (Map) parameters.get("endBeforeDocument"); - if (startAtDocument != null - || startAfterDocument != null - || endAtDocument != null - || endBeforeDocument != null) { - boolean descending = (boolean) orderBy.get(orderBy.size() - 1).get(1); - Query.Direction direction = - descending ? Query.Direction.DESCENDING : Query.Direction.ASCENDING; - query = query.orderBy(FieldPath.documentId(), direction); - } - if (startAtDocument != null) { - query = query.startAt(getDocumentValues(startAtDocument, orderBy, arguments)); - } - if (startAfterDocument != null) { - query = query.startAfter(getDocumentValues(startAfterDocument, orderBy, arguments)); - } - @SuppressWarnings("unchecked") - List startAt = (List) parameters.get("startAt"); - if (startAt != null) query = query.startAt(startAt.toArray()); - @SuppressWarnings("unchecked") - List startAfter = (List) parameters.get("startAfter"); - if (startAfter != null) query = query.startAfter(startAfter.toArray()); - if (endAtDocument != null) { - query = query.endAt(getDocumentValues(endAtDocument, orderBy, arguments)); - } - if (endBeforeDocument != null) { - query = query.endBefore(getDocumentValues(endBeforeDocument, orderBy, arguments)); - } - @SuppressWarnings("unchecked") - List endAt = (List) parameters.get("endAt"); - if (endAt != null) query = query.endAt(endAt.toArray()); - @SuppressWarnings("unchecked") - List endBefore = (List) parameters.get("endBefore"); - if (endBefore != null) query = query.endBefore(endBefore.toArray()); - return query; - } - - private class DocumentObserver implements EventListener { - private int handle; - - DocumentObserver(int handle) { - this.handle = handle; - } - - @Override - public void onEvent(DocumentSnapshot documentSnapshot, FirebaseFirestoreException e) { - if (e != null) { - // TODO: send error - System.out.println(e); - return; - } - Map arguments = new HashMap<>(); - Map metadata = new HashMap<>(); - arguments.put("handle", handle); - metadata.put("hasPendingWrites", documentSnapshot.getMetadata().hasPendingWrites()); - metadata.put("isFromCache", documentSnapshot.getMetadata().isFromCache()); - arguments.put("metadata", metadata); - if (documentSnapshot.exists()) { - arguments.put("data", documentSnapshot.getData()); - arguments.put("path", documentSnapshot.getReference().getPath()); - } else { - arguments.put("data", null); - arguments.put("path", documentSnapshot.getReference().getPath()); - } - channel.invokeMethod("DocumentSnapshot", arguments); - } - } - - private class EventObserver implements EventListener { - private int handle; - - EventObserver(int handle) { - this.handle = handle; - } - - @Override - public void onEvent(QuerySnapshot querySnapshot, FirebaseFirestoreException e) { - if (e != null) { - // TODO: send error - System.out.println(e); - return; - } - - Map arguments = parseQuerySnapshot(querySnapshot); - arguments.put("handle", handle); - - channel.invokeMethod("QuerySnapshot", arguments); - } - } - - private void addDefaultListeners(final String description, Task task, final Result result) { - task.addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(Void ignored) { - result.success(null); - } - }); - task.addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("Error performing " + description, e.getMessage(), null); - } - }); - } - - @Override - public void onMethodCall(MethodCall call, final Result result) { - switch (call.method) { - case "Firestore#runTransaction": - { - final TaskCompletionSource> transactionTCS = - new TaskCompletionSource<>(); - final Task> transactionTCSTask = transactionTCS.getTask(); - - final Map arguments = call.arguments(); - getFirestore(arguments) - .runTransaction( - new Transaction.Function>() { - @Nullable - @Override - public Map apply(@NonNull Transaction transaction) { - // Store transaction. - int transactionId = (Integer) arguments.get("transactionId"); - transactions.append(transactionId, transaction); - completionTasks.append(transactionId, transactionTCS); - - // Start operations on Dart side. - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - channel.invokeMethod( - "DoTransaction", - arguments, - new Result() { - @SuppressWarnings("unchecked") - @Override - public void success(Object doTransactionResult) { - transactionTCS.trySetResult( - (Map) doTransactionResult); - } - - @Override - public void error( - String errorCode, - String errorMessage, - Object errorDetails) { - transactionTCS.trySetException( - new Exception("DoTransaction failed: " + errorMessage)); - } - - @Override - public void notImplemented() { - transactionTCS.trySetException( - new Exception("DoTransaction not implemented")); - } - }); - } - }); - - // Wait till transaction is complete. - try { - String timeoutKey = "transactionTimeout"; - long timeout = ((Number) arguments.get(timeoutKey)).longValue(); - final Map transactionResult = - Tasks.await(transactionTCSTask, timeout, TimeUnit.MILLISECONDS); - - // Once transaction completes return the result to the Dart side. - return transactionResult; - } catch (Exception e) { - Log.e(TAG, e.getMessage(), e); - result.error("Error performing transaction", e.getMessage(), null); - } - return null; - } - }) - .addOnCompleteListener( - new OnCompleteListener>() { - @Override - public void onComplete(Task> task) { - if (task.isSuccessful()) { - result.success(task.getResult()); - } else { - result.error( - "Error performing transaction", task.getException().getMessage(), null); - } - } - }); - break; - } - case "Transaction#get": - { - final Map arguments = call.arguments(); - final Transaction transaction = getTransaction(arguments); - new AsyncTask() { - @Override - protected Void doInBackground(Void... voids) { - try { - DocumentSnapshot documentSnapshot = - transaction.get(getDocumentReference(arguments)); - final Map snapshotMap = new HashMap<>(); - snapshotMap.put("path", documentSnapshot.getReference().getPath()); - if (documentSnapshot.exists()) { - snapshotMap.put("data", documentSnapshot.getData()); - } else { - snapshotMap.put("data", null); - } - Map metadata = new HashMap(); - metadata.put("hasPendingWrites", documentSnapshot.getMetadata().hasPendingWrites()); - metadata.put("isFromCache", documentSnapshot.getMetadata().isFromCache()); - snapshotMap.put("metadata", metadata); - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - result.success(snapshotMap); - } - }); - } catch (final FirebaseFirestoreException e) { - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - result.error("Error performing Transaction#get", e.getMessage(), null); - } - }); - } - return null; - } - }.execute(); - break; - } - case "Transaction#update": - { - final Map arguments = call.arguments(); - final Transaction transaction = getTransaction(arguments); - new AsyncTask() { - @SuppressWarnings("unchecked") - @Override - protected Void doInBackground(Void... voids) { - Map data = (Map) arguments.get("data"); - try { - transaction.update(getDocumentReference(arguments), data); - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - result.success(null); - } - }); - } catch (final IllegalStateException e) { - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - result.error("Error performing Transaction#update", e.getMessage(), null); - } - }); - } - return null; - } - }.execute(); - break; - } - case "Transaction#set": - { - final Map arguments = call.arguments(); - final Transaction transaction = getTransaction(arguments); - new AsyncTask() { - @SuppressWarnings("unchecked") - @Override - protected Void doInBackground(Void... voids) { - Map data = (Map) arguments.get("data"); - transaction.set(getDocumentReference(arguments), data); - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - result.success(null); - } - }); - return null; - } - }.execute(); - break; - } - case "Transaction#delete": - { - final Map arguments = call.arguments(); - final Transaction transaction = getTransaction(arguments); - new AsyncTask() { - @Override - protected Void doInBackground(Void... voids) { - transaction.delete(getDocumentReference(arguments)); - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - result.success(null); - } - }); - return null; - } - }.execute(); - break; - } - case "WriteBatch#create": - { - int handle = nextBatchHandle++; - final Map arguments = call.arguments(); - WriteBatch batch = getFirestore(arguments).batch(); - batches.put(handle, batch); - result.success(handle); - break; - } - case "WriteBatch#setData": - { - Map arguments = call.arguments(); - int handle = (Integer) arguments.get("handle"); - DocumentReference reference = getDocumentReference(arguments); - @SuppressWarnings("unchecked") - Map options = (Map) arguments.get("options"); - WriteBatch batch = batches.get(handle); - if (options != null && (boolean) options.get("merge")) { - batch.set(reference, arguments.get("data"), SetOptions.merge()); - } else { - batch.set(reference, arguments.get("data")); - } - result.success(null); - break; - } - case "WriteBatch#updateData": - { - Map arguments = call.arguments(); - int handle = (Integer) arguments.get("handle"); - DocumentReference reference = getDocumentReference(arguments); - @SuppressWarnings("unchecked") - Map data = (Map) arguments.get("data"); - WriteBatch batch = batches.get(handle); - batch.update(reference, data); - result.success(null); - break; - } - case "WriteBatch#delete": - { - Map arguments = call.arguments(); - int handle = (Integer) arguments.get("handle"); - DocumentReference reference = getDocumentReference(arguments); - WriteBatch batch = batches.get(handle); - batch.delete(reference); - result.success(null); - break; - } - case "WriteBatch#commit": - { - Map arguments = call.arguments(); - int handle = (Integer) arguments.get("handle"); - WriteBatch batch = batches.get(handle); - Task task = batch.commit(); - batches.delete(handle); - addDefaultListeners("commit", task, result); - break; - } - case "Query#addSnapshotListener": - { - Map arguments = call.arguments(); - int handle = nextListenerHandle++; - EventObserver observer = new EventObserver(handle); - observers.put(handle, observer); - MetadataChanges metadataChanges = - (Boolean) arguments.get("includeMetadataChanges") - ? MetadataChanges.INCLUDE - : MetadataChanges.EXCLUDE; - listenerRegistrations.put( - handle, getQuery(arguments).addSnapshotListener(metadataChanges, observer)); - result.success(handle); - break; - } - case "DocumentReference#addSnapshotListener": - { - Map arguments = call.arguments(); - int handle = nextListenerHandle++; - DocumentObserver observer = new DocumentObserver(handle); - documentObservers.put(handle, observer); - MetadataChanges metadataChanges = - (Boolean) arguments.get("includeMetadataChanges") - ? MetadataChanges.INCLUDE - : MetadataChanges.EXCLUDE; - listenerRegistrations.put( - handle, - getDocumentReference(arguments).addSnapshotListener(metadataChanges, observer)); - result.success(handle); - break; - } - case "removeListener": - { - Map arguments = call.arguments(); - int handle = (Integer) arguments.get("handle"); - listenerRegistrations.get(handle).remove(); - listenerRegistrations.remove(handle); - observers.remove(handle); - result.success(null); - break; - } - case "Query#getDocuments": - { - Map arguments = call.arguments(); - Query query = getQuery(arguments); - Source source = getSource(arguments); - Task task = query.get(source); - task.addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(QuerySnapshot querySnapshot) { - result.success(parseQuerySnapshot(querySnapshot)); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("Error performing getDocuments", e.getMessage(), null); - } - }); - break; - } - case "DocumentReference#setData": - { - Map arguments = call.arguments(); - DocumentReference documentReference = getDocumentReference(arguments); - @SuppressWarnings("unchecked") - Map options = (Map) arguments.get("options"); - @SuppressWarnings("unchecked") - Map data = (Map) arguments.get("data"); - Task task; - if (options != null && (boolean) options.get("merge")) { - task = documentReference.set(data, SetOptions.merge()); - } else { - task = documentReference.set(data); - } - addDefaultListeners("setData", task, result); - break; - } - case "DocumentReference#updateData": - { - Map arguments = call.arguments(); - DocumentReference documentReference = getDocumentReference(arguments); - @SuppressWarnings("unchecked") - Map data = (Map) arguments.get("data"); - Task task = documentReference.update(data); - addDefaultListeners("updateData", task, result); - break; - } - case "DocumentReference#get": - { - Map arguments = call.arguments(); - DocumentReference documentReference = getDocumentReference(arguments); - Source source = getSource(arguments); - Task task = documentReference.get(source); - task.addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(DocumentSnapshot documentSnapshot) { - Map snapshotMap = new HashMap<>(); - Map metadata = new HashMap<>(); - metadata.put( - "hasPendingWrites", documentSnapshot.getMetadata().hasPendingWrites()); - metadata.put("isFromCache", documentSnapshot.getMetadata().isFromCache()); - snapshotMap.put("metadata", metadata); - snapshotMap.put("path", documentSnapshot.getReference().getPath()); - if (documentSnapshot.exists()) { - snapshotMap.put("data", documentSnapshot.getData()); - } else { - snapshotMap.put("data", null); - } - result.success(snapshotMap); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("Error performing get", e.getMessage(), null); - } - }); - break; - } - case "DocumentReference#delete": - { - Map arguments = call.arguments(); - DocumentReference documentReference = getDocumentReference(arguments); - Task task = documentReference.delete(); - addDefaultListeners("delete", task, result); - break; - } - case "Firestore#enablePersistence": - { - Map arguments = call.arguments(); - boolean enable = (boolean) arguments.get("enable"); - FirebaseFirestoreSettings.Builder builder = new FirebaseFirestoreSettings.Builder(); - builder.setPersistenceEnabled(enable); - FirebaseFirestoreSettings settings = builder.build(); - getFirestore(arguments).setFirestoreSettings(settings); - result.success(null); - break; - } - case "Firestore#settings": - { - final Map arguments = call.arguments(); - final FirebaseFirestoreSettings.Builder builder = new FirebaseFirestoreSettings.Builder(); - - if (arguments.get("persistenceEnabled") != null) { - builder.setPersistenceEnabled((boolean) arguments.get("persistenceEnabled")); - } - - if (arguments.get("host") != null) { - builder.setHost((String) arguments.get("host")); - } - - if (arguments.get("sslEnabled") != null) { - builder.setSslEnabled((boolean) arguments.get("sslEnabled")); - } - - if (arguments.get("timestampsInSnapshotsEnabled") != null) { - builder.setTimestampsInSnapshotsEnabled( - (boolean) arguments.get("timestampsInSnapshotsEnabled")); - } - - if (arguments.get("cacheSizeBytes") != null) { - builder.setCacheSizeBytes(((Integer) arguments.get("cacheSizeBytes")).longValue()); - } - - FirebaseFirestoreSettings settings = builder.build(); - getFirestore(arguments).setFirestoreSettings(settings); - result.success(null); - break; - } - default: - { - result.notImplemented(); - break; - } - } - } -} - -final class FirestoreMessageCodec extends StandardMessageCodec { - public static final FirestoreMessageCodec INSTANCE = new FirestoreMessageCodec(); - private static final Charset UTF8 = Charset.forName("UTF8"); - private static final byte DATE_TIME = (byte) 128; - private static final byte GEO_POINT = (byte) 129; - private static final byte DOCUMENT_REFERENCE = (byte) 130; - private static final byte BLOB = (byte) 131; - private static final byte ARRAY_UNION = (byte) 132; - private static final byte ARRAY_REMOVE = (byte) 133; - private static final byte DELETE = (byte) 134; - private static final byte SERVER_TIMESTAMP = (byte) 135; - private static final byte TIMESTAMP = (byte) 136; - private static final byte INCREMENT_DOUBLE = (byte) 137; - private static final byte INCREMENT_INTEGER = (byte) 138; - - @Override - protected void writeValue(ByteArrayOutputStream stream, Object value) { - if (value instanceof Date) { - stream.write(DATE_TIME); - writeLong(stream, ((Date) value).getTime()); - } else if (value instanceof Timestamp) { - stream.write(TIMESTAMP); - writeLong(stream, ((Timestamp) value).getSeconds()); - writeInt(stream, ((Timestamp) value).getNanoseconds()); - } else if (value instanceof GeoPoint) { - stream.write(GEO_POINT); - writeAlignment(stream, 8); - writeDouble(stream, ((GeoPoint) value).getLatitude()); - writeDouble(stream, ((GeoPoint) value).getLongitude()); - } else if (value instanceof DocumentReference) { - stream.write(DOCUMENT_REFERENCE); - writeBytes( - stream, ((DocumentReference) value).getFirestore().getApp().getName().getBytes(UTF8)); - writeBytes(stream, ((DocumentReference) value).getPath().getBytes(UTF8)); - } else if (value instanceof Blob) { - stream.write(BLOB); - writeBytes(stream, ((Blob) value).toBytes()); - } else { - super.writeValue(stream, value); - } - } - - @Override - protected Object readValueOfType(byte type, ByteBuffer buffer) { - switch (type) { - case DATE_TIME: - return new Date(buffer.getLong()); - case TIMESTAMP: - return new Timestamp(buffer.getLong(), buffer.getInt()); - case GEO_POINT: - readAlignment(buffer, 8); - return new GeoPoint(buffer.getDouble(), buffer.getDouble()); - case DOCUMENT_REFERENCE: - final byte[] appNameBytes = readBytes(buffer); - String appName = new String(appNameBytes, UTF8); - final FirebaseFirestore firestore = - FirebaseFirestore.getInstance(FirebaseApp.getInstance(appName)); - final byte[] pathBytes = readBytes(buffer); - final String path = new String(pathBytes, UTF8); - return firestore.document(path); - case BLOB: - final byte[] bytes = readBytes(buffer); - return Blob.fromBytes(bytes); - case ARRAY_UNION: - return FieldValue.arrayUnion(toArray(readValue(buffer))); - case ARRAY_REMOVE: - return FieldValue.arrayRemove(toArray(readValue(buffer))); - case DELETE: - return FieldValue.delete(); - case SERVER_TIMESTAMP: - return FieldValue.serverTimestamp(); - case INCREMENT_INTEGER: - final Number integerIncrementValue = (Number) readValue(buffer); - return FieldValue.increment(integerIncrementValue.intValue()); - case INCREMENT_DOUBLE: - final Number doubleIncrementValue = (Number) readValue(buffer); - return FieldValue.increment(doubleIncrementValue.doubleValue()); - default: - return super.readValueOfType(type, buffer); - } - } - - private Object[] toArray(Object source) { - if (source instanceof List) { - return ((List) source).toArray(); - } - - if (source == null) { - return new Object[0]; - } - - String sourceType = source.getClass().getCanonicalName(); - String message = "java.util.List was expected, unable to convert '%s' to an object array"; - throw new IllegalArgumentException(String.format(message, sourceType)); - } -} diff --git a/packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/FlutterFirebaseAppRegistrar.java b/packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index c9d0c3c8db3d..000000000000 --- a/packages/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.cloudfirestore; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/cloud_firestore/android/user-agent.gradle b/packages/cloud_firestore/android/user-agent.gradle deleted file mode 100644 index a445384c1b89..000000000000 --- a/packages/cloud_firestore/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-fst" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/cloud_firestore/example/README.md b/packages/cloud_firestore/example/README.md deleted file mode 100755 index a85ddb780a74..000000000000 --- a/packages/cloud_firestore/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firestore_example - -Demonstrates how to use the firestore plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/cloud_firestore/example/android.iml b/packages/cloud_firestore/example/android.iml deleted file mode 100755 index 462b903e05b6..000000000000 --- a/packages/cloud_firestore/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/cloud_firestore/example/android/app/build.gradle b/packages/cloud_firestore/example/android/app/build.gradle deleted file mode 100755 index 335003e1414f..000000000000 --- a/packages/cloud_firestore/example/android/app/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId 'io.flutter.plugins.firebase.firestoreexample' - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - multiDexEnabled true - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/cloud_firestore/example/android/app/google-services.json b/packages/cloud_firestore/example/android/app/google-services.json deleted file mode 100644 index 5616df5cb338..000000000000 --- a/packages/cloud_firestore/example/android/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "159623150305", - "firebase_url": "https://flutter-firebase-plugins.firebaseio.com", - "project_id": "flutter-firebase-plugins", - "storage_bucket": "flutter-firebase-plugins.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:236f9daea101f77e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} diff --git a/packages/cloud_firestore/example/android/app/gradle.properties b/packages/cloud_firestore/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/cloud_firestore/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/cloud_firestore/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/cloud_firestore/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/cloud_firestore/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/cloud_firestore/example/android/app/src/main/AndroidManifest.xml b/packages/cloud_firestore/example/android/app/src/main/AndroidManifest.xml deleted file mode 100755 index d116d58dd97a..000000000000 --- a/packages/cloud_firestore/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/cloud_firestore/example/android/app/src/main/java/io/flutter/plugins/firebase/firestoreexample/MainActivity.java b/packages/cloud_firestore/example/android/app/src/main/java/io/flutter/plugins/firebase/firestoreexample/MainActivity.java deleted file mode 100644 index 3e63aa8619eb..000000000000 --- a/packages/cloud_firestore/example/android/app/src/main/java/io/flutter/plugins/firebase/firestoreexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.firestoreexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/cloud_firestore/example/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java b/packages/cloud_firestore/example/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java deleted file mode 100644 index 0c58e26a5c1b..000000000000 --- a/packages/cloud_firestore/example/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasedatabaseexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/cloud_firestore/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index db77bb4b7b09..000000000000 Binary files a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/cloud_firestore/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index 17987b79bb8a..000000000000 Binary files a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 09d4391482be..000000000000 Binary files a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index d5f1c8d34e7a..000000000000 Binary files a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 4d6372eebdb2..000000000000 Binary files a/packages/cloud_firestore/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_firestore/example/android/build.gradle b/packages/cloud_firestore/example/android/build.gradle deleted file mode 100755 index 695de848ec30..000000000000 --- a/packages/cloud_firestore/example/android/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - mavenLocal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/cloud_firestore/example/android/gradle.properties b/packages/cloud_firestore/example/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/cloud_firestore/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/cloud_firestore/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/cloud_firestore/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/cloud_firestore/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/cloud_firestore/example/android/settings.gradle b/packages/cloud_firestore/example/android/settings.gradle deleted file mode 100755 index 6cb349eef1b6..000000000000 --- a/packages/cloud_firestore/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} \ No newline at end of file diff --git a/packages/cloud_firestore/example/firestore_example.iml b/packages/cloud_firestore/example/firestore_example.iml deleted file mode 100755 index 1ae40a0f7f54..000000000000 --- a/packages/cloud_firestore/example/firestore_example.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist b/packages/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100755 index 6c2de8086bcd..000000000000 --- a/packages/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/cloud_firestore/example/ios/Flutter/Debug.xcconfig b/packages/cloud_firestore/example/ios/Flutter/Debug.xcconfig deleted file mode 100755 index 9803018ca79d..000000000000 --- a/packages/cloud_firestore/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/cloud_firestore/example/ios/Flutter/Release.xcconfig b/packages/cloud_firestore/example/ios/Flutter/Release.xcconfig deleted file mode 100755 index a4a8c604e13d..000000000000 --- a/packages/cloud_firestore/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj b/packages/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 80980c30cd85..000000000000 --- a/packages/cloud_firestore/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,500 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */; }; - 7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 840012C8B5EDBCF56B0E4AC1 /* Pods */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */, - 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */, - 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { - isa = PBXGroup; - children = ( - E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firestoreExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firestoreExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/cloud_firestore/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/cloud_firestore/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/cloud_firestore/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/cloud_firestore/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/cloud_firestore/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index 1c9580788197..000000000000 --- a/packages/cloud_firestore/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_firestore/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/cloud_firestore/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/cloud_firestore/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/cloud_firestore/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/cloud_firestore/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/cloud_firestore/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/cloud_firestore/example/ios/Runner/AppDelegate.h b/packages/cloud_firestore/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/cloud_firestore/example/ios/Runner/AppDelegate.m b/packages/cloud_firestore/example/ios/Runner/AppDelegate.m deleted file mode 100644 index a4b51c88eb60..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index d22f10b2ab63..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100755 index 28c6bf03016f..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100755 index f091b6b0bca8..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100755 index 4cde12118dda..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100755 index d0ef06e7edb8..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100755 index dcdc2306c285..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100755 index c8f9ed8f5cee..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100755 index 75b2d164a5a9..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100755 index c4df70d39da7..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100755 index 6a84f41e14e2..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100755 index d0e1f5853602..000000000000 Binary files a/packages/cloud_firestore/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/cloud_firestore/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/cloud_firestore/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100755 index ebf48f603974..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_firestore/example/ios/Runner/Base.lproj/Main.storyboard b/packages/cloud_firestore/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100755 index f3c28516fb38..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_firestore/example/ios/Runner/GoogleService-Info.plist b/packages/cloud_firestore/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 9edb534e78d8..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 159623150305-1iiqqggbff817a8bpnalo64nuc3qobid.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.159623150305-1iiqqggbff817a8bpnalo64nuc3qobid - API_KEY - AIzaSyDyzecVw1zXTpBKwfFHxpl7QyYBhimNhUk - GCM_SENDER_ID - 159623150305 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firestoreExample - PROJECT_ID - flutter-firebase-plugins - STORAGE_BUCKET - flutter-firebase-plugins.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:159623150305:ios:7e8aafdf0bd8d289 - DATABASE_URL - https://flutter-firebase-plugins.firebaseio.com - - diff --git a/packages/cloud_firestore/example/ios/Runner/Info.plist b/packages/cloud_firestore/example/ios/Runner/Info.plist deleted file mode 100755 index 4715632a5ee2..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firestore_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/cloud_firestore/example/ios/Runner/main.m b/packages/cloud_firestore/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/cloud_firestore/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/cloud_firestore/example/lib/main.dart b/packages/cloud_firestore/example/lib/main.dart deleted file mode 100755 index 30c1e2ce3036..000000000000 --- a/packages/cloud_firestore/example/lib/main.dart +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:cloud_firestore/cloud_firestore.dart'; - -Future main() async { - final FirebaseApp app = await FirebaseApp.configure( - name: 'test', - options: const FirebaseOptions( - googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd', - gcmSenderID: '79601577497', - apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU', - projectID: 'flutter-firestore', - ), - ); - final Firestore firestore = Firestore(app: app); - await firestore.settings(timestampsInSnapshotsEnabled: true); - - runApp(MaterialApp( - title: 'Firestore Example', home: MyHomePage(firestore: firestore))); -} - -class MessageList extends StatelessWidget { - MessageList({this.firestore}); - - final Firestore firestore; - - @override - Widget build(BuildContext context) { - return StreamBuilder( - stream: firestore.collection('messages').snapshots(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (!snapshot.hasData) return const Text('Loading...'); - final int messageCount = snapshot.data.documents.length; - return ListView.builder( - itemCount: messageCount, - itemBuilder: (_, int index) { - final DocumentSnapshot document = snapshot.data.documents[index]; - final dynamic message = document['message']; - return ListTile( - title: Text( - message != null ? message.toString() : '', - ), - subtitle: Text('Message ${index + 1} of $messageCount'), - ); - }, - ); - }, - ); - } -} - -class MyHomePage extends StatelessWidget { - MyHomePage({this.firestore}); - - final Firestore firestore; - - CollectionReference get messages => firestore.collection('messages'); - - Future _addMessage() async { - await messages.add({ - 'message': 'Hello world!', - 'created_at': FieldValue.serverTimestamp(), - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Firestore Example'), - ), - body: MessageList(firestore: firestore), - floatingActionButton: FloatingActionButton( - onPressed: _addMessage, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ); - } -} diff --git a/packages/cloud_firestore/example/pubspec.yaml b/packages/cloud_firestore/example/pubspec.yaml deleted file mode 100755 index 004c491062e9..000000000000 --- a/packages/cloud_firestore/example/pubspec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: firestore_example -description: Demonstrates how to use the firestore plugin. - -dependencies: - flutter: - sdk: flutter - cloud_firestore: - path: ../ - firebase_core: "^0.4.0" - -dev_dependencies: - flutter_driver: - sdk: flutter - test: any - -flutter: - uses-material-design: true diff --git a/packages/cloud_firestore/example/test_driver/cloud_firestore.dart b/packages/cloud_firestore/example/test_driver/cloud_firestore.dart deleted file mode 100644 index 2c984f7d6985..000000000000 --- a/packages/cloud_firestore/example/test_driver/cloud_firestore.dart +++ /dev/null @@ -1,297 +0,0 @@ -import 'dart:async'; - -import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$Firestore', () { - Firestore firestore; - Firestore firestoreWithSettings; - - setUp(() async { - final FirebaseOptions firebaseOptions = const FirebaseOptions( - googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd', - gcmSenderID: '79601577497', - apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU', - projectID: 'flutter-firestore', - ); - final FirebaseApp app = await FirebaseApp.configure( - name: 'test', - options: firebaseOptions, - ); - final FirebaseApp app2 = await FirebaseApp.configure( - name: 'test2', - options: firebaseOptions, - ); - firestore = Firestore(app: app); - firestoreWithSettings = Firestore(app: app2); - await firestoreWithSettings.settings( - persistenceEnabled: true, - host: null, - sslEnabled: true, - timestampsInSnapshotsEnabled: true, - cacheSizeBytes: 1048576, - ); - }); - - test('getDocumentsWithFirestoreSettings', () async { - final Query query = firestoreWithSettings.collection('messages').limit(1); - final QuerySnapshot querySnapshot = await query.getDocuments(); - expect(querySnapshot.documents.length, 1); - }); - - test('getDocumentsFromCollection', () async { - final Query query = firestore - .collection('messages') - .where('message', isEqualTo: 'Hello world!') - .limit(1); - final QuerySnapshot querySnapshot = await query.getDocuments(); - expect(querySnapshot.metadata, isNotNull); - expect(querySnapshot.documents.first['message'], 'Hello world!'); - final DocumentReference firstDoc = - querySnapshot.documents.first.reference; - final DocumentSnapshot documentSnapshot = await firstDoc.get(); - expect(documentSnapshot.data['message'], 'Hello world!'); - final DocumentSnapshot cachedSnapshot = - await firstDoc.get(source: Source.cache); - expect(cachedSnapshot.data['message'], 'Hello world!'); - final DocumentSnapshot snapshot = await firstDoc.snapshots().first; - expect(snapshot.data['message'], 'Hello world!'); - }); - - test('getDocumentsFromCollectionGroup', () async { - final Query query = firestore - .collectionGroup('reviews') - .where('stars', isEqualTo: 5) - .limit(1); - final QuerySnapshot querySnapshot = await query.getDocuments(); - expect(querySnapshot.documents.first['stars'], 5); - expect(querySnapshot.metadata, isNotNull); - }); - - test('increment', () async { - final DocumentReference ref = firestore.collection('messages').document(); - await ref.setData({ - 'message': 1, - 'created_at': FieldValue.serverTimestamp(), - }); - DocumentSnapshot snapshot = await ref.get(); - expect(snapshot.data['message'], 1); - await ref.updateData({ - 'message': FieldValue.increment(1), - }); - snapshot = await ref.get(); - expect(snapshot.data['message'], 2); - await ref.updateData({ - 'message': FieldValue.increment(40.1), - }); - snapshot = await ref.get(); - expect(snapshot.data['message'], 42.1); - - // Call several times without awaiting the result - await Future.wait(List>.generate( - 3, - (int i) => ref.updateData({ - 'message': FieldValue.increment(i), - }), - )); - snapshot = await ref.get(); - expect(snapshot.data['message'], 45.1); - await ref.delete(); - }); - - test('includeMetadataChanges', () async { - final DocumentReference ref = firestore.collection('messages').document(); - final Stream snapshotWithoutMetadataChanges = - ref.snapshots(includeMetadataChanges: false).take(1); - final Stream snapshotsWithMetadataChanges = - ref.snapshots(includeMetadataChanges: true).take(3); - - ref.setData({'hello': 'world'}); - - final DocumentSnapshot snapshot = - await snapshotWithoutMetadataChanges.first; - expect(snapshot.metadata.hasPendingWrites, true); - expect(snapshot.metadata.isFromCache, true); - expect(snapshot.data['hello'], 'world'); - - final List snapshots = - await snapshotsWithMetadataChanges.toList(); - expect(snapshots[0].metadata.hasPendingWrites, true); - expect(snapshots[0].metadata.isFromCache, true); - expect(snapshots[0].data['hello'], 'world'); - expect(snapshots[1].metadata.hasPendingWrites, true); - expect(snapshots[1].metadata.isFromCache, false); - expect(snapshots[1].data['hello'], 'world'); - expect(snapshots[2].metadata.hasPendingWrites, false); - expect(snapshots[2].metadata.isFromCache, false); - expect(snapshots[2].data['hello'], 'world'); - - await ref.delete(); - }); - - test('runTransaction', () async { - final DocumentReference ref = firestore.collection('messages').document(); - await ref.setData({ - 'message': 'testing', - 'created_at': FieldValue.serverTimestamp(), - }); - final DocumentSnapshot initialSnapshot = await ref.get(); - expect(initialSnapshot.data['message'], 'testing'); - final dynamic result = await firestore.runTransaction( - (Transaction tx) async { - final DocumentSnapshot snapshot = await tx.get(ref); - final Map updatedData = - Map.from(snapshot.data); - updatedData['message'] = 'testing2'; - tx.update(ref, updatedData); // calling await here is optional - return updatedData; - }, - ); - expect(result['message'], 'testing2'); - - await ref.delete(); - final DocumentSnapshot nonexistentSnapshot = await ref.get(); - expect(nonexistentSnapshot.data, null); - expect(nonexistentSnapshot.exists, false); - }); - - test('pagination', () async { - // Populate the database with two test documents - final CollectionReference messages = firestore.collection('messages'); - final DocumentReference doc1 = messages.document(); - // Use document ID as a unique identifier to ensure that we don't - // collide with other tests running against this database. - final String testRun = doc1.documentID; - await doc1.setData({ - 'message': 'pagination testing1', - 'test_run': testRun, - 'created_at': FieldValue.serverTimestamp(), - }); - final DocumentSnapshot snapshot1 = await doc1.get(); - final DocumentReference doc2 = messages.document(); - await doc2.setData({ - 'message': 'pagination testing2', - 'test_run': testRun, - 'created_at': FieldValue.serverTimestamp(), - }); - final DocumentSnapshot snapshot2 = await doc2.get(); - - QuerySnapshot snapshot; - List results; - - // startAtDocument - snapshot = await messages - .orderBy('created_at') - .where('test_run', isEqualTo: testRun) - .startAtDocument(snapshot1) - .getDocuments(); - results = snapshot.documents; - expect(results.length, 2); - expect(results[0].data['message'], 'pagination testing1'); - expect(results[1].data['message'], 'pagination testing2'); - - // startAfterDocument - snapshot = await messages - .orderBy('created_at') - .where('test_run', isEqualTo: testRun) - .startAfterDocument(snapshot1) - .getDocuments(); - results = snapshot.documents; - expect(results.length, 1); - expect(results[0].data['message'], 'pagination testing2'); - - // endAtDocument - snapshot = await messages - .orderBy('created_at') - .where('test_run', isEqualTo: testRun) - .endAtDocument(snapshot2) - .getDocuments(); - results = snapshot.documents; - expect(results.length, 2); - expect(results[0].data['message'], 'pagination testing1'); - expect(results[1].data['message'], 'pagination testing2'); - - // endBeforeDocument - snapshot = await messages - .orderBy('created_at') - .where('test_run', isEqualTo: testRun) - .endBeforeDocument(snapshot2) - .getDocuments(); - results = snapshot.documents; - expect(results.length, 1); - expect(results[0].data['message'], 'pagination testing1'); - - // startAtDocument - endAtDocument - snapshot = await messages - .orderBy('created_at') - .where('test_run', isEqualTo: testRun) - .startAtDocument(snapshot1) - .endAtDocument(snapshot2) - .getDocuments(); - results = snapshot.documents; - expect(results.length, 2); - expect(results[0].data['message'], 'pagination testing1'); - expect(results[1].data['message'], 'pagination testing2'); - - // startAfterDocument - endBeforeDocument - snapshot = await messages - .orderBy('created_at') - .where('test_run', isEqualTo: testRun) - .startAfterDocument(snapshot1) - .endBeforeDocument(snapshot2) - .getDocuments(); - results = snapshot.documents; - expect(results.length, 0); - - // Clean up - await doc1.delete(); - await doc2.delete(); - }); - - test('pagination with map', () async { - // Populate the database with two test documents. - final CollectionReference messages = firestore.collection('messages'); - final DocumentReference doc1 = messages.document(); - // Use document ID as a unique identifier to ensure that we don't - // collide with other tests running against this database. - final String testRun = doc1.documentID; - await doc1.setData({ - 'cake': { - 'flavor': {'type': 1, 'test_run': testRun} - } - }); - - final DocumentSnapshot snapshot1 = await doc1.get(); - final DocumentReference doc2 = await messages.add({ - 'cake': { - 'flavor': {'type': 2, 'test_run': testRun} - } - }); - - QuerySnapshot snapshot; - List results; - - // One pagination call is enough as all of the pagination methods use the same method to get data internally. - snapshot = await messages - .orderBy('cake.flavor.type') - .where('cake.flavor.test_run', isEqualTo: testRun) - .startAtDocument(snapshot1) - .getDocuments(); - results = snapshot.documents; - - expect(results.length, 2); - expect(results[0].data['cake']['flavor']['type'], 1); - expect(results[1].data['cake']['flavor']['type'], 2); - - await doc1.delete(); - await doc2.delete(); - }); - }); -} diff --git a/packages/cloud_firestore/example/test_driver/cloud_firestore_test.dart b/packages/cloud_firestore/example/test_driver/cloud_firestore_test.dart deleted file mode 100644 index cc11eae240e3..000000000000 --- a/packages/cloud_firestore/example/test_driver/cloud_firestore_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_driver/flutter_driver.dart'; - -void main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/cloud_firestore/ios/Assets/.gitkeep b/packages/cloud_firestore/ios/Assets/.gitkeep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h deleted file mode 100644 index 3a9035a10fd9..000000000000 --- a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTCloudFirestorePlugin : NSObject -@end diff --git a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m deleted file mode 100644 index 71c4232af682..000000000000 --- a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m +++ /dev/null @@ -1,668 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "CloudFirestorePlugin.h" -#import "UserAgent.h" - -#import - -static FlutterError *getFlutterError(NSError *error) { - if (error == nil) return nil; - - return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", error.code] - message:error.domain - details:error.localizedDescription]; -} - -static FIRFirestore *getFirestore(NSDictionary *arguments) { - FIRApp *app = [FIRApp appNamed:arguments[@"app"]]; - return [FIRFirestore firestoreForApp:app]; -} - -static FIRDocumentReference *getDocumentReference(NSDictionary *arguments) { - return [getFirestore(arguments) documentWithPath:arguments[@"path"]]; -} - -static NSArray *getDocumentValues(NSDictionary *document, NSArray *orderBy, - BOOL *isCollectionGroup) { - NSMutableArray *values = [[NSMutableArray alloc] init]; - NSDictionary *documentData = document[@"data"]; - if (orderBy) { - for (id item in orderBy) { - NSArray *orderByParameters = item; - NSString *fieldName = orderByParameters[0]; - if ([fieldName rangeOfString:@"."].location != NSNotFound) { - NSArray *fieldNameParts = [fieldName componentsSeparatedByString:@"."]; - NSDictionary *currentMap = [documentData objectForKey:[fieldNameParts objectAtIndex:0]]; - for (int i = 1; i < [fieldNameParts count] - 1; i++) { - currentMap = [currentMap objectForKey:[fieldNameParts objectAtIndex:i]]; - } - [values addObject:[currentMap objectForKey:[fieldNameParts - objectAtIndex:[fieldNameParts count] - 1]]]; - } else { - [values addObject:[documentData objectForKey:fieldName]]; - } - } - } - if (isCollectionGroup) { - NSString *path = document[@"path"]; - [values addObject:path]; - } else { - NSString *documentId = document[@"id"]; - [values addObject:documentId]; - } - return values; -} - -static FIRQuery *getQuery(NSDictionary *arguments) { - NSNumber *data = arguments[@"isCollectionGroup"]; - BOOL isCollectionGroup = data.boolValue; - FIRQuery *query; - if (isCollectionGroup) { - query = [getFirestore(arguments) collectionGroupWithID:arguments[@"path"]]; - } else { - query = [getFirestore(arguments) collectionWithPath:arguments[@"path"]]; - } - NSDictionary *parameters = arguments[@"parameters"]; - NSArray *whereConditions = parameters[@"where"]; - for (id item in whereConditions) { - NSArray *condition = item; - NSString *fieldName = condition[0]; - NSString *op = condition[1]; - id value = condition[2]; - if ([op isEqualToString:@"=="]) { - query = [query queryWhereField:fieldName isEqualTo:value]; - } else if ([op isEqualToString:@"<"]) { - query = [query queryWhereField:fieldName isLessThan:value]; - } else if ([op isEqualToString:@"<="]) { - query = [query queryWhereField:fieldName isLessThanOrEqualTo:value]; - } else if ([op isEqualToString:@">"]) { - query = [query queryWhereField:fieldName isGreaterThan:value]; - } else if ([op isEqualToString:@">="]) { - query = [query queryWhereField:fieldName isGreaterThanOrEqualTo:value]; - } else if ([op isEqualToString:@"array-contains"]) { - query = [query queryWhereField:fieldName arrayContains:value]; - } else { - // Unsupported operator - } - } - id limit = parameters[@"limit"]; - if (limit) { - NSNumber *length = limit; - query = [query queryLimitedTo:[length intValue]]; - } - NSArray *orderBy = parameters[@"orderBy"]; - if (orderBy) { - for (NSArray *orderByParameters in orderBy) { - NSString *fieldName = orderByParameters[0]; - NSNumber *descending = orderByParameters[1]; - query = [query queryOrderedByField:fieldName descending:[descending boolValue]]; - } - } - id startAt = parameters[@"startAt"]; - if (startAt) { - NSArray *startAtValues = startAt; - query = [query queryStartingAtValues:startAtValues]; - } - id startAtDocument = parameters[@"startAtDocument"]; - id startAfterDocument = parameters[@"startAfterDocument"]; - id endAtDocument = parameters[@"endAtDocument"]; - id endBeforeDocument = parameters[@"endBeforeDocument"]; - if (startAtDocument || startAfterDocument || endAtDocument || endBeforeDocument) { - NSArray *orderByParameters = [orderBy lastObject]; - NSNumber *descending = orderByParameters[1]; - query = [query queryOrderedByFieldPath:FIRFieldPath.documentID - descending:[descending boolValue]]; - } - if (startAtDocument) { - query = [query - queryStartingAtValues:getDocumentValues(startAtDocument, orderBy, isCollectionGroup)]; - } - id startAfter = parameters[@"startAfter"]; - if (startAfter) { - NSArray *startAfterValues = startAfter; - query = [query queryStartingAfterValues:startAfterValues]; - } - if (startAfterDocument) { - query = [query - queryStartingAfterValues:getDocumentValues(startAfterDocument, orderBy, isCollectionGroup)]; - } - id endAt = parameters[@"endAt"]; - if (endAt) { - NSArray *endAtValues = endAt; - query = [query queryEndingAtValues:endAtValues]; - } - if (endAtDocument) { - query = - [query queryEndingAtValues:getDocumentValues(endAtDocument, orderBy, isCollectionGroup)]; - } - id endBefore = parameters[@"endBefore"]; - if (endBefore) { - NSArray *endBeforeValues = endBefore; - query = [query queryEndingBeforeValues:endBeforeValues]; - } - if (endBeforeDocument) { - query = [query - queryEndingBeforeValues:getDocumentValues(endBeforeDocument, orderBy, isCollectionGroup)]; - } - return query; -} - -static FIRFirestoreSource getSource(NSDictionary *arguments) { - NSString *source = arguments[@"source"]; - if ([@"server" isEqualToString:source]) { - return FIRFirestoreSourceServer; - } - if ([@"cache" isEqualToString:source]) { - return FIRFirestoreSourceCache; - } - return FIRFirestoreSourceDefault; -} - -static NSDictionary *parseQuerySnapshot(FIRQuerySnapshot *snapshot) { - NSMutableArray *paths = [NSMutableArray array]; - NSMutableArray *documents = [NSMutableArray array]; - NSMutableArray *metadatas = [NSMutableArray array]; - for (FIRDocumentSnapshot *document in snapshot.documents) { - [paths addObject:document.reference.path]; - [documents addObject:document.data]; - [metadatas addObject:@{ - @"hasPendingWrites" : @(document.metadata.hasPendingWrites), - @"isFromCache" : @(document.metadata.isFromCache), - }]; - } - NSMutableArray *documentChanges = [NSMutableArray array]; - for (FIRDocumentChange *documentChange in snapshot.documentChanges) { - NSString *type; - switch (documentChange.type) { - case FIRDocumentChangeTypeAdded: - type = @"DocumentChangeType.added"; - break; - case FIRDocumentChangeTypeModified: - type = @"DocumentChangeType.modified"; - break; - case FIRDocumentChangeTypeRemoved: - type = @"DocumentChangeType.removed"; - break; - } - [documentChanges addObject:@{ - @"type" : type, - @"document" : documentChange.document.data, - @"path" : documentChange.document.reference.path, - @"oldIndex" : [NSNumber numberWithUnsignedInteger:documentChange.oldIndex], - @"newIndex" : [NSNumber numberWithUnsignedInteger:documentChange.newIndex], - @"metadata" : @{ - @"hasPendingWrites" : @(documentChange.document.metadata.hasPendingWrites), - @"isFromCache" : @(documentChange.document.metadata.isFromCache), - }, - }]; - } - return @{ - @"paths" : paths, - @"documentChanges" : documentChanges, - @"documents" : documents, - @"metadatas" : metadatas, - @"metadata" : @{ - @"hasPendingWrites" : @(snapshot.metadata.hasPendingWrites), - @"isFromCache" : @(snapshot.metadata.isFromCache), - } - }; -} - -const UInt8 DATE_TIME = 128; -const UInt8 GEO_POINT = 129; -const UInt8 DOCUMENT_REFERENCE = 130; -const UInt8 BLOB = 131; -const UInt8 ARRAY_UNION = 132; -const UInt8 ARRAY_REMOVE = 133; -const UInt8 DELETE = 134; -const UInt8 SERVER_TIMESTAMP = 135; -const UInt8 TIMESTAMP = 136; -const UInt8 INCREMENT_DOUBLE = 137; -const UInt8 INCREMENT_INTEGER = 138; - -@interface FirestoreWriter : FlutterStandardWriter -- (void)writeValue:(id)value; -@end - -@implementation FirestoreWriter : FlutterStandardWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[NSDate class]]) { - [self writeByte:DATE_TIME]; - NSDate *date = value; - NSTimeInterval time = date.timeIntervalSince1970; - SInt64 ms = (SInt64)(time * 1000.0); - [self writeBytes:&ms length:8]; - } else if ([value isKindOfClass:[FIRTimestamp class]]) { - FIRTimestamp *timestamp = value; - SInt64 seconds = timestamp.seconds; - int nanoseconds = timestamp.nanoseconds; - [self writeByte:TIMESTAMP]; - [self writeBytes:(UInt8 *)&seconds length:8]; - [self writeBytes:(UInt8 *)&nanoseconds length:4]; - } else if ([value isKindOfClass:[FIRGeoPoint class]]) { - FIRGeoPoint *geoPoint = value; - Float64 latitude = geoPoint.latitude; - Float64 longitude = geoPoint.longitude; - [self writeByte:GEO_POINT]; - [self writeAlignment:8]; - [self writeBytes:(UInt8 *)&latitude length:8]; - [self writeBytes:(UInt8 *)&longitude length:8]; - } else if ([value isKindOfClass:[FIRDocumentReference class]]) { - FIRDocumentReference *document = value; - NSString *documentPath = [document path]; - [self writeByte:DOCUMENT_REFERENCE]; - [self writeUTF8:document.firestore.app.name]; - [self writeUTF8:documentPath]; - } else if ([value isKindOfClass:[NSData class]]) { - NSData *blob = value; - [self writeByte:BLOB]; - [self writeSize:(UInt32)blob.length]; - [self writeData:blob]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FirestoreReader : FlutterStandardReader -- (id)readValueOfType:(UInt8)type; -@end - -@implementation FirestoreReader -- (id)readValueOfType:(UInt8)type { - switch (type) { - case DATE_TIME: { - SInt64 value; - [self readBytes:&value length:8]; - return [NSDate dateWithTimeIntervalSince1970:(value / 1000.0)]; - } - case TIMESTAMP: { - SInt64 seconds; - int nanoseconds; - [self readBytes:&seconds length:8]; - [self readBytes:&nanoseconds length:4]; - return [[FIRTimestamp alloc] initWithSeconds:seconds nanoseconds:nanoseconds]; - } - case GEO_POINT: { - Float64 latitude; - Float64 longitude; - [self readAlignment:8]; - [self readBytes:&latitude length:8]; - [self readBytes:&longitude length:8]; - return [[FIRGeoPoint alloc] initWithLatitude:latitude longitude:longitude]; - } - case DOCUMENT_REFERENCE: { - NSString *appName = [self readUTF8]; - FIRFirestore *firestore = [FIRFirestore firestoreForApp:[FIRApp appNamed:appName]]; - NSString *documentPath = [self readUTF8]; - return [firestore documentWithPath:documentPath]; - } - case BLOB: { - UInt32 elementCount = [self readSize]; - return [self readData:elementCount]; - } - case ARRAY_UNION: { - return [FIRFieldValue fieldValueForArrayUnion:[self readValue]]; - } - case ARRAY_REMOVE: { - return [FIRFieldValue fieldValueForArrayRemove:[self readValue]]; - } - case DELETE: { - return [FIRFieldValue fieldValueForDelete]; - } - case SERVER_TIMESTAMP: { - return [FIRFieldValue fieldValueForServerTimestamp]; - } - case INCREMENT_DOUBLE: { - NSNumber *value = [self readValue]; - return [FIRFieldValue fieldValueForDoubleIncrement:value.doubleValue]; - } - case INCREMENT_INTEGER: { - NSNumber *value = [self readValue]; - return [FIRFieldValue fieldValueForIntegerIncrement:value.intValue]; - } - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FirestoreReaderWriter : FlutterStandardReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data; -- (FlutterStandardReader *)readerWithData:(NSData *)data; -@end - -@implementation FirestoreReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FirestoreWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FirestoreReader alloc] initWithData:data]; -} -@end - -@interface FLTCloudFirestorePlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@end - -@implementation FLTCloudFirestorePlugin { - NSMutableDictionary> *_listeners; - int _nextListenerHandle; - NSMutableDictionary *transactions; - NSMutableDictionary *transactionResults; - NSMutableDictionary *_batches; - int _nextBatchHandle; -} - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FirestoreReaderWriter *firestoreReaderWriter = [FirestoreReaderWriter new]; - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/cloud_firestore" - binaryMessenger:[registrar messenger] - codec:[FlutterStandardMethodCodec - codecWithReaderWriter:firestoreReaderWriter]]; - FLTCloudFirestorePlugin *instance = [[FLTCloudFirestorePlugin alloc] init]; - instance.channel = channel; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - _listeners = [NSMutableDictionary> dictionary]; - _batches = [NSMutableDictionary dictionary]; - _nextListenerHandle = 0; - _nextBatchHandle = 0; - transactions = [NSMutableDictionary dictionary]; - transactionResults = [NSMutableDictionary dictionary]; - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - __weak __typeof__(self) weakSelf = self; - void (^defaultCompletionBlock)(NSError *) = ^(NSError *error) { - result(getFlutterError(error)); - }; - if ([@"Firestore#runTransaction" isEqualToString:call.method]) { - [getFirestore(call.arguments) - runTransactionWithBlock:^id(FIRTransaction *transaction, NSError **pError) { - NSNumber *transactionId = call.arguments[@"transactionId"]; - NSNumber *transactionTimeout = call.arguments[@"transactionTimeout"]; - - self->transactions[transactionId] = transaction; - - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); - - [weakSelf.channel invokeMethod:@"DoTransaction" - arguments:call.arguments - result:^(id doTransactionResult) { - FLTCloudFirestorePlugin *currentSelf = weakSelf; - currentSelf->transactionResults[transactionId] = - doTransactionResult; - dispatch_semaphore_signal(semaphore); - }]; - - dispatch_semaphore_wait( - semaphore, - dispatch_time(DISPATCH_TIME_NOW, [transactionTimeout integerValue] * 1000000)); - - return self->transactionResults[transactionId]; - } - completion:^(id transactionResult, NSError *error) { - if (error != nil) { - result([FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", error.code] - message:error.localizedDescription - details:nil]); - } - result(transactionResult); - }]; - } else if ([@"Transaction#get" isEqualToString:call.method]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSNumber *transactionId = call.arguments[@"transactionId"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRTransaction *transaction = self->transactions[transactionId]; - NSError *error = [[NSError alloc] init]; - - FIRDocumentSnapshot *snapshot = [transaction getDocument:document error:&error]; - - if (error != nil) { - result([FlutterError errorWithCode:[NSString stringWithFormat:@"%tu", [error code]] - message:[error localizedDescription] - details:nil]); - } else if (snapshot != nil) { - result(@{ - @"path" : snapshot.reference.path, - @"data" : snapshot.exists ? snapshot.data : [NSNull null], - @"metadata" : @{ - @"hasPendingWrites" : @(snapshot.metadata.hasPendingWrites), - @"isFromCache" : @(snapshot.metadata.isFromCache), - }, - }); - } else { - result(nil); - } - }); - } else if ([@"Transaction#update" isEqualToString:call.method]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSNumber *transactionId = call.arguments[@"transactionId"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRTransaction *transaction = self->transactions[transactionId]; - - [transaction updateData:call.arguments[@"data"] forDocument:document]; - result(nil); - }); - } else if ([@"Transaction#set" isEqualToString:call.method]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSNumber *transactionId = call.arguments[@"transactionId"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRTransaction *transaction = self->transactions[transactionId]; - - [transaction setData:call.arguments[@"data"] forDocument:document]; - result(nil); - }); - } else if ([@"Transaction#delete" isEqualToString:call.method]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSNumber *transactionId = call.arguments[@"transactionId"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRTransaction *transaction = self->transactions[transactionId]; - - [transaction deleteDocument:document]; - result(nil); - }); - } else if ([@"DocumentReference#setData" isEqualToString:call.method]) { - NSDictionary *options = call.arguments[@"options"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - if (![options isEqual:[NSNull null]] && - [options[@"merge"] isEqual:[NSNumber numberWithBool:YES]]) { - [document setData:call.arguments[@"data"] merge:YES completion:defaultCompletionBlock]; - } else { - [document setData:call.arguments[@"data"] completion:defaultCompletionBlock]; - } - } else if ([@"DocumentReference#updateData" isEqualToString:call.method]) { - FIRDocumentReference *document = getDocumentReference(call.arguments); - [document updateData:call.arguments[@"data"] completion:defaultCompletionBlock]; - } else if ([@"DocumentReference#delete" isEqualToString:call.method]) { - FIRDocumentReference *document = getDocumentReference(call.arguments); - [document deleteDocumentWithCompletion:defaultCompletionBlock]; - } else if ([@"DocumentReference#get" isEqualToString:call.method]) { - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRFirestoreSource source = getSource(call.arguments); - [document - getDocumentWithSource:source - completion:^(FIRDocumentSnapshot *_Nullable snapshot, NSError *_Nullable error) { - if (snapshot == nil) { - result(getFlutterError(error)); - } else { - result(@{ - @"path" : snapshot.reference.path, - @"data" : snapshot.exists ? snapshot.data : [NSNull null], - @"metadata" : @{ - @"hasPendingWrites" : @(snapshot.metadata.hasPendingWrites), - @"isFromCache" : @(snapshot.metadata.isFromCache), - }, - }); - } - }]; - } else if ([@"Query#addSnapshotListener" isEqualToString:call.method]) { - __block NSNumber *handle = [NSNumber numberWithInt:_nextListenerHandle++]; - FIRQuery *query; - @try { - query = getQuery(call.arguments); - } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"invalid_query" - message:[exception name] - details:[exception reason]]); - } - NSNumber *includeMetadataChanges = call.arguments[@"includeMetadataChanges"]; - id listener = [query - addSnapshotListenerWithIncludeMetadataChanges:includeMetadataChanges.boolValue - listener:^(FIRQuerySnapshot *_Nullable snapshot, - NSError *_Nullable error) { - if (snapshot == nil) { - result(getFlutterError(error)); - return; - } - NSMutableDictionary *arguments = - [parseQuerySnapshot(snapshot) mutableCopy]; - [arguments setObject:handle forKey:@"handle"]; - [weakSelf.channel invokeMethod:@"QuerySnapshot" - arguments:arguments]; - }]; - _listeners[handle] = listener; - result(handle); - } else if ([@"DocumentReference#addSnapshotListener" isEqualToString:call.method]) { - __block NSNumber *handle = [NSNumber numberWithInt:_nextListenerHandle++]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - NSNumber *includeMetadataChanges = call.arguments[@"includeMetadataChanges"]; - id listener = [document - addSnapshotListenerWithIncludeMetadataChanges:includeMetadataChanges.boolValue - listener:^(FIRDocumentSnapshot *snapshot, - NSError *_Nullable error) { - if (snapshot == nil) { - result(getFlutterError(error)); - return; - } - [weakSelf.channel - invokeMethod:@"DocumentSnapshot" - arguments:@{ - @"handle" : handle, - @"path" : snapshot ? snapshot.reference.path - : [NSNull null], - @"data" : snapshot.exists ? snapshot.data - : [NSNull null], - @"metadata" : snapshot ? @{ - @"hasPendingWrites" : - @(snapshot.metadata.hasPendingWrites), - @"isFromCache" : - @(snapshot.metadata.isFromCache), - } - : [NSNull null], - }]; - }]; - _listeners[handle] = listener; - result(handle); - } else if ([@"Query#getDocuments" isEqualToString:call.method]) { - FIRQuery *query; - FIRFirestoreSource source = getSource(call.arguments); - @try { - query = getQuery(call.arguments); - } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"invalid_query" - message:[exception name] - details:[exception reason]]); - } - - [query - getDocumentsWithSource:source - completion:^(FIRQuerySnapshot *_Nullable snapshot, NSError *_Nullable error) { - if (snapshot == nil) { - result(getFlutterError(error)); - return; - } - result(parseQuerySnapshot(snapshot)); - }]; - } else if ([@"removeListener" isEqualToString:call.method]) { - NSNumber *handle = call.arguments[@"handle"]; - [[_listeners objectForKey:handle] remove]; - [_listeners removeObjectForKey:handle]; - result(nil); - } else if ([@"WriteBatch#create" isEqualToString:call.method]) { - __block NSNumber *handle = [NSNumber numberWithInt:_nextBatchHandle++]; - FIRWriteBatch *batch = [getFirestore(call.arguments) batch]; - _batches[handle] = batch; - result(handle); - } else if ([@"WriteBatch#setData" isEqualToString:call.method]) { - NSNumber *handle = call.arguments[@"handle"]; - NSDictionary *options = call.arguments[@"options"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRWriteBatch *batch = [_batches objectForKey:handle]; - if (![options isEqual:[NSNull null]] && - [options[@"merge"] isEqual:[NSNumber numberWithBool:YES]]) { - [batch setData:call.arguments[@"data"] forDocument:document merge:YES]; - } else { - [batch setData:call.arguments[@"data"] forDocument:document]; - } - result(nil); - } else if ([@"WriteBatch#updateData" isEqualToString:call.method]) { - NSNumber *handle = call.arguments[@"handle"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRWriteBatch *batch = [_batches objectForKey:handle]; - [batch updateData:call.arguments[@"data"] forDocument:document]; - result(nil); - } else if ([@"WriteBatch#delete" isEqualToString:call.method]) { - NSNumber *handle = call.arguments[@"handle"]; - FIRDocumentReference *document = getDocumentReference(call.arguments); - FIRWriteBatch *batch = [_batches objectForKey:handle]; - [batch deleteDocument:document]; - result(nil); - } else if ([@"WriteBatch#commit" isEqualToString:call.method]) { - NSNumber *handle = call.arguments[@"handle"]; - FIRWriteBatch *batch = [_batches objectForKey:handle]; - [batch commitWithCompletion:defaultCompletionBlock]; - [_batches removeObjectForKey:handle]; - } else if ([@"Firestore#enablePersistence" isEqualToString:call.method]) { - bool enable = (bool)call.arguments[@"enable"]; - FIRFirestoreSettings *settings = [[FIRFirestoreSettings alloc] init]; - settings.persistenceEnabled = enable; - FIRFirestore *db = getFirestore(call.arguments); - db.settings = settings; - result(nil); - } else if ([@"Firestore#settings" isEqualToString:call.method]) { - FIRFirestoreSettings *settings = [[FIRFirestoreSettings alloc] init]; - if (![call.arguments[@"persistenceEnabled"] isEqual:[NSNull null]]) { - settings.persistenceEnabled = (bool)call.arguments[@"persistenceEnabled"]; - } - if (![call.arguments[@"host"] isEqual:[NSNull null]]) { - settings.host = (NSString *)call.arguments[@"host"]; - } - if (![call.arguments[@"sslEnabled"] isEqual:[NSNull null]]) { - settings.sslEnabled = (bool)call.arguments[@"sslEnabled"]; - } - if (![call.arguments[@"timestampsInSnapshotsEnabled"] isEqual:[NSNull null]]) { - settings.timestampsInSnapshotsEnabled = (bool)call.arguments[@"timestampsInSnapshotsEnabled"]; - } - if (![call.arguments[@"cacheSizeBytes"] isEqual:[NSNull null]]) { - settings.cacheSizeBytes = ((NSNumber *)call.arguments[@"cacheSizeBytes"]).intValue; - } - FIRFirestore *db = getFirestore(call.arguments); - db.settings = settings; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/packages/cloud_firestore/ios/cloud_firestore.podspec b/packages/cloud_firestore/ios/cloud_firestore.podspec deleted file mode 100755 index 8b4f4e8b917d..000000000000 --- a/packages/cloud_firestore/ios/cloud_firestore.podspec +++ /dev/null @@ -1,32 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'cloud_firestore' - s.version = '0.0.1' - s.summary = 'Firestore plugin for Flutter.' - s.description = <<-DESC -Firestore plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/firestore' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/Firestore', '~> 6.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-fst\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/cloud_firestore/lib/cloud_firestore.dart b/packages/cloud_firestore/lib/cloud_firestore.dart deleted file mode 100755 index fba72b049cb6..000000000000 --- a/packages/cloud_firestore/lib/cloud_firestore.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library cloud_firestore; - -import 'dart:async'; -import 'dart:convert'; -import 'dart:typed_data'; -import 'dart:ui' show hashValues, hashList; - -import 'package:collection/collection.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -import 'src/utils/auto_id_generator.dart'; - -part 'src/blob.dart'; -part 'src/collection_reference.dart'; -part 'src/document_change.dart'; -part 'src/document_reference.dart'; -part 'src/document_snapshot.dart'; -part 'src/field_value.dart'; -part 'src/firestore.dart'; -part 'src/firestore_message_codec.dart'; -part 'src/geo_point.dart'; -part 'src/query.dart'; -part 'src/query_snapshot.dart'; -part 'src/snapshot_metadata.dart'; -part 'src/timestamp.dart'; -part 'src/transaction.dart'; -part 'src/write_batch.dart'; -part 'src/source.dart'; diff --git a/packages/cloud_firestore/lib/src/blob.dart b/packages/cloud_firestore/lib/src/blob.dart deleted file mode 100644 index 665efead5622..000000000000 --- a/packages/cloud_firestore/lib/src/blob.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -class Blob { - const Blob(this.bytes); - - final Uint8List bytes; - - @override - bool operator ==(dynamic other) => - other is Blob && - const DeepCollectionEquality().equals(other.bytes, bytes); - - @override - int get hashCode => hashList(bytes); -} diff --git a/packages/cloud_firestore/lib/src/collection_reference.dart b/packages/cloud_firestore/lib/src/collection_reference.dart deleted file mode 100644 index f1de3a8ba4b9..000000000000 --- a/packages/cloud_firestore/lib/src/collection_reference.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// A CollectionReference object can be used for adding documents, getting -/// document references, and querying for documents (using the methods -/// inherited from [Query]). -class CollectionReference extends Query { - CollectionReference._(Firestore firestore, List pathComponents) - : super._(firestore: firestore, pathComponents: pathComponents); - - /// ID of the referenced collection. - String get id => _pathComponents.isEmpty ? null : _pathComponents.last; - - /// For subcollections, parent returns the containing [DocumentReference]. - /// - /// For root collections, null is returned. - DocumentReference parent() { - if (_pathComponents.length < 2) { - return null; - } - return DocumentReference._( - firestore, - (List.from(_pathComponents)..removeLast()), - ); - } - - /// A string containing the slash-separated path to this CollectionReference - /// (relative to the root of the database). - String get path => _path; - - /// Returns a `DocumentReference` with the provided path. - /// - /// If no [path] is provided, an auto-generated ID is used. - /// - /// The unique key generated is prefixed with a client-generated timestamp - /// so that the resulting list will be chronologically-sorted. - DocumentReference document([String path]) { - List childPath; - if (path == null) { - final String key = AutoIdGenerator.autoId(); - childPath = List.from(_pathComponents)..add(key); - } else { - childPath = List.from(_pathComponents)..addAll(path.split(('/'))); - } - return DocumentReference._(firestore, childPath); - } - - /// Returns a `DocumentReference` with an auto-generated ID, after - /// populating it with provided [data]. - /// - /// The unique key generated is prefixed with a client-generated timestamp - /// so that the resulting list will be chronologically-sorted. - Future add(Map data) async { - final DocumentReference newDocument = document(); - await newDocument.setData(data); - return newDocument; - } -} diff --git a/packages/cloud_firestore/lib/src/document_change.dart b/packages/cloud_firestore/lib/src/document_change.dart deleted file mode 100644 index 8409d512a43e..000000000000 --- a/packages/cloud_firestore/lib/src/document_change.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// An enumeration of document change types. -enum DocumentChangeType { - /// Indicates a new document was added to the set of documents matching the - /// query. - added, - - /// Indicates a document within the query was modified. - modified, - - /// Indicates a document within the query was removed (either deleted or no - /// longer matches the query. - removed, -} - -/// A DocumentChange represents a change to the documents matching a query. -/// -/// It contains the document affected and the type of change that occurred -/// (added, modified, or removed). -class DocumentChange { - DocumentChange._(Map data, this._firestore) - : oldIndex = data['oldIndex'], - newIndex = data['newIndex'], - document = DocumentSnapshot._( - data['path'], - _asStringKeyedMap(data['document']), - SnapshotMetadata._(data["metadata"]["hasPendingWrites"], - data["metadata"]["isFromCache"]), - _firestore, - ), - type = DocumentChangeType.values.firstWhere((DocumentChangeType type) { - return type.toString() == data['type']; - }); - - final Firestore _firestore; - - /// The type of change that occurred (added, modified, or removed). - final DocumentChangeType type; - - /// The index of the changed document in the result set immediately prior to - /// this [DocumentChange] (i.e. supposing that all prior DocumentChange objects - /// have been applied). - /// - /// -1 for [DocumentChangeType.added] events. - final int oldIndex; - - /// The index of the changed document in the result set immediately after this - /// DocumentChange (i.e. supposing that all prior [DocumentChange] objects - /// and the current [DocumentChange] object have been applied). - /// - /// -1 for [DocumentChangeType.removed] events. - final int newIndex; - - /// The document affected by this change. - final DocumentSnapshot document; -} diff --git a/packages/cloud_firestore/lib/src/document_reference.dart b/packages/cloud_firestore/lib/src/document_reference.dart deleted file mode 100644 index 413cf41be0be..000000000000 --- a/packages/cloud_firestore/lib/src/document_reference.dart +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// A [DocumentReference] refers to a document location in a Firestore database -/// and can be used to write, read, or listen to the location. -/// -/// The document at the referenced location may or may not exist. -/// A [DocumentReference] can also be used to create a [CollectionReference] -/// to a subcollection. -class DocumentReference { - DocumentReference._(this.firestore, List pathComponents) - : _pathComponents = pathComponents, - assert(firestore != null); - - /// The Firestore instance associated with this document reference - final Firestore firestore; - - final List _pathComponents; - - @override - bool operator ==(dynamic o) => - o is DocumentReference && o.firestore == firestore && o.path == path; - - @override - int get hashCode => hashList(_pathComponents); - - /// Parent returns the containing [CollectionReference]. - CollectionReference parent() { - return CollectionReference._( - firestore, - (List.from(_pathComponents)..removeLast()), - ); - } - - /// Slash-delimited path representing the database location of this query. - String get path => _pathComponents.join('/'); - - /// This document's given or generated ID in the collection. - String get documentID => _pathComponents.last; - - /// Writes to the document referred to by this [DocumentReference]. - /// - /// If the document does not yet exist, it will be created. - /// - /// If [merge] is true, the provided data will be merged into an - /// existing document instead of overwriting. - Future setData(Map data, {bool merge = false}) { - return Firestore.channel.invokeMethod( - 'DocumentReference#setData', - { - 'app': firestore.app.name, - 'path': path, - 'data': data, - 'options': {'merge': merge}, - }, - ); - } - - /// Updates fields in the document referred to by this [DocumentReference]. - /// - /// Values in [data] may be of any supported Firestore type as well as - /// special sentinel [FieldValue] type. - /// - /// If no document exists yet, the update will fail. - Future updateData(Map data) { - return Firestore.channel.invokeMethod( - 'DocumentReference#updateData', - { - 'app': firestore.app.name, - 'path': path, - 'data': data, - }, - ); - } - - /// Reads the document referenced by this [DocumentReference]. - /// - /// If no document exists, the read will return null. - Future get({Source source = Source.serverAndCache}) async { - final Map data = - await Firestore.channel.invokeMapMethod( - 'DocumentReference#get', - { - 'app': firestore.app.name, - 'path': path, - 'source': _getSourceString(source), - }, - ); - return DocumentSnapshot._( - data['path'], - _asStringKeyedMap(data['data']), - SnapshotMetadata._(data['metadata']['hasPendingWrites'], - data['metadata']['isFromCache']), - firestore, - ); - } - - /// Deletes the document referred to by this [DocumentReference]. - Future delete() { - return Firestore.channel.invokeMethod( - 'DocumentReference#delete', - {'app': firestore.app.name, 'path': path}, - ); - } - - /// Returns the reference of a collection contained inside of this - /// document. - CollectionReference collection(String collectionPath) { - return firestore.collection( - [path, collectionPath].join('/'), - ); - } - - /// Notifies of documents at this location - // TODO(jackson): Reduce code duplication with [Query] - Stream snapshots({bool includeMetadataChanges = false}) { - assert(includeMetadataChanges != null); - Future _handle; - // It's fine to let the StreamController be garbage collected once all the - // subscribers have cancelled; this analyzer warning is safe to ignore. - StreamController controller; // ignore: close_sinks - controller = StreamController.broadcast( - onListen: () { - _handle = Firestore.channel.invokeMethod( - 'DocumentReference#addSnapshotListener', - { - 'app': firestore.app.name, - 'path': path, - 'includeMetadataChanges': includeMetadataChanges, - }, - ).then((dynamic result) => result); - _handle.then((int handle) { - Firestore._documentObservers[handle] = controller; - }); - }, - onCancel: () { - _handle.then((int handle) async { - await Firestore.channel.invokeMethod( - 'removeListener', - {'handle': handle}, - ); - Firestore._documentObservers.remove(handle); - }); - }, - ); - return controller.stream; - } -} diff --git a/packages/cloud_firestore/lib/src/document_snapshot.dart b/packages/cloud_firestore/lib/src/document_snapshot.dart deleted file mode 100644 index 45508566674a..000000000000 --- a/packages/cloud_firestore/lib/src/document_snapshot.dart +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// A DocumentSnapshot contains data read from a document in your Firestore -/// database. -/// -/// The data can be extracted with the data property or by using subscript -/// syntax to access a specific field. -class DocumentSnapshot { - DocumentSnapshot._(this._path, this.data, this.metadata, this._firestore); - - final String _path; - final Firestore _firestore; - - /// The reference that produced this snapshot - DocumentReference get reference => _firestore.document(_path); - - /// Contains all the data of this snapshot - final Map data; - - /// Metadata about this snapshot concerning its source and if it has local - /// modifications. - final SnapshotMetadata metadata; - - /// Reads individual values from the snapshot - dynamic operator [](String key) => data[key]; - - /// Returns the ID of the snapshot's document - String get documentID => _path.split('/').last; - - /// Returns `true` if the document exists. - bool get exists => data != null; -} - -Map _asStringKeyedMap(Map map) { - if (map == null) return null; - if (map is Map) { - return map; - } else { - return Map.from(map); - } -} diff --git a/packages/cloud_firestore/lib/src/field_value.dart b/packages/cloud_firestore/lib/src/field_value.dart deleted file mode 100644 index 4ab12b0411f3..000000000000 --- a/packages/cloud_firestore/lib/src/field_value.dart +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -@visibleForTesting -enum FieldValueType { - arrayUnion, - arrayRemove, - delete, - serverTimestamp, - incrementDouble, - incrementInteger, -} - -/// Sentinel values that can be used when writing document fields with set() or -/// update(). -class FieldValue { - FieldValue._(this.type, this.value); - - @visibleForTesting - final FieldValueType type; - - @visibleForTesting - final dynamic value; - - /// Returns a special value that tells the server to union the given elements - /// with any array value that already exists on the server. - /// - /// Each specified element that doesn't already exist in the array will be - /// added to the end. If the field being modified is not already an array it - /// will be overwritten with an array containing exactly the specified - /// elements. - static FieldValue arrayUnion(List elements) => - FieldValue._(FieldValueType.arrayUnion, elements); - - /// Returns a special value that tells the server to remove the given - /// elements from any array value that already exists on the server. - /// - /// All instances of each element specified will be removed from the array. - /// If the field being modified is not already an array it will be overwritten - /// with an empty array. - static FieldValue arrayRemove(List elements) => - FieldValue._(FieldValueType.arrayRemove, elements); - - /// Returns a sentinel for use with update() to mark a field for deletion. - static FieldValue delete() => FieldValue._(FieldValueType.delete, null); - - /// Returns a sentinel for use with set() or update() to include a - /// server-generated timestamp in the written data. - static FieldValue serverTimestamp() => - FieldValue._(FieldValueType.serverTimestamp, null); - - /// Returns a special value for use with set() or update() that tells the - /// server to increment the field’s current value by the given value. - static FieldValue increment(num value) { - // It is a compile-time error for any type other than int or double to - // attempt to extend or implement num. - assert(value is int || value is double); - if (value is double) { - return FieldValue._(FieldValueType.incrementDouble, value); - } else if (value is int) { - return FieldValue._(FieldValueType.incrementInteger, value); - } - return null; - } -} diff --git a/packages/cloud_firestore/lib/src/firestore.dart b/packages/cloud_firestore/lib/src/firestore.dart deleted file mode 100644 index c2fa17720995..000000000000 --- a/packages/cloud_firestore/lib/src/firestore.dart +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// The entry point for accessing a Firestore. -/// -/// You can get an instance by calling [Firestore.instance]. -class Firestore { - Firestore({FirebaseApp app}) : app = app ?? FirebaseApp.instance { - if (_initialized) return; - channel.setMethodCallHandler((MethodCall call) async { - if (call.method == 'QuerySnapshot') { - final QuerySnapshot snapshot = QuerySnapshot._(call.arguments, this); - _queryObservers[call.arguments['handle']].add(snapshot); - } else if (call.method == 'DocumentSnapshot') { - final DocumentSnapshot snapshot = DocumentSnapshot._( - call.arguments['path'], - _asStringKeyedMap(call.arguments['data']), - SnapshotMetadata._(call.arguments['metadata']['hasPendingWrites'], - call.arguments['metadata']['isFromCache']), - this, - ); - _documentObservers[call.arguments['handle']].add(snapshot); - } else if (call.method == 'DoTransaction') { - final int transactionId = call.arguments['transactionId']; - final Transaction transaction = Transaction(transactionId, this); - final dynamic result = - await _transactionHandlers[transactionId](transaction); - await transaction._finish(); - return result; - } - }); - _initialized = true; - } - - /// Gets the instance of Firestore for the default Firebase app. - static final Firestore instance = Firestore(); - - /// The [FirebaseApp] instance to which this [FirebaseDatabase] belongs. - /// - /// If null, the default [FirebaseApp] is used. - final FirebaseApp app; - - static bool _initialized = false; - - @visibleForTesting - static const MethodChannel channel = MethodChannel( - 'plugins.flutter.io/cloud_firestore', - StandardMethodCodec(FirestoreMessageCodec()), - ); - - static final Map> _queryObservers = - >{}; - - static final Map> _documentObservers = - >{}; - - static final Map _transactionHandlers = - {}; - static int _transactionHandlerId = 0; - - @override - bool operator ==(dynamic o) => o is Firestore && o.app == app; - - @override - int get hashCode => app.hashCode; - - /// Gets a [CollectionReference] for the specified Firestore path. - CollectionReference collection(String path) { - assert(path != null); - return CollectionReference._(this, path.split('/')); - } - - /// Gets a [Query] for the specified collection group. - Query collectionGroup(String path) { - assert(path != null); - assert(!path.contains("/"), "Collection IDs must not contain '/'."); - return Query._( - firestore: this, - isCollectionGroup: true, - pathComponents: path.split('/'), - ); - } - - /// Gets a [DocumentReference] for the specified Firestore path. - DocumentReference document(String path) { - assert(path != null); - return DocumentReference._(this, path.split('/')); - } - - /// Creates a write batch, used for performing multiple writes as a single - /// atomic operation. - /// - /// Unlike transactions, write batches are persisted offline and therefore are - /// preferable when you don’t need to condition your writes on read data. - WriteBatch batch() => WriteBatch._(this); - - /// Executes the given TransactionHandler and then attempts to commit the - /// changes applied within an atomic transaction. - /// - /// In the TransactionHandler, a set of reads and writes can be performed - /// atomically using the Transaction object passed to the TransactionHandler. - /// After the TransactionHandler is run, Firestore will attempt to apply the - /// changes to the server. If any of the data read has been modified outside - /// of this transaction since being read, then the transaction will be - /// retried by executing the updateBlock again. If the transaction still - /// fails after 5 retries, then the transaction will fail. - /// - /// The TransactionHandler may be executed multiple times, it should be able - /// to handle multiple executions. - /// - /// Data accessed with the transaction will not reflect local changes that - /// have not been committed. For this reason, it is required that all - /// reads are performed before any writes. Transactions must be performed - /// while online. Otherwise, reads will fail, and the final commit will fail. - /// - /// By default transactions are limited to 5 seconds of execution time. This - /// timeout can be adjusted by setting the timeout parameter. - Future> runTransaction( - TransactionHandler transactionHandler, - {Duration timeout = const Duration(seconds: 5)}) async { - assert(timeout.inMilliseconds > 0, - 'Transaction timeout must be more than 0 milliseconds'); - final int transactionId = _transactionHandlerId++; - _transactionHandlers[transactionId] = transactionHandler; - final Map result = await channel - .invokeMapMethod( - 'Firestore#runTransaction', { - 'app': app.name, - 'transactionId': transactionId, - 'transactionTimeout': timeout.inMilliseconds - }); - return result ?? {}; - } - - @deprecated - Future enablePersistence(bool enable) async { - assert(enable != null); - await channel - .invokeMethod('Firestore#enablePersistence', { - 'app': app.name, - 'enable': enable, - }); - } - - Future settings( - {bool persistenceEnabled, - String host, - bool sslEnabled, - bool timestampsInSnapshotsEnabled, - int cacheSizeBytes}) async { - await channel.invokeMethod('Firestore#settings', { - 'app': app.name, - 'persistenceEnabled': persistenceEnabled, - 'host': host, - 'sslEnabled': sslEnabled, - 'timestampsInSnapshotsEnabled': timestampsInSnapshotsEnabled, - 'cacheSizeBytes': cacheSizeBytes, - }); - } -} diff --git a/packages/cloud_firestore/lib/src/firestore_message_codec.dart b/packages/cloud_firestore/lib/src/firestore_message_codec.dart deleted file mode 100644 index 14f6e020675c..000000000000 --- a/packages/cloud_firestore/lib/src/firestore_message_codec.dart +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -@visibleForTesting -class FirestoreMessageCodec extends StandardMessageCodec { - const FirestoreMessageCodec(); - - static const int _kDateTime = 128; - static const int _kGeoPoint = 129; - static const int _kDocumentReference = 130; - static const int _kBlob = 131; - static const int _kArrayUnion = 132; - static const int _kArrayRemove = 133; - static const int _kDelete = 134; - static const int _kServerTimestamp = 135; - static const int _kTimestamp = 136; - static const int _kIncrementDouble = 137; - static const int _kIncrementInteger = 138; - - static const Map _kFieldValueCodes = - { - FieldValueType.arrayUnion: _kArrayUnion, - FieldValueType.arrayRemove: _kArrayRemove, - FieldValueType.delete: _kDelete, - FieldValueType.serverTimestamp: _kServerTimestamp, - FieldValueType.incrementDouble: _kIncrementDouble, - FieldValueType.incrementInteger: _kIncrementInteger, - }; - - @override - void writeValue(WriteBuffer buffer, dynamic value) { - if (value is DateTime) { - buffer.putUint8(_kDateTime); - buffer.putInt64(value.millisecondsSinceEpoch); - } else if (value is Timestamp) { - buffer.putUint8(_kTimestamp); - buffer.putInt64(value.seconds); - buffer.putInt32(value.nanoseconds); - } else if (value is GeoPoint) { - buffer.putUint8(_kGeoPoint); - buffer.putFloat64(value.latitude); - buffer.putFloat64(value.longitude); - } else if (value is DocumentReference) { - buffer.putUint8(_kDocumentReference); - final List appName = utf8.encoder.convert(value.firestore.app.name); - writeSize(buffer, appName.length); - buffer.putUint8List(appName); - final List bytes = utf8.encoder.convert(value.path); - writeSize(buffer, bytes.length); - buffer.putUint8List(bytes); - } else if (value is Blob) { - buffer.putUint8(_kBlob); - writeSize(buffer, value.bytes.length); - buffer.putUint8List(value.bytes); - } else if (value is FieldValue) { - final int code = _kFieldValueCodes[value.type]; - assert(code != null); - buffer.putUint8(code); - if (value.value != null) writeValue(buffer, value.value); - } else { - super.writeValue(buffer, value); - } - } - - @override - dynamic readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case _kDateTime: - return DateTime.fromMillisecondsSinceEpoch(buffer.getInt64()); - case _kTimestamp: - return Timestamp(buffer.getInt64(), buffer.getInt32()); - case _kGeoPoint: - return GeoPoint(buffer.getFloat64(), buffer.getFloat64()); - case _kDocumentReference: - final int appNameLength = readSize(buffer); - final String appName = - utf8.decoder.convert(buffer.getUint8List(appNameLength)); - final FirebaseApp app = FirebaseApp(name: appName); - final Firestore firestore = Firestore(app: app); - final int pathLength = readSize(buffer); - final String path = - utf8.decoder.convert(buffer.getUint8List(pathLength)); - return firestore.document(path); - case _kBlob: - final int length = readSize(buffer); - final List bytes = buffer.getUint8List(length); - return Blob(bytes); - case _kArrayUnion: - final List value = readValue(buffer); - return FieldValue.arrayUnion(value); - case _kArrayRemove: - final List value = readValue(buffer); - return FieldValue.arrayRemove(value); - case _kDelete: - return FieldValue.delete(); - case _kServerTimestamp: - return FieldValue.serverTimestamp(); - case _kIncrementDouble: - final double value = readValue(buffer); - return FieldValue.increment(value); - case _kIncrementInteger: - final int value = readValue(buffer); - return FieldValue.increment(value); - default: - return super.readValueOfType(type, buffer); - } - } -} diff --git a/packages/cloud_firestore/lib/src/geo_point.dart b/packages/cloud_firestore/lib/src/geo_point.dart deleted file mode 100644 index bc91d4d16712..000000000000 --- a/packages/cloud_firestore/lib/src/geo_point.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -class GeoPoint { - const GeoPoint(this.latitude, this.longitude); - - final double latitude; - final double longitude; - - @override - bool operator ==(dynamic o) => - o is GeoPoint && o.latitude == latitude && o.longitude == longitude; - - @override - int get hashCode => hashValues(latitude, longitude); -} diff --git a/packages/cloud_firestore/lib/src/query.dart b/packages/cloud_firestore/lib/src/query.dart deleted file mode 100644 index 114b48a6df57..000000000000 --- a/packages/cloud_firestore/lib/src/query.dart +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// Represents a query over the data at a particular location. -class Query { - Query._( - {@required this.firestore, - @required List pathComponents, - bool isCollectionGroup = false, - Map parameters}) - : _pathComponents = pathComponents, - _isCollectionGroup = isCollectionGroup, - _parameters = parameters ?? - Map.unmodifiable({ - 'where': List>.unmodifiable(>[]), - 'orderBy': List>.unmodifiable(>[]), - }), - assert(firestore != null), - assert(pathComponents != null); - - /// The Firestore instance associated with this query - final Firestore firestore; - - final List _pathComponents; - final Map _parameters; - final bool _isCollectionGroup; - - String get _path => _pathComponents.join('/'); - - Query _copyWithParameters(Map parameters) { - return Query._( - firestore: firestore, - isCollectionGroup: _isCollectionGroup, - pathComponents: _pathComponents, - parameters: Map.unmodifiable( - Map.from(_parameters)..addAll(parameters), - ), - ); - } - - Map buildArguments() { - return Map.from(_parameters) - ..addAll({ - 'path': _path, - }); - } - - /// Notifies of query results at this location - // TODO(jackson): Reduce code duplication with [DocumentReference] - Stream snapshots({bool includeMetadataChanges = false}) { - assert(includeMetadataChanges != null); - Future _handle; - // It's fine to let the StreamController be garbage collected once all the - // subscribers have cancelled; this analyzer warning is safe to ignore. - StreamController controller; // ignore: close_sinks - controller = StreamController.broadcast( - onListen: () { - _handle = Firestore.channel.invokeMethod( - 'Query#addSnapshotListener', - { - 'app': firestore.app.name, - 'path': _path, - 'isCollectionGroup': _isCollectionGroup, - 'parameters': _parameters, - 'includeMetadataChanges': includeMetadataChanges, - }, - ).then((dynamic result) => result); - _handle.then((int handle) { - Firestore._queryObservers[handle] = controller; - }); - }, - onCancel: () { - _handle.then((int handle) async { - await Firestore.channel.invokeMethod( - 'removeListener', - {'handle': handle}, - ); - Firestore._queryObservers.remove(handle); - }); - }, - ); - return controller.stream; - } - - /// Fetch the documents for this query - Future getDocuments( - {Source source = Source.serverAndCache}) async { - assert(source != null); - final Map data = - await Firestore.channel.invokeMapMethod( - 'Query#getDocuments', - { - 'app': firestore.app.name, - 'path': _path, - 'isCollectionGroup': _isCollectionGroup, - 'parameters': _parameters, - 'source': _getSourceString(source), - }, - ); - return QuerySnapshot._(data, firestore); - } - - /// Obtains a CollectionReference corresponding to this query's location. - CollectionReference reference() => - CollectionReference._(firestore, _pathComponents); - - /// Creates and returns a new [Query] with additional filter on specified - /// [field]. [field] refers to a field in a document. - /// - /// The [field] may consist of a single field name (referring to a top level - /// field in the document), or a series of field names seperated by dots '.' - /// (referring to a nested field in the document). - /// - /// Only documents satisfying provided condition are included in the result - /// set. - Query where( - String field, { - dynamic isEqualTo, - dynamic isLessThan, - dynamic isLessThanOrEqualTo, - dynamic isGreaterThan, - dynamic isGreaterThanOrEqualTo, - dynamic arrayContains, - bool isNull, - }) { - final ListEquality equality = const ListEquality(); - final List> conditions = - List>.from(_parameters['where']); - - void addCondition(String field, String operator, dynamic value) { - final List condition = [field, operator, value]; - assert( - conditions - .where((List item) => equality.equals(condition, item)) - .isEmpty, - 'Condition $condition already exists in this query.'); - conditions.add(condition); - } - - if (isEqualTo != null) addCondition(field, '==', isEqualTo); - if (isLessThan != null) addCondition(field, '<', isLessThan); - if (isLessThanOrEqualTo != null) - addCondition(field, '<=', isLessThanOrEqualTo); - if (isGreaterThan != null) addCondition(field, '>', isGreaterThan); - if (isGreaterThanOrEqualTo != null) - addCondition(field, '>=', isGreaterThanOrEqualTo); - if (arrayContains != null) - addCondition(field, 'array-contains', arrayContains); - if (isNull != null) { - assert( - isNull, - 'isNull can only be set to true. ' - 'Use isEqualTo to filter on non-null values.'); - addCondition(field, '==', null); - } - - return _copyWithParameters({'where': conditions}); - } - - /// Creates and returns a new [Query] that's additionally sorted by the specified - /// [field]. - Query orderBy(String field, {bool descending = false}) { - final List> orders = - List>.from(_parameters['orderBy']); - - final List order = [field, descending]; - assert(orders.where((List item) => field == item[0]).isEmpty, - 'OrderBy $field already exists in this query'); - orders.add(order); - return _copyWithParameters({'orderBy': orders}); - } - - /// Creates and returns a new [Query] that starts after the provided document - /// (exclusive). The starting position is relative to the order of the query. - /// The document must contain all of the fields provided in the orderBy of - /// this query. - /// - /// Cannot be used in combination with [startAtDocument], [startAt], or - /// [startAfter], but can be used in combination with [endAt], - /// [endBefore], [endAtDocument] and [endBeforeDocument]. - /// - /// See also: - /// * [endAfterDocument] for a query that ends after a document. - /// * [startAtDocument] for a query that starts at a document. - /// * [endAtDocument] for a query that ends at a document. - Query startAfterDocument(DocumentSnapshot documentSnapshot) { - assert(documentSnapshot != null); - assert(!_parameters.containsKey('startAfter')); - assert(!_parameters.containsKey('startAt')); - assert(!_parameters.containsKey('startAfterDocument')); - assert(!_parameters.containsKey('startAtDocument')); - return _copyWithParameters({ - 'startAfterDocument': { - 'id': documentSnapshot.documentID, - 'path': documentSnapshot.reference.path, - 'data': documentSnapshot.data - } - }); - } - - /// Creates and returns a new [Query] that starts at the provided document - /// (inclusive). The starting position is relative to the order of the query. - /// The document must contain all of the fields provided in the orderBy of - /// this query. - /// - /// Cannot be used in combination with [startAfterDocument], [startAfter], or - /// [startAt], but can be used in combination with [endAt], - /// [endBefore], [endAtDocument] and [endBeforeDocument]. - /// - /// See also: - /// * [startAfterDocument] for a query that starts after a document. - /// * [endAtDocument] for a query that ends at a document. - /// * [endBeforeDocument] for a query that ends before a document. - Query startAtDocument(DocumentSnapshot documentSnapshot) { - assert(documentSnapshot != null); - assert(!_parameters.containsKey('startAfter')); - assert(!_parameters.containsKey('startAt')); - assert(!_parameters.containsKey('startAfterDocument')); - assert(!_parameters.containsKey('startAtDocument')); - return _copyWithParameters({ - 'startAtDocument': { - 'id': documentSnapshot.documentID, - 'path': documentSnapshot.reference.path, - 'data': documentSnapshot.data - }, - }); - } - - /// Takes a list of [values], creates and returns a new [Query] that starts - /// after the provided fields relative to the order of the query. - /// - /// The [values] must be in order of [orderBy] filters. - /// - /// Cannot be used in combination with [startAt], [startAfterDocument], or - /// [startAtDocument], but can be used in combination with [endAt], - /// [endBefore], [endAtDocument] and [endBeforeDocument]. - Query startAfter(List values) { - assert(values != null); - assert(!_parameters.containsKey('startAfter')); - assert(!_parameters.containsKey('startAt')); - assert(!_parameters.containsKey('startAfterDocument')); - assert(!_parameters.containsKey('startAtDocument')); - return _copyWithParameters({'startAfter': values}); - } - - /// Takes a list of [values], creates and returns a new [Query] that starts at - /// the provided fields relative to the order of the query. - /// - /// The [values] must be in order of [orderBy] filters. - /// - /// Cannot be used in combination with [startAfter], [startAfterDocument], - /// or [startAtDocument], but can be used in combination with [endAt], - /// [endBefore], [endAtDocument] and [endBeforeDocument]. - Query startAt(List values) { - assert(values != null); - assert(!_parameters.containsKey('startAfter')); - assert(!_parameters.containsKey('startAt')); - assert(!_parameters.containsKey('startAfterDocument')); - assert(!_parameters.containsKey('startAtDocument')); - return _copyWithParameters({'startAt': values}); - } - - /// Creates and returns a new [Query] that ends at the provided document - /// (inclusive). The end position is relative to the order of the query. - /// The document must contain all of the fields provided in the orderBy of - /// this query. - /// - /// Cannot be used in combination with [endBefore], [endBeforeDocument], or - /// [endAt], but can be used in combination with [startAt], - /// [startAfter], [startAtDocument] and [startAfterDocument]. - /// - /// See also: - /// * [startAfterDocument] for a query that starts after a document. - /// * [startAtDocument] for a query that starts at a document. - /// * [endBeforeDocument] for a query that ends before a document. - Query endAtDocument(DocumentSnapshot documentSnapshot) { - assert(documentSnapshot != null); - assert(!_parameters.containsKey('endBefore')); - assert(!_parameters.containsKey('endAt')); - assert(!_parameters.containsKey('endBeforeDocument')); - assert(!_parameters.containsKey('endAtDocument')); - return _copyWithParameters({ - 'endAtDocument': { - 'id': documentSnapshot.documentID, - 'path': documentSnapshot.reference.path, - 'data': documentSnapshot.data - }, - }); - } - - /// Takes a list of [values], creates and returns a new [Query] that ends at the - /// provided fields relative to the order of the query. - /// - /// The [values] must be in order of [orderBy] filters. - /// - /// Cannot be used in combination with [endBefore], [endBeforeDocument], or - /// [endAtDocument], but can be used in combination with [startAt], - /// [startAfter], [startAtDocument] and [startAfterDocument]. - Query endAt(List values) { - assert(values != null); - assert(!_parameters.containsKey('endBefore')); - assert(!_parameters.containsKey('endAt')); - assert(!_parameters.containsKey('endBeforeDocument')); - assert(!_parameters.containsKey('endAtDocument')); - return _copyWithParameters({'endAt': values}); - } - - /// Creates and returns a new [Query] that ends before the provided document - /// (exclusive). The end position is relative to the order of the query. - /// The document must contain all of the fields provided in the orderBy of - /// this query. - /// - /// Cannot be used in combination with [endAt], [endBefore], or - /// [endAtDocument], but can be used in combination with [startAt], - /// [startAfter], [startAtDocument] and [startAfterDocument]. - /// - /// See also: - /// * [startAfterDocument] for a query that starts after document. - /// * [startAtDocument] for a query that starts at a document. - /// * [endAtDocument] for a query that ends at a document. - Query endBeforeDocument(DocumentSnapshot documentSnapshot) { - assert(documentSnapshot != null); - assert(!_parameters.containsKey('endBefore')); - assert(!_parameters.containsKey('endAt')); - assert(!_parameters.containsKey('endBeforeDocument')); - assert(!_parameters.containsKey('endAtDocument')); - return _copyWithParameters({ - 'endBeforeDocument': { - 'id': documentSnapshot.documentID, - 'path': documentSnapshot.reference.path, - 'data': documentSnapshot.data, - }, - }); - } - - /// Takes a list of [values], creates and returns a new [Query] that ends before - /// the provided fields relative to the order of the query. - /// - /// The [values] must be in order of [orderBy] filters. - /// - /// Cannot be used in combination with [endAt], [endBeforeDocument], or - /// [endBeforeDocument], but can be used in combination with [startAt], - /// [startAfter], [startAtDocument] and [startAfterDocument]. - Query endBefore(List values) { - assert(values != null); - assert(!_parameters.containsKey('endBefore')); - assert(!_parameters.containsKey('endAt')); - assert(!_parameters.containsKey('endBeforeDocument')); - assert(!_parameters.containsKey('endAtDocument')); - return _copyWithParameters({'endBefore': values}); - } - - /// Creates and returns a new Query that's additionally limited to only return up - /// to the specified number of documents. - Query limit(int length) { - assert(!_parameters.containsKey('limit')); - return _copyWithParameters({'limit': length}); - } -} diff --git a/packages/cloud_firestore/lib/src/query_snapshot.dart b/packages/cloud_firestore/lib/src/query_snapshot.dart deleted file mode 100644 index 1ecb0bd54fe1..000000000000 --- a/packages/cloud_firestore/lib/src/query_snapshot.dart +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// A QuerySnapshot contains zero or more DocumentSnapshot objects. -class QuerySnapshot { - QuerySnapshot._(Map data, this._firestore) - : documents = List.generate(data['documents'].length, - (int index) { - return DocumentSnapshot._( - data['paths'][index], - _asStringKeyedMap(data['documents'][index]), - SnapshotMetadata._( - data['metadatas'][index]['hasPendingWrites'], - data['metadatas'][index]['isFromCache'], - ), - _firestore, - ); - }), - documentChanges = List.generate( - data['documentChanges'].length, (int index) { - return DocumentChange._( - data['documentChanges'][index], - _firestore, - ); - }), - metadata = SnapshotMetadata._( - data['metadata']['hasPendingWrites'], - data['metadata']['isFromCache'], - ); - - /// Gets a list of all the documents included in this snapshot - final List documents; - - /// An array of the documents that changed since the last snapshot. If this - /// is the first snapshot, all documents will be in the list as Added changes. - final List documentChanges; - - final SnapshotMetadata metadata; - - final Firestore _firestore; -} diff --git a/packages/cloud_firestore/lib/src/snapshot_metadata.dart b/packages/cloud_firestore/lib/src/snapshot_metadata.dart deleted file mode 100644 index 39f51f5928e8..000000000000 --- a/packages/cloud_firestore/lib/src/snapshot_metadata.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// Metadata about a snapshot, describing the state of the snapshot. -class SnapshotMetadata { - SnapshotMetadata._(this.hasPendingWrites, this.isFromCache); - - /// Whether the snapshot contains the result of local writes that have not yet - /// been committed to the backend. - /// - /// If your listener has opted into metadata updates (via - /// [DocumentListenOptions] or [QueryListenOptions]) you will receive another - /// snapshot with `hasPendingWrites` equal to `false` once the writes have been - /// committed to the backend. - final bool hasPendingWrites; - - /// Whether the snapshot was created from cached data rather than guaranteed - /// up-to-date server data. - /// - /// If your listener has opted into metadata updates (via - /// [DocumentListenOptions] or [QueryListenOptions]) you will receive another - /// snapshot with `isFomCache` equal to `false` once the client has received - /// up-to-date data from the backend. - final bool isFromCache; -} diff --git a/packages/cloud_firestore/lib/src/source.dart b/packages/cloud_firestore/lib/src/source.dart deleted file mode 100644 index 0a0a43eef8f3..000000000000 --- a/packages/cloud_firestore/lib/src/source.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// An enumeration of firestore source types. -enum Source { - /// Causes Firestore to try to retrieve an up-to-date (server-retrieved) snapshot, but fall back to - /// returning cached data if the server can't be reached. - serverAndCache, - - /// Causes Firestore to avoid the cache, generating an error if the server cannot be reached. Note - /// that the cache will still be updated if the server request succeeds. Also note that - /// latency-compensation still takes effect, so any pending write operations will be visible in the - /// returned data (merged into the server-provided data). - server, - - /// Causes Firestore to immediately return a value from the cache, ignoring the server completely - /// (implying that the returned value may be stale with respect to the value on the server). If - /// there is no data in the cache to satisfy the [get()] or [getDocuments()] call, - /// [DocumentReference.get()] will return an error and [Query.getDocuments()] will return an empty - /// [QuerySnapshot] with no documents. - cache, -} - -/// Converts [Source] to [String] -String _getSourceString(Source source) { - assert(source != null); - if (source == Source.server) { - return 'server'; - } - if (source == Source.cache) { - return 'cache'; - } - return 'default'; -} diff --git a/packages/cloud_firestore/lib/src/timestamp.dart b/packages/cloud_firestore/lib/src/timestamp.dart deleted file mode 100644 index 027f5a55ed76..000000000000 --- a/packages/cloud_firestore/lib/src/timestamp.dart +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2018, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -const int _kThousand = 1000; -const int _kMillion = 1000000; -const int _kBillion = 1000000000; - -void _check(bool expr, String name, int value) { - if (!expr) { - throw ArgumentError("Timestamp $name out of range: $value"); - } -} - -/// A Timestamp represents a point in time independent of any time zone or calendar, -/// represented as seconds and fractions of seconds at nanosecond resolution in UTC -/// Epoch time. It is encoded using the Proleptic Gregorian Calendar which extends -/// the Gregorian calendar backwards to year one. It is encoded assuming all minutes -/// are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table -/// is needed for interpretation. Range is from 0001-01-01T00:00:00Z to -/// 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we -/// can convert to and from RFC 3339 date strings. -/// -/// For more information, see [the reference timestamp definition](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto) -class Timestamp implements Comparable { - Timestamp(this._seconds, this._nanoseconds) { - _validateRange(_seconds, _nanoseconds); - } - - factory Timestamp.fromMillisecondsSinceEpoch(int milliseconds) { - final int seconds = (milliseconds / _kThousand).floor(); - final int nanoseconds = (milliseconds - seconds * _kThousand) * _kMillion; - return Timestamp(seconds, nanoseconds); - } - - factory Timestamp.fromMicrosecondsSinceEpoch(int microseconds) { - final int seconds = (microseconds / _kMillion).floor(); - final int nanoseconds = (microseconds - seconds * _kMillion) * _kThousand; - return Timestamp(seconds, nanoseconds); - } - - factory Timestamp.fromDate(DateTime date) { - return Timestamp.fromMicrosecondsSinceEpoch(date.microsecondsSinceEpoch); - } - - factory Timestamp.now() { - return Timestamp.fromMicrosecondsSinceEpoch( - DateTime.now().microsecondsSinceEpoch); - } - - final int _seconds; - final int _nanoseconds; - - static const int _kStartOfTime = -62135596800; - static const int _kEndOfTime = 253402300800; - - int get seconds => _seconds; - - int get nanoseconds => _nanoseconds; - - int get millisecondsSinceEpoch => - (seconds * _kThousand + nanoseconds / _kMillion).floor(); - - int get microsecondsSinceEpoch => - (seconds * _kMillion + nanoseconds / _kThousand).floor(); - - DateTime toDate() { - return DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch); - } - - @override - int get hashCode => hashValues(seconds, nanoseconds); - @override - bool operator ==(dynamic o) => - o is Timestamp && o.seconds == seconds && o.nanoseconds == nanoseconds; - @override - int compareTo(Timestamp other) { - if (seconds == other.seconds) { - return nanoseconds.compareTo(other.nanoseconds); - } - - return seconds.compareTo(other.seconds); - } - - @override - String toString() { - return "Timestamp(seconds=$seconds, nanoseconds=$nanoseconds)"; - } - - static void _validateRange(int seconds, int nanoseconds) { - _check(nanoseconds >= 0, 'nanoseconds', nanoseconds); - _check(nanoseconds < _kBillion, 'nanoseconds', nanoseconds); - _check(seconds >= _kStartOfTime, 'seconds', seconds); - _check(seconds < _kEndOfTime, 'seconds', seconds); - } -} diff --git a/packages/cloud_firestore/lib/src/transaction.dart b/packages/cloud_firestore/lib/src/transaction.dart deleted file mode 100644 index d13e3f19f9b2..000000000000 --- a/packages/cloud_firestore/lib/src/transaction.dart +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -typedef Future TransactionHandler(Transaction transaction); - -class Transaction { - @visibleForTesting - Transaction(this._transactionId, this._firestore); - - int _transactionId; - Firestore _firestore; - List> _pendingResults = >[]; - Future _finish() => Future.wait(_pendingResults); - - /// Reads the document referenced by the provided DocumentReference. - Future get(DocumentReference documentReference) { - final Future result = _get(documentReference); - _pendingResults.add(result); - return result; - } - - Future _get(DocumentReference documentReference) async { - final Map result = await Firestore.channel - .invokeMapMethod('Transaction#get', { - 'app': _firestore.app.name, - 'transactionId': _transactionId, - 'path': documentReference.path, - }); - if (result != null) { - return DocumentSnapshot._( - documentReference.path, - result['data']?.cast(), - SnapshotMetadata._(result['metadata']['hasPendingWrites'], - result['metadata']['isFromCache']), - _firestore); - } else { - return null; - } - } - - /// Deletes the document referred to by the provided [documentReference]. - /// - /// Awaiting the returned [Future] is optional and will be done automatically - /// when the transaction handler completes. - Future delete(DocumentReference documentReference) { - final Future result = _delete(documentReference); - _pendingResults.add(result); - return result; - } - - Future _delete(DocumentReference documentReference) async { - return Firestore.channel - .invokeMethod('Transaction#delete', { - 'app': _firestore.app.name, - 'transactionId': _transactionId, - 'path': documentReference.path, - }); - } - - /// Updates fields in the document referred to by [documentReference]. - /// The update will fail if applied to a document that does not exist. - /// - /// Awaiting the returned [Future] is optional and will be done automatically - /// when the transaction handler completes. - Future update( - DocumentReference documentReference, Map data) async { - final Future result = _update(documentReference, data); - _pendingResults.add(result); - return result; - } - - Future _update( - DocumentReference documentReference, Map data) async { - return Firestore.channel - .invokeMethod('Transaction#update', { - 'app': _firestore.app.name, - 'transactionId': _transactionId, - 'path': documentReference.path, - 'data': data, - }); - } - - /// Writes to the document referred to by the provided [DocumentReference]. - /// If the document does not exist yet, it will be created. If you pass - /// SetOptions, the provided data can be merged into the existing document. - /// - /// Awaiting the returned [Future] is optional and will be done automatically - /// when the transaction handler completes. - Future set( - DocumentReference documentReference, Map data) { - final Future result = _set(documentReference, data); - _pendingResults.add(result); - return result; - } - - Future _set( - DocumentReference documentReference, Map data) async { - return Firestore.channel - .invokeMethod('Transaction#set', { - 'app': _firestore.app.name, - 'transactionId': _transactionId, - 'path': documentReference.path, - 'data': data, - }); - } -} diff --git a/packages/cloud_firestore/lib/src/utils/auto_id_generator.dart b/packages/cloud_firestore/lib/src/utils/auto_id_generator.dart deleted file mode 100644 index e2e1cc57138a..000000000000 --- a/packages/cloud_firestore/lib/src/utils/auto_id_generator.dart +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2017, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:math'; - -/// Utility class for generating Firebase child node keys. -/// -/// Since the Flutter plugin API is asynchronous, there's no way for us -/// to use the native SDK to generate the node key synchronously and we -/// have to do it ourselves if we want to be able to reference the -/// newly-created node synchronously. -/// -/// This code is based largely on the Android implementation and ported to Dart. - -class AutoIdGenerator { - static const int _AUTO_ID_LENGTH = 20; - - static const String _AUTO_ID_ALPHABET = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - - static final Random _random = Random(); - - static String autoId() { - final StringBuffer stringBuffer = StringBuffer(); - final int maxRandom = _AUTO_ID_ALPHABET.length; - - for (int i = 0; i < _AUTO_ID_LENGTH; ++i) { - stringBuffer.write(_AUTO_ID_ALPHABET[_random.nextInt(maxRandom)]); - } - - return stringBuffer.toString(); - } -} diff --git a/packages/cloud_firestore/lib/src/write_batch.dart b/packages/cloud_firestore/lib/src/write_batch.dart deleted file mode 100644 index 6a41ee7bfec3..000000000000 --- a/packages/cloud_firestore/lib/src/write_batch.dart +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2018, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_firestore; - -/// A [WriteBatch] is a series of write operations to be performed as one unit. -/// -/// Operations done on a [WriteBatch] do not take effect until you [commit]. -/// -/// Once committed, no further operations can be performed on the [WriteBatch], -/// nor can it be committed again. -class WriteBatch { - WriteBatch._(this._firestore) - : _handle = Firestore.channel.invokeMethod( - 'WriteBatch#create', {'app': _firestore.app.name}); - - final Firestore _firestore; - Future _handle; - final List> _actions = >[]; - - /// Indicator to whether or not this [WriteBatch] has been committed. - bool _committed = false; - - /// Commits all of the writes in this write batch as a single atomic unit. - /// - /// Calling this method prevents any future operations from being added. - Future commit() async { - if (!_committed) { - _committed = true; - await Future.wait(_actions); - await Firestore.channel.invokeMethod( - 'WriteBatch#commit', {'handle': await _handle}); - } else { - throw StateError("This batch has already been committed."); - } - } - - /// Deletes the document referred to by [document]. - void delete(DocumentReference document) { - if (!_committed) { - _handle.then((dynamic handle) { - _actions.add( - Firestore.channel.invokeMethod( - 'WriteBatch#delete', - { - 'app': _firestore.app.name, - 'handle': handle, - 'path': document.path, - }, - ), - ); - }); - } else { - throw StateError( - "This batch has been committed and can no longer be changed."); - } - } - - /// Writes to the document referred to by [document]. - /// - /// If the document does not yet exist, it will be created. - /// - /// If [merge] is true, the provided data will be merged into an - /// existing document instead of overwriting. - void setData(DocumentReference document, Map data, - {bool merge = false}) { - if (!_committed) { - _handle.then((dynamic handle) { - _actions.add( - Firestore.channel.invokeMethod( - 'WriteBatch#setData', - { - 'app': _firestore.app.name, - 'handle': handle, - 'path': document.path, - 'data': data, - 'options': {'merge': merge}, - }, - ), - ); - }); - } else { - throw StateError( - "This batch has been committed and can no longer be changed."); - } - } - - /// Updates fields in the document referred to by [document]. - /// - /// If the document does not exist, the operation will fail. - void updateData(DocumentReference document, Map data) { - if (!_committed) { - _handle.then((dynamic handle) { - _actions.add( - Firestore.channel.invokeMethod( - 'WriteBatch#updateData', - { - 'app': _firestore.app.name, - 'handle': handle, - 'path': document.path, - 'data': data, - }, - ), - ); - }); - } else { - throw StateError( - "This batch has been committed and can no longer be changed."); - } - } -} diff --git a/packages/cloud_firestore/pubspec.yaml b/packages/cloud_firestore/pubspec.yaml deleted file mode 100755 index 475130fbb5f5..000000000000 --- a/packages/cloud_firestore/pubspec.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: cloud_firestore -description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database with - live synchronization and offline support on Android and iOS. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_firestore -version: 0.12.9 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.cloudfirestore - iosPrefix: FLT - pluginClass: CloudFirestorePlugin - -dependencies: - flutter: - sdk: flutter - meta: "^1.0.5" - collection: "^1.14.3" - firebase_core: "^0.4.0" - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/cloud_firestore/test/cloud_firestore_test.dart b/packages/cloud_firestore/test/cloud_firestore_test.dart deleted file mode 100755 index c68f04405009..000000000000 --- a/packages/cloud_firestore/test/cloud_firestore_test.dart +++ /dev/null @@ -1,1279 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:typed_data'; - -import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$Firestore', () { - int mockHandleId = 0; - FirebaseApp app; - Firestore firestore; - final List log = []; - CollectionReference collectionReference; - Query collectionGroupQuery; - Transaction transaction; - const Map kMockDocumentSnapshotData = { - '1': 2 - }; - const Map kMockSnapshotMetadata = { - "hasPendingWrites": false, - "isFromCache": false, - }; - setUp(() async { - mockHandleId = 0; - // Required for FirebaseApp.configure - FirebaseApp.channel.setMockMethodCallHandler( - (MethodCall methodCall) async {}, - ); - app = await FirebaseApp.configure( - name: 'testApp', - options: const FirebaseOptions( - googleAppID: '1:1234567890:ios:42424242424242', - gcmSenderID: '1234567890', - ), - ); - firestore = Firestore(app: app); - collectionReference = firestore.collection('foo'); - collectionGroupQuery = firestore.collectionGroup('bar'); - transaction = Transaction(0, firestore); - Firestore.channel.setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'Query#addSnapshotListener': - final int handle = mockHandleId++; - // Wait before sending a message back. - // Otherwise the first request didn't have the time to finish. - Future.delayed(Duration.zero).then((_) { - // TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. - // https://github.com/flutter/flutter/issues/33446 - // ignore: deprecated_member_use - BinaryMessages.handlePlatformMessage( - Firestore.channel.name, - Firestore.channel.codec.encodeMethodCall( - MethodCall('QuerySnapshot', { - 'app': app.name, - 'handle': handle, - 'paths': ["${methodCall.arguments['path']}/0"], - 'documents': [kMockDocumentSnapshotData], - 'metadatas': >[kMockSnapshotMetadata], - 'metadata': kMockSnapshotMetadata, - 'documentChanges': [ - { - 'oldIndex': -1, - 'newIndex': 0, - 'type': 'DocumentChangeType.added', - 'document': kMockDocumentSnapshotData, - 'metadata': kMockSnapshotMetadata, - }, - ], - }), - ), - (_) {}, - ); - }); - return handle; - case 'DocumentReference#addSnapshotListener': - final int handle = mockHandleId++; - // Wait before sending a message back. - // Otherwise the first request didn't have the time to finish. - Future.delayed(Duration.zero).then((_) { - // TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. - // https://github.com/flutter/flutter/issues/33446 - // ignore: deprecated_member_use - BinaryMessages.handlePlatformMessage( - Firestore.channel.name, - Firestore.channel.codec.encodeMethodCall( - MethodCall('DocumentSnapshot', { - 'handle': handle, - 'path': methodCall.arguments['path'], - 'data': kMockDocumentSnapshotData, - 'metadata': kMockSnapshotMetadata, - }), - ), - (_) {}, - ); - }); - return handle; - case 'Query#getDocuments': - return { - 'paths': ["${methodCall.arguments['path']}/0"], - 'documents': [kMockDocumentSnapshotData], - 'metadatas': >[kMockSnapshotMetadata], - 'metadata': kMockSnapshotMetadata, - 'documentChanges': [ - { - 'oldIndex': -1, - 'newIndex': 0, - 'type': 'DocumentChangeType.added', - 'document': kMockDocumentSnapshotData, - 'metadata': kMockSnapshotMetadata, - }, - ], - }; - case 'DocumentReference#setData': - return true; - case 'DocumentReference#get': - if (methodCall.arguments['path'] == 'foo/bar') { - return { - 'path': 'foo/bar', - 'data': {'key1': 'val1'}, - 'metadata': kMockSnapshotMetadata, - }; - } else if (methodCall.arguments['path'] == 'foo/notExists') { - return { - 'path': 'foo/notExists', - 'data': null, - 'metadata': kMockSnapshotMetadata, - }; - } - throw PlatformException(code: 'UNKNOWN_PATH'); - case 'Firestore#runTransaction': - return {'1': 3}; - case 'Transaction#get': - if (methodCall.arguments['path'] == 'foo/bar') { - return { - 'path': 'foo/bar', - 'data': {'key1': 'val1'}, - 'metadata': kMockSnapshotMetadata, - }; - } else if (methodCall.arguments['path'] == 'foo/notExists') { - return { - 'path': 'foo/notExists', - 'data': null, - 'metadata': kMockSnapshotMetadata, - }; - } - throw PlatformException(code: 'UNKNOWN_PATH'); - case 'Transaction#set': - return null; - case 'Transaction#update': - return null; - case 'Transaction#delete': - return null; - case 'WriteBatch#create': - return 1; - default: - return null; - } - }); - log.clear(); - }); - - test('multiple apps', () async { - expect(Firestore.instance, equals(Firestore())); - final FirebaseApp app = FirebaseApp(name: firestore.app.name); - expect(firestore, equals(Firestore(app: app))); - }); - - test('settings', () async { - final FirebaseApp app = const FirebaseApp(name: "testApp2"); - final Firestore firestoreWithSettings = Firestore(app: app); - await firestoreWithSettings.settings( - persistenceEnabled: true, - host: null, - sslEnabled: true, - timestampsInSnapshotsEnabled: true, - cacheSizeBytes: 500000, - ); - expect(log, [ - isMethodCall('Firestore#settings', arguments: { - 'app': firestoreWithSettings.app.name, - 'persistenceEnabled': true, - 'host': null, - 'sslEnabled': true, - 'timestampsInSnapshotsEnabled': true, - 'cacheSizeBytes': 500000, - }), - ]); - }); - - group('Transaction', () { - test('runTransaction', () async { - final Map result = await firestore.runTransaction( - (Transaction tx) async {}, - timeout: const Duration(seconds: 3)); - - expect(log, [ - isMethodCall('Firestore#runTransaction', arguments: { - 'app': app.name, - 'transactionId': 0, - 'transactionTimeout': 3000 - }), - ]); - expect(result, equals({'1': 3})); - }); - - test('get', () async { - final DocumentReference documentReference = - firestore.document('foo/bar'); - final DocumentSnapshot snapshot = - await transaction.get(documentReference); - expect(snapshot.reference.firestore, firestore); - expect(log, [ - isMethodCall('Transaction#get', arguments: { - 'app': app.name, - 'transactionId': 0, - 'path': documentReference.path - }) - ]); - }); - - test('get notExists', () async { - final DocumentReference documentReference = - firestore.document('foo/notExists'); - await transaction.get(documentReference); - expect(log, [ - isMethodCall('Transaction#get', arguments: { - 'app': app.name, - 'transactionId': 0, - 'path': documentReference.path - }) - ]); - }); - - test('delete', () async { - final DocumentReference documentReference = - firestore.document('foo/bar'); - await transaction.delete(documentReference); - expect(log, [ - isMethodCall('Transaction#delete', arguments: { - 'app': app.name, - 'transactionId': 0, - 'path': documentReference.path - }) - ]); - }); - - test('update', () async { - final DocumentReference documentReference = - firestore.document('foo/bar'); - final DocumentSnapshot documentSnapshot = await documentReference.get(); - final Map data = documentSnapshot.data; - data['key2'] = 'val2'; - await transaction.set(documentReference, data); - expect(log, [ - isMethodCall('DocumentReference#get', arguments: { - 'app': app.name, - 'path': 'foo/bar', - 'source': 'default', - }), - isMethodCall('Transaction#set', arguments: { - 'app': app.name, - 'transactionId': 0, - 'path': documentReference.path, - 'data': {'key1': 'val1', 'key2': 'val2'} - }) - ]); - }); - - test('set', () async { - final DocumentReference documentReference = - firestore.document('foo/bar'); - final DocumentSnapshot documentSnapshot = await documentReference.get(); - final Map data = documentSnapshot.data; - data['key2'] = 'val2'; - await transaction.set(documentReference, data); - expect(log, [ - isMethodCall('DocumentReference#get', arguments: { - 'app': app.name, - 'path': 'foo/bar', - 'source': 'default', - }), - isMethodCall('Transaction#set', arguments: { - 'app': app.name, - 'transactionId': 0, - 'path': documentReference.path, - 'data': {'key1': 'val1', 'key2': 'val2'} - }) - ]); - }); - }); - - group('Blob', () { - test('hashCode equality', () async { - final Uint8List bytesA = Uint8List(8); - bytesA.setAll(0, [0, 2, 4, 6, 8, 10, 12, 14]); - final Blob a = Blob(bytesA); - final Uint8List bytesB = Uint8List(8); - bytesB.setAll(0, [0, 2, 4, 6, 8, 10, 12, 14]); - final Blob b = Blob(bytesB); - expect(a.hashCode == b.hashCode, isTrue); - }); - test('hashCode not equal', () async { - final Uint8List bytesA = Uint8List(8); - bytesA.setAll(0, [0, 2, 4, 6, 8, 10, 12, 14]); - final Blob a = Blob(bytesA); - final Uint8List bytesB = Uint8List(8); - bytesB.setAll(0, [1, 2, 4, 6, 8, 10, 12, 14]); - final Blob b = Blob(bytesB); - expect(a.hashCode == b.hashCode, isFalse); - }); - }); - - group('CollectionsReference', () { - test('id', () async { - expect(collectionReference.id, equals('foo')); - }); - test('parent', () async { - final DocumentReference docRef = collectionReference.document('bar'); - expect(docRef.parent().id, equals('foo')); - expect(collectionReference.parent(), isNull); - }); - test('path', () async { - expect(collectionReference.path, equals('foo')); - }); - test('listen', () async { - final QuerySnapshot snapshot = await collectionReference - .snapshots(includeMetadataChanges: true) - .first; - final DocumentSnapshot document = snapshot.documents[0]; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - // Flush the async removeListener call - await Future.delayed(Duration.zero); - expect(log, [ - isMethodCall( - 'Query#addSnapshotListener', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'parameters': { - 'where': >[], - 'orderBy': >[], - }, - 'includeMetadataChanges': true, - }, - ), - isMethodCall( - 'removeListener', - arguments: {'handle': 0}, - ), - ]); - }); - test('where', () async { - final StreamSubscription subscription = - collectionReference - .where('createdAt', isLessThan: 100) - .snapshots() - .listen((QuerySnapshot querySnapshot) {}); - subscription.cancel(); - await Future.delayed(Duration.zero); - expect( - log, - equals([ - isMethodCall( - 'Query#addSnapshotListener', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'parameters': { - 'where': >[ - ['createdAt', '<', 100], - ], - 'orderBy': >[], - }, - 'includeMetadataChanges': false, - }, - ), - isMethodCall( - 'removeListener', - arguments: {'handle': 0}, - ), - ]), - ); - }); - test('where field isNull', () async { - final StreamSubscription subscription = - collectionReference - .where('profile', isNull: true) - .snapshots() - .listen((QuerySnapshot querySnapshot) {}); - subscription.cancel(); - await Future.delayed(Duration.zero); - expect( - log, - equals([ - isMethodCall( - 'Query#addSnapshotListener', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'parameters': { - 'where': >[ - ['profile', '==', null], - ], - 'orderBy': >[], - }, - 'includeMetadataChanges': false, - }, - ), - isMethodCall( - 'removeListener', - arguments: {'handle': 0}, - ), - ]), - ); - }); - test('orderBy', () async { - final StreamSubscription subscription = - collectionReference - .orderBy('createdAt') - .snapshots() - .listen((QuerySnapshot querySnapshot) {}); - subscription.cancel(); - await Future.delayed(Duration.zero); - expect( - log, - equals([ - isMethodCall( - 'Query#addSnapshotListener', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'parameters': { - 'where': >[], - 'orderBy': >[ - ['createdAt', false] - ], - }, - 'includeMetadataChanges': false, - }, - ), - isMethodCall( - 'removeListener', - arguments: {'handle': 0}, - ), - ]), - ); - }); - }); - - group('DocumentReference', () { - test('listen', () async { - final DocumentSnapshot snapshot = await firestore - .document('path/to/foo') - .snapshots(includeMetadataChanges: true) - .first; - expect(snapshot.documentID, equals('foo')); - expect(snapshot.reference.path, equals('path/to/foo')); - expect(snapshot.data, equals(kMockDocumentSnapshotData)); - // Flush the async removeListener call - await Future.delayed(Duration.zero); - expect( - log, - [ - isMethodCall( - 'DocumentReference#addSnapshotListener', - arguments: { - 'app': app.name, - 'path': 'path/to/foo', - 'includeMetadataChanges': true, - }, - ), - isMethodCall( - 'removeListener', - arguments: {'handle': 0}, - ), - ], - ); - }); - test('set', () async { - await collectionReference - .document('bar') - .setData({'bazKey': 'quxValue'}); - expect( - log, - [ - isMethodCall( - 'DocumentReference#setData', - arguments: { - 'app': app.name, - 'path': 'foo/bar', - 'data': {'bazKey': 'quxValue'}, - 'options': {'merge': false}, - }, - ), - ], - ); - }); - test('merge set', () async { - await collectionReference - .document('bar') - .setData({'bazKey': 'quxValue'}, merge: true); - expect( - log, - [ - isMethodCall( - 'DocumentReference#setData', - arguments: { - 'app': app.name, - 'path': 'foo/bar', - 'data': {'bazKey': 'quxValue'}, - 'options': {'merge': true}, - }, - ), - ], - ); - }); - test('update', () async { - await collectionReference - .document('bar') - .updateData({'bazKey': 'quxValue'}); - expect( - log, - [ - isMethodCall( - 'DocumentReference#updateData', - arguments: { - 'app': app.name, - 'path': 'foo/bar', - 'data': {'bazKey': 'quxValue'}, - }, - ), - ], - ); - }); - test('delete', () async { - await collectionReference.document('bar').delete(); - expect( - log, - equals([ - isMethodCall( - 'DocumentReference#delete', - arguments: { - 'app': app.name, - 'path': 'foo/bar', - }, - ), - ]), - ); - }); - test('get', () async { - final DocumentSnapshot snapshot = - await collectionReference.document('bar').get(source: Source.cache); - expect(snapshot.reference.firestore, firestore); - expect( - log, - equals([ - isMethodCall( - 'DocumentReference#get', - arguments: { - 'app': app.name, - 'path': 'foo/bar', - 'source': 'cache', - }, - ), - ]), - ); - log.clear(); - expect(snapshot.reference.path, equals('foo/bar')); - expect(snapshot.data.containsKey('key1'), equals(true)); - expect(snapshot.data['key1'], equals('val1')); - expect(snapshot.exists, isTrue); - - final DocumentSnapshot snapshot2 = await collectionReference - .document('notExists') - .get(source: Source.serverAndCache); - expect(snapshot2.data, isNull); - expect(snapshot2.exists, isFalse); - expect( - log, - equals([ - isMethodCall( - 'DocumentReference#get', - arguments: { - 'app': app.name, - 'path': 'foo/notExists', - 'source': 'default', - }, - ), - ]), - ); - - try { - await collectionReference.document('baz').get(); - } on PlatformException catch (e) { - expect(e.code, equals('UNKNOWN_PATH')); - } - }); - test('collection', () async { - final CollectionReference colRef = - collectionReference.document('bar').collection('baz'); - expect(colRef.path, equals('foo/bar/baz')); - }); - test('parent', () async { - final CollectionReference colRef = - collectionReference.document('bar').collection('baz'); - expect(colRef.parent().documentID, equals('bar')); - }); - }); - - group('Query', () { - test('getDocumentsFromCollection', () async { - QuerySnapshot snapshot = - await collectionReference.getDocuments(source: Source.server); - expect(snapshot.metadata.hasPendingWrites, - equals(kMockSnapshotMetadata['hasPendingWrites'])); - expect(snapshot.metadata.isFromCache, - equals(kMockSnapshotMetadata['isFromCache'])); - DocumentSnapshot document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // startAtDocument - snapshot = - await collectionReference.startAtDocument(document).getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // startAfterDocument - snapshot = await collectionReference - .startAfterDocument(document) - .getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // endAtDocument - snapshot = - await collectionReference.endAtDocument(document).getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // endBeforeDocument - snapshot = await collectionReference - .endBeforeDocument(document) - .getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // startAtDocument - endAtDocument - snapshot = await collectionReference - .startAtDocument(document) - .endAtDocument(document) - .getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('foo/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - expect( - log, - equals( - [ - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'source': 'server', - 'parameters': { - 'where': >[], - 'orderBy': >[], - }, - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'startAtDocument': { - 'id': '0', - 'path': 'foo/0', - 'data': kMockDocumentSnapshotData, - }, - }, - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'startAfterDocument': { - 'id': '0', - 'path': 'foo/0', - 'data': kMockDocumentSnapshotData, - }, - }, - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'endAtDocument': { - 'id': '0', - 'path': 'foo/0', - 'data': kMockDocumentSnapshotData, - }, - }, - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'endBeforeDocument': { - 'id': '0', - 'path': 'foo/0', - 'data': kMockDocumentSnapshotData, - }, - }, - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'foo', - 'isCollectionGroup': false, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'startAtDocument': { - 'id': '0', - 'path': 'foo/0', - 'data': kMockDocumentSnapshotData, - }, - 'endAtDocument': { - 'id': '0', - 'path': 'foo/0', - 'data': kMockDocumentSnapshotData, - }, - }, - }, - ), - ], - ), - ); - }); - test('getDocumentsFromCollectionGroup', () async { - QuerySnapshot snapshot = await collectionGroupQuery.getDocuments(); - expect(snapshot.metadata.hasPendingWrites, - equals(kMockSnapshotMetadata['hasPendingWrites'])); - expect(snapshot.metadata.isFromCache, - equals(kMockSnapshotMetadata['isFromCache'])); - DocumentSnapshot document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('bar/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // startAtDocument - snapshot = - await collectionGroupQuery.startAtDocument(document).getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('bar/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // startAfterDocument - snapshot = await collectionGroupQuery - .startAfterDocument(document) - .getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('bar/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // endAtDocument - snapshot = - await collectionGroupQuery.endAtDocument(document).getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('bar/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // endBeforeDocument - snapshot = await collectionGroupQuery - .endBeforeDocument(document) - .getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('bar/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - // startAtDocument - endAtDocument - snapshot = await collectionGroupQuery - .startAtDocument(document) - .endAtDocument(document) - .getDocuments(); - document = snapshot.documents.first; - expect(document.documentID, equals('0')); - expect(document.reference.path, equals('bar/0')); - expect(document.data, equals(kMockDocumentSnapshotData)); - - expect( - log, - equals( - [ - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'bar', - 'isCollectionGroup': true, - 'parameters': { - 'where': >[], - 'orderBy': >[], - }, - 'source': 'default', - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'bar', - 'isCollectionGroup': true, - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'startAtDocument': { - 'id': '0', - 'path': 'bar/0', - 'data': kMockDocumentSnapshotData, - }, - }, - 'source': 'default', - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'bar', - 'isCollectionGroup': true, - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'startAfterDocument': { - 'id': '0', - 'path': 'bar/0', - 'data': kMockDocumentSnapshotData, - }, - }, - 'source': 'default', - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'bar', - 'isCollectionGroup': true, - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'endAtDocument': { - 'id': '0', - 'path': 'bar/0', - 'data': kMockDocumentSnapshotData, - }, - }, - 'source': 'default', - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'bar', - 'isCollectionGroup': true, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'endBeforeDocument': { - 'id': '0', - 'path': 'bar/0', - 'data': kMockDocumentSnapshotData, - }, - }, - 'source': 'default', - }, - ), - isMethodCall( - 'Query#getDocuments', - arguments: { - 'app': app.name, - 'path': 'bar', - 'isCollectionGroup': true, - 'source': 'default', - 'parameters': { - 'where': >[], - 'orderBy': >[], - 'startAtDocument': { - 'id': '0', - 'path': 'bar/0', - 'data': kMockDocumentSnapshotData, - }, - 'endAtDocument': { - 'id': '0', - 'path': 'bar/0', - 'data': kMockDocumentSnapshotData, - }, - }, - 'source': 'default', - }, - ), - ], - ), - ); - }); - }); - - group('FirestoreMessageCodec', () { - const MessageCodec codec = FirestoreMessageCodec(); - final DateTime testTime = DateTime(2015, 10, 30, 11, 16); - final Timestamp timestamp = Timestamp.fromDate(testTime); - test('should encode and decode simple messages', () { - _checkEncodeDecode(codec, testTime); - _checkEncodeDecode(codec, timestamp); - _checkEncodeDecode( - codec, const GeoPoint(37.421939, -122.083509)); - _checkEncodeDecode(codec, firestore.document('foo/bar')); - }); - test('should encode and decode composite message', () { - final List message = [ - testTime, - const GeoPoint(37.421939, -122.083509), - firestore.document('foo/bar'), - ]; - _checkEncodeDecode(codec, message); - }); - test('encode and decode blob', () { - final Uint8List bytes = Uint8List(4); - bytes[0] = 128; - final Blob message = Blob(bytes); - _checkEncodeDecode(codec, message); - }); - - test('encode and decode FieldValue', () { - _checkEncodeDecode(codec, FieldValue.arrayUnion([123])); - _checkEncodeDecode(codec, FieldValue.arrayRemove([123])); - _checkEncodeDecode(codec, FieldValue.delete()); - _checkEncodeDecode(codec, FieldValue.serverTimestamp()); - _checkEncodeDecode(codec, FieldValue.increment(1.0)); - _checkEncodeDecode(codec, FieldValue.increment(1)); - }); - }); - - group('Timestamp', () { - test('is accurate for dates after epoch', () { - final DateTime date = DateTime.fromMillisecondsSinceEpoch(22501); - final Timestamp timestamp = Timestamp.fromDate(date); - - expect(timestamp.seconds, equals(22)); - expect(timestamp.nanoseconds, equals(501000000)); - }); - - test('is accurate for dates before epoch', () { - final DateTime date = DateTime.fromMillisecondsSinceEpoch(-1250); - final Timestamp timestamp = Timestamp.fromDate(date); - - expect(timestamp.seconds, equals(-2)); - expect(timestamp.nanoseconds, equals(750000000)); - }); - - test('creates equivalent timestamps regardless of factory', () { - const int kMilliseconds = 22501; - const int kMicroseconds = 22501000; - final DateTime date = - DateTime.fromMicrosecondsSinceEpoch(kMicroseconds); - - final Timestamp timestamp = Timestamp(22, 501000000); - final Timestamp milliTimestamp = - Timestamp.fromMillisecondsSinceEpoch(kMilliseconds); - final Timestamp microTimestamp = - Timestamp.fromMicrosecondsSinceEpoch(kMicroseconds); - final Timestamp dateTimestamp = Timestamp.fromDate(date); - - expect(timestamp, equals(milliTimestamp)); - expect(milliTimestamp, equals(microTimestamp)); - expect(microTimestamp, equals(dateTimestamp)); - }); - - test('correctly compares timestamps', () { - final Timestamp alpha = Timestamp.fromDate(DateTime(2017, 5, 11)); - final Timestamp beta1 = Timestamp.fromDate(DateTime(2018, 2, 19)); - final Timestamp beta2 = Timestamp.fromDate(DateTime(2018, 4, 2)); - final Timestamp beta3 = Timestamp.fromDate(DateTime(2018, 4, 20)); - final Timestamp preview = Timestamp.fromDate(DateTime(2018, 6, 20)); - final List inOrder = [ - alpha, - beta1, - beta2, - beta3, - preview - ]; - - final List timestamps = [ - beta2, - beta3, - alpha, - preview, - beta1 - ]; - timestamps.sort(); - expect(_deepEqualsList(timestamps, inOrder), isTrue); - }); - - test('rejects dates outside RFC 3339 range', () { - final List invalidDates = [ - DateTime.fromMillisecondsSinceEpoch(-70000000000000), - DateTime.fromMillisecondsSinceEpoch(300000000000000), - ]; - - invalidDates.forEach((DateTime date) { - expect(() => Timestamp.fromDate(date), throwsArgumentError); - }); - }); - }); - - group('WriteBatch', () { - test('set', () async { - final WriteBatch batch = firestore.batch(); - batch.setData( - collectionReference.document('bar'), - {'bazKey': 'quxValue'}, - ); - await batch.commit(); - expect( - log, - [ - isMethodCall('WriteBatch#create', arguments: { - 'app': app.name, - }), - isMethodCall( - 'WriteBatch#setData', - arguments: { - 'app': app.name, - 'handle': 1, - 'path': 'foo/bar', - 'data': {'bazKey': 'quxValue'}, - 'options': {'merge': false}, - }, - ), - isMethodCall( - 'WriteBatch#commit', - arguments: { - 'handle': 1, - }, - ), - ], - ); - }); - test('merge set', () async { - final WriteBatch batch = firestore.batch(); - batch.setData( - collectionReference.document('bar'), - {'bazKey': 'quxValue'}, - merge: true, - ); - await batch.commit(); - expect( - log, - [ - isMethodCall('WriteBatch#create', arguments: { - 'app': app.name, - }), - isMethodCall('WriteBatch#setData', arguments: { - 'app': app.name, - 'handle': 1, - 'path': 'foo/bar', - 'data': {'bazKey': 'quxValue'}, - 'options': {'merge': true}, - }), - isMethodCall( - 'WriteBatch#commit', - arguments: { - 'handle': 1, - }, - ), - ], - ); - }); - test('update', () async { - final WriteBatch batch = firestore.batch(); - batch.updateData( - collectionReference.document('bar'), - {'bazKey': 'quxValue'}, - ); - await batch.commit(); - expect( - log, - [ - isMethodCall( - 'WriteBatch#create', - arguments: { - 'app': app.name, - }, - ), - isMethodCall( - 'WriteBatch#updateData', - arguments: { - 'app': app.name, - 'handle': 1, - 'path': 'foo/bar', - 'data': {'bazKey': 'quxValue'}, - }, - ), - isMethodCall( - 'WriteBatch#commit', - arguments: { - 'handle': 1, - }, - ), - ], - ); - }); - test('delete', () async { - final WriteBatch batch = firestore.batch(); - batch.delete(collectionReference.document('bar')); - await batch.commit(); - expect( - log, - [ - isMethodCall( - 'WriteBatch#create', - arguments: { - 'app': app.name, - }, - ), - isMethodCall( - 'WriteBatch#delete', - arguments: { - 'app': app.name, - 'handle': 1, - 'path': 'foo/bar', - }, - ), - isMethodCall( - 'WriteBatch#commit', - arguments: { - 'handle': 1, - }, - ), - ], - ); - }); - }); - }); -} - -void _checkEncodeDecode(MessageCodec codec, T message) { - final ByteData encoded = codec.encodeMessage(message); - final T decoded = codec.decodeMessage(encoded); - if (message == null) { - expect(encoded, isNull); - expect(decoded, isNull); - } else { - expect(_deepEquals(message, decoded), isTrue); - final ByteData encodedAgain = codec.encodeMessage(decoded); - expect( - encodedAgain.buffer.asUint8List(), - orderedEquals(encoded.buffer.asUint8List()), - ); - } -} - -bool _deepEquals(dynamic valueA, dynamic valueB) { - if (valueA is TypedData) - return valueB is TypedData && _deepEqualsTypedData(valueA, valueB); - if (valueA is List) return valueB is List && _deepEqualsList(valueA, valueB); - if (valueA is Map) return valueB is Map && _deepEqualsMap(valueA, valueB); - if (valueA is double && valueA.isNaN) return valueB is double && valueB.isNaN; - if (valueA is FieldValue) { - return valueB is FieldValue && _deepEqualsFieldValue(valueA, valueB); - } - return valueA == valueB; -} - -bool _deepEqualsTypedData(TypedData valueA, TypedData valueB) { - if (valueA is ByteData) { - return valueB is ByteData && - _deepEqualsList( - valueA.buffer.asUint8List(), valueB.buffer.asUint8List()); - } - if (valueA is Uint8List) - return valueB is Uint8List && _deepEqualsList(valueA, valueB); - if (valueA is Int32List) - return valueB is Int32List && _deepEqualsList(valueA, valueB); - if (valueA is Int64List) - return valueB is Int64List && _deepEqualsList(valueA, valueB); - if (valueA is Float64List) - return valueB is Float64List && _deepEqualsList(valueA, valueB); - throw 'Unexpected typed data: $valueA'; -} - -bool _deepEqualsList(List valueA, List valueB) { - if (valueA.length != valueB.length) return false; - for (int i = 0; i < valueA.length; i++) { - if (!_deepEquals(valueA[i], valueB[i])) return false; - } - return true; -} - -bool _deepEqualsMap( - Map valueA, Map valueB) { - if (valueA.length != valueB.length) return false; - for (final dynamic key in valueA.keys) { - if (!valueB.containsKey(key) || !_deepEquals(valueA[key], valueB[key])) - return false; - } - return true; -} - -bool _deepEqualsFieldValue(FieldValue valueA, FieldValue valueB) { - if (valueA.type != valueB.type) return false; - if (valueA.value == null) return valueB.value == null; - if (valueA.value is List) return _deepEqualsList(valueA.value, valueB.value); - if (valueA.value is Map) return _deepEqualsMap(valueA.value, valueB.value); - return valueA.value == valueB.value; -} diff --git a/packages/cloud_functions/.gitignore b/packages/cloud_functions/.gitignore deleted file mode 100644 index b7209965bef4..000000000000 --- a/packages/cloud_functions/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -.DS_Store -.atom/ -.idea/ -.vscode/ - -.packages -.pub/ -.dart_tool/ -pubspec.lock - -Podfile -Podfile.lock -Pods/ -.symlinks/ -**/Flutter/App.framework/ -**/Flutter/Flutter.framework/ -**/Flutter/Generated.xcconfig -**/Flutter/flutter_assets/ -ServiceDefinitions.json -xcuserdata/ - -local.properties -.gradle/ -gradlew -gradlew.bat -gradle-wrapper.jar -*.iml - -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m -GeneratedPluginRegistrant.java -build/ -.flutter-plugins - -ios/Classes/UserAgent.h diff --git a/packages/cloud_functions/CHANGELOG.md b/packages/cloud_functions/CHANGELOG.md deleted file mode 100644 index 57062fbbfa2c..000000000000 --- a/packages/cloud_functions/CHANGELOG.md +++ /dev/null @@ -1,103 +0,0 @@ -## 0.4.1 - -* Support for cloud functions emulators. - -## 0.4.0+3 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.4.0+2 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.4.0+1 - -* Remove reference to unused header file. - -## 0.4.0 - -* Removed unused `parameters` param from `getHttpsCallable`. - -## 0.3.0+1 - -* Update iOS dependencies to latest. - -## 0.3.0 - -* Update Android dependencies to latest. - -## 0.2.0+1 - -* Removed flaky timeout test. - -## 0.2.0 - -* **Breaking change**. Updated Dart API to replace `call` with `getHttpsCallable`. -* Added support for timeouts. -* Additional integration testing. - -## 0.1.2+1 - -* Added a driver test. - -## 0.1.2 - -* Specifying a version for Cloud Functions CocoaPod dependency to prevent build errors on iOS. -* Fix on iOS when using a null region. -* Upgrade the firebase_core dependency of the example app. - -## 0.1.1+1 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.1.1 - -* Support for regions and multiple apps - -## 0.1.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.1.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.0.5 - -* Set iOS deployment target to 8.0 (minimum supported by both Firebase SDKs and Flutter), fixes compilation errors. -* Fixes null pointer error when callable function fails with exception (iOS). - -## 0.0.4+1 - -* Bump Android dependencies to latest. - -## 0.0.4 - -* Fixed podspec to use static_framework - -## 0.0.3 - -* Added missing dependency on meta package. - -## 0.0.2 - -* Bump Android and Firebase dependency versions. - -## 0.0.1 - -* The Cloud Functions for Firebase client SDKs let you call functions - directly from a Firebase app. This plugin exposes this ability to - Flutter apps. - - [Callable functions](https://firebase.google.com/docs/functions/callable) - are similar to other HTTP functions, with these additional features: - - - With callables, Firebase Authentication and FCM tokens are - automatically included in requests. - - The functions.https.onCall trigger automatically deserializes - the request body and validates auth tokens. diff --git a/packages/cloud_functions/LICENSE b/packages/cloud_functions/LICENSE deleted file mode 100644 index 7319cc0d9e04..000000000000 --- a/packages/cloud_functions/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright 2018, the Chromium project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/cloud_functions/README.md b/packages/cloud_functions/README.md deleted file mode 100644 index 0e3440416ddf..000000000000 --- a/packages/cloud_functions/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Cloud Functions Plugin for Flutter - -A Flutter plugin to use the [Cloud Functions for Firebase API](https://firebase.google.com/docs/functions/callable) - -[![pub package](https://img.shields.io/pub/v/cloud_functions.svg)](https://pub.dartlang.org/packages/cloud_functions) - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Setup - -To use this plugin: - -1. Using the [Firebase Console](http://console.firebase.google.com/), add an Android app to your project: -Follow the assistant, download the generated google-services.json file and place it inside android/app. Next, -modify the android/build.gradle file and the android/app/build.gradle file to add the Google services plugin -as described by the Firebase assistant. Ensure that your `android/build.gradle` file contains the -`maven.google.com` as [described here](https://firebase.google.com/docs/android/setup#add_the_sdk). -1. Using the [Firebase Console](http://console.firebase.google.com/), add an iOS app to your project: -Follow the assistant, download the generated GoogleService-Info.plist file, open ios/Runner.xcworkspace -with Xcode, and within Xcode place the file inside ios/Runner. Don't follow the steps named -"Add Firebase SDK" and "Add initialization code" in the Firebase assistant. -1. Add `cloud_functions` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). - -## Usage - -```dart -import 'package:cloud_functions/cloud_functions.dart'; -``` - -Getting an instance of the callable function: - -```dart -final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable( - functionName: 'YOUR_CALLABLE_FUNCTION_NAME', -); -``` - -Calling the function: - -```dart -dynamic resp = await callable.call(); -``` - -Calling the function with parameters: - -```dart -dynamic resp = await callable.call({ - 'YOUR_PARAMETER_NAME': 'YOUR_PARAMETER_VALUE', -}); -``` - -## Getting Started - -See the `example` directory for a complete sample app using Cloud Functions for Firebase. diff --git a/packages/cloud_functions/android/build.gradle b/packages/cloud_functions/android/build.gradle deleted file mode 100644 index 6dab63091f8d..000000000000 --- a/packages/cloud_functions/android/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -def PLUGIN = "cloud_functions"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebase.cloudfunctions' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-functions:17.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/cloud_functions/android/gradle.properties b/packages/cloud_functions/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/cloud_functions/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/cloud_functions/android/settings.gradle b/packages/cloud_functions/android/settings.gradle deleted file mode 100644 index 94986afd276c..000000000000 --- a/packages/cloud_functions/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'cloud_functions' diff --git a/packages/cloud_functions/android/src/main/AndroidManifest.xml b/packages/cloud_functions/android/src/main/AndroidManifest.xml deleted file mode 100644 index 9130c77645aa..000000000000 --- a/packages/cloud_functions/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/CloudFunctionsPlugin.java b/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/CloudFunctionsPlugin.java deleted file mode 100644 index b99ddefec324..000000000000 --- a/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/CloudFunctionsPlugin.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.cloudfunctions.cloudfunctions; - -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.FirebaseApp; -import com.google.firebase.functions.FirebaseFunctions; -import com.google.firebase.functions.FirebaseFunctionsException; -import com.google.firebase.functions.HttpsCallableReference; -import com.google.firebase.functions.HttpsCallableResult; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** CloudFunctionsPlugin */ -public class CloudFunctionsPlugin implements MethodCallHandler { - /** Plugin registration. */ - public static void registerWith(Registrar registrar) { - final MethodChannel channel = new MethodChannel(registrar.messenger(), "cloud_functions"); - channel.setMethodCallHandler(new CloudFunctionsPlugin()); - } - - @Override - public void onMethodCall(MethodCall call, final Result result) { - switch (call.method) { - case "CloudFunctions#call": - String functionName = call.argument("functionName"); - Map parameters = call.argument("parameters"); - String appName = call.argument("app"); - FirebaseApp app = FirebaseApp.getInstance(appName); - String region = call.argument("region"); - String origin = call.argument("origin"); - FirebaseFunctions functions; - if (region != null) { - functions = FirebaseFunctions.getInstance(app, region); - } else { - functions = FirebaseFunctions.getInstance(app); - } - if (origin != null) { - functions.useFunctionsEmulator(origin); - } - HttpsCallableReference httpsCallableReference = functions.getHttpsCallable(functionName); - Number timeoutMilliseconds = call.argument("timeoutMilliseconds"); - if (timeoutMilliseconds != null) { - httpsCallableReference.setTimeout(timeoutMilliseconds.longValue(), TimeUnit.MILLISECONDS); - } - httpsCallableReference - .call(parameters) - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (task.isSuccessful()) { - result.success(task.getResult().getData()); - } else { - if (task.getException() instanceof FirebaseFunctionsException) { - FirebaseFunctionsException exception = - (FirebaseFunctionsException) task.getException(); - Map exceptionMap = new HashMap<>(); - exceptionMap.put("code", exception.getCode().name()); - exceptionMap.put("message", exception.getMessage()); - exceptionMap.put("details", exception.getDetails()); - result.error( - "functionsError", - "Cloud function failed with exception.", - exceptionMap); - } else { - Exception exception = task.getException(); - result.error(null, exception.getMessage(), null); - } - } - } - }); - break; - default: - result.notImplemented(); - } - } -} diff --git a/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/FlutterFirebaseAppRegistrar.java b/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 859db85b6ca8..000000000000 --- a/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.cloudfunctions; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/cloud_functions/android/user-agent.gradle b/packages/cloud_functions/android/user-agent.gradle deleted file mode 100644 index 4c1efff355d5..000000000000 --- a/packages/cloud_functions/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-fn" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/cloud_functions/example/.metadata b/packages/cloud_functions/example/.metadata deleted file mode 100644 index e4328aa1f4e3..000000000000 --- a/packages/cloud_functions/example/.metadata +++ /dev/null @@ -1,8 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: b135fb3795a16ab2b884820ed7a67d650338aac3 - channel: master diff --git a/packages/cloud_functions/example/README.md b/packages/cloud_functions/example/README.md deleted file mode 100644 index ddf6c6e905f5..000000000000 --- a/packages/cloud_functions/example/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# cloud_functions_example - -Demonstrates how to use the cloud_functions plugin. - -## Function - -This example assumes the existence of the following function: - -``` -import * as functions from 'firebase-functions'; - -export const repeat = functions.https.onCall((data, context) => { - return { - repeat_message: data.message, - repeat_count: data.count + 1, - } -}); -``` - -This function accepts a message and count from the client and responds with -the same message and an incremented count. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](https://flutter.io/). diff --git a/packages/cloud_functions/example/android/app/build.gradle b/packages/cloud_functions/example/android/app/build.gradle deleted file mode 100644 index 4b75a0d8eec4..000000000000 --- a/packages/cloud_functions/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebase.cloudfunctions.cloudfunctionsexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/cloud_functions/example/android/app/google-services.json b/packages/cloud_functions/example/android/app/google-services.json deleted file mode 100644 index e0cbef053078..000000000000 --- a/packages/cloud_functions/example/android/app/google-services.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "project_info": { - "project_number": "297855924061", - "firebase_url": "https://flutterfire-cd2f7.firebaseio.com", - "project_id": "flutterfire-cd2f7", - "storage_bucket": "flutterfire-cd2f7.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:669871c998cc21bd", - "android_client_info": { - "package_name": "com.yourcompany.firebaseauth.example" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-r1u58cnh4p6l1ghpkteil46erlkfll62.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.yourcompany.firebaseauth.example", - "certificate_hash": "c3adef7e7773e40e777d5c236dbba7461cbea5f0" - } - }, - { - "client_id": "297855924061-col4in4uubarifm60nbq8id01ec3ss4c.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.yourcompany.firebaseauth.example", - "certificate_hash": "8a4e194f5bfc3fb1075e7daae8dcddd526fde207" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "297855924061-kb5qcr80u5irm12sbkppfts5shui45rv.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.functions.firebaseFunctionsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:7521d73664dc56fc", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.cloudfunctions.cloudfunctionsexample" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:6ef94ae486218531", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firebaseremoteconfigexample" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:236f9daea101f77e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-n8i063j2dib6goh5or4lrctg6sccpevi.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample", - "certificate_hash": "a8fc78a37cd4f0471580936de67a2cb2ae4657c7" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "297855924061-kb5qcr80u5irm12sbkppfts5shui45rv.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.functions.firebaseFunctionsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:db912bec12847bd9", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase_database_example" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-fbg7lp8bvtbibn2edns7d5fc3k0fhsa3.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebase_database_example", - "certificate_hash": "c3adef7e7773e40e777d5c236dbba7461cbea5f0" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "297855924061-kb5qcr80u5irm12sbkppfts5shui45rv.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.functions.firebaseFunctionsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:92efa9a0df6f077f", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase_storage_example" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/cloud_functions/example/android/app/gradle.properties b/packages/cloud_functions/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/cloud_functions/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/cloud_functions/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/cloud_functions/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/cloud_functions/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/cloud_functions/example/android/app/src/main/AndroidManifest.xml b/packages/cloud_functions/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index c202d0439f32..000000000000 --- a/packages/cloud_functions/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_functions/example/android/app/src/main/java/io/flutter/plugins/firebase/cloudfunctions/cloudfunctionsexample/MainActivity.java b/packages/cloud_functions/example/android/app/src/main/java/io/flutter/plugins/firebase/cloudfunctions/cloudfunctionsexample/MainActivity.java deleted file mode 100644 index e9cea8f13290..000000000000 --- a/packages/cloud_functions/example/android/app/src/main/java/io/flutter/plugins/firebase/cloudfunctions/cloudfunctionsexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebase.cloudfunctions.cloudfunctionsexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/cloud_functions/example/android/app/src/main/res/drawable/launch_background.xml b/packages/cloud_functions/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/cloud_functions/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/cloud_functions/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/cloud_functions/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/cloud_functions/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_functions/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/cloud_functions/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/cloud_functions/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_functions/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/cloud_functions/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/cloud_functions/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_functions/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/cloud_functions/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/cloud_functions/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_functions/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/cloud_functions/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/cloud_functions/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/cloud_functions/example/android/app/src/main/res/values/styles.xml b/packages/cloud_functions/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/cloud_functions/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/cloud_functions/example/android/build.gradle b/packages/cloud_functions/example/android/build.gradle deleted file mode 100644 index 359119307d55..000000000000 --- a/packages/cloud_functions/example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/cloud_functions/example/android/gradle.properties b/packages/cloud_functions/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/cloud_functions/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/cloud_functions/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/cloud_functions/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2819f022f1fd..000000000000 --- a/packages/cloud_functions/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/cloud_functions/example/android/settings.gradle b/packages/cloud_functions/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/cloud_functions/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/cloud_functions/example/ios/Flutter/AppFrameworkInfo.plist b/packages/cloud_functions/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9367d483e44e..000000000000 --- a/packages/cloud_functions/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 - - diff --git a/packages/cloud_functions/example/ios/Flutter/Debug.xcconfig b/packages/cloud_functions/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/cloud_functions/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/cloud_functions/example/ios/Flutter/Release.xcconfig b/packages/cloud_functions/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/cloud_functions/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/cloud_functions/example/ios/Runner.xcodeproj/project.pbxproj b/packages/cloud_functions/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 63fc2b8af35d..000000000000 --- a/packages/cloud_functions/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,499 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; - 321A95AA20CF709900174684 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 321A95A920CF709800174684 /* GoogleService-Info.plist */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8A0F7791B12524DDA0D8A3EA /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A5621CE483D44D1D6884687 /* libPods-Runner.a */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; - 321A95A920CF709800174684 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5A5621CE483D44D1D6884687 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 8A0F7791B12524DDA0D8A3EA /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3DF8FE6703033F0BCE4B5295 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 5A5621CE483D44D1D6884687 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 8AF80AEEDE5B4CF194812581 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 8AF80AEEDE5B4CF194812581 /* Pods */, - 3DF8FE6703033F0BCE4B5295 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 321A95A920CF709800174684 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - E8BAE8C0F3076226C64B5EF1 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 70F8FE3E9FCB1DECBF8E567D /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 321A95AA20CF709900174684 /* GoogleService-Info.plist in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 70F8FE3E9FCB1DECBF8E567D /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - E8BAE8C0F3076226C64B5EF1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.cloudfunctions.cloudFunctionsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.cloudfunctions.cloudFunctionsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/cloud_functions/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/cloud_functions/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/cloud_functions/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/cloud_functions/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/cloud_functions/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1263ac84b105..000000000000 --- a/packages/cloud_functions/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_functions/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/cloud_functions/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/cloud_functions/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/cloud_functions/example/ios/Runner/AppDelegate.h b/packages/cloud_functions/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/cloud_functions/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/cloud_functions/example/ios/Runner/AppDelegate.m b/packages/cloud_functions/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/cloud_functions/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/cloud_functions/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/cloud_functions/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/cloud_functions/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/cloud_functions/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_functions/example/ios/Runner/Base.lproj/Main.storyboard b/packages/cloud_functions/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/cloud_functions/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/cloud_functions/example/ios/Runner/GoogleService-Info.plist b/packages/cloud_functions/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 285747c33fba..000000000000 --- a/packages/cloud_functions/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 297855924061-6gkhkcr566enm8q2ds9d81quuh6mm6of.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.297855924061-6gkhkcr566enm8q2ds9d81quuh6mm6of - API_KEY - AIzaSyBq6mcufFXfyqr79uELCiqM_O_1-G72PVU - GCM_SENDER_ID - 297855924061 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebase.cloudfunctions.cloudFunctionsExample - PROJECT_ID - flutterfire-cd2f7 - STORAGE_BUCKET - flutterfire-cd2f7.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:297855924061:ios:ccfb5cc13360119c - DATABASE_URL - https://flutterfire-cd2f7.firebaseio.com - - \ No newline at end of file diff --git a/packages/cloud_functions/example/ios/Runner/Info.plist b/packages/cloud_functions/example/ios/Runner/Info.plist deleted file mode 100644 index 44a0467e2f2c..000000000000 --- a/packages/cloud_functions/example/ios/Runner/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - cloud_functions_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/cloud_functions/example/ios/Runner/main.m b/packages/cloud_functions/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/cloud_functions/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/cloud_functions/example/lib/main.dart b/packages/cloud_functions/example/lib/main.dart deleted file mode 100644 index ae88e469b6a4..000000000000 --- a/packages/cloud_functions/example/lib/main.dart +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2018, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:cloud_functions/cloud_functions.dart'; - -void main() => runApp(MyApp()); - -class MyApp extends StatefulWidget { - @override - _MyAppState createState() => _MyAppState(); -} - -class _MyAppState extends State { - String _response = 'no response'; - int _responseCount = 0; - - @override - Widget build(BuildContext context) { - final HttpsCallable callable = CloudFunctions.instance - .getHttpsCallable(functionName: 'repeat') - ..timeout = const Duration(seconds: 30); - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Cloud Functions example app'), - ), - body: Center( - child: Container( - margin: const EdgeInsets.only(top: 32.0, left: 16.0, right: 16.0), - child: Column( - children: [ - Text('Response $_responseCount: $_response'), - MaterialButton( - child: const Text('SEND REQUEST'), - onPressed: () async { - try { - final HttpsCallableResult result = await callable.call( - { - 'message': 'hello world!', - 'count': _responseCount, - }, - ); - print(result.data); - setState(() { - _response = result.data['repeat_message']; - _responseCount = result.data['repeat_count']; - }); - } on CloudFunctionsException catch (e) { - print('caught firebase functions exception'); - print(e.code); - print(e.message); - print(e.details); - } catch (e) { - print('caught generic exception'); - print(e); - } - }, - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/packages/cloud_functions/example/pubspec.yaml b/packages/cloud_functions/example/pubspec.yaml deleted file mode 100644 index 2619baf7dcb8..000000000000 --- a/packages/cloud_functions/example/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: cloud_functions_example -description: Demonstrates how to use the cloud_functions plugin. -version: 1.0.0+1 -author: Flutter Team - -dependencies: - flutter: - sdk: flutter - cupertino_icons: ^0.1.2 - cloud_functions: - path: .. - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - - -flutter: - uses-material-design: true - diff --git a/packages/cloud_functions/example/test/cloud_functions.dart b/packages/cloud_functions/example/test/cloud_functions.dart deleted file mode 100644 index 4bccc1f0aed0..000000000000 --- a/packages/cloud_functions/example/test/cloud_functions.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:cloud_functions/cloud_functions.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$CloudFunctions', () { - test('call', () async { - // default timeout - final HttpsCallable callable = - CloudFunctions.instance.getHttpsCallable(functionName: 'repeat'); - final HttpsCallableResult response = - await callable.call({ - 'message': 'foo', - 'count': 1, - }); - expect(response.data['repeat_message'], 'foo'); - - // long custom timeout - callable.timeout = const Duration(days: 300); - expect(response.data['repeat_count'], 2); - final dynamic response2 = await callable.call({ - 'message': 'bar', - 'count': 42, - }); - expect(response2.data['repeat_message'], 'bar'); - expect(response2.data['repeat_count'], 43); - }); - }); -} diff --git a/packages/cloud_functions/example/test/cloud_functions_test.dart b/packages/cloud_functions/example/test/cloud_functions_test.dart deleted file mode 100644 index f2c29d1115ac..000000000000 --- a/packages/cloud_functions/example/test/cloud_functions_test.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; - -import '../lib/main.dart'; - -void main() { - testWidgets('CloudFunctions example widget test', - (WidgetTester tester) async { - await tester.pumpWidget(MyApp()); - expect(find.text('Cloud Functions example app'), findsOneWidget); - }); -} diff --git a/packages/cloud_functions/example/test_driver/cloud_functions_test.dart b/packages/cloud_functions/example/test_driver/cloud_functions_test.dart deleted file mode 100644 index db46258dfebe..000000000000 --- a/packages/cloud_functions/example/test_driver/cloud_functions_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/cloud_functions/ios/Assets/.gitkeep b/packages/cloud_functions/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h b/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h deleted file mode 100644 index f49ddc6883d2..000000000000 --- a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface CloudFunctionsPlugin : NSObject -@end diff --git a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m b/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m deleted file mode 100644 index e48c0fbc73cb..000000000000 --- a/packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "CloudFunctionsPlugin.h" -#import "UserAgent.h" - -#import "Firebase/Firebase.h" - -@interface CloudFunctionsPlugin () -@property(nonatomic, retain) FlutterMethodChannel *_channel; -@end - -@implementation CloudFunctionsPlugin - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"cloud_functions" - binaryMessenger:[registrar messenger]]; - CloudFunctionsPlugin *instance = [[CloudFunctionsPlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"CloudFunctions#call" isEqualToString:call.method]) { - NSString *functionName = call.arguments[@"functionName"]; - NSObject *parameters = call.arguments[@"parameters"]; - NSString *appName = call.arguments[@"app"]; - NSString *region = call.arguments[@"region"]; - NSString *origin = call.arguments[@"origin"]; - NSNumber *timeoutMicroseconds = call.arguments[@"timeoutMicroseconds"]; - FIRApp *app = [FIRApp appNamed:appName]; - FIRFunctions *functions; - if (region != nil && region != (id)[NSNull null]) { - functions = [FIRFunctions functionsForApp:app region:region]; - } else { - functions = [FIRFunctions functionsForApp:app]; - } - if (origin != nil && origin != (id)[NSNull null]) { - [functions useFunctionsEmulatorOrigin:origin]; - } - FIRHTTPSCallable *function = [functions HTTPSCallableWithName:functionName]; - if (timeoutMicroseconds != nil && timeoutMicroseconds != [NSNull null]) { - [function setTimeoutInterval:(NSTimeInterval)timeoutMicroseconds.doubleValue / 1000000]; - } - [function callWithObject:parameters - completion:^(FIRHTTPSCallableResult *callableResult, NSError *error) { - if (error) { - FlutterError *flutterError; - if (error.domain == FIRFunctionsErrorDomain) { - NSDictionary *details = [NSMutableDictionary dictionary]; - [details setValue:[self mapFunctionsErrorCodes:error.code] forKey:@"code"]; - if (error.localizedDescription != nil) { - [details setValue:error.localizedDescription forKey:@"message"]; - } - if (error.userInfo[FIRFunctionsErrorDetailsKey] != nil) { - [details setValue:error.userInfo[FIRFunctionsErrorDetailsKey] - forKey:@"details"]; - } - - flutterError = - [FlutterError errorWithCode:@"functionsError" - message:@"Firebase function failed with exception." - details:details]; - } else { - flutterError = [FlutterError - errorWithCode:[NSString stringWithFormat:@"%ld", error.code] - message:error.localizedDescription - details:nil]; - } - result(flutterError); - } else { - result(callableResult.data); - } - }]; - } else { - result(FlutterMethodNotImplemented); - } -} - -// Map function error code objects to Strings that match error names on Android. -- (NSString *)mapFunctionsErrorCodes:(FIRFunctionsErrorCode)code { - if (code == FIRFunctionsErrorCodeAborted) { - return @"ABORTED"; - } else if (code == FIRFunctionsErrorCodeAlreadyExists) { - return @"ALREADY_EXISTS"; - } else if (code == FIRFunctionsErrorCodeCancelled) { - return @"CANCELLED"; - } else if (code == FIRFunctionsErrorCodeDataLoss) { - return @"DATA_LOSS"; - } else if (code == FIRFunctionsErrorCodeDeadlineExceeded) { - return @"DEADLINE_EXCEEDED"; - } else if (code == FIRFunctionsErrorCodeFailedPrecondition) { - return @"FAILED_PRECONDITION"; - } else if (code == FIRFunctionsErrorCodeInternal) { - return @"INTERNAL"; - } else if (code == FIRFunctionsErrorCodeInvalidArgument) { - return @"INVALID_ARGUMENT"; - } else if (code == FIRFunctionsErrorCodeNotFound) { - return @"NOT_FOUND"; - } else if (code == FIRFunctionsErrorCodeOK) { - return @"OK"; - } else if (code == FIRFunctionsErrorCodeOutOfRange) { - return @"OUT_OF_RANGE"; - } else if (code == FIRFunctionsErrorCodePermissionDenied) { - return @"PERMISSION_DENIED"; - } else if (code == FIRFunctionsErrorCodeResourceExhausted) { - return @"RESOURCE_EXHAUSTED"; - } else if (code == FIRFunctionsErrorCodeUnauthenticated) { - return @"UNAUTHENTICATED"; - } else if (code == FIRFunctionsErrorCodeUnavailable) { - return @"UNAVAILABLE"; - } else if (code == FIRFunctionsErrorCodeUnimplemented) { - return @"UNIMPLEMENTED"; - } else { - return @"UNKNOWN"; - } -} - -@end diff --git a/packages/cloud_functions/ios/cloud_functions.podspec b/packages/cloud_functions/ios/cloud_functions.podspec deleted file mode 100644 index 7ff410257bbe..000000000000 --- a/packages/cloud_functions/ios/cloud_functions.podspec +++ /dev/null @@ -1,34 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'cloud_functions' - s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/Functions', '~> 6.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-fn\\"" >> Classes/UserAgent.h - CMD -end - diff --git a/packages/cloud_functions/lib/cloud_functions.dart b/packages/cloud_functions/lib/cloud_functions.dart deleted file mode 100644 index 068d3040cfee..000000000000 --- a/packages/cloud_functions/lib/cloud_functions.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library cloud_functions; - -import 'dart:async'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -part 'src/cloud_functions.dart'; -part 'src/https_callable.dart'; -part 'src/https_callable_result.dart'; diff --git a/packages/cloud_functions/lib/src/cloud_functions.dart b/packages/cloud_functions/lib/src/cloud_functions.dart deleted file mode 100644 index d15db7b49a1f..000000000000 --- a/packages/cloud_functions/lib/src/cloud_functions.dart +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_functions; - -class CloudFunctionsException implements Exception { - CloudFunctionsException._(this.code, this.message, this.details); - - final String code; - final String message; - final dynamic details; -} - -/// The entry point for accessing a CloudFunctions. -/// -/// You can get an instance by calling [CloudFunctions.instance]. -class CloudFunctions { - CloudFunctions({FirebaseApp app, String region}) - : _app = app ?? FirebaseApp.instance, - _region = region; - - @visibleForTesting - static const MethodChannel channel = MethodChannel('cloud_functions'); - - static CloudFunctions _instance = CloudFunctions(); - - static CloudFunctions get instance => _instance; - - final FirebaseApp _app; - - final String _region; - - String _origin; - - /// Gets an instance of a Callable HTTPS trigger in Cloud Functions. - /// - /// Can then be executed by calling `call()` on it. - /// - /// @param functionName The name of the callable function. - HttpsCallable getHttpsCallable({@required String functionName}) { - return HttpsCallable._(this, functionName); - } - - /// Changes this instance to point to a Cloud Functions emulator running locally. - /// - /// @param origin The origin of the local emulator, such as "//10.0.2.2:5005". - CloudFunctions useFunctionsEmulator({@required String origin}) { - _origin = origin; - return this; - } -} diff --git a/packages/cloud_functions/lib/src/https_callable.dart b/packages/cloud_functions/lib/src/https_callable.dart deleted file mode 100644 index 6ae34dbf73f5..000000000000 --- a/packages/cloud_functions/lib/src/https_callable.dart +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_functions; - -/// A reference to a particular Callable HTTPS trigger in Cloud Functions. -/// -/// You can get an instance by calling [CloudFunctions.instance.getHTTPSCallable]. -class HttpsCallable { - HttpsCallable._(this._cloudFunctions, this._functionName); - - final CloudFunctions _cloudFunctions; - final String _functionName; - - /// Executes this Callable HTTPS trigger asynchronously. - /// - /// The data passed into the trigger can be any of the following types: - /// - /// `null` - /// `String` - /// `num` - /// [List], where the contained objects are also one of these types. - /// [Map], where the values are also one of these types. - /// - /// The request to the Cloud Functions backend made by this method - /// automatically includes a Firebase Instance ID token to identify the app - /// instance. If a user is logged in with Firebase Auth, an auth ID token for - /// the user is also automatically included. - Future call([dynamic parameters]) async { - try { - final MethodChannel channel = CloudFunctions.channel; - final dynamic response = await channel - .invokeMethod('CloudFunctions#call', { - 'app': _cloudFunctions._app.name, - 'region': _cloudFunctions._region, - 'origin': _cloudFunctions._origin, - 'timeoutMicroseconds': timeout?.inMicroseconds, - 'functionName': _functionName, - 'parameters': parameters, - }); - return HttpsCallableResult._(response); - } on PlatformException catch (e) { - if (e.code == 'functionsError') { - final String code = e.details['code']; - final String message = e.details['message']; - final dynamic details = e.details['details']; - throw CloudFunctionsException._(code, message, details); - } else { - throw Exception('Unable to call function ' + _functionName); - } - } catch (e) { - rethrow; - } - } - - /// The timeout to use when calling the function. Defaults to 60 seconds. - Duration timeout; -} diff --git a/packages/cloud_functions/lib/src/https_callable_result.dart b/packages/cloud_functions/lib/src/https_callable_result.dart deleted file mode 100644 index 46f53f3a0e93..000000000000 --- a/packages/cloud_functions/lib/src/https_callable_result.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -part of cloud_functions; - -/// The result of calling a HttpsCallable function. -class HttpsCallableResult { - HttpsCallableResult._(this.data); - - /// Returns the data that was returned from the Callable HTTPS trigger. - final dynamic data; -} diff --git a/packages/cloud_functions/pubspec.yaml b/packages/cloud_functions/pubspec.yaml deleted file mode 100644 index d1e9bf14f4cd..000000000000 --- a/packages/cloud_functions/pubspec.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: cloud_functions -description: Flutter plugin for Cloud Functions. -version: 0.4.1 -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/cloud_functions - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.cloudfunctions.cloudfunctions - pluginClass: CloudFunctionsPlugin - -dependencies: - meta: ^1.1.6 - flutter: - sdk: flutter - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - -environment: - sdk: '>=2.0.0-dev.28.0 <3.0.0' - flutter: '>=0.2.4 <2.0.0' diff --git a/packages/cloud_functions/test/cloud_functions_test.dart b/packages/cloud_functions/test/cloud_functions_test.dart deleted file mode 100644 index 6e58c422423f..000000000000 --- a/packages/cloud_functions/test/cloud_functions_test.dart +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2018, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:cloud_functions/cloud_functions.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$CloudFunctions', () { - final List log = []; - - setUp(() async { - CloudFunctions.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'FirebaseFunctions#call': - return { - 'foo': 'bar', - }; - default: - return true; - } - }); - log.clear(); - }); - - test('call', () async { - await CloudFunctions.instance - .getHttpsCallable(functionName: 'baz') - .call(); - final HttpsCallable callable = - CloudFunctions(app: const FirebaseApp(name: '1337'), region: 'space') - .getHttpsCallable(functionName: 'qux') - ..timeout = const Duration(days: 300); - await callable.call({ - 'quux': 'quuz', - }); - await CloudFunctions.instance - .useFunctionsEmulator(origin: 'http://localhost:5001') - .getHttpsCallable(functionName: 'bez') - .call(); - expect( - log, - [ - isMethodCall( - 'CloudFunctions#call', - arguments: { - 'app': '[DEFAULT]', - 'region': null, - 'origin': null, - 'functionName': 'baz', - 'timeoutMicroseconds': null, - 'parameters': null, - }, - ), - isMethodCall( - 'CloudFunctions#call', - arguments: { - 'app': '1337', - 'region': 'space', - 'origin': null, - 'functionName': 'qux', - 'timeoutMicroseconds': (const Duration(days: 300)).inMicroseconds, - 'parameters': {'quux': 'quuz'}, - }, - ), - isMethodCall( - 'CloudFunctions#call', - arguments: { - 'app': '[DEFAULT]', - 'region': null, - 'origin': 'http://localhost:5001', - 'functionName': 'bez', - 'timeoutMicroseconds': null, - 'parameters': null, - }, - ), - ], - ); - }); - }); -} diff --git a/packages/firebase_admob/CHANGELOG.md b/packages/firebase_admob/CHANGELOG.md deleted file mode 100644 index 7a44bfb131f5..000000000000 --- a/packages/firebase_admob/CHANGELOG.md +++ /dev/null @@ -1,165 +0,0 @@ -## 0.9.0+4 - -* Add the ability to horizontally adjust the ads banner location by specifying a pixel offset from the centre. - -## 0.9.0+3 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.9.0+2 - -* On Android, no longer crashes when registering the plugin if no activity is available. - -## 0.9.0+1 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. - -## 0.9.0 - -* Update Android dependencies to latest. - -## 0.8.0+4 - -* Update documentation to add AdMob App ID in Info.plist -* Add iOS AdMob App ID in Info.plist in example project - -## 0.8.0+3 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.8.0+2 - -* Remove categories. - -## 0.8.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.8.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.7.0 - -* Mark Dart code as deprecated where the newer version AdMob deprecates features (Birthday, Gender, and Family targeting). -* Update gradle dependencies. -* Add documentation for new AndroidManifest requirements. - -## 0.6.1+1 - -* Bump Android dependencies to latest. -* __THIS WAS AN UNINTENTIONAL BREAKING CHANGE__. Users should consume 0.6.1 instead if they need the old API, or 0.7.0 for the bumped version. -* Guide how to fix crash with admob version 17.0.0 in README - -## 0.6.1 - -* listener on MobileAd shouldn't be final. -* Ad listeners can to be set in or out of Ad initialization. - -## 0.6.0 - -* Add nonPersonalizedAds option to MobileAdTargetingInfo - -## 0.5.7 - -* Bumped mockito dependency to pick up Dart 2 support. - -## 0.5.6 - -* Bump Android and Firebase dependency versions. - -## 0.5.5 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.5.4+1 - -* Graduate to beta. - -## 0.5.4 - -* Fixed a bug that was causing rewarded video failure event to be called on the wrong listener. - -## 0.5.3 - -* Updated Google Play Services dependencies to version 15.0.0. -* Added handling of rewarded video completion event. - -## 0.5.2 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.5.1 - -* Fixed Dart 2 type errors. - -## 0.5.0 - -* **Breaking change**. The BannerAd constructor now requires an AdSize - parameter. BannerAds can be created with AdSize.smartBanner, or one of - the other predefined AdSize values. Previously BannerAds were always - defined with the smartBanner size. - -## 0.4.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.3.2 - -* Fixed Dart 2 type errors. - -## 0.3.1 - -* Enabled use in Swift projects. - -## 0.3.0 - -* Added support for rewarded video ads. -* **Breaking change**. The properties and parameters named "unitId" in BannerAd - and InterstitialAd have been renamed to "adUnitId" to better match AdMob's - documentation and UI. - -## 0.2.3 - -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.2.2 - -* Added platform-specific App IDs and ad unit IDs to example. -* Separated load and show functionality for interstitials in example. - -## 0.2.1 - -* Use safe area layout to place ad in iOS 11 - -## 0.2.0 - -* **Breaking change**. MobileAd TargetingInfo requestAgent is now hardcoded to 'flutter-alpha'. - -## 0.1.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). -* Relaxed GMS dependency to [11.4.0,12.0[ - -## 0.0.3 - -* Add FLT prefix to iOS types -* Change GMS dependency to 11.4.+ - -## 0.0.2 - -* Change GMS dependency to 11.+ - -## 0.0.1 - -* Initial Release: not ready for production use diff --git a/packages/firebase_admob/LICENSE b/packages/firebase_admob/LICENSE deleted file mode 100644 index c89293372cf3..000000000000 --- a/packages/firebase_admob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/firebase_admob/README.md b/packages/firebase_admob/README.md deleted file mode 100644 index a7a285249c49..000000000000 --- a/packages/firebase_admob/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# firebase_admob - -A plugin for [Flutter](https://flutter.io) that supports loading and -displaying banner, interstitial (full-screen), and rewarded video ads using the -[Firebase AdMob API](https://firebase.google.com/docs/admob/). - -*Note*: This plugin is in beta, and may still have a few issues and missing APIs. -[Feedback](https://github.com/flutter/flutter/issues) and -[Pull Requests](https://github.com/flutter/plugins/pulls) are welcome. - -## AndroidManifest changes - -AdMob 17 requires the App ID to be included in the `AndroidManifest.xml`. Failure -to do so will result in a crash on launch of your app. The line should look like: - -```xml - -``` - -where `[ADMOB_APP_ID]` is your App ID. You must pass the same value when you -initialize the plugin in your Dart code. - -See https://goo.gl/fQ2neu for more information about configuring `AndroidManifest.xml` -and setting up your App ID. - -## Info.plist changes - -Admob 7.42.0 requires the App ID to be included in `Info.plist`. Failure to do so will result in a crash on launch of your app. The lines should look like: - -```xml -GADApplicationIdentifier -[ADMOB_APP_ID] -``` - -where `[ADMOB_APP_ID]` is your App ID. You must pass the same value when you initialize the plugin in your Dart code. - -See https://developers.google.com/admob/ios/quick-start#update_your_infoplist for more information about configuring `Info.plist` and setting up your App ID. - -## Initializing the plugin -The AdMob plugin must be initialized with an AdMob App ID. - -```dart -FirebaseAdMob.instance.initialize(appId: appId); -``` -### Android -Starting in version 17.0.0, if you are an AdMob publisher you are now required to add your AdMob app ID in your **AndroidManifest.xml** file. Once you find your AdMob app ID in the AdMob UI, add it to your manifest adding the following tag: - -```xml - - - - - - -``` - -Failure to add this tag will result in the app crashing at app launch with a message starting with *"The Google Mobile Ads SDK was initialized incorrectly."* - -On Android, this value must be the same as the App ID value set in your -`AndroidManifest.xml`. - -### iOS -Starting in version 7.42.0, you are required to add your AdMob app ID in your **Info.plist** file under the Runner directory. You can add it using Xcode or edit the file manually: - -```xml - - GADApplicationIdentifier - ca-app-pub-################~########## - -``` - -Failure to add this tag will result in the app crashing at app launch with a message including *"GADVerifyApplicationID."* - -## Using banners and interstitials -Banner and interstitial ads can be configured with target information. -And in the example below, the ads are given test ad unit IDs for a quick start. - -```dart -MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo( - keywords: ['flutterio', 'beautiful apps'], - contentUrl: 'https://flutter.io', - birthday: DateTime.now(), - childDirected: false, - designedForFamilies: false, - gender: MobileAdGender.male, // or MobileAdGender.female, MobileAdGender.unknown - testDevices: [], // Android emulators are considered test devices -); - -BannerAd myBanner = BannerAd( - // Replace the testAdUnitId with an ad unit id from the AdMob dash. - // https://developers.google.com/admob/android/test-ads - // https://developers.google.com/admob/ios/test-ads - adUnitId: BannerAd.testAdUnitId, - size: AdSize.smartBanner, - targetingInfo: targetingInfo, - listener: (MobileAdEvent event) { - print("BannerAd event is $event"); - }, -); - -InterstitialAd myInterstitial = InterstitialAd( - // Replace the testAdUnitId with an ad unit id from the AdMob dash. - // https://developers.google.com/admob/android/test-ads - // https://developers.google.com/admob/ios/test-ads - adUnitId: InterstitialAd.testAdUnitId, - targetingInfo: targetingInfo, - listener: (MobileAdEvent event) { - print("InterstitialAd event is $event"); - }, -); -``` - -Ads must be loaded before they're shown. -```dart -myBanner - // typically this happens well before the ad is shown - ..load() - ..show( - // Positions the banner ad 60 pixels from the bottom of the screen - anchorOffset: 60.0, - // Positions the banner ad 10 pixels from the center of the screen to the right - horizontalCenterOffset: 10.0, - // Banner Position - anchorType: AnchorType.bottom, - ); -``` - -Ads must be loaded before they're shown. -```dart -myBanner - // typically this happens well before the ad is shown - ..load() - ..show( - // Positions the banner ad 60 pixels from the bottom of the screen - anchorOffset: 60.0, - // Positions the banner ad 10 pixels from the center of the screen to the left - horizontalCenterOffset: -10.0, - // Banner Position - anchorType: AnchorType.bottom, - ); -``` - -```dart -myInterstitial - ..load() - ..show( - anchorType: AnchorType.bottom, - anchorOffset: 0.0, - horizontalCenterOffset: 0.0, - ); -``` - -`BannerAd` and `InterstitialAd` objects can be disposed to free up plugin -resources. Disposing a banner ad that's been shown removes it from the screen. -Interstitial ads, however, can't be programmatically removed from view. - -Banner and interstitial ads can be created with a `MobileAdEvent` listener. The -listener can be used to detect when the ad has actually finished loading -(or failed to load at all). - -## Using rewarded video ads - -Unlike banners and interstitials, rewarded video ads are loaded one at a time -via a singleton object, `RewardedVideoAd.instance`. Its `load` method takes an -AdMob ad unit ID and an instance of `MobileAdTargetingInfo`: -```dart -RewardedVideoAd.instance.load(myAdMobAdUnitId, targetingInfo); -``` - -To listen for events in the rewarded video ad lifecycle, apps can define a -function matching the `RewardedVideoAdListener` typedef, and assign it to the -`listener` instance variable in `RewardedVideoAd`. If set, the `listener` -function will be invoked whenever one of the events in the `RewardedVideAdEvent` -enum occurs. After a rewarded video ad loads, for example, the -`RewardedVideoAdEvent.loaded` is sent. Any time after that, apps can show the ad -by calling `show`: -```dart -RewardedVideoAd.instance.show(); -``` - -When the AdMob SDK decides it's time to grant an in-app reward, it does so via -the `RewardedVideoAdEvent.rewarded` event: -```dart -RewardedVideoAd.instance.listener = - (RewardedVideoAdEvent event, {String rewardType, int rewardAmount}) { - if (event == RewardedVideoAdEvent.rewarded) { - setState(() { - // Here, apps should update state to reflect the reward. - _goldCoins += rewardAmount; - }); - } -}; -``` - -Because `RewardedVideoAd` is a singleton object, it does not offer a `dispose` -method. - -## Limitations - -This is just an initial version of the plugin. There are still some -limitations: - -- Banner ads cannot be animated into view. -- It's not possible to specify a banner ad's size. -- There's no support for native ads. -- The existing tests are fairly rudimentary. -- There is no API doc. -- The example should demonstrate how to show gate a route push with an - interstitial ad - -For Flutter plugins for other Firebase products, see -[FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). diff --git a/packages/firebase_admob/android/build.gradle b/packages/firebase_admob/android/build.gradle deleted file mode 100644 index 846ec4851ca3..000000000000 --- a/packages/firebase_admob/android/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -def PLUGIN = "firebase_admob"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebaseadmob' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-ads:17.2.0' - } -} diff --git a/packages/firebase_admob/android/gradle.properties b/packages/firebase_admob/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_admob/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_admob/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_admob/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 96ffc2a20435..000000000000 --- a/packages/firebase_admob/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Thu Nov 01 21:03:34 PDT 2018 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_admob/android/settings.gradle b/packages/firebase_admob/android/settings.gradle deleted file mode 100644 index c8378038e665..000000000000 --- a/packages/firebase_admob/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_admob' diff --git a/packages/firebase_admob/android/src/main/AndroidManifest.xml b/packages/firebase_admob/android/src/main/AndroidManifest.xml deleted file mode 100644 index 42a48978de0d..000000000000 --- a/packages/firebase_admob/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/AdRequestBuilderFactory.java b/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/AdRequestBuilderFactory.java deleted file mode 100644 index 9703241655c6..000000000000 --- a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/AdRequestBuilderFactory.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseadmob; - -import android.os.Bundle; -import android.util.Log; -import com.google.ads.mediation.admob.AdMobAdapter; -import com.google.android.gms.ads.AdRequest; -import java.util.ArrayList; -import java.util.Date; -import java.util.Map; - -class AdRequestBuilderFactory { - - private static final String TAG = "flutter"; - private final Map targetingInfo; - - AdRequestBuilderFactory(Map targetingInfo) { - this.targetingInfo = targetingInfo; - } - - private String getTargetingInfoString(String key, Object value) { - if (value == null) return null; - if (!(value instanceof String)) { - Log.w(TAG, "targeting info " + key + ": expected a String"); - return null; - } - String stringValue = (String) value; - if (stringValue.isEmpty()) { - Log.w(TAG, "targeting info " + key + ": expected a non-empty String"); - return null; - } - return stringValue; - } - - private Boolean getTargetingInfoBoolean(String key, Object value) { - if (value == null) return null; - if (!(value instanceof Boolean)) { - Log.w(TAG, "targeting info " + key + ": expected a boolean"); - return null; - } - return (Boolean) value; - } - - private Integer getTargetingInfoInteger(String key, Object value) { - if (value == null) return null; - if (!(value instanceof Integer)) { - Log.w(TAG, "targeting info " + key + ": expected an integer"); - return null; - } - return (Integer) value; - } - - private ArrayList getTargetingInfoArrayList(String key, Object value) { - if (value == null) return null; - if (!(value instanceof ArrayList)) { - Log.w(TAG, "targeting info " + key + ": expected an ArrayList"); - return null; - } - return (ArrayList) value; - } - - AdRequest.Builder createAdRequestBuilder() { - AdRequest.Builder builder = new AdRequest.Builder(); - if (targetingInfo == null) return builder; - - ArrayList testDevices = - getTargetingInfoArrayList("testDevices", targetingInfo.get("testDevices")); - if (testDevices != null) { - for (Object deviceValue : testDevices) { - String device = getTargetingInfoString("testDevices element", deviceValue); - if (device != null) builder.addTestDevice(device); - } - } - - ArrayList keywords = getTargetingInfoArrayList("keywords", targetingInfo.get("keywords")); - if (keywords != null) { - for (Object keywordValue : keywords) { - String keyword = getTargetingInfoString("keywords element", keywordValue); - if (keyword != null) builder.addKeyword(keyword); - } - } - - String contentUrl = getTargetingInfoString("contentUrl", targetingInfo.get("contentUrl")); - if (contentUrl != null) builder.setContentUrl(contentUrl); - - Object birthday = targetingInfo.get("birthday"); - if (birthday != null) { - if (!(birthday instanceof Long)) - Log.w(TAG, "targetingInfo birthday: expected a long integer"); - else builder.setBirthday(new Date((Long) birthday)); - } - - Integer gender = getTargetingInfoInteger("gender", targetingInfo.get("gender")); - if (gender != null) { - switch (gender) { - case 0: // MobileAdGender.unknown - case 1: // MobileAdGender.male - case 2: // MobileAdGender.female - builder.setGender(gender); - break; - default: - Log.w(TAG, "targetingInfo gender: invalid value"); - } - } - - Boolean designedForFamilies = - getTargetingInfoBoolean("designedForFamilies", targetingInfo.get("designedForFamilies")); - if (designedForFamilies != null) builder.setIsDesignedForFamilies(designedForFamilies); - - Boolean childDirected = - getTargetingInfoBoolean("childDirected", targetingInfo.get("childDirected")); - if (childDirected != null) builder.tagForChildDirectedTreatment(childDirected); - - String requestAgent = getTargetingInfoString("requestAgent", targetingInfo.get("requestAgent")); - if (requestAgent != null) builder.setRequestAgent(requestAgent); - - Boolean nonPersonalizedAds = - getTargetingInfoBoolean("nonPersonalizedAds", targetingInfo.get("nonPersonalizedAds")); - if (nonPersonalizedAds != null && nonPersonalizedAds) { - Bundle extras = new Bundle(); - extras.putString("npa", "1"); - builder.addNetworkExtrasBundle(AdMobAdapter.class, extras); - } - - return builder; - } -} diff --git a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/FirebaseAdMobPlugin.java b/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/FirebaseAdMobPlugin.java deleted file mode 100644 index 62e6fe4befeb..000000000000 --- a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/FirebaseAdMobPlugin.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseadmob; - -import android.app.Activity; -import android.view.Gravity; -import com.google.android.gms.ads.AdSize; -import com.google.android.gms.ads.MobileAds; -import com.google.firebase.FirebaseApp; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.util.Map; - -public class FirebaseAdMobPlugin implements MethodCallHandler { - - private final Registrar registrar; - private final MethodChannel channel; - - RewardedVideoAdWrapper rewardedWrapper; - - public static void registerWith(Registrar registrar) { - if (registrar.activity() == null) { - // If a background Flutter view tries to register the plugin, there will be no activity from the registrar. - // We stop the registering process immediately because the firebase_admob requires an activity. - return; - } - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_admob"); - channel.setMethodCallHandler(new FirebaseAdMobPlugin(registrar, channel)); - } - - private FirebaseAdMobPlugin(Registrar registrar, MethodChannel channel) { - this.registrar = registrar; - this.channel = channel; - FirebaseApp.initializeApp(registrar.context()); - rewardedWrapper = new RewardedVideoAdWrapper(registrar.activity(), channel); - } - - private void callInitialize(MethodCall call, Result result) { - String appId = call.argument("appId"); - if (appId == null || appId.isEmpty()) { - result.error("no_app_id", "a null or empty AdMob appId was provided", null); - return; - } - MobileAds.initialize(registrar.context(), appId); - result.success(Boolean.TRUE); - } - - private void callLoadBannerAd( - int id, Activity activity, MethodChannel channel, MethodCall call, Result result) { - String adUnitId = call.argument("adUnitId"); - if (adUnitId == null || adUnitId.isEmpty()) { - result.error("no_unit_id", "a null or empty adUnitId was provided for ad id=" + id, null); - return; - } - - int width = call.argument("width"); - int height = call.argument("height"); - String adSizeType = call.argument("adSizeType"); - - if (!adSizeType.equals("AdSizeType.WidthAndHeight") - && !adSizeType.equals("AdSizeType.SmartBanner")) { - String errMsg = - String.format("an invalid adSizeType (%s) was provided for banner id=%d", adSizeType, id); - result.error("invalid_adsizetype", errMsg, null); - } - - if (adSizeType.equals("AdSizeType.WidthAndHeight") && (width <= 0 || height <= 0)) { - String errMsg = - String.format( - "an invalid AdSize (%d, %d) was provided for banner id=%d", width, height, id); - result.error("invalid_adsize", errMsg, null); - } - - AdSize adSize; - if (adSizeType.equals("AdSizeType.SmartBanner")) { - adSize = AdSize.SMART_BANNER; - } else { - adSize = new AdSize(width, height); - } - - MobileAd.Banner banner = MobileAd.createBanner(id, adSize, activity, channel); - - if (banner.status != MobileAd.Status.CREATED) { - if (banner.status == MobileAd.Status.FAILED) - result.error("load_failed_ad", "cannot reload a failed ad, id=" + id, null); - else result.success(Boolean.TRUE); // The ad was already loaded. - return; - } - - Map targetingInfo = call.argument("targetingInfo"); - banner.load(adUnitId, targetingInfo); - result.success(Boolean.TRUE); - } - - private void callLoadInterstitialAd(MobileAd ad, MethodCall call, Result result) { - if (ad.status != MobileAd.Status.CREATED) { - if (ad.status == MobileAd.Status.FAILED) - result.error("load_failed_ad", "cannot reload a failed ad, id=" + ad.id, null); - else result.success(Boolean.TRUE); // The ad was already loaded. - return; - } - - String adUnitId = call.argument("adUnitId"); - if (adUnitId == null || adUnitId.isEmpty()) { - result.error( - "no_adunit_id", "a null or empty adUnitId was provided for ad id=" + ad.id, null); - return; - } - Map targetingInfo = call.argument("targetingInfo"); - ad.load(adUnitId, targetingInfo); - result.success(Boolean.TRUE); - } - - private void callLoadRewardedVideoAd(MethodCall call, Result result) { - if (rewardedWrapper.getStatus() != RewardedVideoAdWrapper.Status.CREATED - && rewardedWrapper.getStatus() != RewardedVideoAdWrapper.Status.FAILED) { - result.success(Boolean.TRUE); // The ad was already loading or loaded. - return; - } - - String adUnitId = call.argument("adUnitId"); - if (adUnitId == null || adUnitId.isEmpty()) { - result.error( - "no_ad_unit_id", "a non-empty adUnitId was not provided for rewarded video", null); - return; - } - - Map targetingInfo = call.argument("targetingInfo"); - if (targetingInfo == null) { - result.error( - "no_targeting_info", "a null targetingInfo object was provided for rewarded video", null); - return; - } - - rewardedWrapper.load(adUnitId, targetingInfo); - result.success(Boolean.TRUE); - } - - private void callShowAd(int id, MethodCall call, Result result) { - MobileAd ad = MobileAd.getAdForId(id); - if (ad == null) { - result.error("ad_not_loaded", "show failed, the specified ad was not loaded id=" + id, null); - return; - } - if (call.argument("anchorOffset") != null) { - ad.anchorOffset = Double.parseDouble((String) call.argument("anchorOffset")); - } - if (call.argument("horizontalCenterOffset") != null) { - ad.horizontalCenterOffset = - Double.parseDouble((String) call.argument("horizontalCenterOffset")); - } - if (call.argument("anchorType") != null) { - ad.anchorType = call.argument("anchorType").equals("bottom") ? Gravity.BOTTOM : Gravity.TOP; - } - - ad.show(); - result.success(Boolean.TRUE); - } - - private void callIsAdLoaded(int id, MethodCall call, Result result) { - MobileAd ad = MobileAd.getAdForId(id); - if (ad == null) { - result.error("no_ad_for_id", "isAdLoaded failed, no add exists for id=" + id, null); - return; - } - result.success(ad.status == MobileAd.Status.LOADED ? Boolean.TRUE : Boolean.FALSE); - } - - private void callShowRewardedVideoAd(MethodCall call, Result result) { - if (rewardedWrapper.getStatus() == RewardedVideoAdWrapper.Status.LOADED) { - rewardedWrapper.show(); - result.success(Boolean.TRUE); - } else { - result.error("ad_not_loaded", "show failed for rewarded video, no ad was loaded", null); - } - } - - private void callDisposeAd(int id, MethodCall call, Result result) { - MobileAd ad = MobileAd.getAdForId(id); - if (ad == null) { - result.error("no_ad_for_id", "dispose failed, no add exists for id=" + id, null); - return; - } - - ad.dispose(); - result.success(Boolean.TRUE); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - if (call.method.equals("initialize")) { - callInitialize(call, result); - return; - } - - Activity activity = registrar.activity(); - if (activity == null) { - result.error("no_activity", "firebase_admob plugin requires a foreground activity", null); - return; - } - - Integer id = call.argument("id"); - - switch (call.method) { - case "loadBannerAd": - callLoadBannerAd(id, activity, channel, call, result); - break; - case "loadInterstitialAd": - callLoadInterstitialAd(MobileAd.createInterstitial(id, activity, channel), call, result); - break; - case "loadRewardedVideoAd": - callLoadRewardedVideoAd(call, result); - break; - case "showAd": - callShowAd(id, call, result); - break; - case "showRewardedVideoAd": - callShowRewardedVideoAd(call, result); - break; - case "disposeAd": - callDisposeAd(id, call, result); - break; - case "isAdLoaded": - callIsAdLoaded(id, call, result); - break; - default: - result.notImplemented(); - } - } -} diff --git a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/MobileAd.java b/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/MobileAd.java deleted file mode 100644 index a13573194c94..000000000000 --- a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/MobileAd.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseadmob; - -import android.app.Activity; -import android.util.Log; -import android.util.SparseArray; -import android.view.Gravity; -import android.view.View; -import android.view.ViewGroup; -import android.widget.LinearLayout; -import com.google.android.gms.ads.AdListener; -import com.google.android.gms.ads.AdSize; -import com.google.android.gms.ads.AdView; -import com.google.android.gms.ads.InterstitialAd; -import io.flutter.plugin.common.MethodChannel; -import java.util.HashMap; -import java.util.Map; - -abstract class MobileAd extends AdListener { - private static final String TAG = "flutter"; - private static SparseArray allAds = new SparseArray(); - - final Activity activity; - final MethodChannel channel; - final int id; - Status status; - double anchorOffset; - double horizontalCenterOffset; - int anchorType; - - enum Status { - CREATED, - LOADING, - FAILED, - PENDING, // The ad will be shown when status is changed to LOADED. - LOADED, - } - - private MobileAd(int id, Activity activity, MethodChannel channel) { - this.id = id; - this.activity = activity; - this.channel = channel; - this.status = Status.CREATED; - this.anchorOffset = 0.0; - this.horizontalCenterOffset = 0.0; - this.anchorType = Gravity.BOTTOM; - allAds.put(id, this); - } - - static Banner createBanner(Integer id, AdSize adSize, Activity activity, MethodChannel channel) { - MobileAd ad = getAdForId(id); - return (ad != null) ? (Banner) ad : new Banner(id, adSize, activity, channel); - } - - static Interstitial createInterstitial(Integer id, Activity activity, MethodChannel channel) { - MobileAd ad = getAdForId(id); - return (ad != null) ? (Interstitial) ad : new Interstitial(id, activity, channel); - } - - static MobileAd getAdForId(Integer id) { - return allAds.get(id); - } - - Status getStatus() { - return status; - } - - abstract void load(String adUnitId, Map targetingInfo); - - abstract void show(); - - void dispose() { - allAds.remove(id); - } - - private Map argumentsMap(Object... args) { - Map arguments = new HashMap(); - arguments.put("id", id); - for (int i = 0; i < args.length; i += 2) arguments.put(args[i].toString(), args[i + 1]); - return arguments; - } - - @Override - public void onAdLoaded() { - boolean statusWasPending = status == Status.PENDING; - status = Status.LOADED; - channel.invokeMethod("onAdLoaded", argumentsMap()); - if (statusWasPending) show(); - } - - @Override - public void onAdFailedToLoad(int errorCode) { - Log.w(TAG, "onAdFailedToLoad: " + errorCode); - status = Status.FAILED; - channel.invokeMethod("onAdFailedToLoad", argumentsMap("errorCode", errorCode)); - } - - @Override - public void onAdOpened() { - channel.invokeMethod("onAdOpened", argumentsMap()); - } - - @Override - public void onAdClicked() { - channel.invokeMethod("onAdClicked", argumentsMap()); - } - - @Override - public void onAdImpression() { - channel.invokeMethod("onAdImpression", argumentsMap()); - } - - @Override - public void onAdLeftApplication() { - channel.invokeMethod("onAdLeftApplication", argumentsMap()); - } - - @Override - public void onAdClosed() { - channel.invokeMethod("onAdClosed", argumentsMap()); - } - - static class Banner extends MobileAd { - private AdView adView; - private AdSize adSize; - - private Banner(Integer id, AdSize adSize, Activity activity, MethodChannel channel) { - super(id, activity, channel); - this.adSize = adSize; - } - - @Override - void load(String adUnitId, Map targetingInfo) { - if (status != Status.CREATED) return; - status = Status.LOADING; - - adView = new AdView(activity); - adView.setAdSize(adSize); - adView.setAdUnitId(adUnitId); - adView.setAdListener(this); - - AdRequestBuilderFactory factory = new AdRequestBuilderFactory(targetingInfo); - adView.loadAd(factory.createAdRequestBuilder().build()); - } - - @Override - void show() { - if (status == Status.LOADING) { - status = Status.PENDING; - return; - } - if (status != Status.LOADED) return; - - if (activity.findViewById(id) == null) { - LinearLayout content = new LinearLayout(activity); - content.setId(id); - content.setOrientation(LinearLayout.VERTICAL); - content.setGravity(anchorType); - content.addView(adView); - final float scale = activity.getResources().getDisplayMetrics().density; - - int left = horizontalCenterOffset > 0 ? (int) (horizontalCenterOffset * scale) : 0; - int right = - horizontalCenterOffset < 0 ? (int) (Math.abs(horizontalCenterOffset) * scale) : 0; - if (anchorType == Gravity.BOTTOM) { - content.setPadding(left, 0, right, (int) (anchorOffset * scale)); - } else { - content.setPadding(left, (int) (anchorOffset * scale), right, 0); - } - - activity.addContentView( - content, - new ViewGroup.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - } - } - - @Override - void dispose() { - super.dispose(); - - View contentView = activity.findViewById(id); - if (contentView == null || !(contentView.getParent() instanceof ViewGroup)) return; - - adView.destroy(); - - ViewGroup contentParent = (ViewGroup) (contentView.getParent()); - contentParent.removeView(contentView); - } - } - - static class Interstitial extends MobileAd { - private InterstitialAd interstitial = null; - - private Interstitial(int id, Activity activity, MethodChannel channel) { - super(id, activity, channel); - } - - @Override - void load(String adUnitId, Map targetingInfo) { - status = Status.LOADING; - - interstitial = new InterstitialAd(activity); - interstitial.setAdUnitId(adUnitId); - - interstitial.setAdListener(this); - AdRequestBuilderFactory factory = new AdRequestBuilderFactory(targetingInfo); - interstitial.loadAd(factory.createAdRequestBuilder().build()); - } - - @Override - void show() { - if (status == Status.LOADING) { - status = Status.PENDING; - return; - } - interstitial.show(); - } - - // It is not possible to hide/remove/destroy an AdMob interstitial Ad. - } -} diff --git a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/RewardedVideoAdWrapper.java b/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/RewardedVideoAdWrapper.java deleted file mode 100644 index cc96880163fb..000000000000 --- a/packages/firebase_admob/android/src/main/java/io/flutter/plugins/firebaseadmob/RewardedVideoAdWrapper.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseadmob; - -import android.app.Activity; -import android.util.Log; -import com.google.android.gms.ads.MobileAds; -import com.google.android.gms.ads.reward.RewardItem; -import com.google.android.gms.ads.reward.RewardedVideoAd; -import com.google.android.gms.ads.reward.RewardedVideoAdListener; -import io.flutter.plugin.common.MethodChannel; -import java.util.HashMap; -import java.util.Map; - -public class RewardedVideoAdWrapper implements RewardedVideoAdListener { - private static final String TAG = "flutter"; - - final RewardedVideoAd rewardedInstance; - final Activity activity; - final MethodChannel channel; - Status status; - - @Override - public void onRewardedVideoAdLoaded() { - status = Status.LOADED; - channel.invokeMethod("onRewardedVideoAdLoaded", argumentsMap()); - } - - @Override - public void onRewardedVideoAdOpened() { - channel.invokeMethod("onRewardedVideoAdOpened", argumentsMap()); - } - - @Override - public void onRewardedVideoStarted() { - channel.invokeMethod("onRewardedVideoStarted", argumentsMap()); - } - - @Override - public void onRewardedVideoAdClosed() { - this.status = Status.CREATED; - channel.invokeMethod("onRewardedVideoAdClosed", argumentsMap()); - } - - @Override - public void onRewardedVideoCompleted() { - channel.invokeMethod("onRewardedVideoCompleted", argumentsMap()); - } - - @Override - public void onRewarded(RewardItem rewardItem) { - channel.invokeMethod( - "onRewarded", - argumentsMap("rewardType", rewardItem.getType(), "rewardAmount", rewardItem.getAmount())); - } - - @Override - public void onRewardedVideoAdLeftApplication() { - channel.invokeMethod("onRewardedVideoAdLeftApplication", argumentsMap()); - } - - @Override - public void onRewardedVideoAdFailedToLoad(int errorCode) { - Log.w(TAG, "onRewardedVideoAdFailedToLoad: " + errorCode); - status = Status.FAILED; - channel.invokeMethod("onRewardedVideoAdFailedToLoad", argumentsMap("errorCode", errorCode)); - } - - enum Status { - CREATED, - LOADING, - FAILED, - LOADED - } - - public RewardedVideoAdWrapper(Activity activity, MethodChannel channel) { - this.activity = activity; - this.channel = channel; - this.status = Status.CREATED; - this.rewardedInstance = MobileAds.getRewardedVideoAdInstance(activity); - this.rewardedInstance.setRewardedVideoAdListener(this); - } - - Status getStatus() { - return status; - } - - public void load(String adUnitId, Map targetingInfo) { - status = Status.LOADING; - AdRequestBuilderFactory factory = new AdRequestBuilderFactory(targetingInfo); - rewardedInstance.loadAd(adUnitId, factory.createAdRequestBuilder().build()); - } - - public void show() { - if (rewardedInstance.isLoaded()) { - rewardedInstance.show(); - } - } - - private Map argumentsMap(Object... args) { - Map arguments = new HashMap(); - for (int i = 0; i < args.length; i += 2) arguments.put(args[i].toString(), args[i + 1]); - return arguments; - } -} diff --git a/packages/firebase_admob/example/README.md b/packages/firebase_admob/example/README.md deleted file mode 100644 index 148a11720dd8..000000000000 --- a/packages/firebase_admob/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_admob_example - -Demonstrates how to use the firebase_admob plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_admob/example/android.iml b/packages/firebase_admob/example/android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/firebase_admob/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_admob/example/android/app/build.gradle b/packages/firebase_admob/example/android/app/build.gradle deleted file mode 100644 index f919f535e16d..000000000000 --- a/packages/firebase_admob/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebaseadmobexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_admob/example/android/app/google-services.json b/packages/firebase_admob/example/android/app/google-services.json deleted file mode 100644 index ee45722eb3f3..000000000000 --- a/packages/firebase_admob/example/android/app/google-services.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "project_info": { - "project_number": "395789065833", - "firebase_url": "https://admob-test-66963.firebaseio.com", - "project_id": "admob-test-66963", - "storage_bucket": "admob-test-66963.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:395789065833:android:cf455c18665bfb73", - "android_client_info": { - "package_name": "com.yourcompany.ads" - } - }, - "oauth_client": [ - { - "client_id": "395789065833-72h13sj0ba0alalnijd26ni8q19d7s27.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.yourcompany.ads", - "certificate_hash": "266da292ae1273cd3bedde8f7e5d82080234d46f" - } - }, - { - "client_id": "395789065833-soebkshopimb9sbsugdqeohjcrqc1h5v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyAckYXawYez8b74iXfGVM7OBowoqjhiZ38" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "395789065833-soebkshopimb9sbsugdqeohjcrqc1h5v.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:395789065833:android:d848e43bc35ca200", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseadmobexample" - } - }, - "oauth_client": [ - { - "client_id": "395789065833-jo1lkael0e4be0r2o2tan6qm3khfr6rs.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseadmobexample", - "certificate_hash": "266da292ae1273cd3bedde8f7e5d82080234d46f" - } - }, - { - "client_id": "395789065833-soebkshopimb9sbsugdqeohjcrqc1h5v.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyAckYXawYez8b74iXfGVM7OBowoqjhiZ38" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "395789065833-soebkshopimb9sbsugdqeohjcrqc1h5v.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_admob/example/android/app/gradle.properties b/packages/firebase_admob/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_admob/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_admob/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_admob/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_admob/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_admob/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_admob/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 2e3a97d95f94..000000000000 --- a/packages/firebase_admob/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/firebase_admob/example/android/app/src/main/java/io/flutter/plugins/firebaseadmobexample/MainActivity.java b/packages/firebase_admob/example/android/app/src/main/java/io/flutter/plugins/firebaseadmobexample/MainActivity.java deleted file mode 100644 index 14775bbf2fb7..000000000000 --- a/packages/firebase_admob/example/android/app/src/main/java/io/flutter/plugins/firebaseadmobexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseadmobexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_admob/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_admob/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_admob/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_admob/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_admob/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_admob/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_admob/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_admob/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_admob/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_admob/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_admob/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_admob/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_admob/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_admob/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_admob/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_admob/example/android/build.gradle b/packages/firebase_admob/example/android/build.gradle deleted file mode 100644 index 695de848ec30..000000000000 --- a/packages/firebase_admob/example/android/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - mavenLocal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_admob/example/android/gradle.properties b/packages/firebase_admob/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_admob/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_admob/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_admob/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_admob/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_admob/example/android/settings.gradle b/packages/firebase_admob/example/android/settings.gradle deleted file mode 100644 index 115da6cb4f4d..000000000000 --- a/packages/firebase_admob/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_admob/example/firebase_admob_example.iml b/packages/firebase_admob/example/firebase_admob_example.iml deleted file mode 100644 index 9d5dae19540c..000000000000 --- a/packages/firebase_admob/example/firebase_admob_example.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_admob/example/firebase_admob_example_android.iml b/packages/firebase_admob/example/firebase_admob_example_android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/firebase_admob/example/firebase_admob_example_android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_admob/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_admob/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6c2de8086bcd..000000000000 --- a/packages/firebase_admob/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_admob/example/ios/Flutter/Debug.xcconfig b/packages/firebase_admob/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_admob/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_admob/example/ios/Flutter/Release.xcconfig b/packages/firebase_admob/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_admob/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_admob/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_admob/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index e2d0ec0f0e29..000000000000 --- a/packages/firebase_admob/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,485 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 6E27B1151F0DAFA70028FD65 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6E27B1141F0DAFA70028FD65 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - FBE669D215209F1F44CEEB21 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F369F228D3A43519CEE308 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 6E27B1141F0DAFA70028FD65 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 83F369F228D3A43519CEE308 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - FBE669D215209F1F44CEEB21 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 07A52D07C2C05D9527204891 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 5B6AAA352BAC85BF7DD68C46 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 83F369F228D3A43519CEE308 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 07A52D07C2C05D9527204891 /* Pods */, - 5B6AAA352BAC85BF7DD68C46 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 6E27B1141F0DAFA70028FD65 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 2C1A4E9A6849F7CC6B679EA5 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - E42D8ABA8B028F5FFACB19B6 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6E27B1151F0DAFA70028FD65 /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 2C1A4E9A6849F7CC6B679EA5 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - E42D8ABA8B028F5FFACB19B6 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseAdMobExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseAdMobExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_admob/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_admob/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_admob/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_admob/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_admob/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1c9580788197..000000000000 --- a/packages/firebase_admob/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_admob/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_admob/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_admob/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_admob/example/ios/Runner/AppDelegate.h b/packages/firebase_admob/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/firebase_admob/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_admob/example/ios/Runner/AppDelegate.m b/packages/firebase_admob/example/ios/Runner/AppDelegate.m deleted file mode 100644 index f08675707182..000000000000 --- a/packages/firebase_admob/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d22f10b2ab63..000000000000 --- a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_admob/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_admob/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_admob/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index ebf48f603974..000000000000 --- a/packages/firebase_admob/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_admob/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_admob/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_admob/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_admob/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_admob/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 907bb24d3bd4..000000000000 --- a/packages/firebase_admob/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 395789065833-eo2pbi7673tisook4bem8jlhikgthqvd.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.395789065833-eo2pbi7673tisook4bem8jlhikgthqvd - API_KEY - AIzaSyAbCza-YTeE5nvWNGGzdlrS4JzZMtfArHY - GCM_SENDER_ID - 395789065833 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebaseadmobile - PROJECT_ID - admob-test-66963 - STORAGE_BUCKET - admob-test-66963.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:395789065833:ios:5c32deb7b961ebcf - DATABASE_URL - https://admob-test-66963.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_admob/example/ios/Runner/Info.plist b/packages/firebase_admob/example/ios/Runner/Info.plist deleted file mode 100644 index dc157b6af2ac..000000000000 --- a/packages/firebase_admob/example/ios/Runner/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - GADApplicationIdentifier - ca-app-pub-3940256099942544~1458002511 - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_admob_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_admob/example/ios/Runner/main.m b/packages/firebase_admob/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/firebase_admob/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_admob/example/lib/main.dart b/packages/firebase_admob/example/lib/main.dart deleted file mode 100644 index e5014d652f13..000000000000 --- a/packages/firebase_admob/example/lib/main.dart +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:firebase_admob/firebase_admob.dart'; - -// You can also test with your own ad unit IDs by registering your device as a -// test device. Check the logs for your device's ID value. -const String testDevice = 'YOUR_DEVICE_ID'; - -class MyApp extends StatefulWidget { - @override - _MyAppState createState() => _MyAppState(); -} - -class _MyAppState extends State { - static const MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo( - testDevices: testDevice != null ? [testDevice] : null, - keywords: ['foo', 'bar'], - contentUrl: 'http://foo.com/bar.html', - childDirected: true, - nonPersonalizedAds: true, - ); - - BannerAd _bannerAd; - InterstitialAd _interstitialAd; - int _coins = 0; - - BannerAd createBannerAd() { - return BannerAd( - adUnitId: BannerAd.testAdUnitId, - size: AdSize.banner, - targetingInfo: targetingInfo, - listener: (MobileAdEvent event) { - print("BannerAd event $event"); - }, - ); - } - - InterstitialAd createInterstitialAd() { - return InterstitialAd( - adUnitId: InterstitialAd.testAdUnitId, - targetingInfo: targetingInfo, - listener: (MobileAdEvent event) { - print("InterstitialAd event $event"); - }, - ); - } - - @override - void initState() { - super.initState(); - FirebaseAdMob.instance.initialize(appId: FirebaseAdMob.testAppId); - _bannerAd = createBannerAd()..load(); - RewardedVideoAd.instance.listener = - (RewardedVideoAdEvent event, {String rewardType, int rewardAmount}) { - print("RewardedVideoAd event $event"); - if (event == RewardedVideoAdEvent.rewarded) { - setState(() { - _coins += rewardAmount; - }); - } - }; - } - - @override - void dispose() { - _bannerAd?.dispose(); - _interstitialAd?.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('AdMob Plugin example app'), - ), - body: SingleChildScrollView( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - RaisedButton( - child: const Text('SHOW BANNER'), - onPressed: () { - _bannerAd ??= createBannerAd(); - _bannerAd - ..load() - ..show(); - }), - RaisedButton( - child: const Text('SHOW BANNER WITH OFFSET'), - onPressed: () { - _bannerAd ??= createBannerAd(); - _bannerAd - ..load() - ..show(horizontalCenterOffset: -50, anchorOffset: 100); - }), - RaisedButton( - child: const Text('REMOVE BANNER'), - onPressed: () { - _bannerAd?.dispose(); - _bannerAd = null; - }), - RaisedButton( - child: const Text('LOAD INTERSTITIAL'), - onPressed: () { - _interstitialAd?.dispose(); - _interstitialAd = createInterstitialAd()..load(); - }, - ), - RaisedButton( - child: const Text('SHOW INTERSTITIAL'), - onPressed: () { - _interstitialAd?.show(); - }, - ), - RaisedButton( - child: const Text('LOAD REWARDED VIDEO'), - onPressed: () { - RewardedVideoAd.instance.load( - adUnitId: RewardedVideoAd.testAdUnitId, - targetingInfo: targetingInfo); - }, - ), - RaisedButton( - child: const Text('SHOW REWARDED VIDEO'), - onPressed: () { - RewardedVideoAd.instance.show(); - }, - ), - Text("You have $_coins coins."), - ].map((Widget button) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 16.0), - child: button, - ); - }).toList(), - ), - ), - ), - ), - ); - } -} - -void main() { - runApp(MyApp()); -} diff --git a/packages/firebase_admob/example/pubspec.yaml b/packages/firebase_admob/example/pubspec.yaml deleted file mode 100644 index 775e4852b10a..000000000000 --- a/packages/firebase_admob/example/pubspec.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: firebase_admob_example -description: Demonstrates how to use the firebase_admob plugin. - -dependencies: - flutter: - sdk: flutter - firebase_admob: - path: ../ - firebase_core: ^0.4.0 - -flutter: - uses-material-design: true diff --git a/packages/firebase_admob/firebase_admob_android.iml b/packages/firebase_admob/firebase_admob_android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/firebase_admob/firebase_admob_android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_admob/ios/Assets/.gitkeep b/packages/firebase_admob/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_admob/ios/Classes/FLTMobileAd.h b/packages/firebase_admob/ios/Classes/FLTMobileAd.h deleted file mode 100644 index 1979be13eb4e..000000000000 --- a/packages/firebase_admob/ios/Classes/FLTMobileAd.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import "GoogleMobileAds/GoogleMobileAds.h" - -typedef enum : NSUInteger { - CREATED, - LOADING, - FAILED, - PENDING, // Will be shown when status is changed to LOADED. - LOADED, -} FLTMobileAdStatus; - -@interface FLTMobileAd : NSObject -+ (void)configureWithAppId:(NSString *)appId; -+ (FLTMobileAd *)getAdForId:(NSNumber *)mobileAdId; -- (FLTMobileAdStatus)status; -- (void)loadWithAdUnitId:(NSString *)adUnitId targetingInfo:(NSDictionary *)targetingInfo; -- (void)show; -- (void)showAtOffset:(double)anchorOffset - hCenterOffset:(double)horizontalCenterOffset - fromAnchor:(int)anchorType; -- (void)dispose; -@end - -@interface FLTBannerAd : FLTMobileAd -+ (instancetype)withId:(NSNumber *)mobileAdId - adSize:(GADAdSize)adSize - channel:(FlutterMethodChannel *)channel; -@end - -@interface FLTInterstitialAd : FLTMobileAd -+ (instancetype)withId:(NSNumber *)mobileAdId channel:(FlutterMethodChannel *)channel; -@end diff --git a/packages/firebase_admob/ios/Classes/FLTMobileAd.m b/packages/firebase_admob/ios/Classes/FLTMobileAd.m deleted file mode 100644 index 9e263406d620..000000000000 --- a/packages/firebase_admob/ios/Classes/FLTMobileAd.m +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FLTMobileAd.h" -#import "FLTRequestFactory.h" -#import "FirebaseAdMobPlugin.h" - -static NSMutableDictionary *allAds = nil; -static NSDictionary *statusToString = nil; - -@implementation FLTMobileAd -NSNumber *_mobileAdId; -FlutterMethodChannel *_channel; -FLTMobileAdStatus _status; -double _anchorOffset; -double _horizontalCenterOffset; -int _anchorType; - -+ (void)initialize { - if (allAds == nil) { - allAds = [[NSMutableDictionary alloc] init]; - } - _anchorType = 0; - _anchorOffset = 0; - _horizontalCenterOffset = 0; - - if (statusToString == nil) { - statusToString = @{ - @(CREATED) : @"CREATED", - @(LOADING) : @"LOADING", - @(FAILED) : @"FAILED", - @(PENDING) : @"PENDING", - @(LOADED) : @"LOADED" - }; - } -} - -+ (void)configureWithAppId:(NSString *)appId { - [GADMobileAds configureWithApplicationID:appId]; -} - -+ (FLTMobileAd *)getAdForId:(NSNumber *)mobileAdId { - return allAds[mobileAdId]; -} - -+ (UIViewController *)rootViewController { - return [UIApplication sharedApplication].delegate.window.rootViewController; -} - -- (instancetype)initWithId:(NSNumber *)mobileAdId channel:(FlutterMethodChannel *)channel { - self = [super init]; - if (self) { - _mobileAdId = mobileAdId; - _channel = channel; - _status = CREATED; - _anchorOffset = 0; - _horizontalCenterOffset = 0; - _anchorType = 0; - allAds[mobileAdId] = self; - } - return self; -} - -- (FLTMobileAdStatus)status { - return _status; -} - -- (void)loadWithAdUnitId:(NSString *)adUnitId targetingInfo:(NSDictionary *)targetingInfo { - // Implemented by the Banner and Interstitial subclasses -} - -- (void)showAtOffset:(double)anchorOffset - hCenterOffset:(double)horizontalCenterOffset - fromAnchor:(int)anchorType { - _anchorType = anchorType; - _anchorOffset = anchorOffset; - if (_anchorType == 0) { - _anchorOffset = -_anchorOffset; - } - _horizontalCenterOffset = horizontalCenterOffset; - [self show]; -} - -- (void)show { - // Implemented by the Banner and Interstitial subclasses -} - -- (void)dispose { - [allAds removeObjectForKey:_mobileAdId]; -} - -- (NSDictionary *)argumentsMap { - return @{@"id" : _mobileAdId}; -} - -- (NSString *)description { - NSString *statusString = (NSString *)statusToString[[NSNumber numberWithInt:_status]]; - return [NSString - stringWithFormat:@"%@ %@ mobileAdId:%@", super.description, statusString, _mobileAdId]; -} -@end - -@implementation FLTBannerAd -GADBannerView *_banner; -GADAdSize _adSize; - -+ (instancetype)withId:(NSNumber *)mobileAdId - adSize:(GADAdSize)adSize - channel:(FlutterMethodChannel *)channel { - FLTMobileAd *ad = [FLTMobileAd getAdForId:mobileAdId]; - return ad != nil ? (FLTBannerAd *)ad - : [[FLTBannerAd alloc] initWithId:mobileAdId adSize:adSize channel:channel]; -} - -- (instancetype)initWithId:mobileAdId - adSize:(GADAdSize)adSize - channel:(FlutterMethodChannel *)channel { - self = [super initWithId:mobileAdId channel:channel]; - if (self) { - _adSize = adSize; - return self; - } - - return nil; -} - -- (void)loadWithAdUnitId:(NSString *)adUnitId targetingInfo:(NSDictionary *)targetingInfo { - if (_status != CREATED) return; - _status = LOADING; - _banner = [[GADBannerView alloc] initWithAdSize:_adSize]; - _banner.delegate = self; - _banner.adUnitID = adUnitId; - _banner.rootViewController = [FLTMobileAd rootViewController]; - FLTRequestFactory *factory = [[FLTRequestFactory alloc] initWithTargetingInfo:targetingInfo]; - [_banner loadRequest:[factory createRequest]]; -} - -- (void)show { - if (_status == LOADING) { - _status = PENDING; - return; - } - - if (_status != LOADED) return; - - _banner.translatesAutoresizingMaskIntoConstraints = NO; - UIView *screen = [FLTMobileAd rootViewController].view; - [screen addSubview:_banner]; - -#if defined(__IPHONE_11_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0) - if (@available(ios 11.0, *)) { - UILayoutGuide *guide = screen.safeAreaLayoutGuide; - [NSLayoutConstraint activateConstraints:@[ - [_banner.centerXAnchor constraintEqualToAnchor:guide.centerXAnchor - constant:_horizontalCenterOffset], - [_banner.bottomAnchor - constraintEqualToAnchor:_anchorType == 0 ? guide.bottomAnchor : guide.topAnchor - constant:_anchorOffset] - ]]; - } else { - [self placeBannerPreIos11]; - } -#else - [self placeBannerPreIos11]; -#endif -} - -- (void)placeBannerPreIos11 { - UIView *screen = [FLTMobileAd rootViewController].view; - CGFloat x = screen.frame.size.width / 2 - _banner.frame.size.width / 2 + _horizontalCenterOffset; - CGFloat y; - if (_anchorType == 0) { - y = screen.frame.size.height - _banner.frame.size.height + _anchorOffset; - } else { - y = _anchorOffset; - } - _banner.frame = (CGRect){{x, y}, _banner.frame.size}; - [screen addSubview:_banner]; -} - -- (void)adViewDidReceiveAd:(GADBannerView *)adView { - bool statusWasPending = _status == PENDING; - _status = LOADED; - [_channel invokeMethod:@"onAdLoaded" arguments:[self argumentsMap]]; - if (statusWasPending) [self show]; -} - -- (void)adView:(GADBannerView *)adView didFailToReceiveAdWithError:(GADRequestError *)error { - FLTLogWarning(@"adView:didFailToReceiveAdWithError: %@ (MobileAd %@)", - [error localizedDescription], self); - [_channel invokeMethod:@"onAdFailedToLoad" arguments:[self argumentsMap]]; -} - -- (void)adViewWillPresentScreen:(GADBannerView *)adView { - [_channel invokeMethod:@"onAdClicked" arguments:[self argumentsMap]]; -} - -- (void)adViewWillDismissScreen:(GADBannerView *)adView { - [_channel invokeMethod:@"onAdImpression" arguments:[self argumentsMap]]; -} - -- (void)adViewDidDismissScreen:(GADBannerView *)adView { - [_channel invokeMethod:@"onAdClosed" arguments:[self argumentsMap]]; -} - -- (void)adViewWillLeaveApplication:(GADBannerView *)adView { - [_channel invokeMethod:@"onAdLeftApplication" arguments:[self argumentsMap]]; -} - -- (void)dispose { - if (_banner.superview) [_banner removeFromSuperview]; - _banner = nil; - [super dispose]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@ for: %@", super.description, _banner]; -} -@end - -@implementation FLTInterstitialAd -GADInterstitial *_interstitial; - -+ (instancetype)withId:(NSNumber *)mobileAdId channel:(FlutterMethodChannel *)channel { - FLTMobileAd *ad = [FLTMobileAd getAdForId:mobileAdId]; - return ad != nil ? (FLTInterstitialAd *)ad - : [[FLTInterstitialAd alloc] initWithId:mobileAdId channel:channel]; -} - -- (void)loadWithAdUnitId:(NSString *)adUnitId targetingInfo:(NSDictionary *)targetingInfo { - if (_status != CREATED) return; - _status = LOADING; - - _interstitial = [[GADInterstitial alloc] initWithAdUnitID:adUnitId]; - _interstitial.delegate = self; - FLTRequestFactory *factory = [[FLTRequestFactory alloc] initWithTargetingInfo:targetingInfo]; - [_interstitial loadRequest:[factory createRequest]]; -} - -- (void)show { - if (_status == LOADING) { - _status = PENDING; - return; - } - if (_status != LOADED) return; - - [_interstitial presentFromRootViewController:[FLTMobileAd rootViewController]]; -} - -- (void)interstitialDidReceiveAd:(GADInterstitial *)ad { - bool statusWasPending = _status == PENDING; - _status = LOADED; - [_channel invokeMethod:@"onAdLoaded" arguments:[self argumentsMap]]; - if (statusWasPending) [self show]; -} - -- (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error { - FLTLogWarning(@"interstitial:didFailToReceiveAdWithError: %@ (MobileAd %@)", - [error localizedDescription], self); - [_channel invokeMethod:@"onAdFailedToLoad" arguments:[self argumentsMap]]; -} - -- (void)interstitialWillPresentScreen:(GADInterstitial *)ad { - [_channel invokeMethod:@"onAdClicked" arguments:[self argumentsMap]]; -} - -- (void)interstitialWillDismissScreen:(GADInterstitial *)ad { - [_channel invokeMethod:@"onAdImpression" arguments:[self argumentsMap]]; -} - -- (void)interstitialDidDismissScreen:(GADInterstitial *)ad { - [_channel invokeMethod:@"onAdClosed" arguments:[self argumentsMap]]; -} - -- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad { - [_channel invokeMethod:@"onAdLeftApplication" arguments:[self argumentsMap]]; -} - -- (void)dispose { - // It is not possible to hide/remove/destroy an AdMob interstitial Ad. - _interstitial = nil; - [super dispose]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@ for: %@", super.description, _interstitial]; -} -@end diff --git a/packages/firebase_admob/ios/Classes/FLTRequestFactory.h b/packages/firebase_admob/ios/Classes/FLTRequestFactory.h deleted file mode 100644 index b1a304a8e3ed..000000000000 --- a/packages/firebase_admob/ios/Classes/FLTRequestFactory.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "GoogleMobileAds/GoogleMobileAds.h" - -@interface FLTRequestFactory : NSObject - -- (instancetype)initWithTargetingInfo:(NSDictionary *)targetingInfo; -- (GADRequest *)createRequest; - -@end diff --git a/packages/firebase_admob/ios/Classes/FLTRequestFactory.m b/packages/firebase_admob/ios/Classes/FLTRequestFactory.m deleted file mode 100644 index 1b2e7f8e29e1..000000000000 --- a/packages/firebase_admob/ios/Classes/FLTRequestFactory.m +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FLTRequestFactory.h" -#import "FirebaseAdMobPlugin.h" -#import "GoogleMobileAds/GADExtras.h" -#import "GoogleMobileAds/GoogleMobileAds.h" - -@implementation FLTRequestFactory - -NSDictionary *_targetingInfo; - -- (instancetype)initWithTargetingInfo:(NSDictionary *)targetingInfo { - self = [super init]; - if (self) { - _targetingInfo = targetingInfo; - } - return self; -} - -- (NSArray *)targetingInfoArrayForKey:(NSString *)key info:(NSDictionary *)info { - NSObject *value = info[key]; - if (value == NULL) { - return nil; - } - if (![value isKindOfClass:[NSArray class]]) { - FLTLogWarning(@"targeting info %@: expected an array (MobileAd %@)", key, self); - return nil; - } - return (NSArray *)value; -} - -- (NSString *)targetingInfoStringForKey:(NSString *)key info:(NSDictionary *)info { - NSObject *value = info[key]; - if (value == NULL) { - return nil; - } - if (![value isKindOfClass:[NSString class]]) { - FLTLogWarning(@"targeting info %@: expected a string (MobileAd %@)", key, self); - return nil; - } - NSString *stringValue = (NSString *)value; - if ([stringValue length] == 0) { - FLTLogWarning(@"targeting info %@: expected a non-empty string (MobileAd %@)", key, self); - return nil; - } - return stringValue; -} - -- (NSNumber *)targetingInfoBoolForKey:(NSString *)key info:(NSDictionary *)info { - NSObject *value = info[key]; - if (value == NULL) { - return nil; - } - if (![value isKindOfClass:[NSNumber class]]) { - FLTLogWarning(@"targeting info %@: expected a boolean, (MobileAd %@)", key, self); - return nil; - } - return (NSNumber *)value; -} - -- (GADRequest *)createRequest { - GADRequest *request = [GADRequest request]; - if (_targetingInfo == nil) { - return request; - } - - NSArray *testDevices = [self targetingInfoArrayForKey:@"testDevices" info:_targetingInfo]; - if (testDevices != nil) { - request.testDevices = testDevices; - } - - NSArray *keywords = [self targetingInfoArrayForKey:@"keywords" info:_targetingInfo]; - if (keywords != nil) { - request.keywords = keywords; - } - - NSString *contentURL = [self targetingInfoStringForKey:@"contentUrl" info:_targetingInfo]; - if (contentURL != nil) { - request.contentURL = contentURL; - } - - NSObject *birthday = _targetingInfo[@"birthday"]; - if (birthday != NULL) { - if (![birthday isKindOfClass:[NSNumber class]]) { - FLTLogWarning(@"targeting info birthday: expected a long integer (MobileAd %@)", self); - } else { - // Incoming time value is milliseconds since the epoch, NSDate uses - // seconds. - request.birthday = - [NSDate dateWithTimeIntervalSince1970:((NSNumber *)birthday).longValue / 1000.0]; - } - } - - NSObject *gender = _targetingInfo[@"gender"]; - if (gender != NULL) { - if (![gender isKindOfClass:[NSNumber class]]) { - FLTLogWarning(@"targeting info gender: expected an integer (MobileAd %@)", self); - } else { - int genderValue = ((NSNumber *)gender).intValue; - switch (genderValue) { - case 0: // MobileAdGender.unknown - case 1: // MobileAdGender.male - case 2: // MobileAdGender.female - request.gender = genderValue; - break; - default: - FLTLogWarning(@"targeting info gender: not one of 0, 1, or 2 (MobileAd %@)", self); - } - } - } - - NSNumber *childDirected = [self targetingInfoBoolForKey:@"childDirected" info:_targetingInfo]; - if (childDirected != nil) { - [request tagForChildDirectedTreatment:childDirected.boolValue]; - } - - NSString *requestAgent = [self targetingInfoStringForKey:@"requestAgent" info:_targetingInfo]; - if (requestAgent != nil) { - request.requestAgent = requestAgent; - } - - NSNumber *nonPersonalizedAds = [self targetingInfoBoolForKey:@"nonPersonalizedAds" - info:_targetingInfo]; - if (nonPersonalizedAds != nil && [nonPersonalizedAds boolValue]) { - GADExtras *extras = [[GADExtras alloc] init]; - extras.additionalParameters = @{@"npa" : @"1"}; - [request registerAdNetworkExtras:extras]; - } - - return request; -} - -@end diff --git a/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.h b/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.h deleted file mode 100644 index 33ae96594308..000000000000 --- a/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import "GoogleMobileAds/GoogleMobileAds.h" - -typedef enum : NSUInteger { - FLTRewardedVideoAdStatusCreated, - FLTRewardedVideoAdStatusLoading, - FLTRewardedVideoAdStatusFailed, - FLTRewardedVideoAdStatusLoaded, -} FLTRewardedVideoAdStatus; - -@interface FLTRewardedVideoAdWrapper : NSObject -- (instancetype)initWithChannel:(FlutterMethodChannel *)channel; -- (FLTRewardedVideoAdStatus)status; -- (void)loadWithAdUnitId:(NSString *)adUnitId targetingInfo:(NSDictionary *)targetingInfo; -- (void)show; -@end diff --git a/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m b/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m deleted file mode 100644 index c05345eb92af..000000000000 --- a/packages/firebase_admob/ios/Classes/FLTRewardedVideoAdWrapper.m +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FLTRewardedVideoAdWrapper.h" -#import "FLTRequestFactory.h" -#import "FirebaseAdMobPlugin.h" - -static NSDictionary *rewardedStatusToString = nil; - -@interface FLTRewardedVideoAdWrapper () -@end - -@implementation FLTRewardedVideoAdWrapper - -FlutterMethodChannel *_rewardedChannel; -FLTRewardedVideoAdStatus _rewardedStatus; - -+ (void)initialize { - if (rewardedStatusToString == nil) { - rewardedStatusToString = @{ - @(FLTRewardedVideoAdStatusCreated) : @"CREATED", - @(FLTRewardedVideoAdStatusLoading) : @"LOADING", - @(FLTRewardedVideoAdStatusFailed) : @"FAILED", - @(FLTRewardedVideoAdStatusLoaded) : @"LOADED" - }; - } -} - -+ (UIViewController *)rootViewController { - return [UIApplication sharedApplication].delegate.window.rootViewController; -} - -- (instancetype)initWithChannel:(FlutterMethodChannel *)channel { - self = [super init]; - if (self) { - _rewardedChannel = channel; - _rewardedStatus = FLTRewardedVideoAdStatusCreated; - [GADRewardBasedVideoAd sharedInstance].delegate = self; - } - return self; -} - -- (FLTRewardedVideoAdStatus)status { - return _rewardedStatus; -} - -- (void)loadWithAdUnitId:(NSString *)adUnitId targetingInfo:(NSDictionary *)targetingInfo { - if (_rewardedStatus != FLTRewardedVideoAdStatusCreated && - _rewardedStatus != FLTRewardedVideoAdStatusFailed) { - return; - } - - _rewardedStatus = FLTRewardedVideoAdStatusLoading; - FLTRequestFactory *factory = [[FLTRequestFactory alloc] initWithTargetingInfo:targetingInfo]; - [[GADRewardBasedVideoAd sharedInstance] loadRequest:[factory createRequest] - withAdUnitID:adUnitId]; -} - -- (void)show { - [[GADRewardBasedVideoAd sharedInstance] - presentFromRootViewController:[FLTRewardedVideoAdWrapper rootViewController]]; -} - -- (NSString *)description { - NSString *statusString = - (NSString *)rewardedStatusToString[[NSNumber numberWithInt:_rewardedStatus]]; - return [NSString - stringWithFormat:@"%@ %@ FLTRewardedVideoAdWrapper", super.description, statusString]; -} - -- (void)rewardBasedVideoAd:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd - didRewardUserWithReward:(nonnull GADAdReward *)reward { - NSDictionary *arguments = @{ - @"rewardAmount" : [NSNumber numberWithInt:[reward.amount intValue]], - @"rewardType" : reward.type - }; - [_rewardedChannel invokeMethod:@"onRewarded" arguments:arguments]; -} - -- (void)rewardBasedVideoAd:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd - didFailToLoadWithError:(nonnull NSError *)error { - NSLog(@"interstitial:didFailToReceiveAdWithError: %@ (MobileAd %@)", [error localizedDescription], - self); - _rewardedStatus = FLTRewardedVideoAdStatusFailed; - [_rewardedChannel invokeMethod:@"onRewardedVideoAdFailedToLoad" arguments:@{}]; -} - -- (void)rewardBasedVideoAdDidReceiveAd:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd { - _rewardedStatus = FLTRewardedVideoAdStatusLoaded; - [_rewardedChannel invokeMethod:@"onRewardedVideoAdLoaded" arguments:@{}]; -} - -- (void)rewardBasedVideoAdDidOpen:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd { - [_rewardedChannel invokeMethod:@"onRewardedVideoAdOpened" arguments:@{}]; -} - -- (void)rewardBasedVideoAdDidStartPlaying:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd { - [_rewardedChannel invokeMethod:@"onRewardedVideoStarted" arguments:@{}]; -} - -- (void)rewardBasedVideoAdDidCompletePlaying:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd { - [_rewardedChannel invokeMethod:@"onRewardedVideoCompleted" arguments:@{}]; -} - -- (void)rewardBasedVideoAdDidClose:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd { - [_rewardedChannel invokeMethod:@"onRewardedVideoAdClosed" arguments:@{}]; - _rewardedStatus = FLTRewardedVideoAdStatusCreated; -} - -- (void)rewardBasedVideoAdWillLeaveApplication:(nonnull GADRewardBasedVideoAd *)rewardBasedVideoAd { - [_rewardedChannel invokeMethod:@"onRewardedVideoAdLeftApplication" arguments:@{}]; -} - -@end diff --git a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h b/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h deleted file mode 100644 index e09cedc6bbcb..000000000000 --- a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -#define FLTLogWarning(format, ...) NSLog((@"FirebaseAdMobPlugin " format), ##__VA_ARGS__) - -@interface FLTFirebaseAdMobPlugin : NSObject -@end diff --git a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m b/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m deleted file mode 100644 index d94762b9b61f..000000000000 --- a/packages/firebase_admob/ios/Classes/FirebaseAdMobPlugin.m +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseAdMobPlugin.h" - -#import - -#import "FLTMobileAd.h" -#import "FLTRewardedVideoAdWrapper.h" -#import "Firebase/Firebase.h" - -@interface FLTFirebaseAdMobPlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@property(nonatomic, strong) FLTRewardedVideoAdWrapper *rewardedWrapper; -@end - -@implementation FLTFirebaseAdMobPlugin - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FLTFirebaseAdMobPlugin *instance = [[FLTFirebaseAdMobPlugin alloc] init]; - instance.channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_admob" - binaryMessenger:[registrar messenger]]; - [registrar addMethodCallDelegate:instance channel:instance.channel]; - instance.rewardedWrapper = [[FLTRewardedVideoAdWrapper alloc] initWithChannel:instance.channel]; -} - -- (instancetype)init { - self = [super init]; - if (self && ![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - return self; -} - -- (void)dealloc { - [self.channel setMethodCallHandler:nil]; - self.channel = nil; -} - -- (void)callInitialize:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *appId = (NSString *)call.arguments[@"appId"]; - if (appId == nil || [appId length] == 0) { - result([FlutterError errorWithCode:@"no_app_id" - message:@"a non-empty AdMob appId was not provided" - details:nil]); - return; - } - [FLTMobileAd configureWithAppId:appId]; - result([NSNumber numberWithBool:YES]); -} - -- (void)callLoadBannerAdWithId:(NSNumber *)id - channel:(FlutterMethodChannel *)channel - call:(FlutterMethodCall *)call - result:(FlutterResult)result { - NSString *adUnitId = (NSString *)call.arguments[@"adUnitId"]; - if (adUnitId == nil || [adUnitId length] == 0) { - NSString *message = - [NSString stringWithFormat:@"a null or empty adUnitId was provided for %@", id]; - result([FlutterError errorWithCode:@"no_adunit_id" message:message details:nil]); - return; - } - - NSNumber *widthArg = (NSNumber *)call.arguments[@"width"]; - NSNumber *heightArg = (NSNumber *)call.arguments[@"height"]; - - if (widthArg == nil || heightArg == nil) { - NSString *message = - [NSString stringWithFormat:@"a null height or width was provided for banner id=%@", id]; - result([FlutterError errorWithCode:@"invalid_adsize" message:message details:nil]); - return; - } - - NSString *adSizeTypeArg = (NSString *)call.arguments[@"adSizeType"]; - FLTLogWarning(@"Size Type: %@", adSizeTypeArg); - if (adSizeTypeArg == nil || (![adSizeTypeArg isEqualToString:@"AdSizeType.SmartBanner"] && - ![adSizeTypeArg isEqualToString:@"AdSizeType.WidthAndHeight"])) { - NSString *message = [NSString - stringWithFormat:@"a null or invalid ad size type was provided for banner id=%@", id]; - result([FlutterError errorWithCode:@"invalid_adsizetype" message:message details:nil]); - return; - } - - int width = [widthArg intValue]; - int height = [heightArg intValue]; - - if ([adSizeTypeArg isEqualToString:@"AdSizeType.WidthAndHeight"] && (width <= 0 || height <= 0)) { - NSString *message = - [NSString stringWithFormat:@"an invalid AdSize (%d, %d) was provided for banner id=%@", - width, height, id]; - result([FlutterError errorWithCode:@"invalid_adsize" message:message details:nil]); - return; - } - - GADAdSize adSize; - if ([adSizeTypeArg isEqualToString:@"AdSizeType.SmartBanner"]) { - if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)) { - adSize = kGADAdSizeSmartBannerPortrait; - } else { - adSize = kGADAdSizeSmartBannerLandscape; - } - } else { - adSize = GADAdSizeFromCGSize(CGSizeMake(width, height)); - } - - FLTBannerAd *banner = [FLTBannerAd withId:id adSize:adSize channel:self.channel]; - - if (banner.status != CREATED) { - if (banner.status == FAILED) { - NSString *message = [NSString stringWithFormat:@"cannot reload a failed ad=%@", banner]; - result([FlutterError errorWithCode:@"load_failed_ad" message:message details:nil]); - } else { - result([NSNumber numberWithBool:YES]); // The ad was already loaded. - } - } - - NSDictionary *targetingInfo = (NSDictionary *)call.arguments[@"targetingInfo"]; - [banner loadWithAdUnitId:adUnitId targetingInfo:targetingInfo]; - result([NSNumber numberWithBool:YES]); -} - -- (void)callLoadInterstitialAd:(FLTMobileAd *)ad - call:(FlutterMethodCall *)call - result:(FlutterResult)result { - if (ad.status != CREATED) { - if (ad.status == FAILED) { - NSString *message = [NSString stringWithFormat:@"cannot reload a failed ad=%@", ad]; - result([FlutterError errorWithCode:@"load_failed_ad" message:message details:nil]); - } else { - result([NSNumber numberWithBool:YES]); // The ad was already loaded. - } - } - - NSString *adUnitId = (NSString *)call.arguments[@"adUnitId"]; - if (adUnitId == nil || [adUnitId length] == 0) { - NSString *message = - [NSString stringWithFormat:@"a null or emtpy adUnitId was provided for %@", ad]; - result([FlutterError errorWithCode:@"no_adunit_id" message:message details:nil]); - return; - } - - NSDictionary *targetingInfo = (NSDictionary *)call.arguments[@"targetingInfo"]; - [ad loadWithAdUnitId:adUnitId targetingInfo:targetingInfo]; - result([NSNumber numberWithBool:YES]); -} - -- (void)callLoadRewardedVideoAd:(FlutterMethodCall *)call result:(FlutterResult)result { - if (self.rewardedWrapper.status == FLTRewardedVideoAdStatusLoading || - self.rewardedWrapper.status == FLTRewardedVideoAdStatusLoaded) { - result([NSNumber numberWithBool:YES]); // The ad is loaded or about to be. - } - - NSString *adUnitId = (NSString *)call.arguments[@"adUnitId"]; - if (adUnitId == nil || [adUnitId length] == 0) { - result([FlutterError errorWithCode:@"no_ad_unit_id" - message:@"a non-empty adUnitId was not provided for rewarded video." - details:nil]); - return; - } - - NSDictionary *targetingInfo = (NSDictionary *)call.arguments[@"targetingInfo"]; - if (targetingInfo == nil) { - result([FlutterError - errorWithCode:@"no_targeting_info" - message:@"a null targetingInfo object was provided for rewarded video." - details:nil]); - return; - } - - [self.rewardedWrapper loadWithAdUnitId:adUnitId targetingInfo:targetingInfo]; - result([NSNumber numberWithBool:YES]); -} - -- (void)callShowAd:(NSNumber *)mobileAdId - call:(FlutterMethodCall *)call - result:(FlutterResult)result { - FLTMobileAd *ad = [FLTMobileAd getAdForId:mobileAdId]; - if (ad == nil) { - NSString *message = - [NSString stringWithFormat:@"show failed, the specified ad was not loaded id=%d", - mobileAdId.intValue]; - result([FlutterError errorWithCode:@"ad_not_loaded" message:message details:nil]); - } - - double offset = 0.0; - double horizontalCenterOffset = 0.0; - int type = 0; - if (call.arguments[@"anchorOffset"] != nil) { - offset = [call.arguments[@"anchorOffset"] doubleValue]; - } - if (call.arguments[@"horizontalCenterOffset"] != nil) { - horizontalCenterOffset = [call.arguments[@"horizontalCenterOffset"] doubleValue]; - } - if (call.arguments[@"anchorType"] != nil) { - type = [call.arguments[@"anchorType"] isEqualToString:@"bottom"] ? 0 : 1; - } - - [ad showAtOffset:offset hCenterOffset:horizontalCenterOffset fromAnchor:type]; - result([NSNumber numberWithBool:YES]); -} - -- (void)callIsAdLoaded:(NSNumber *)mobileAdId - call:(FlutterMethodCall *)call - result:(FlutterResult)result { - FLTMobileAd *ad = [FLTMobileAd getAdForId:mobileAdId]; - if (ad == nil) { - NSString *message = [NSString - stringWithFormat:@"isAdLoaded failed, no ad exists for id=%d", mobileAdId.intValue]; - result([FlutterError errorWithCode:@"no_ad_for_id" message:message details:nil]); - return; - } - if (ad.status == LOADED) { - result([NSNumber numberWithBool:YES]); - } else { - result([NSNumber numberWithBool:NO]); - } -} - -- (void)callShowRewardedVideoAd:(FlutterMethodCall *)call result:(FlutterResult)result { - if (self.rewardedWrapper.status != FLTRewardedVideoAdStatusLoaded) { - result([FlutterError errorWithCode:@"ad_not_loaded" - message:@"show failed for rewarded video, no ad was loaded" - details:nil]); - return; - } - - [self.rewardedWrapper show]; - result([NSNumber numberWithBool:YES]); -} - -- (void)callDisposeAd:(NSNumber *)mobileAdId - call:(FlutterMethodCall *)call - result:(FlutterResult)result { - FLTMobileAd *ad = [FLTMobileAd getAdForId:mobileAdId]; - if (ad == nil) { - NSString *message = - [NSString stringWithFormat:@"dispose failed, no ad exists for id=%d", mobileAdId.intValue]; - result([FlutterError errorWithCode:@"no_ad_for_id" message:message details:nil]); - } - - [ad dispose]; - result([NSNumber numberWithBool:YES]); -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([call.method isEqualToString:@"initialize"]) { - [self callInitialize:call result:result]; - return; - } - - if ([call.method isEqualToString:@"loadRewardedVideoAd"]) { - [self callLoadRewardedVideoAd:call result:result]; - return; - } - - if ([call.method isEqualToString:@"showRewardedVideoAd"]) { - [self callShowRewardedVideoAd:call result:result]; - return; - } - - NSNumber *mobileAdId = (NSNumber *)call.arguments[@"id"]; - if (mobileAdId == nil) { - NSString *message = @"FirebaseAdMobPlugin method calls for banners and " - @"interstitials must specify an " - @"integer mobile ad id"; - result([FlutterError errorWithCode:@"no_id" message:message details:nil]); - return; - } - - if ([call.method isEqualToString:@"loadBannerAd"]) { - [self callLoadBannerAdWithId:mobileAdId channel:self.channel call:call result:result]; - } else if ([call.method isEqualToString:@"loadInterstitialAd"]) { - [self callLoadInterstitialAd:[FLTInterstitialAd withId:mobileAdId channel:self.channel] - call:call - result:result]; - } else if ([call.method isEqualToString:@"showAd"]) { - [self callShowAd:mobileAdId call:call result:result]; - } else if ([call.method isEqualToString:@"isAdLoaded"]) { - [self callIsAdLoaded:mobileAdId call:call result:result]; - } else if ([call.method isEqualToString:@"disposeAd"]) { - [self callDisposeAd:mobileAdId call:call result:result]; - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/packages/firebase_admob/ios/firebase_admob.podspec b/packages/firebase_admob/ios/firebase_admob.podspec deleted file mode 100644 index 3992db721126..000000000000 --- a/packages/firebase_admob/ios/firebase_admob.podspec +++ /dev/null @@ -1,24 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'firebase_admob' - s.version = '0.0.1' - s.summary = 'Firebase Admob plugin for Flutter.' - s.description = <<-DESC -Firebase Admob plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_admob' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/AdMob' - - s.ios.deployment_target = '8.0' - - s.static_framework = true -end diff --git a/packages/firebase_admob/lib/firebase_admob.dart b/packages/firebase_admob/lib/firebase_admob.dart deleted file mode 100644 index 70289b2b5dc2..000000000000 --- a/packages/firebase_admob/lib/firebase_admob.dart +++ /dev/null @@ -1,528 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// ignore_for_file: deprecated_member_use_from_same_package - -import 'dart:async'; -import 'dart:io' show Platform; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -/// [MobileAd] status changes reported to [MobileAdListener]s. -/// -/// Applications can wait until an ad is [MobileAdEvent.loaded] before showing -/// it, to ensure that the ad is displayed promptly. -enum MobileAdEvent { - loaded, - failedToLoad, - clicked, - impression, - opened, - leftApplication, - closed, -} - -/// The user's gender for the sake of ad targeting using [MobileAdTargetingInfo]. -// Warning: the index values of the enums must match the values of the corresponding -// AdMob constants. For example MobileAdGender.female.index == kGADGenderFemale. -@Deprecated('This functionality is deprecated in AdMob without replacement.') -enum MobileAdGender { - unknown, - male, - female, -} - -/// Signature for a [MobileAd] status change callback. -typedef void MobileAdListener(MobileAdEvent event); - -/// Targeting info per the native AdMob API. -/// -/// This class's properties mirror the native AdRequest API. See for example: -/// [AdRequest.Builder for Android](https://firebase.google.com/docs/reference/android/com/google/android/gms/ads/AdRequest.Builder). -class MobileAdTargetingInfo { - const MobileAdTargetingInfo( - {this.keywords, - this.contentUrl, - @Deprecated('This functionality is deprecated in AdMob without replacement.') - this.birthday, - @Deprecated('This functionality is deprecated in AdMob without replacement.') - this.gender, - @Deprecated('Use `childDirected` instead.') - this.designedForFamilies, - this.childDirected, - this.testDevices, - this.nonPersonalizedAds}); - - final List keywords; - final String contentUrl; - @Deprecated('This functionality is deprecated in AdMob without replacement.') - final DateTime birthday; - @Deprecated('This functionality is deprecated in AdMob without replacement.') - final MobileAdGender gender; - @Deprecated( - 'This functionality is deprecated in AdMob. Use `childDirected` instead.') - final bool designedForFamilies; - final bool childDirected; - final List testDevices; - final bool nonPersonalizedAds; - - Map toJson() { - final Map json = { - 'requestAgent': 'flutter-alpha', - }; - - if (keywords != null && keywords.isNotEmpty) { - assert(keywords.every((String s) => s != null && s.isNotEmpty)); - json['keywords'] = keywords; - } - if (nonPersonalizedAds != null) - json['nonPersonalizedAds'] = nonPersonalizedAds; - if (contentUrl != null && contentUrl.isNotEmpty) - json['contentUrl'] = contentUrl; - if (birthday != null) json['birthday'] = birthday.millisecondsSinceEpoch; - if (gender != null) json['gender'] = gender.index; - if (designedForFamilies != null) - json['designedForFamilies'] = designedForFamilies; - if (childDirected != null) json['childDirected'] = childDirected; - if (testDevices != null && testDevices.isNotEmpty) { - assert(testDevices.every((String s) => s != null && s.isNotEmpty)); - json['testDevices'] = testDevices; - } - - return json; - } -} - -enum AnchorType { bottom, top } - -// The types of ad sizes supported for banners. The names of the values are used -// in MethodChannel calls to iOS and Android, and should not be changed. -enum AdSizeType { - WidthAndHeight, - SmartBanner, -} - -/// [AdSize] represents the size of a banner ad. There are six sizes available, -/// which are the same for both iOS and Android. See the guides for banners on -/// [Android](https://developers.google.com/admob/android/banner#banner_sizes) -/// and [iOS](https://developers.google.com/admob/ios/banner#banner_sizes) for -/// additional details. -class AdSize { - // Private constructor. Apps should use the static constants rather than - // create their own instances of [AdSize]. - const AdSize._({ - @required this.width, - @required this.height, - @required this.adSizeType, - }); - - final int height; - final int width; - final AdSizeType adSizeType; - - /// The standard banner (320x50) size. - static const AdSize banner = AdSize._( - width: 320, - height: 50, - adSizeType: AdSizeType.WidthAndHeight, - ); - - /// The large banner (320x100) size. - static const AdSize largeBanner = AdSize._( - width: 320, - height: 100, - adSizeType: AdSizeType.WidthAndHeight, - ); - - /// The medium rectangle (300x250) size. - static const AdSize mediumRectangle = AdSize._( - width: 300, - height: 250, - adSizeType: AdSizeType.WidthAndHeight, - ); - - /// The full banner (468x60) size. - static const AdSize fullBanner = AdSize._( - width: 468, - height: 60, - adSizeType: AdSizeType.WidthAndHeight, - ); - - /// The leaderboard (728x90) size. - static const AdSize leaderboard = AdSize._( - width: 728, - height: 90, - adSizeType: AdSizeType.WidthAndHeight, - ); - - /// The smart banner size. Smart banners are unique in that the width and - /// height values declared here aren't used. At runtime, the Mobile Ads SDK - /// will automatically adjust the banner's width to match the width of the - /// displaying device's screen. It will also set the banner's height using a - /// calculation based on the displaying device's height. For more info see the - /// [Android](https://developers.google.com/admob/android/banner) and - /// [iOS](https://developers.google.com/admob/ios/banner) banner ad guides. - static const AdSize smartBanner = AdSize._( - width: 0, - height: 0, - adSizeType: AdSizeType.SmartBanner, - ); -} - -/// A mobile [BannerAd] or [InterstitialAd] for the [FirebaseAdMobPlugin]. -/// -/// A [MobileAd] must be loaded with [load] before it is shown with [show]. -/// -/// A valid [adUnitId] is required. -abstract class MobileAd { - /// Default constructor, used by subclasses. - MobileAd( - {@required this.adUnitId, - MobileAdTargetingInfo targetingInfo, - this.listener}) - : _targetingInfo = targetingInfo ?? const MobileAdTargetingInfo() { - assert(adUnitId != null && adUnitId.isNotEmpty); - assert(_allAds[id] == null); - _allAds[id] = this; - } - - static final Map _allAds = {}; - - /// Optional targeting info per the native AdMob API. - MobileAdTargetingInfo get targetingInfo => _targetingInfo; - final MobileAdTargetingInfo _targetingInfo; - - /// Identifies the source of ads for your application. - /// - /// For testing use a [sample ad unit](https://developers.google.com/admob/ios/test-ads#sample_ad_units). - final String adUnitId; - - /// Called when the status of the ad changes. - MobileAdListener listener; - - /// An internal id that identifies this mobile ad to the native AdMob plugin. - /// - /// Plugin log messages will identify this property as the ad's `mobileAdId`. - int get id => hashCode; - - /// Start loading this ad. - Future load(); - - /// Show this ad. - /// - /// The ad must have been loaded with [load] first. If loading hasn't finished - /// the ad will not actually appear until the ad has finished loading. - /// - /// The [listener] will be notified when the ad has finished loading or fails - /// to do so. An ad that fails to load will not be shown. - /// - /// anchorOffset is the logical pixel offset from the edge of the screen (default 0.0) - /// anchorType place advert at top or bottom of screen (default bottom) - Future show( - {double anchorOffset = 0.0, - double horizontalCenterOffset = 0.0, - AnchorType anchorType = AnchorType.bottom}) { - return _invokeBooleanMethod("showAd", { - 'id': id, - 'anchorOffset': anchorOffset.toString(), - 'horizontalCenterOffset': horizontalCenterOffset.toString(), - 'anchorType': describeEnum(anchorType) - }); - } - - /// Free the plugin resources associated with this ad. - /// - /// Disposing a banner ad that's been shown removes it from the screen. - /// Interstitial ads can't be programmatically removed from view. - Future dispose() { - assert(_allAds[id] != null); - _allAds[id] = null; - return _invokeBooleanMethod("disposeAd", {'id': id}); - } - - Future isLoaded() { - return _invokeBooleanMethod("isAdLoaded", { - 'id': id, - }); - } -} - -/// A banner ad for the [FirebaseAdMobPlugin]. -class BannerAd extends MobileAd { - /// Create a BannerAd. - /// - /// A valid [adUnitId] is required. - BannerAd({ - @required String adUnitId, - @required this.size, - MobileAdTargetingInfo targetingInfo, - MobileAdListener listener, - }) : super( - adUnitId: adUnitId, - targetingInfo: targetingInfo, - listener: listener); - - final AdSize size; - - /// These are AdMob's test ad unit IDs, which always return test ads. You're - /// encouraged to use them for testing in your own apps. - static final String testAdUnitId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544/6300978111' - : 'ca-app-pub-3940256099942544/2934735716'; - - @override - Future load() { - return _invokeBooleanMethod("loadBannerAd", { - 'id': id, - 'adUnitId': adUnitId, - 'targetingInfo': targetingInfo?.toJson(), - 'width': size.width, - 'height': size.height, - 'adSizeType': size.adSizeType.toString(), - }); - } -} - -/// A full-screen interstitial ad for the [FirebaseAdMobPlugin]. -class InterstitialAd extends MobileAd { - /// Create an Interstitial. - /// - /// A valid [adUnitId] is required. - InterstitialAd({ - String adUnitId, - MobileAdTargetingInfo targetingInfo, - MobileAdListener listener, - }) : super( - adUnitId: adUnitId, - targetingInfo: targetingInfo, - listener: listener); - - /// A platform-specific AdMob test ad unit ID for interstitials. This ad unit - /// has been specially configured to always return test ads, and developers - /// are encouraged to use it while building and testing their apps. - static final String testAdUnitId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544/1033173712' - : 'ca-app-pub-3940256099942544/4411468910'; - - @override - Future load() { - return _invokeBooleanMethod("loadInterstitialAd", { - 'id': id, - 'adUnitId': adUnitId, - 'targetingInfo': targetingInfo?.toJson(), - }); - } -} - -/// [RewardedVideoAd] status changes reported to [RewardedVideoAdListener]s. -/// -/// The [rewarded] event is particularly important, since it indicates that the -/// user has watched a video for long enough to be given an in-app reward. -enum RewardedVideoAdEvent { - loaded, - failedToLoad, - opened, - leftApplication, - closed, - rewarded, - started, - completed, -} - -/// Signature for a [RewardedVideoAd] status change callback. The optional -/// parameters are only used when the [RewardedVideoAdEvent.rewarded] event -/// is sent, when they'll contain the reward amount and reward type that were -/// configured for the AdMob ad unit when it was created. They will be null for -/// all other events. -typedef void RewardedVideoAdListener(RewardedVideoAdEvent event, - {String rewardType, int rewardAmount}); - -/// An AdMob rewarded video ad. -/// -/// This class is a singleton, and [RewardedVideoAd.instance] provides a -/// reference to the single instance, which is created at launch. The native -/// Android and iOS APIs for AdMob use a singleton to manage rewarded video ad -/// objects, and that pattern is reflected here. -/// -/// Apps should assign a callback function to [RewardedVideoAd]'s listener -/// property in order to receive reward notifications from the AdMob SDK: -/// ``` -/// RewardedVideoAd.instance.listener = (RewardedVideoAdEvent event, -/// [String rewardType, int rewardAmount]) { -/// print("You were rewarded with $rewardAmount $rewardType!"); -/// } -/// }; -/// ``` -/// -/// The function will be invoked when any of the events in -/// [RewardedVideoAdEvent] occur. -/// -/// To load and show ads, call the load method: -/// ``` -/// RewardedVideoAd.instance.load(myAdUnitString, myTargetingInfoObj); -/// ``` -/// -/// Later (any point after your listener callback receives the -/// RewardedVideoAdEvent.loaded event), call the show method: -/// ``` -/// RewardedVideoAd.instance.show(); -/// ``` -/// -/// Only one rewarded video ad can be loaded at a time. Because the video assets -/// are so large, it's a good idea to start loading an ad well in advance of -/// when it's likely to be needed. -class RewardedVideoAd { - RewardedVideoAd._(); - - /// A platform-specific AdMob test ad unit ID for rewarded video ads. This ad - /// unit has been specially configured to always return test ads, and - /// developers are encouraged to use it while building and testing their apps. - static final String testAdUnitId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544/5224354917' - : 'ca-app-pub-3940256099942544/1712485313'; - - static final RewardedVideoAd _instance = RewardedVideoAd._(); - - /// The one and only instance of this class. - static RewardedVideoAd get instance => _instance; - - /// Callback invoked for events in the rewarded video ad lifecycle. - RewardedVideoAdListener listener; - - /// Shows a rewarded video ad if one has been loaded. - Future show() { - return _invokeBooleanMethod("showRewardedVideoAd"); - } - - /// Loads a rewarded video ad using the provided ad unit ID. - Future load( - {@required String adUnitId, MobileAdTargetingInfo targetingInfo}) { - assert(adUnitId.isNotEmpty); - return _invokeBooleanMethod("loadRewardedVideoAd", { - 'adUnitId': adUnitId, - 'targetingInfo': targetingInfo?.toJson(), - }); - } -} - -/// Support for Google AdMob mobile ads. -/// -/// Before loading or showing an ad the plugin must be initialized with -/// an AdMob app id: -/// ``` -/// FirebaseAdMob.instance.initialize(appId: myAppId); -/// ``` -/// -/// Apps can create, load, and show mobile ads. For example: -/// ``` -/// BannerAd myBanner = BannerAd(unitId: myBannerAdUnitId) -/// ..load() -/// ..show(); -/// ``` -/// -/// See also: -/// -/// * The example associated with this plugin. -/// * [BannerAd], a small rectangular ad displayed at the bottom of the screen. -/// * [InterstitialAd], a full screen ad that must be dismissed by the user. -/// * [RewardedVideoAd], a full screen video ad that provides in-app user -/// rewards. -class FirebaseAdMob { - @visibleForTesting - FirebaseAdMob.private(MethodChannel channel) : _channel = channel { - _channel.setMethodCallHandler(_handleMethod); - } - - // A placeholder AdMob App ID for testing. AdMob App IDs and ad unit IDs are - // specific to a single operating system, so apps building for both Android and - // iOS will need a set for each platform. - static final String testAppId = Platform.isAndroid - ? 'ca-app-pub-3940256099942544~3347511713' - : 'ca-app-pub-3940256099942544~1458002511'; - - static final FirebaseAdMob _instance = FirebaseAdMob.private( - const MethodChannel('plugins.flutter.io/firebase_admob'), - ); - - /// The single shared instance of this plugin. - static FirebaseAdMob get instance => _instance; - - final MethodChannel _channel; - - static const Map _methodToMobileAdEvent = - { - 'onAdLoaded': MobileAdEvent.loaded, - 'onAdFailedToLoad': MobileAdEvent.failedToLoad, - 'onAdClicked': MobileAdEvent.clicked, - 'onAdImpression': MobileAdEvent.impression, - 'onAdOpened': MobileAdEvent.opened, - 'onAdLeftApplication': MobileAdEvent.leftApplication, - 'onAdClosed': MobileAdEvent.closed, - }; - - static const Map _methodToRewardedVideoAdEvent = - { - 'onRewarded': RewardedVideoAdEvent.rewarded, - 'onRewardedVideoAdClosed': RewardedVideoAdEvent.closed, - 'onRewardedVideoAdFailedToLoad': RewardedVideoAdEvent.failedToLoad, - 'onRewardedVideoAdLeftApplication': RewardedVideoAdEvent.leftApplication, - 'onRewardedVideoAdLoaded': RewardedVideoAdEvent.loaded, - 'onRewardedVideoAdOpened': RewardedVideoAdEvent.opened, - 'onRewardedVideoStarted': RewardedVideoAdEvent.started, - 'onRewardedVideoCompleted': RewardedVideoAdEvent.completed, - }; - - /// Initialize this plugin for the AdMob app specified by `appId`. - Future initialize( - {@required String appId, - String trackingId, - bool analyticsEnabled = false}) { - assert(appId != null && appId.isNotEmpty); - assert(analyticsEnabled != null); - return _invokeBooleanMethod("initialize", { - 'appId': appId, - 'trackingId': trackingId, - 'analyticsEnabled': analyticsEnabled, - }); - } - - Future _handleMethod(MethodCall call) { - assert(call.arguments is Map); - final Map argumentsMap = call.arguments; - final RewardedVideoAdEvent rewardedEvent = - _methodToRewardedVideoAdEvent[call.method]; - if (rewardedEvent != null) { - if (RewardedVideoAd.instance.listener != null) { - if (rewardedEvent == RewardedVideoAdEvent.rewarded) { - RewardedVideoAd.instance.listener(rewardedEvent, - rewardType: argumentsMap['rewardType'], - rewardAmount: argumentsMap['rewardAmount']); - } else { - RewardedVideoAd.instance.listener(rewardedEvent); - } - } - } else { - final int id = argumentsMap['id']; - if (id != null && MobileAd._allAds[id] != null) { - final MobileAd ad = MobileAd._allAds[id]; - final MobileAdEvent mobileAdEvent = _methodToMobileAdEvent[call.method]; - if (mobileAdEvent != null && ad.listener != null) { - ad.listener(mobileAdEvent); - } - } - } - - return Future.value(null); - } -} - -Future _invokeBooleanMethod(String method, [dynamic arguments]) async { - final bool result = await FirebaseAdMob.instance._channel.invokeMethod( - method, - arguments, - ); - return result; -} diff --git a/packages/firebase_admob/pubspec.yaml b/packages/firebase_admob/pubspec.yaml deleted file mode 100644 index e6ba7fa7271a..000000000000 --- a/packages/firebase_admob/pubspec.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: firebase_admob -description: Flutter plugin for Firebase AdMob, supporting - banner, interstitial (full-screen), and rewarded video ads -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_admob -version: 0.9.0+4 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebaseadmob - iosPrefix: FLT - pluginClass: FirebaseAdMobPlugin - -dependencies: - meta: ^1.0.4 - platform: ^2.0.0 - flutter: - sdk: flutter - -dev_dependencies: - mockito: ^3.0.0 - flutter_test: - sdk: flutter - firebase_core: ^0.4.0 - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_admob/test/firebase_admob_test.dart b/packages/firebase_admob/test/firebase_admob_test.dart deleted file mode 100644 index 4d85664fa614..000000000000 --- a/packages/firebase_admob/test/firebase_admob_test.dart +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_admob/firebase_admob.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('FirebaseAdMob', () { - const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_admob'); - - final List log = []; - final FirebaseAdMob admob = FirebaseAdMob.private(channel); - - setUp(() async { - channel.setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'initialize': - case 'loadBannerAd': - case 'loadInterstitialAd': - case 'loadRewardedVideoAd': - case 'showAd': - case 'showRewardedVideoAd': - case 'disposeAd': - return Future.value(true); - default: - assert(false); - return null; - } - }); - }); - - test('initialize', () async { - log.clear(); - - expect(await admob.initialize(appId: FirebaseAdMob.testAppId), true); - expect(log, [ - isMethodCall('initialize', arguments: { - 'appId': FirebaseAdMob.testAppId, - 'trackingId': null, - 'analyticsEnabled': false, - }), - ]); - }); - - test('banner', () async { - log.clear(); - - final BannerAd banner = BannerAd( - adUnitId: BannerAd.testAdUnitId, - size: AdSize.banner, - ); - final int id = banner.id; - - expect(await banner.load(), true); - expect(await banner.show(), true); - expect(await banner.dispose(), true); - - expect(log, [ - isMethodCall('loadBannerAd', arguments: { - 'id': id, - 'adUnitId': BannerAd.testAdUnitId, - 'targetingInfo': {'requestAgent': 'flutter-alpha'}, - 'width': 320, - 'height': 50, - 'adSizeType': 'AdSizeType.WidthAndHeight', - }), - isMethodCall('showAd', arguments: { - 'id': id, - 'anchorOffset': '0.0', - 'horizontalCenterOffset': '0.0', - 'anchorType': 'bottom', - }), - isMethodCall('disposeAd', arguments: { - 'id': id, - }), - ]); - }); - - test('interstitial', () async { - log.clear(); - - final InterstitialAd interstitial = InterstitialAd( - adUnitId: InterstitialAd.testAdUnitId, - ); - final int id = interstitial.id; - - expect(await interstitial.load(), true); - expect( - await interstitial.show( - anchorOffset: 60.0, - horizontalCenterOffset: 10.0, - anchorType: AnchorType.top), - true); - expect(await interstitial.dispose(), true); - - expect(log, [ - isMethodCall('loadInterstitialAd', arguments: { - 'id': id, - 'adUnitId': InterstitialAd.testAdUnitId, - 'targetingInfo': {'requestAgent': 'flutter-alpha'}, - }), - isMethodCall('showAd', arguments: { - 'id': id, - 'anchorOffset': '60.0', - 'horizontalCenterOffset': '10.0', - 'anchorType': 'top', - }), - isMethodCall('disposeAd', arguments: { - 'id': id, - }), - ]); - }); - - test('rewarded', () async { - log.clear(); - - expect( - await RewardedVideoAd.instance.load( - adUnitId: RewardedVideoAd.testAdUnitId, - targetingInfo: const MobileAdTargetingInfo()), - true); - - expect(await RewardedVideoAd.instance.show(), true); - - expect(log, [ - isMethodCall('loadRewardedVideoAd', arguments: { - 'adUnitId': RewardedVideoAd.testAdUnitId, - 'targetingInfo': {'requestAgent': 'flutter-alpha'}, - }), - isMethodCall('showRewardedVideoAd', arguments: null), - ]); - }); - }); -} diff --git a/packages/firebase_analytics/.gitignore b/packages/firebase_analytics/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_analytics/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_analytics/CHANGELOG.md b/packages/firebase_analytics/CHANGELOG.md deleted file mode 100644 index 16051241ebb9..000000000000 --- a/packages/firebase_analytics/CHANGELOG.md +++ /dev/null @@ -1,230 +0,0 @@ -## 5.0.0 - -* **Breaking change**. Remove deprecated method `setMinimumSessionDuration`. -* **Breaking change**. Removed `FirebaseAnalyticsAndroid.setAnalyticsCollectionEnabled`. Use - `FirebaseAnalytics.setAnalyticsCollectionEnabled` instead. -* Update Android gradle plugin and gradle version. -* Remove redundant casts on Android. - -## 4.0.2 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 4.0.1 - -* Refactor unit tests to use `setMockMethodCallHandler`. - -## 4.0.0 - -* Added new tracking events: - - `logLevelStart` - - `logLevelEnd` - - `logRemoveFromCart` - - `logSetCheckoutOption` -* **Breaking change**. Add new required parameter `method` to `logShare` event tracking. -* **Breaking change**. The following event names are reserved and cannot be used: - - `ad_activeview` - - `ad_click` - - `ad_exposure` - - `ad_impression` - - `ad_query` - - `adunit_exposure` - - `first_visit` - - `screen_view` - -## 3.0.3 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 3.0.2 - -* Bump minimum Flutter version to 1.5.0. -* Add missing template type parameter to `invokeMethod` calls. - -## 3.0.1 - -* Switch to using the `FIRAnalytics` version of `setAnalyticsCollectionEnabled` for - compatibility with Firebase Analytics iOS CocoaPod version 6.0. -* Update podspec to ensure availability of `setAnalyticsCollectionEnabled`. - -## 3.0.0 - -* Update Android dependencies to latest. - -## 2.1.1+3 - -* Added an initial integration test. - -## 2.1.1+2 - -* Fixed errors in code sample for `FirebaseAnalyticsObserver`. - -## 2.1.1+1 - -* Added hyperlinks to example app reference in README.md. - -## 2.1.1 - -* Added screen_view tracking of Navigator.pushReplacement - -## 2.1.0 - -* Add Login event support - -## 2.0.3 - -* Add resetAnalyticsData method - -## 2.0.2+1 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 2.0.2 - -* Enable setAnalyticsCollectionEnabled support for iOS - -## 2.0.1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 2.0.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - - This was originally incorrectly pushed in the `1.2.0` update. - -## 1.2.0+1 - -* **Revert the breaking 1.2.0 update**. 1.2.0 was known to be breaking and - should have incremented the major version number instead of the minor. This - revert is in and of itself breaking for anyone that has already migrated - however. Anyone who has already migrated their app to AndroidX should - immediately update to `2.0.0` instead. That's the correctly versioned new push - of `1.2.0`. - -## 1.2.0 - -* **BAD**. This was a breaking change that was incorrectly published on a minor - version upgrade, should never have happened. Reverted by 1.2.0+1. - - "**Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library." - -## 1.1.0 - -* Allow user to handle `PlatformException`s caught by `FirebaseAnalyticsObserver._sendScreenView()`. - -## 1.0.6 - -* Allow user ID to be set to null. - -## 1.0.5 - -* Update the `METHOD` Android constant used for `logSignUp` method. - -## 1.0.4 - -* Bump Android dependencies to latest. - -## 1.0.3 - -* Updated test and mockito dependencies to pick up Dart 2 support - -## 1.0.2 - -* Bump Android and Firebase dependency versions. - -## 1.0.1 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 1.0.0 - -* Bump to released version. - -## 0.3.3 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.3.2 - -* Updated package channel name - -## 0.3.1 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.3.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.2.3 - -* Enabled use in Swift projects. - -## 0.2.2+1 - -* Updated description to clarify this is 'Google Analytics for Firebase' - -## 0.2.2 - -* Moved to the io.flutter.plugins organization. - -## 0.2.1 - -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.2.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). -* Relaxed GMS dependency to [11.4.0,12.0[ - -## 0.1.2 - -* Added FLT prefix to iOS types -* Change GMS dependency to 11.4.+ - -## 0.1.1 - -* Change GMS dependency to 11.+ - -## 0.1.0+1 - -* Aligned author name with rest of repo. - -## 0.1.0 - -* Added `FirebaseAnalyticsObserver` (a `NavigatorObserver`) to automatically log `PageRoute` transitions - -## 0.0.5 - -* Support for long parameter values on Android - -## 0.0.4 - -* Updated to Firebase SDK to always use latest patch version for 11.0.x builds - -## 0.0.3 - -* Updated to Firebase SDK Version 11.0.1 - -## 0.0.2 - -* Bumped buildToolsVersion to 25.0.3 -* Updated README.md - -## 0.0.1 - -* Initial Release diff --git a/packages/firebase_analytics/LICENSE b/packages/firebase_analytics/LICENSE deleted file mode 100755 index 000b4618d2bd..000000000000 --- a/packages/firebase_analytics/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_analytics/README.md b/packages/firebase_analytics/README.md deleted file mode 100755 index f8874acc1480..000000000000 --- a/packages/firebase_analytics/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Google Analytics for Firebase - -[![pub package](https://img.shields.io/pub/v/firebase_analytics.svg)](https://pub.dartlang.org/packages/firebase_analytics) - -A Flutter plugin to use the [Google Analytics for Firebase API](https://firebase.google.com/docs/analytics/). - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage -To use this plugin, add `firebase_analytics` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). You must also configure firebase analytics for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#4 for step by step details). - -## Track PageRoute Transitions - -To track `PageRoute` transitions, add a `FirebaseAnalyticsObserver` to the list of `NavigatorObservers` on your -`Navigator`, e.g. if you're using a `MaterialApp`: - -```dart - -FirebaseAnalytics analytics = FirebaseAnalytics(); - -MaterialApp( - home: MyAppHome(), - navigatorObservers: [ - FirebaseAnalyticsObserver(analytics: analytics), - ], -); -``` - -You can also track transitions within your `PageRoute` (e.g. when the user switches from one tab to another) by -implementing `RouteAware` and subscribing it to `FirebaseAnalyticsObserver`. See [`example/lib/tabs_page.dart`][tabs_page] -for an example of how to wire that up. - -## Getting Started - -See the [`example`][example] directory for a complete sample app using Google Analytics for Firebase. - -[example]: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics/example -[tabs_page]: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics/example/lib/tabs_page.dart \ No newline at end of file diff --git a/packages/firebase_analytics/android/build.gradle b/packages/firebase_analytics/android/build.gradle deleted file mode 100755 index 96633d9194bc..000000000000 --- a/packages/firebase_analytics/android/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -def PLUGIN = "firebase_analytics"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebaseanalytics' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-analytics:16.5.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_analytics/android/gradle.properties b/packages/firebase_analytics/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_analytics/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_analytics/android/settings.gradle b/packages/firebase_analytics/android/settings.gradle deleted file mode 100755 index 4b80dda8afc7..000000000000 --- a/packages/firebase_analytics/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_analytics' diff --git a/packages/firebase_analytics/android/src/main/AndroidManifest.xml b/packages/firebase_analytics/android/src/main/AndroidManifest.xml deleted file mode 100755 index d05df03b0c80..000000000000 --- a/packages/firebase_analytics/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_analytics/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java b/packages/firebase_analytics/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java deleted file mode 100755 index 0ec15c7cc22b..000000000000 --- a/packages/firebase_analytics/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseanalytics; - -import android.app.Activity; -import android.os.Bundle; -import com.google.firebase.FirebaseApp; -import com.google.firebase.analytics.FirebaseAnalytics; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry; -import java.util.Map; - -/** Flutter plugin for Firebase Analytics. */ -public class FirebaseAnalyticsPlugin implements MethodCallHandler { - private final PluginRegistry.Registrar registrar; - private final FirebaseAnalytics firebaseAnalytics; - - public static void registerWith(PluginRegistry.Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_analytics"); - channel.setMethodCallHandler(new FirebaseAnalyticsPlugin(registrar)); - } - - private FirebaseAnalyticsPlugin(PluginRegistry.Registrar registrar) { - this.registrar = registrar; - FirebaseApp.initializeApp(registrar.context()); - this.firebaseAnalytics = FirebaseAnalytics.getInstance(registrar.context()); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - switch (call.method) { - case "logEvent": - handleLogEvent(call, result); - break; - case "setUserId": - handleSetUserId(call, result); - break; - case "setCurrentScreen": - handleSetCurrentScreen(call, result); - break; - case "setAnalyticsCollectionEnabled": - handleSetAnalyticsCollectionEnabled(call, result); - break; - case "setSessionTimeoutDuration": - handleSetSessionTimeoutDuration(call, result); - break; - case "setUserProperty": - handleSetUserProperty(call, result); - break; - case "resetAnalyticsData": - handleResetAnalyticsData(result); - break; - default: - result.notImplemented(); - break; - } - } - - private void handleLogEvent(MethodCall call, Result result) { - - final String eventName = call.argument("name"); - final Map map = call.argument("parameters"); - final Bundle parameterBundle = createBundleFromMap(map); - firebaseAnalytics.logEvent(eventName, parameterBundle); - result.success(null); - } - - private void handleSetUserId(MethodCall call, Result result) { - final String id = (String) call.arguments; - firebaseAnalytics.setUserId(id); - result.success(null); - } - - private void handleSetCurrentScreen(MethodCall call, Result result) { - Activity activity = registrar.activity(); - if (activity == null) { - result.error("no_activity", "handleSetCurrentScreen requires a foreground activity", null); - return; - } - - final String screenName = call.argument("screenName"); - final String screenClassOverride = call.argument("screenClassOverride"); - - firebaseAnalytics.setCurrentScreen(activity, screenName, screenClassOverride); - result.success(null); - } - - private void handleSetAnalyticsCollectionEnabled(MethodCall call, Result result) { - final Boolean enabled = call.arguments(); - firebaseAnalytics.setAnalyticsCollectionEnabled(enabled); - result.success(null); - } - - private void handleSetSessionTimeoutDuration(MethodCall call, Result result) { - final Integer milliseconds = call.arguments(); - firebaseAnalytics.setSessionTimeoutDuration(milliseconds); - result.success(null); - } - - private void handleSetUserProperty(MethodCall call, Result result) { - final String name = call.argument("name"); - final String value = call.argument("value"); - - firebaseAnalytics.setUserProperty(name, value); - result.success(null); - } - - private void handleResetAnalyticsData(Result result) { - firebaseAnalytics.resetAnalyticsData(); - result.success(null); - } - - private static Bundle createBundleFromMap(Map map) { - if (map == null) { - return null; - } - - Bundle bundle = new Bundle(); - for (Map.Entry jsonParam : map.entrySet()) { - final Object value = jsonParam.getValue(); - final String key = jsonParam.getKey(); - if (value instanceof String) { - bundle.putString(key, (String) value); - } else if (value instanceof Integer) { - bundle.putInt(key, (Integer) value); - } else if (value instanceof Long) { - bundle.putLong(key, (Long) value); - } else if (value instanceof Double) { - bundle.putDouble(key, (Double) value); - } else if (value instanceof Boolean) { - bundle.putBoolean(key, (Boolean) value); - } else { - throw new IllegalArgumentException( - "Unsupported value type: " + value.getClass().getCanonicalName()); - } - } - return bundle; - } -} diff --git a/packages/firebase_analytics/android/src/main/java/io/flutter/plugins/firebaseanalytics/FlutterFirebaseAppRegistrar.java b/packages/firebase_analytics/android/src/main/java/io/flutter/plugins/firebaseanalytics/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 01c08327078d..000000000000 --- a/packages/firebase_analytics/android/src/main/java/io/flutter/plugins/firebaseanalytics/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseanalytics; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_analytics/android/user-agent.gradle b/packages/firebase_analytics/android/user-agent.gradle deleted file mode 100644 index b41aa26c5d1d..000000000000 --- a/packages/firebase_analytics/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-analytics" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_analytics/example/README.md b/packages/firebase_analytics/example/README.md deleted file mode 100755 index 101d033eea86..000000000000 --- a/packages/firebase_analytics/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_analytics_example - -Demonstrates how to use the firebase_analytics plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_analytics/example/android.iml b/packages/firebase_analytics/example/android.iml deleted file mode 100755 index 462b903e05b6..000000000000 --- a/packages/firebase_analytics/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_analytics/example/android/app/build.gradle b/packages/firebase_analytics/example/android/app/build.gradle deleted file mode 100755 index 3d617c0045f0..000000000000 --- a/packages/firebase_analytics/example/android/app/build.gradle +++ /dev/null @@ -1,59 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebaseanalyticsexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_analytics/example/android/app/google-services.json b/packages/firebase_analytics/example/android/app/google-services.json deleted file mode 100755 index d7828277516e..000000000000 --- a/packages/firebase_analytics/example/android/app/google-services.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "project_info": { - "project_number": "22422828327", - "firebase_url": "https://flutter-plugins-analytics.firebaseio.com", - "project_id": "flutter-plugins-analytics", - "storage_bucket": "flutter-plugins-analytics.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:22422828327:android:72a6b73c96532099", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseanalyticsexample" - } - }, - "oauth_client": [ - { - "client_id": "22422828327-i4s5s21mag6441kkl7l4sbp5ti3frbb3.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseanalyticsexample", - "certificate_hash": "f8323ac5fe6e7adc1ddc5612e16b5d04d7f1358b" - } - }, - { - "client_id": "22422828327-a63cmhasfhmvjckqkpe6ktkl953nf36f.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDc6IWV13gfkOanJWSXwdmVzi8-E7qKrlo" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "22422828327-a63cmhasfhmvjckqkpe6ktkl953nf36f.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_analytics/example/android/app/gradle.properties b/packages/firebase_analytics/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_analytics/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_analytics/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_analytics/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_analytics/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_analytics/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_analytics/example/android/app/src/main/AndroidManifest.xml deleted file mode 100755 index f6ddd6443c46..000000000000 --- a/packages/firebase_analytics/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/firebase_analytics/example/android/app/src/main/java/io/flutter/plugins/.gitignore b/packages/firebase_analytics/example/android/app/src/main/java/io/flutter/plugins/.gitignore deleted file mode 100755 index 0f2aeaa1dc2c..000000000000 --- a/packages/firebase_analytics/example/android/app/src/main/java/io/flutter/plugins/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -GeneratedPluginRegistrant.java - - diff --git a/packages/firebase_analytics/example/android/app/src/main/java/io/flutter/plugins/firebaseanalyticsexample/MainActivity.java b/packages/firebase_analytics/example/android/app/src/main/java/io/flutter/plugins/firebaseanalyticsexample/MainActivity.java deleted file mode 100644 index ac7abd0b9609..000000000000 --- a/packages/firebase_analytics/example/android/app/src/main/java/io/flutter/plugins/firebaseanalyticsexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseanalyticsexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_analytics/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_analytics/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 09d4391482be..000000000000 Binary files a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_analytics/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_analytics/example/android/build.gradle b/packages/firebase_analytics/example/android/build.gradle deleted file mode 100755 index 3f271ea72055..000000000000 --- a/packages/firebase_analytics/example/android/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - mavenLocal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_analytics/example/android/gradle.properties b/packages/firebase_analytics/example/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_analytics/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_analytics/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_analytics/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 0c59c158ca01..000000000000 --- a/packages/firebase_analytics/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Wed Jul 31 23:52:55 BRT 2019 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/packages/firebase_analytics/example/android/settings.gradle b/packages/firebase_analytics/example/android/settings.gradle deleted file mode 100755 index 115da6cb4f4d..000000000000 --- a/packages/firebase_analytics/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_analytics/example/firebase_analytics_example.iml b/packages/firebase_analytics/example/firebase_analytics_example.iml deleted file mode 100755 index 1ae40a0f7f54..000000000000 --- a/packages/firebase_analytics/example/firebase_analytics_example.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_analytics/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_analytics/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100755 index 6c2de8086bcd..000000000000 --- a/packages/firebase_analytics/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_analytics/example/ios/Flutter/Debug.xcconfig b/packages/firebase_analytics/example/ios/Flutter/Debug.xcconfig deleted file mode 100755 index 9803018ca79d..000000000000 --- a/packages/firebase_analytics/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/firebase_analytics/example/ios/Flutter/Release.xcconfig b/packages/firebase_analytics/example/ios/Flutter/Release.xcconfig deleted file mode 100755 index a4a8c604e13d..000000000000 --- a/packages/firebase_analytics/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/firebase_analytics/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_analytics/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 5d3acaf85694..000000000000 --- a/packages/firebase_analytics/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,482 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5C6F5A6B1EC3AF0E008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A6A1EC3AF0E008D64B5 /* GeneratedPluginRegistrant.m */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - B1F3D14E8117A6C9F65810E0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D558BB7489B1C82B42A9097 /* libPods-Runner.a */; }; - B43DDBB51EA0304000A48ABE /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B43DDBB41EA0304000A48ABE /* GoogleService-Info.plist */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 4D558BB7489B1C82B42A9097 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 5C6F5A691EC3AF0E008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 5C6F5A6A1EC3AF0E008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B43DDBB41EA0304000A48ABE /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - B1F3D14E8117A6C9F65810E0 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 840012C8B5EDBCF56B0E4AC1 /* Pods */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 5C6F5A691EC3AF0E008D64B5 /* GeneratedPluginRegistrant.h */, - 5C6F5A6A1EC3AF0E008D64B5 /* GeneratedPluginRegistrant.m */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - B43DDBB41EA0304000A48ABE /* GoogleService-Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 4D558BB7489B1C82B42A9097 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B43DDBB51EA0304000A48ABE /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 5C6F5A6B1EC3AF0E008D64B5 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseAnalyticsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseAnalyticsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_analytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_analytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_analytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_analytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_analytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index 1c9580788197..000000000000 --- a/packages/firebase_analytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_analytics/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_analytics/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_analytics/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_analytics/example/ios/Runner/AppDelegate.h b/packages/firebase_analytics/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_analytics/example/ios/Runner/AppDelegate.m b/packages/firebase_analytics/example/ios/Runner/AppDelegate.m deleted file mode 100644 index a4b51c88eb60..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index d22f10b2ab63..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100755 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100755 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100755 index 4cde12118dda..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100755 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100755 index dcdc2306c285..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100755 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100755 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100755 index c4df70d39da7..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100755 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100755 index d0e1f5853602..000000000000 Binary files a/packages/firebase_analytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_analytics/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_analytics/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100755 index ebf48f603974..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_analytics/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_analytics/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100755 index f3c28516fb38..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_analytics/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_analytics/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index ebf17fdc314a..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 22422828327-dht1d0h6vf8j2r7t4lslc44cqtunrgie.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.22422828327-dht1d0h6vf8j2r7t4lslc44cqtunrgie - API_KEY - AIzaSyDnzw8kNyq19zKkygY161hBuzaeoIcRtK8 - GCM_SENDER_ID - 22422828327 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebaseAnalyticsExample - PROJECT_ID - flutter-plugins-analytics - STORAGE_BUCKET - flutter-plugins-analytics.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:22422828327:ios:900bf026228cf65a - DATABASE_URL - https://flutter-plugins-analytics.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_analytics/example/ios/Runner/Info.plist b/packages/firebase_analytics/example/ios/Runner/Info.plist deleted file mode 100755 index 50d501fd1f7f..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_analytics_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_analytics/example/ios/Runner/main.m b/packages/firebase_analytics/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/firebase_analytics/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_analytics/example/lib/main.dart b/packages/firebase_analytics/example/lib/main.dart deleted file mode 100755 index 2c3affd29c1c..000000000000 --- a/packages/firebase_analytics/example/lib/main.dart +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; - -import 'tabs_page.dart'; - -void main() { - runApp(MyApp()); -} - -class MyApp extends StatelessWidget { - static FirebaseAnalytics analytics = FirebaseAnalytics(); - static FirebaseAnalyticsObserver observer = - FirebaseAnalyticsObserver(analytics: analytics); - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Firebase Analytics Demo', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - navigatorObservers: [observer], - home: MyHomePage( - title: 'Firebase Analytics Demo', - analytics: analytics, - observer: observer, - ), - ); - } -} - -class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title, this.analytics, this.observer}) - : super(key: key); - - final String title; - final FirebaseAnalytics analytics; - final FirebaseAnalyticsObserver observer; - - @override - _MyHomePageState createState() => _MyHomePageState(analytics, observer); -} - -class _MyHomePageState extends State { - _MyHomePageState(this.analytics, this.observer); - - final FirebaseAnalyticsObserver observer; - final FirebaseAnalytics analytics; - String _message = ''; - - void setMessage(String message) { - setState(() { - _message = message; - }); - } - - Future _sendAnalyticsEvent() async { - await analytics.logEvent( - name: 'test_event', - parameters: { - 'string': 'string', - 'int': 42, - 'long': 12345678910, - 'double': 42.0, - 'bool': true, - }, - ); - setMessage('logEvent succeeded'); - } - - Future _testSetUserId() async { - await analytics.setUserId('some-user'); - setMessage('setUserId succeeded'); - } - - Future _testSetCurrentScreen() async { - await analytics.setCurrentScreen( - screenName: 'Analytics Demo', - screenClassOverride: 'AnalyticsDemo', - ); - setMessage('setCurrentScreen succeeded'); - } - - Future _testSetAnalyticsCollectionEnabled() async { - await analytics.setAnalyticsCollectionEnabled(false); - await analytics.setAnalyticsCollectionEnabled(true); - setMessage('setAnalyticsCollectionEnabled succeeded'); - } - - Future _testSetSessionTimeoutDuration() async { - await analytics.android?.setSessionTimeoutDuration(2000000); - setMessage('setSessionTimeoutDuration succeeded'); - } - - Future _testSetUserProperty() async { - await analytics.setUserProperty(name: 'regular', value: 'indeed'); - setMessage('setUserProperty succeeded'); - } - - Future _testAllEventTypes() async { - await analytics.logAddPaymentInfo(); - await analytics.logAddToCart( - currency: 'USD', - value: 123.0, - itemId: 'test item id', - itemName: 'test item name', - itemCategory: 'test item category', - quantity: 5, - price: 24.0, - origin: 'test origin', - itemLocationId: 'test location id', - destination: 'test destination', - startDate: '2015-09-14', - endDate: '2015-09-17', - ); - await analytics.logAddToWishlist( - itemId: 'test item id', - itemName: 'test item name', - itemCategory: 'test item category', - quantity: 5, - price: 24.0, - value: 123.0, - currency: 'USD', - itemLocationId: 'test location id', - ); - await analytics.logAppOpen(); - await analytics.logBeginCheckout( - value: 123.0, - currency: 'USD', - transactionId: 'test tx id', - numberOfNights: 2, - numberOfRooms: 3, - numberOfPassengers: 4, - origin: 'test origin', - destination: 'test destination', - startDate: '2015-09-14', - endDate: '2015-09-17', - travelClass: 'test travel class', - ); - await analytics.logCampaignDetails( - source: 'test source', - medium: 'test medium', - campaign: 'test campaign', - term: 'test term', - content: 'test content', - aclid: 'test aclid', - cp1: 'test cp1', - ); - await analytics.logEarnVirtualCurrency( - virtualCurrencyName: 'bitcoin', - value: 345.66, - ); - await analytics.logEcommercePurchase( - currency: 'USD', - value: 432.45, - transactionId: 'test tx id', - tax: 3.45, - shipping: 5.67, - coupon: 'test coupon', - location: 'test location', - numberOfNights: 3, - numberOfRooms: 4, - numberOfPassengers: 5, - origin: 'test origin', - destination: 'test destination', - startDate: '2015-09-13', - endDate: '2015-09-14', - travelClass: 'test travel class', - ); - await analytics.logGenerateLead( - currency: 'USD', - value: 123.45, - ); - await analytics.logJoinGroup( - groupId: 'test group id', - ); - await analytics.logLevelUp( - level: 5, - character: 'witch doctor', - ); - await analytics.logLogin(); - await analytics.logPostScore( - score: 1000000, - level: 70, - character: 'tiefling cleric', - ); - await analytics.logPresentOffer( - itemId: 'test item id', - itemName: 'test item name', - itemCategory: 'test item category', - quantity: 6, - price: 3.45, - value: 67.8, - currency: 'USD', - itemLocationId: 'test item location id', - ); - await analytics.logPurchaseRefund( - currency: 'USD', - value: 45.67, - transactionId: 'test tx id', - ); - await analytics.logSearch( - searchTerm: 'hotel', - numberOfNights: 2, - numberOfRooms: 1, - numberOfPassengers: 3, - origin: 'test origin', - destination: 'test destination', - startDate: '2015-09-14', - endDate: '2015-09-16', - travelClass: 'test travel class', - ); - await analytics.logSelectContent( - contentType: 'test content type', - itemId: 'test item id', - ); - await analytics.logShare( - contentType: 'test content type', - itemId: 'test item id', - method: 'facebook'); - await analytics.logSignUp( - signUpMethod: 'test sign up method', - ); - await analytics.logSpendVirtualCurrency( - itemName: 'test item name', - virtualCurrencyName: 'bitcoin', - value: 34, - ); - await analytics.logTutorialBegin(); - await analytics.logTutorialComplete(); - await analytics.logUnlockAchievement(id: 'all Firebase API covered'); - await analytics.logViewItem( - itemId: 'test item id', - itemName: 'test item name', - itemCategory: 'test item category', - itemLocationId: 'test item location id', - price: 3.45, - quantity: 6, - currency: 'USD', - value: 67.8, - flightNumber: 'test flight number', - numberOfPassengers: 3, - numberOfRooms: 1, - numberOfNights: 2, - origin: 'test origin', - destination: 'test destination', - startDate: '2015-09-14', - endDate: '2015-09-15', - searchTerm: 'test search term', - travelClass: 'test travel class', - ); - await analytics.logViewItemList( - itemCategory: 'test item category', - ); - await analytics.logViewSearchResults( - searchTerm: 'test search term', - ); - setMessage('All standard events logged successfully'); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), - body: Column( - children: [ - MaterialButton( - child: const Text('Test logEvent'), - onPressed: _sendAnalyticsEvent, - ), - MaterialButton( - child: const Text('Test standard event types'), - onPressed: _testAllEventTypes, - ), - MaterialButton( - child: const Text('Test setUserId'), - onPressed: _testSetUserId, - ), - MaterialButton( - child: const Text('Test setCurrentScreen'), - onPressed: _testSetCurrentScreen, - ), - MaterialButton( - child: const Text('Test setAnalyticsCollectionEnabled'), - onPressed: _testSetAnalyticsCollectionEnabled, - ), - MaterialButton( - child: const Text('Test setSessionTimeoutDuration'), - onPressed: _testSetSessionTimeoutDuration, - ), - MaterialButton( - child: const Text('Test setUserProperty'), - onPressed: _testSetUserProperty, - ), - Text(_message, - style: const TextStyle(color: Color.fromARGB(255, 0, 155, 0))), - ], - ), - floatingActionButton: FloatingActionButton( - child: const Icon(Icons.tab), - onPressed: () { - Navigator.of(context).push(MaterialPageRoute( - settings: const RouteSettings(name: TabsPage.routeName), - builder: (BuildContext context) { - return TabsPage(observer); - })); - }), - ); - } -} diff --git a/packages/firebase_analytics/example/lib/tabs_page.dart b/packages/firebase_analytics/example/lib/tabs_page.dart deleted file mode 100644 index 9f09998a16e4..000000000000 --- a/packages/firebase_analytics/example/lib/tabs_page.dart +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:firebase_analytics/observer.dart'; - -class TabsPage extends StatefulWidget { - TabsPage(this.observer); - - final FirebaseAnalyticsObserver observer; - - static const String routeName = '/tab'; - - @override - State createState() => _TabsPageState(observer); -} - -class _TabsPageState extends State - with SingleTickerProviderStateMixin, RouteAware { - _TabsPageState(this.observer); - - final FirebaseAnalyticsObserver observer; - TabController _controller; - int selectedIndex = 0; - - final List tabs = [ - const Tab(text: 'LEFT'), - const Tab(text: 'RIGHT'), - ]; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - observer.subscribe(this, ModalRoute.of(context)); - } - - @override - void dispose() { - observer.unsubscribe(this); - super.dispose(); - } - - @override - void initState() { - super.initState(); - _controller = TabController( - vsync: this, - length: tabs.length, - initialIndex: selectedIndex, - ); - _controller.addListener(() { - setState(() { - if (selectedIndex != _controller.index) { - selectedIndex = _controller.index; - _sendCurrentTabToAnalytics(); - } - }); - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - bottom: TabBar( - controller: _controller, - tabs: tabs, - ), - ), - body: TabBarView( - controller: _controller, - children: tabs.map((Tab tab) { - return Center(child: Text(tab.text)); - }).toList(), - ), - ); - } - - @override - void didPush() { - _sendCurrentTabToAnalytics(); - } - - @override - void didPopNext() { - _sendCurrentTabToAnalytics(); - } - - void _sendCurrentTabToAnalytics() { - observer.analytics.setCurrentScreen( - screenName: '${TabsPage.routeName}/tab$selectedIndex', - ); - } -} diff --git a/packages/firebase_analytics/example/pubspec.yaml b/packages/firebase_analytics/example/pubspec.yaml deleted file mode 100755 index 2207a8ecb318..000000000000 --- a/packages/firebase_analytics/example/pubspec.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: firebase_analytics_example -description: Demonstrates how to use the firebase_analytics plugin. - -dependencies: - flutter: - sdk: flutter - firebase_analytics: - path: ../ - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - -# For information on the generic Dart part of this file, see the -# following page: https://www.dartlang.org/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section here, in - # this "flutter" section, as in: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # To add assets from package dependencies, first ensure the asset - # is in the lib/ directory of the dependency. Then, - # refer to the asset with a path prefixed with - # `packages/PACKAGE_NAME/`. Note: the `lib/` is implied, do not - # include `lib/` in the asset path. - # - # Here is an example: - # - # assets: - # - packages/PACKAGE_NAME/path/to/asset - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 diff --git a/packages/firebase_analytics/example/test_driver/firebase_analytics.dart b/packages/firebase_analytics/example/test_driver/firebase_analytics.dart deleted file mode 100644 index ee09c9415527..000000000000 --- a/packages/firebase_analytics/example/test_driver/firebase_analytics.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; -import 'dart:io'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_analytics/firebase_analytics.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$FirebaseAnalytics', () { - FirebaseAnalytics analytics; - - setUp(() { - analytics = FirebaseAnalytics(); - }); - - test('Android-only functionality', () async { - if (Platform.isIOS) { - expect(analytics.android, isNull); - } - if (Platform.isAndroid) { - await analytics.android.setSessionTimeoutDuration(1000); - } - }); - - test('logging', () async { - expect(analytics.setAnalyticsCollectionEnabled(true), completes); - expect(analytics.setCurrentScreen(screenName: 'testing'), completes); - expect(analytics.logEvent(name: 'testing'), completes); - }); - }); -} diff --git a/packages/firebase_analytics/example/test_driver/firebase_analytics_test.dart b/packages/firebase_analytics/example/test_driver/firebase_analytics_test.dart deleted file mode 100644 index db46258dfebe..000000000000 --- a/packages/firebase_analytics/example/test_driver/firebase_analytics_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_analytics/ios/Assets/.gitkeep b/packages/firebase_analytics/ios/Assets/.gitkeep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h b/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h deleted file mode 100644 index 0ddf1f57a7de..000000000000 --- a/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseAnalyticsPlugin : NSObject -@end diff --git a/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.m b/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.m deleted file mode 100644 index a96ff58caa93..000000000000 --- a/packages/firebase_analytics/ios/Classes/FirebaseAnalyticsPlugin.m +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseAnalyticsPlugin.h" -#import "UserAgent.h" - -#import "Firebase/Firebase.h" - -@implementation FLTFirebaseAnalyticsPlugin { -} - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_analytics" - binaryMessenger:[registrar messenger]]; - FLTFirebaseAnalyticsPlugin *instance = [[FLTFirebaseAnalyticsPlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"logEvent" isEqualToString:call.method]) { - NSString *eventName = call.arguments[@"name"]; - id parameterMap = call.arguments[@"parameters"]; - - if (parameterMap != [NSNull null]) { - [FIRAnalytics logEventWithName:eventName parameters:parameterMap]; - } else { - [FIRAnalytics logEventWithName:eventName parameters:nil]; - } - - result(nil); - } else if ([@"setUserId" isEqualToString:call.method]) { - NSString *userId = call.arguments; - [FIRAnalytics setUserID:userId]; - result(nil); - } else if ([@"setCurrentScreen" isEqualToString:call.method]) { - NSString *screenName = call.arguments[@"screenName"]; - NSString *screenClassOverride = call.arguments[@"screenClassOverride"]; - [FIRAnalytics setScreenName:screenName screenClass:screenClassOverride]; - result(nil); - } else if ([@"setUserProperty" isEqualToString:call.method]) { - NSString *name = call.arguments[@"name"]; - NSString *value = call.arguments[@"value"]; - [FIRAnalytics setUserPropertyString:value forName:name]; - result(nil); - } else if ([@"setAnalyticsCollectionEnabled" isEqualToString:call.method]) { - NSNumber *enabled = [NSNumber numberWithBool:call.arguments]; - [FIRAnalytics setAnalyticsCollectionEnabled:[enabled boolValue]]; - result(nil); - } else if ([@"resetAnalyticsData" isEqualToString:call.method]) { - [FIRAnalytics resetAnalyticsData]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/packages/firebase_analytics/ios/firebase_analytics.podspec b/packages/firebase_analytics/ios/firebase_analytics.podspec deleted file mode 100755 index 31c21add0d96..000000000000 --- a/packages/firebase_analytics/ios/firebase_analytics.podspec +++ /dev/null @@ -1,33 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_analytics' - s.version = '0.0.1' - s.summary = 'Firebase Analytics plugin for Flutter.' - s.description = <<-DESC -Firebase Analytics plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_analytics' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/Analytics', '~> 6.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-analytics\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_analytics/lib/firebase_analytics.dart b/packages/firebase_analytics/lib/firebase_analytics.dart deleted file mode 100755 index c04ac1c3e468..000000000000 --- a/packages/firebase_analytics/lib/firebase_analytics.dart +++ /dev/null @@ -1,1097 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -const MethodChannel firebaseChannel = - MethodChannel('plugins.flutter.io/firebase_analytics'); - -/// Firebase Analytics API. -class FirebaseAnalytics { - final MethodChannel _channel = firebaseChannel; - - /// Namespace for analytics API available on Android only. - /// - /// The value of this field is `null` on non-Android platforms. If you are - /// writing cross-platform code, consider using null-aware operator when - /// accessing it. - /// - /// Example: - /// - /// FirebaseAnalytics analytics = FirebaseAnalytics(); - /// analytics.android?.setSessionTimeoutDuration(true); - final FirebaseAnalyticsAndroid android = - defaultTargetPlatform == TargetPlatform.android - ? FirebaseAnalyticsAndroid() - : null; - - /// Logs a custom Flutter Analytics event with the given [name] and event [parameters]. - Future logEvent( - {@required String name, Map parameters}) async { - if (_reservedEventNames.contains(name)) { - throw ArgumentError.value( - name, 'name', 'Event name is reserved and cannot be used'); - } - - const String kReservedPrefix = 'firebase_'; - - if (name.startsWith(kReservedPrefix)) { - throw ArgumentError.value(name, 'name', - 'Prefix "$kReservedPrefix" is reserved and cannot be used.'); - } - - await _channel.invokeMethod('logEvent', { - 'name': name, - 'parameters': parameters, - }); - } - - /// Sets whether analytics collection is enabled for this app on this device. - /// - /// This setting is persisted across app sessions. By default it is enabled. - Future setAnalyticsCollectionEnabled(bool enabled) async { - if (enabled == null) { - throw ArgumentError.notNull('enabled'); - } - - await _channel.invokeMethod('setAnalyticsCollectionEnabled', enabled); - } - - /// Sets the user ID property. - /// - /// This feature must be used in accordance with [Google's Privacy Policy][1]. - /// - /// [1]: https://www.google.com/policies/privacy/ - Future setUserId(String id) async { - await _channel.invokeMethod('setUserId', id); - } - - /// Sets the current [screenName], which specifies the current visual context - /// in your app. - /// - /// This helps identify the areas in your app where users spend their time - /// and how they interact with your app. - /// - /// The class name can optionally be overridden by the [screenClassOverride] - /// parameter. - /// - /// The [screenName] and [screenClassOverride] remain in effect until the - /// current `Activity` (in Android) or `UIViewController` (in iOS) changes or - /// a new call to [setCurrentScreen] is made. - /// - /// See also: - /// - /// https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.html#setCurrentScreen(android.app.Activity, java.lang.String, java.lang.String) - /// https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Classes/FIRAnalytics#setscreennamescreenclass - Future setCurrentScreen( - {@required String screenName, - String screenClassOverride = 'Flutter'}) async { - if (screenName == null) { - throw ArgumentError.notNull('screenName'); - } - - await _channel.invokeMethod('setCurrentScreen', { - 'screenName': screenName, - 'screenClassOverride': screenClassOverride, - }); - } - - static final RegExp _nonAlphaNumeric = RegExp(r'[^a-zA-Z0-9_]'); - static final RegExp _alpha = RegExp(r'[a-zA-Z]'); - - /// Sets a user property to a given value. - /// - /// Up to 25 user property names are supported. Once set, user property - /// values persist throughout the app lifecycle and across sessions. - /// - /// [name] is the name of the user property to set. Should contain 1 to 24 - /// alphanumeric characters or underscores and must start with an alphabetic - /// character. The "firebase_" prefix is reserved and should not be used for - /// user property names. - Future setUserProperty( - {@required String name, @required String value}) async { - if (name == null) { - throw ArgumentError.notNull('name'); - } - - if (name.isEmpty || - name.length > 24 || - name.indexOf(_alpha) != 0 || - name.contains(_nonAlphaNumeric)) - throw ArgumentError.value( - name, 'name', 'must contain 1 to 24 alphanumeric characters.'); - - if (name.startsWith('firebase_')) - throw ArgumentError.value(name, 'name', '"firebase_" prefix is reserved'); - - await _channel.invokeMethod('setUserProperty', { - 'name': name, - 'value': value, - }); - } - - /// Clears all analytics data for this app from the device and resets the app instance id. - Future resetAnalyticsData() async { - await _channel.invokeMethod('resetAnalyticsData'); - } - - /// Logs the standard `add_payment_info` event. - /// - /// This event signifies that a user has submitted their payment information - /// to your app. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#ADD_PAYMENT_INFO - Future logAddPaymentInfo() { - return logEvent(name: 'add_payment_info'); - } - - /// Logs the standard `add_to_cart` event. - /// - /// This event signifies that an item was added to a cart for purchase. Add - /// this event to a funnel with [logEcommercePurchase] to gauge the - /// effectiveness of your checkout process. Note: If you supply the - /// [value] parameter, you must also supply the [currency] parameter so that - /// revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#ADD_TO_CART - Future logAddToCart({ - @required String itemId, - @required String itemName, - @required String itemCategory, - @required int quantity, - double price, - double value, - String currency, - String origin, - String itemLocationId, - String destination, - String startDate, - String endDate, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'add_to_cart', - parameters: filterOutNulls({ - _ITEM_ID: itemId, - _ITEM_NAME: itemName, - _ITEM_CATEGORY: itemCategory, - _QUANTITY: quantity, - _PRICE: price, - _VALUE: value, - _CURRENCY: currency, - _ORIGIN: origin, - _ITEM_LOCATION_ID: itemLocationId, - _DESTINATION: destination, - _START_DATE: startDate, - _END_DATE: endDate, - }), - ); - } - - /// Logs the standard `add_to_wishlist` event. - /// - /// This event signifies that an item was added to a wishlist. Use this event - /// to identify popular gift items in your app. Note: If you supply the - /// [value] parameter, you must also supply the [currency] parameter so that - /// revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#ADD_TO_WISHLIST - Future logAddToWishlist({ - @required String itemId, - @required String itemName, - @required String itemCategory, - @required int quantity, - double price, - double value, - String currency, - String itemLocationId, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'add_to_wishlist', - parameters: filterOutNulls({ - _ITEM_ID: itemId, - _ITEM_NAME: itemName, - _ITEM_CATEGORY: itemCategory, - _QUANTITY: quantity, - _PRICE: price, - _VALUE: value, - _CURRENCY: currency, - _ITEM_LOCATION_ID: itemLocationId, - }), - ); - } - - /// Logs the standard `app_open` event. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#APP_OPEN - Future logAppOpen() { - return logEvent(name: 'app_open'); - } - - /// Logs the standard `begin_checkout` event. - /// - /// This event signifies that a user has begun the process of checking out. - /// Add this event to a funnel with your [logEcommercePurchase] event to - /// gauge the effectiveness of your checkout process. Note: If you supply the - /// [value] parameter, you must also supply the [currency] parameter so that - /// revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#BEGIN_CHECKOUT - Future logBeginCheckout({ - double value, - String currency, - String transactionId, - int numberOfNights, - int numberOfRooms, - int numberOfPassengers, - String origin, - String destination, - String startDate, - String endDate, - String travelClass, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'begin_checkout', - parameters: filterOutNulls({ - _VALUE: value, - _CURRENCY: currency, - _TRANSACTION_ID: transactionId, - _NUMBER_OF_NIGHTS: numberOfNights, - _NUMBER_OF_ROOMS: numberOfRooms, - _NUMBER_OF_PASSENGERS: numberOfPassengers, - _ORIGIN: origin, - _DESTINATION: destination, - _START_DATE: startDate, - _END_DATE: endDate, - _TRAVEL_CLASS: travelClass, - }), - ); - } - - /// Logs the standard `campaign_details` event. - /// - /// Log this event to supply the referral details of a re-engagement campaign. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#CAMPAIGN_DETAILS - Future logCampaignDetails({ - @required String source, - @required String medium, - @required String campaign, - String term, - String content, - String aclid, - String cp1, - }) { - return logEvent( - name: 'campaign_details', - parameters: filterOutNulls({ - _SOURCE: source, - _MEDIUM: medium, - _CAMPAIGN: campaign, - _TERM: term, - _CONTENT: content, - _ACLID: aclid, - _CP1: cp1, - }), - ); - } - - /// Logs the standard `earn_virtual_currency` event. - /// - /// This event tracks the awarding of virtual currency in your app. Log this - /// along with [logSpendVirtualCurrency] to better understand your virtual - /// economy. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#EARN_VIRTUAL_CURRENCY - Future logEarnVirtualCurrency({ - @required String virtualCurrencyName, - @required num value, - }) { - return logEvent( - name: 'earn_virtual_currency', - parameters: filterOutNulls({ - _VIRTUAL_CURRENCY_NAME: virtualCurrencyName, - _VALUE: value, - }), - ); - } - - /// Logs the standard `ecommerce_purchase` event. - /// - /// This event signifies that an item was purchased by a user. Note: This is - /// different from the in-app purchase event, which is reported automatically - /// for Google Play-based apps. Note: If you supply the [value] parameter, - /// you must also supply the [currency] parameter so that revenue metrics can - /// be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#ECOMMERCE_PURCHASE - Future logEcommercePurchase({ - String currency, - double value, - String transactionId, - double tax, - double shipping, - String coupon, - String location, - int numberOfNights, - int numberOfRooms, - int numberOfPassengers, - String origin, - String destination, - String startDate, - String endDate, - String travelClass, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'ecommerce_purchase', - parameters: filterOutNulls({ - _CURRENCY: currency, - _VALUE: value, - _TRANSACTION_ID: transactionId, - _TAX: tax, - _SHIPPING: shipping, - _COUPON: coupon, - _LOCATION: location, - _NUMBER_OF_NIGHTS: numberOfNights, - _NUMBER_OF_ROOMS: numberOfRooms, - _NUMBER_OF_PASSENGERS: numberOfPassengers, - _ORIGIN: origin, - _DESTINATION: destination, - _START_DATE: startDate, - _END_DATE: endDate, - _TRAVEL_CLASS: travelClass, - }), - ); - } - - /// Logs the standard `generate_lead` event. - /// - /// Log this event when a lead has been generated in the app to understand - /// the efficacy of your install and re-engagement campaigns. Note: If you - /// supply the [value] parameter, you must also supply the [currency] - /// parameter so that revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#GENERATE_LEAD - Future logGenerateLead({ - String currency, - double value, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'generate_lead', - parameters: filterOutNulls({ - _CURRENCY: currency, - _VALUE: value, - }), - ); - } - - /// Logs the standard `join_group` event. - /// - /// Log this event when a user joins a group such as a guild, team or family. - /// Use this event to analyze how popular certain groups or social features - /// are in your app. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#JOIN_GROUP - Future logJoinGroup({ - @required String groupId, - }) { - return logEvent( - name: 'join_group', - parameters: filterOutNulls({ - _GROUP_ID: groupId, - }), - ); - } - - /// Logs the standard `level_up` event. - /// - /// This event signifies that a player has leveled up in your gaming app. It - /// can help you gauge the level distribution of your userbase and help you - /// identify certain levels that are difficult to pass. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#LEVEL_UP - Future logLevelUp({ - @required int level, - String character, - }) { - return logEvent( - name: 'level_up', - parameters: filterOutNulls({ - _LEVEL: level, - _CHARACTER: character, - }), - ); - } - - /// Logs the standard `level_start` event. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#LEVEL_START - Future logLevelStart({ - @required String levelName, - }) { - return logEvent( - name: 'level_start', - parameters: filterOutNulls({ - _LEVEL_NAME: levelName, - }), - ); - } - - /// Logs the standard `level_end` event. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#LEVEL_END - Future logLevelEnd({ - @required String levelName, - int success, - }) { - return logEvent( - name: 'level_end', - parameters: filterOutNulls({ - _LEVEL_NAME: levelName, - _SUCCESS: success, - }), - ); - } - - /// Logs the standard `login` event. - /// - /// Apps with a login feature can report this event to signify that a user - /// has logged in. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#LOGIN - Future logLogin({String loginMethod}) { - return logEvent( - name: 'login', - parameters: filterOutNulls({ - _METHOD: loginMethod, - }), - ); - } - - /// Logs the standard `post_score` event. - /// - /// Log this event when the user posts a score in your gaming app. This event - /// can help you understand how users are actually performing in your game - /// and it can help you correlate high scores with certain audiences or - /// behaviors. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#POST_SCORE - Future logPostScore({ - @required int score, - int level, - String character, - }) { - return logEvent( - name: 'post_score', - parameters: filterOutNulls({ - _SCORE: score, - _LEVEL: level, - _CHARACTER: character, - }), - ); - } - - /// Logs the standard `present_offer` event. - /// - /// This event signifies that the app has presented a purchase offer to a - /// user. Add this event to a funnel with the [logAddToCart] and - /// [logEcommercePurchase] to gauge your conversion process. Note: If you - /// supply the [value] parameter, you must also supply the [currency] - /// parameter so that revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#PRESENT_OFFER - Future logPresentOffer({ - @required String itemId, - @required String itemName, - @required String itemCategory, - @required int quantity, - double price, - double value, - String currency, - String itemLocationId, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'present_offer', - parameters: filterOutNulls({ - _ITEM_ID: itemId, - _ITEM_NAME: itemName, - _ITEM_CATEGORY: itemCategory, - _QUANTITY: quantity, - _PRICE: price, - _VALUE: value, - _CURRENCY: currency, - _ITEM_LOCATION_ID: itemLocationId, - }), - ); - } - - /// Logs the standard `purchase_refund` event. - /// - /// This event signifies that an item purchase was refunded. Note: If you - /// supply the [value] parameter, you must also supply the [currency] - /// parameter so that revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#PURCHASE_REFUND - Future logPurchaseRefund({ - String currency, - double value, - String transactionId, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'purchase_refund', - parameters: filterOutNulls({ - _CURRENCY: currency, - _VALUE: value, - _TRANSACTION_ID: transactionId, - }), - ); - } - - /// Logs the standard `remove_from_cart` event. - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#REMOVE_FROM_CART - Future logRemoveFromCart({ - @required String itemId, - @required String itemName, - @required String itemCategory, - @required int quantity, - double price, - double value, - String currency, - String origin, - String itemLocationId, - String destination, - String startDate, - String endDate, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'remove_from_cart', - parameters: filterOutNulls({ - _QUANTITY: quantity, - _ITEM_CATEGORY: itemCategory, - _ITEM_NAME: itemName, - _ITEM_ID: itemId, - _VALUE: value, - _PRICE: price, - _CURRENCY: currency, - _ITEM_LOCATION_ID: itemLocationId, - _ORIGIN: origin, - _START_DATE: startDate, - _END_DATE: endDate, - _DESTINATION: destination, - }), - ); - } - - /// Logs the standard `search` event. - /// - /// Apps that support search features can use this event to contextualize - /// search operations by supplying the appropriate, corresponding parameters. - /// This event can help you identify the most popular content in your app. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SEARCH - Future logSearch({ - @required String searchTerm, - int numberOfNights, - int numberOfRooms, - int numberOfPassengers, - String origin, - String destination, - String startDate, - String endDate, - String travelClass, - }) { - return logEvent( - name: 'search', - parameters: filterOutNulls({ - _SEARCH_TERM: searchTerm, - _NUMBER_OF_NIGHTS: numberOfNights, - _NUMBER_OF_ROOMS: numberOfRooms, - _NUMBER_OF_PASSENGERS: numberOfPassengers, - _ORIGIN: origin, - _DESTINATION: destination, - _START_DATE: startDate, - _END_DATE: endDate, - _TRAVEL_CLASS: travelClass, - }), - ); - } - - /// Logs the standard `select_content` event. - /// - /// This general purpose event signifies that a user has selected some - /// content of a certain type in an app. The content can be any object in - /// your app. This event can help you identify popular content and categories - /// of content in your app. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SELECT_CONTENT - Future logSelectContent({ - @required String contentType, - @required String itemId, - }) { - return logEvent( - name: 'select_content', - parameters: filterOutNulls({ - _CONTENT_TYPE: contentType, - _ITEM_ID: itemId, - }), - ); - } - - /// Logs the standard `set_checkout_option` event. - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SET_CHECKOUT_OPTION - Future logSetCheckoutOption({ - @required int checkoutStep, - @required String checkoutOption, - }) { - return logEvent( - name: 'set_checkout_option', - parameters: filterOutNulls({ - _CHECKOUT_STEP: checkoutStep, - _CHECKOUT_OPTION: checkoutOption, - }), - ); - } - - /// Logs the standard `share` event. - /// - /// Apps with social features can log the Share event to identify the most - /// viral content. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SHARE - Future logShare({ - @required String contentType, - @required String itemId, - @required String method, - }) { - return logEvent( - name: 'share', - parameters: filterOutNulls({ - _CONTENT_TYPE: contentType, - _ITEM_ID: itemId, - _METHOD: method, - }), - ); - } - - /// Logs the standard `sign_up` event. - /// - /// This event indicates that a user has signed up for an account in your - /// app. The parameter signifies the method by which the user signed up. Use - /// this event to understand the different behaviors between logged in and - /// logged out users. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SIGN_UP - Future logSignUp({ - @required String signUpMethod, - }) { - return logEvent( - name: 'sign_up', - parameters: filterOutNulls({ - _METHOD: signUpMethod, - }), - ); - } - - /// Logs the standard `spend_virtual_currency` event. - /// - /// This event tracks the sale of virtual goods in your app and can help you - /// identify which virtual goods are the most popular objects of purchase. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SPEND_VIRTUAL_CURRENCY - Future logSpendVirtualCurrency({ - @required String itemName, - @required String virtualCurrencyName, - @required num value, - }) { - return logEvent( - name: 'spend_virtual_currency', - parameters: filterOutNulls({ - _ITEM_NAME: itemName, - _VIRTUAL_CURRENCY_NAME: virtualCurrencyName, - _VALUE: value, - }), - ); - } - - /// Logs the standard `tutorial_begin` event. - /// - /// This event signifies the start of the on-boarding process in your app. - /// Use this in a funnel with [logTutorialComplete] to understand how many - /// users complete this process and move on to the full app experience. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#TUTORIAL_BEGIN - Future logTutorialBegin() { - return logEvent(name: 'tutorial_begin'); - } - - /// Logs the standard `tutorial_complete` event. - /// - /// Use this event to signify the user's completion of your app's on-boarding - /// process. Add this to a funnel with [logTutorialBegin] to gauge the - /// completion rate of your on-boarding process. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#TUTORIAL_COMPLETE - Future logTutorialComplete() { - return logEvent(name: 'tutorial_complete'); - } - - /// Logs the standard `unlock_achievement` event with a given achievement - /// [id]. - /// - /// Log this event when the user has unlocked an achievement in your game. - /// Since achievements generally represent the breadth of a gaming - /// experience, this event can help you understand how many users are - /// experiencing all that your game has to offer. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#UNLOCK_ACHIEVEMENT - Future logUnlockAchievement({ - @required String id, - }) { - return logEvent( - name: 'unlock_achievement', - parameters: filterOutNulls({ - _ACHIEVEMENT_ID: id, - }), - ); - } - - /// Logs the standard `view_item` event. - /// - /// This event signifies that some content was shown to the user. This - /// content may be a product, a webpage or just a simple image or text. Use - /// the appropriate parameters to contextualize the event. Use this event to - /// discover the most popular items viewed in your app. Note: If you supply - /// the [value] parameter, you must also supply the [currency] parameter so - /// that revenue metrics can be computed accurately. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#VIEW_ITEM - Future logViewItem({ - @required String itemId, - @required String itemName, - @required String itemCategory, - String itemLocationId, - double price, - int quantity, - String currency, - double value, - String flightNumber, - int numberOfPassengers, - int numberOfNights, - int numberOfRooms, - String origin, - String destination, - String startDate, - String endDate, - String searchTerm, - String travelClass, - }) { - _requireValueAndCurrencyTogether(value, currency); - - return logEvent( - name: 'view_item', - parameters: filterOutNulls({ - _ITEM_ID: itemId, - _ITEM_NAME: itemName, - _ITEM_CATEGORY: itemCategory, - _ITEM_LOCATION_ID: itemLocationId, - _PRICE: price, - _QUANTITY: quantity, - _CURRENCY: currency, - _VALUE: value, - _FLIGHT_NUMBER: flightNumber, - _NUMBER_OF_PASSENGERS: numberOfPassengers, - _NUMBER_OF_NIGHTS: numberOfNights, - _NUMBER_OF_ROOMS: numberOfRooms, - _ORIGIN: origin, - _DESTINATION: destination, - _START_DATE: startDate, - _END_DATE: endDate, - _SEARCH_TERM: searchTerm, - _TRAVEL_CLASS: travelClass, - }), - ); - } - - /// Logs the standard `view_item_list` event. - /// - /// Log this event when the user has been presented with a list of items of a - /// certain category. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#VIEW_ITEM_LIST - Future logViewItemList({ - @required String itemCategory, - }) { - return logEvent( - name: 'view_item_list', - parameters: filterOutNulls({ - _ITEM_CATEGORY: itemCategory, - }), - ); - } - - /// Logs the standard `view_search_results` event. - /// - /// Log this event when the user has been presented with the results of a - /// search. - /// - /// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#VIEW_SEARCH_RESULTS - Future logViewSearchResults({ - @required String searchTerm, - }) { - return logEvent( - name: 'view_search_results', - parameters: filterOutNulls({ - _SEARCH_TERM: searchTerm, - }), - ); - } -} - -/// Android-specific analytics API. -class FirebaseAnalyticsAndroid { - final MethodChannel _channel = firebaseChannel; - - /// Sets the duration of inactivity that terminates the current session. - /// - /// The default value is 1800000 (30 minutes). - Future setSessionTimeoutDuration(int milliseconds) async { - if (milliseconds == null) { - throw ArgumentError.notNull('milliseconds'); - } - await _channel.invokeMethod( - 'setSessionTimeoutDuration', milliseconds); - } -} - -/// Creates a new map containing all of the key/value pairs from [parameters] -/// except those whose value is `null`. -@visibleForTesting -Map filterOutNulls(Map parameters) { - final Map filtered = {}; - parameters.forEach((String key, dynamic value) { - if (value != null) { - filtered[key] = value; - } - }); - return filtered; -} - -@visibleForTesting -const String valueAndCurrencyMustBeTogetherError = 'If you supply the "value" ' - 'parameter, you must also supply the "currency" parameter.'; - -void _requireValueAndCurrencyTogether(double value, String currency) { - if (value != null && currency == null) { - throw ArgumentError(valueAndCurrencyMustBeTogetherError); - } -} - -/// Reserved event names that cannot be used. -/// -/// See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html -const List _reservedEventNames = [ - 'ad_activeview', - 'ad_click', - 'ad_exposure', - 'ad_impression', - 'ad_query', - 'adunit_exposure', - 'app_clear_data', - 'app_uninstall', - 'app_update', - 'error', - 'first_open', - 'first_visit', - 'in_app_purchase', - 'notification_dismiss', - 'notification_foreground', - 'notification_open', - 'notification_receive', - 'os_update', - 'screen_view', - 'session_start', - 'user_engagement', -]; - -// The following constants are defined in: -// -// https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Param.html - -/// Game achievement ID. -const String _ACHIEVEMENT_ID = 'achievement_id'; - -/// `CAMPAIGN_DETAILS` click ID. -const String _ACLID = 'aclid'; - -/// `CAMPAIGN_DETAILS` name; used for keyword analysis to identify a specific -/// product promotion or strategic campaign. -const String _CAMPAIGN = 'campaign'; - -/// Character used in game. -const String _CHARACTER = 'character'; - -/// `CAMPAIGN_DETAILS` content; used for A/B testing and content-targeted ads to -/// differentiate ads or links that point to the same URL. -const String _CONTENT = 'content'; - -/// Type of content selected. -const String _CONTENT_TYPE = 'content_type'; - -/// Coupon code for a purchasable item. -const String _COUPON = 'coupon'; - -/// `CAMPAIGN_DETAILS` custom parameter. -const String _CP1 = 'cp1'; - -/// Purchase currency in 3 letter ISO_4217 format. -const String _CURRENCY = 'currency'; - -/// Flight or Travel destination. -const String _DESTINATION = 'destination'; - -/// The arrival date, check-out date, or rental end date for the item. -const String _END_DATE = 'end_date'; - -/// Indicates that the associated event should either -/// extend the current session or start a new session -/// if no session was active when the event was logged. -// const String _EXTENDED_SESSION = 'extend_session'; - -/// Flight number for travel events. -const String _FLIGHT_NUMBER = 'flight_number'; - -/// Group/clan/guild id. -const String _GROUP_ID = 'group_id'; - -/// Item category. -const String _ITEM_CATEGORY = 'item_category'; - -/// Item ID. -const String _ITEM_ID = 'item_id'; - -/// The Google Place ID that corresponds to the associated item. -const String _ITEM_LOCATION_ID = 'item_location_id'; - -/// Item Brand. -// const String _ITEM_BRAND = 'item_brand'; - -/// Item Variant. -// const String _ITEM_VARIANT = 'item_variant'; - -/// The list in which the item was presented to the user. -// const String _ITEM_LIST = 'item_list'; - -/// The checkout step (1..N). -const String _CHECKOUT_STEP = 'checkout_step'; - -/// Some option on a step in an ecommerce flow. -const String _CHECKOUT_OPTION = 'checkout_option'; - -/// The name of a creative used in a promotional spot. -// const String _CREATIVE_NAME = 'creative_name'; - -/// The name of a creative slot. -// const String _CREATIVE_SLOT = 'creative_slot'; - -/// The store or affiliation from which this transaction occurred. -// const String _AFFILIATION = 'affiliation'; - -/// The index of an item in a list. -// const String _INDEX = 'index'; - -/// Item name (String). -const String _ITEM_NAME = 'item_name'; - -/// Level in game (long). -const String _LEVEL = 'level'; - -/// The name of a level in a game (String). -const String _LEVEL_NAME = 'level_name'; - -/// The result of an operation (long). -const String _SUCCESS = 'success'; - -/// Location. -const String _LOCATION = 'location'; - -/// `CAMPAIGN_DETAILS` medium; used to identify a medium such as email or -/// cost-per-click (cpc). -const String _MEDIUM = 'medium'; - -/// Number of nights staying at hotel (long). -const String _NUMBER_OF_NIGHTS = 'number_of_nights'; - -/// Number of passengers traveling (long). -const String _NUMBER_OF_PASSENGERS = 'number_of_passengers'; - -/// Number of rooms for travel events (long). -const String _NUMBER_OF_ROOMS = 'number_of_rooms'; - -/// Flight or Travel origin. -const String _ORIGIN = 'origin'; - -/// Purchase price (double). -const String _PRICE = 'price'; - -/// Purchase quantity (long). -const String _QUANTITY = 'quantity'; - -/// Score in game (long). -const String _SCORE = 'score'; - -/// The search string/keywords used. -const String _SEARCH_TERM = 'search_term'; - -/// Shipping cost (double). -const String _SHIPPING = 'shipping'; - -/// A particular approach used in an operation; for example, "facebook" or -/// "email" in the context of a sign_up or login event. -const String _METHOD = 'method'; - -/// `CAMPAIGN_DETAILS` source; used to identify a search engine, newsletter, or -/// other source. -const String _SOURCE = 'source'; - -/// The departure date, check-in date, or rental start date for the item. -const String _START_DATE = 'start_date'; - -/// Tax amount (double). -const String _TAX = 'tax'; - -/// `CAMPAIGN_DETAILS` term; used with paid search to supply the keywords for -/// ads. -const String _TERM = 'term'; - -/// A single ID for a ecommerce group transaction. -const String _TRANSACTION_ID = 'transaction_id'; - -/// Travel class. -const String _TRAVEL_CLASS = 'travel_class'; - -/// A context-specific numeric value which is accumulated automatically for -/// each event type. -const String _VALUE = 'value'; - -/// Name of virtual currency type. -const String _VIRTUAL_CURRENCY_NAME = 'virtual_currency_name'; diff --git a/packages/firebase_analytics/lib/observer.dart b/packages/firebase_analytics/lib/observer.dart deleted file mode 100644 index d11db332573d..000000000000 --- a/packages/firebase_analytics/lib/observer.dart +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; -import 'package:flutter/widgets.dart'; - -import 'firebase_analytics.dart'; - -/// Signature for a function that extracts a screen name from [RouteSettings]. -/// -/// Usually, the route name is not a plain string, and it may contains some -/// unique ids that makes it difficult to aggregate over them in Firebase -/// Analytics. -typedef String ScreenNameExtractor(RouteSettings settings); - -String defaultNameExtractor(RouteSettings settings) => settings.name; - -/// A [NavigatorObserver] that sends events to Firebase Analytics when the -/// currently active [PageRoute] changes. -/// -/// When a route is pushed or popped, [nameExtractor] is used to extract a name -/// from [RouteSettings] of the now active route and that name is sent to -/// Firebase. -/// -/// The following operations will result in sending a screen view event: -/// ```dart -/// Navigator.pushNamed(context, '/contact/123'); -/// -/// Navigator.push(context, MaterialPageRoute( -/// settings: RouteSettings(name: '/contact/123'), -/// builder: (_) => ContactDetail(123))); -/// -/// Navigator.pushReplacement(context, MaterialPageRoute( -/// settings: RouteSettings(name: '/contact/123'), -/// builder: (_) => ContactDetail(123))); -/// -/// Navigator.pop(context); -/// ``` -/// -/// To use it, add it to the `navigatorObservers` of your [Navigator], e.g. if -/// you're using a [MaterialApp]: -/// ```dart -/// MaterialApp( -/// home: MyAppHome(), -/// navigatorObservers: [ -/// FirebaseAnalyticsObserver(analytics: service.analytics), -/// ], -/// ); -/// ``` -/// -/// You can also track screen views within your [PageRoute] by implementing -/// [PageRouteAware] and subscribing it to [FirebaseAnalyticsObserver]. See the -/// [PageRouteObserver] docs for an example. -class FirebaseAnalyticsObserver extends RouteObserver> { - /// Creates a [NavigatorObserver] that sends events to [FirebaseAnalytics]. - /// - /// When a route is pushed or popped, [nameExtractor] is used to extract a - /// name from [RouteSettings] of the now active route and that name is sent to - /// Firebase. Defaults to `defaultNameExtractor`. - /// - /// If a [PlatformException] is thrown while the observer attempts to send the - /// active route to [analytics], `onError` will be called with the - /// exception. If `onError` is omitted, the exception will be printed using - /// `debugPrint()`. - FirebaseAnalyticsObserver({ - @required this.analytics, - this.nameExtractor = defaultNameExtractor, - Function(PlatformException error) onError, - }) : _onError = onError; - - final FirebaseAnalytics analytics; - final ScreenNameExtractor nameExtractor; - final void Function(PlatformException error) _onError; - - void _sendScreenView(PageRoute route) { - final String screenName = nameExtractor(route.settings); - if (screenName != null) { - analytics.setCurrentScreen(screenName: screenName).catchError( - (Object error) { - if (_onError == null) { - debugPrint('$FirebaseAnalyticsObserver: $error'); - } else { - _onError(error); - } - }, - test: (Object error) => error is PlatformException, - ); - } - } - - @override - void didPush(Route route, Route previousRoute) { - super.didPush(route, previousRoute); - if (route is PageRoute) { - _sendScreenView(route); - } - } - - @override - void didReplace({Route newRoute, Route oldRoute}) { - super.didReplace(newRoute: newRoute, oldRoute: oldRoute); - if (newRoute is PageRoute) { - _sendScreenView(newRoute); - } - } - - @override - void didPop(Route route, Route previousRoute) { - super.didPop(route, previousRoute); - if (previousRoute is PageRoute && route is PageRoute) { - _sendScreenView(previousRoute); - } - } -} diff --git a/packages/firebase_analytics/pubspec.yaml b/packages/firebase_analytics/pubspec.yaml deleted file mode 100755 index 071ed2321382..000000000000 --- a/packages/firebase_analytics/pubspec.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: firebase_analytics -description: Flutter plugin for Google Analytics for Firebase, an app measurement - solution that provides insight on app usage and user engagement on Android and iOS. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_analytics -version: 5.0.0 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebaseanalytics - iosPrefix: FLT - pluginClass: FirebaseAnalyticsPlugin - -dependencies: - meta: ^1.0.4 - flutter: - sdk: flutter - -dev_dependencies: - mockito: 3.0.0 - flutter_test: - sdk: flutter - firebase_core: ^0.4.0 - flutter_driver: - sdk: flutter - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_analytics/test/firebase_analytics_test.dart b/packages/firebase_analytics/test/firebase_analytics_test.dart deleted file mode 100755 index c8af79710f0d..000000000000 --- a/packages/firebase_analytics/test/firebase_analytics_test.dart +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:flutter/services.dart'; - -void main() { - final FirebaseAnalytics analytics = FirebaseAnalytics(); - const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_analytics'); - MethodCall methodCall; - - setUp(() async { - channel.setMockMethodCallHandler((MethodCall m) async { - methodCall = m; - }); - }); - - tearDown(() { - channel.setMockMethodCallHandler(null); - methodCall = null; - }); - - group('filterOutNulls', () { - test('filters out null values', () { - final Map original = { - 'a': 1, - 'b': null, - 'c': 'd' - }; - final Map filtered = filterOutNulls(original); - - expect(filtered, isNot(same(original))); - expect(original, {'a': 1, 'b': null, 'c': 'd'}); - expect(filtered, {'a': 1, 'c': 'd'}); - }); - }); - - group('FirebaseAnalytics', () { - test('setUserId', () async { - await analytics.setUserId('test-user-id'); - expect( - methodCall, - isMethodCall( - 'setUserId', - arguments: 'test-user-id', - ), - ); - }); - - test('setCurrentScreen', () async { - await analytics.setCurrentScreen( - screenName: 'test-screen-name', - screenClassOverride: 'test-class-override', - ); - expect( - methodCall, - isMethodCall( - 'setCurrentScreen', - arguments: { - 'screenName': 'test-screen-name', - 'screenClassOverride': 'test-class-override', - }, - ), - ); - }); - - test('setUserProperty', () async { - await analytics.setUserProperty(name: 'test_name', value: 'test-value'); - expect( - methodCall, - isMethodCall( - 'setUserProperty', - arguments: { - 'name': 'test_name', - 'value': 'test-value', - }, - ), - ); - }); - - test('setUserProperty rejects invalid names', () async { - // invalid character - expect(analytics.setUserProperty(name: 'test-name', value: 'test-value'), - throwsArgumentError); - // non-alpha first character - expect(analytics.setUserProperty(name: '0test', value: 'test-value'), - throwsArgumentError); - // null - expect(analytics.setUserProperty(name: null, value: 'test-value'), - throwsArgumentError); - // blank - expect(analytics.setUserProperty(name: '', value: 'test-value'), - throwsArgumentError); - // reserved prefix - expect( - analytics.setUserProperty(name: 'firebase_test', value: 'test-value'), - throwsArgumentError); - }); - - test('setAnalyticsCollectionEnabled', () async { - await analytics.setAnalyticsCollectionEnabled(false); - expect( - methodCall, - isMethodCall( - 'setAnalyticsCollectionEnabled', - arguments: false, - ), - ); - }); - - test('setSessionTimeoutDuration', () async { - await analytics.android.setSessionTimeoutDuration(234); - expect( - methodCall, - isMethodCall( - 'setSessionTimeoutDuration', - arguments: 234, - ), - ); - }); - - test('resetAnalyticsData', () async { - await analytics.resetAnalyticsData(); - expect( - methodCall, - isMethodCall( - 'resetAnalyticsData', - arguments: null, - ), - ); - }); - }); - - group('FirebaseAnalytics analytics events', () { - test('logEvent log events', () async { - await analytics.logEvent( - name: 'test-event', - parameters: {'a': 'b'}, - ); - expect( - methodCall, - isMethodCall( - 'logEvent', - arguments: { - 'name': 'test-event', - 'parameters': {'a': 'b'}, - }, - ), - ); - }); - - test('logEvent rejects events with reserved names', () async { - expect(analytics.logEvent(name: 'app_clear_data'), throwsArgumentError); - }); - - test('logEvent rejects events with reserved prefix', () async { - expect(analytics.logEvent(name: 'firebase_foo'), throwsArgumentError); - }); - - void smokeTest(String testFunctionName, Future testFunction()) { - test('$testFunctionName works', () async { - await testFunction(); - expect(methodCall.arguments['name'], testFunctionName); - }); - } - - smokeTest('add_payment_info', () => analytics.logAddPaymentInfo()); - - smokeTest( - 'add_to_cart', - () => analytics.logAddToCart( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - )); - - smokeTest( - 'add_to_wishlist', - () => analytics.logAddToWishlist( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - )); - - smokeTest('app_open', () => analytics.logAppOpen()); - - smokeTest('begin_checkout', () => analytics.logBeginCheckout()); - - smokeTest( - 'campaign_details', - () => analytics.logCampaignDetails( - source: 'test-source', - medium: 'test-medium', - campaign: 'test-campaign', - )); - - smokeTest( - 'earn_virtual_currency', - () => analytics.logEarnVirtualCurrency( - virtualCurrencyName: 'bitcoin', - value: 34, - )); - - smokeTest('ecommerce_purchase', () => analytics.logEcommercePurchase()); - - smokeTest('generate_lead', () => analytics.logGenerateLead()); - - smokeTest( - 'join_group', - () => analytics.logJoinGroup( - groupId: 'test-group-id', - )); - - smokeTest( - 'level_up', - () => analytics.logLevelUp( - level: 56, - )); - - smokeTest( - 'level_start', - () => analytics.logLevelStart( - levelName: 'level-name', - )); - - smokeTest( - 'level_end', - () => analytics.logLevelEnd( - levelName: 'level-name', - success: 1, - )); - - smokeTest('login', () => analytics.logLogin()); - - smokeTest( - 'login', - () => analytics.logLogin( - loginMethod: 'email', - )); - - smokeTest( - 'post_score', - () => analytics.logPostScore( - score: 34, - )); - - smokeTest( - 'present_offer', - () => analytics.logPresentOffer( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - )); - - smokeTest('purchase_refund', () => analytics.logPurchaseRefund()); - - smokeTest( - 'search', - () => analytics.logSearch( - searchTerm: 'test search term', - )); - - smokeTest( - 'select_content', - () => analytics.logSelectContent( - contentType: 'test content type', - itemId: 'test item id', - )); - - smokeTest( - 'share', - () => analytics.logShare( - contentType: 'test content type', - itemId: 'test item id', - method: 'test method', - )); - - smokeTest( - 'sign_up', - () => analytics.logSignUp( - signUpMethod: 'test sign-up method', - )); - - smokeTest( - 'spend_virtual_currency', - () => analytics.logSpendVirtualCurrency( - itemName: 'test-item-name', - virtualCurrencyName: 'bitcoin', - value: 345, - )); - - smokeTest('tutorial_begin', () => analytics.logTutorialBegin()); - - smokeTest('tutorial_complete', () => analytics.logTutorialComplete()); - - smokeTest( - 'unlock_achievement', - () => analytics.logUnlockAchievement( - id: 'firebase analytics api coverage', - )); - - smokeTest( - 'view_item', - () => analytics.logViewItem( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - )); - - smokeTest( - 'view_item_list', - () => analytics.logViewItemList( - itemCategory: 'test-category', - )); - - smokeTest( - 'view_search_results', - () => analytics.logViewSearchResults( - searchTerm: 'test search term', - )); - - smokeTest('set_checkout_option', () { - return analytics.logSetCheckoutOption( - checkoutStep: 1, checkoutOption: 'some credit card'); - }); - - void testRequiresValueAndCurrencyTogether( - String methodName, Future testFn()) { - test('$methodName requires value and currency together', () async { - try { - testFn(); - fail('Expected ArgumentError'); - } on ArgumentError catch (error) { - expect(error.message, valueAndCurrencyMustBeTogetherError); - } - }); - } - - testRequiresValueAndCurrencyTogether('logAddToCart', () { - return analytics.logAddToCart( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logRemoveFromCart', () { - return analytics.logRemoveFromCart( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logAddToWishlist', () { - return analytics.logAddToWishlist( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logBeginCheckout', () { - return analytics.logBeginCheckout( - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logEcommercePurchase', () { - return analytics.logEcommercePurchase( - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logGenerateLead', () { - return analytics.logGenerateLead( - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logPresentOffer', () { - return analytics.logPresentOffer( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - quantity: 5, - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logPurchaseRefund', () { - return analytics.logPurchaseRefund( - value: 123.90, - ); - }); - - testRequiresValueAndCurrencyTogether('logViewItem', () { - return analytics.logViewItem( - itemId: 'test-id', - itemName: 'test-name', - itemCategory: 'test-category', - value: 123.90, - ); - }); - }); -} diff --git a/packages/firebase_analytics/test/observer_test.dart b/packages/firebase_analytics/test/observer_test.dart deleted file mode 100644 index bcbd31059272..000000000000 --- a/packages/firebase_analytics/test/observer_test.dart +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:mockito/mockito.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:flutter/widgets.dart'; - -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; - -void main() { - group('FirebaseAnalyticsObserver', () { - FirebaseAnalytics analytics; - FirebaseAnalyticsObserver observer; - final List printLog = []; - - void overridePrint(void Function() func) { - final ZoneSpecification spec = - ZoneSpecification(print: (_, __, ___, String msg) { - // Add to log instead of printing to stdout - printLog.add(msg); - }); - return Zone.current.fork(specification: spec).run(func); - } - - setUp(() { - printLog.clear(); - analytics = MockFirebaseAnalytics(); - observer = FirebaseAnalyticsObserver(analytics: analytics); - when(analytics.setCurrentScreen(screenName: anyNamed('screenName'))) - .thenAnswer((Invocation invocation) => Future.value()); - }); - - test('setCurrentScreen on route pop', () { - final PageRoute route = MockPageRoute(); - final PageRoute previousRoute = MockPageRoute(); - when(previousRoute.settings) - .thenReturn(const RouteSettings(name: 'previousRoute')); - - observer.didPop(route, previousRoute); - - verify(analytics.setCurrentScreen(screenName: 'previousRoute')).called(1); - }); - - test('setCurrentScreen on route push', () { - final PageRoute route = MockPageRoute(); - final PageRoute previousRoute = MockPageRoute(); - when(route.settings).thenReturn(const RouteSettings(name: 'route')); - - observer.didPush(route, previousRoute); - - verify(analytics.setCurrentScreen(screenName: 'route')).called(1); - }); - - test('setCurrentScreen on route pushReplacement', () { - final PageRoute route = MockPageRoute(); - final PageRoute previousRoute = MockPageRoute(); - when(route.settings).thenReturn(const RouteSettings(name: 'route')); - - observer.didReplace(newRoute: route, oldRoute: previousRoute); - - verify(analytics.setCurrentScreen(screenName: 'route')).called(1); - }); - - test('uses nameExtractor', () { - observer = FirebaseAnalyticsObserver( - analytics: analytics, - nameExtractor: (RouteSettings settings) => 'foo', - ); - final PageRoute route = MockPageRoute(); - final PageRoute previousRoute = MockPageRoute(); - - observer.didPush(route, previousRoute); - - verify(analytics.setCurrentScreen(screenName: 'foo')).called(1); - }); - - test('handles only ${PlatformException}s', () async { - observer = FirebaseAnalyticsObserver( - analytics: analytics, - nameExtractor: (RouteSettings settings) => 'foo', - ); - - final PageRoute route = MockPageRoute(); - final PageRoute previousRoute = MockPageRoute(); - - // Throws non-PlatformExceptions - when(analytics.setCurrentScreen(screenName: anyNamed('screenName'))) - .thenThrow(ArgumentError()); - - expect(() => observer.didPush(route, previousRoute), throwsArgumentError); - - // Print PlatformExceptions - Future throwPlatformException() async => - throw PlatformException(code: 'a'); - - when(analytics.setCurrentScreen(screenName: anyNamed('screenName'))) - .thenAnswer((Invocation invocation) => throwPlatformException()); - - overridePrint(() => observer.didPush(route, previousRoute)); - - await pumpEventQueue(); - expect( - printLog, - ['$FirebaseAnalyticsObserver: ${PlatformException(code: 'a')}'], - ); - }); - - test('runs onError', () async { - PlatformException passedException; - - final void Function(PlatformException error) handleError = - (PlatformException error) { - passedException = error; - }; - - observer = FirebaseAnalyticsObserver( - analytics: analytics, - nameExtractor: (RouteSettings settings) => 'foo', - onError: handleError, - ); - - final PageRoute route = MockPageRoute(); - final PageRoute previousRoute = MockPageRoute(); - - final PlatformException thrownException = PlatformException(code: 'b'); - Future throwPlatformException() async => throw thrownException; - - when(analytics.setCurrentScreen(screenName: anyNamed('screenName'))) - .thenAnswer((Invocation invocation) => throwPlatformException()); - - observer.didPush(route, previousRoute); - - await pumpEventQueue(); - expect(passedException, thrownException); - }); - }); -} - -class MockFirebaseAnalytics extends Mock implements FirebaseAnalytics {} - -class MockPageRoute extends Mock implements PageRoute {} diff --git a/packages/firebase_auth/.gitignore b/packages/firebase_auth/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_auth/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_auth/CHANGELOG.md b/packages/firebase_auth/CHANGELOG.md deleted file mode 100644 index d2b0aa1a4e34..000000000000 --- a/packages/firebase_auth/CHANGELOG.md +++ /dev/null @@ -1,465 +0,0 @@ -## 0.14.0+2 - -* Reduce compiler warnings on iOS port by replacing `int` with `long` backing in returned timestamps. - -## 0.14.0+1 - -* Add dependency on `androidx.annotation:annotation:1.0.0`. - -## 0.14.0 - -* Added new `IdTokenResult` class. -* **Breaking Change**. `getIdToken()` method now returns `IdTokenResult` instead of a token `String`. - Use the `token` property of `IdTokenResult` to retrieve the token `String`. -* Added integration testing for `getIdToken()`. - -## 0.13.1+1 - -* Update authentication example in README. - -## 0.13.1 - -* Fixed a crash on iOS when sign-in fails. -* Additional integration testing. -* Updated documentation for `FirebaseUser.delete()` to include error codes. -* Updated Firebase project to match other Flutterfire apps. - -## 0.13.0 - -* **Breaking change**: Replace `FirebaseUserMetadata.creationTimestamp` and - `FirebaseUserMetadata.lastSignInTimestamp` with `creationTime` and `lastSignInTime`. - Previously on iOS `creationTimestamp` and `lastSignInTimestamp` returned in - seconds and on Android in milliseconds. Now, both platforms provide values as a - `DateTime`. - -## 0.12.0+1 - -* Fixes iOS sign-in exceptions when `additionalUserInfo` is `nil` or has `nil` fields. -* Additional integration testing. - -## 0.12.0 - -* Added new `AuthResult` and `AdditionalUserInfo` classes. -* **Breaking Change**. Sign-in methods now return `AuthResult` instead of `FirebaseUser`. - Retrieve the `FirebaseUser` using the `user` property of `AuthResult`. - -## 0.11.1+12 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.11.1+11 - -* On iOS, `getIdToken()` now uses the `refresh` parameter instead of always using `true`. - -## 0.11.1+10 - -* On Android, `providerData` now includes `UserInfo` for the phone authentication provider. - -## 0.11.1+9 - -* Update README to clarify importance of filling out all fields for OAuth consent screen. - -## 0.11.1+8 - -* Automatically register for iOS notifications, ensuring that phone authentication - will work even if Firebase method swizzling is disabled. - -## 0.11.1+7 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.11.1+6 - -* Add documentation of support email requirement to README. - -## 0.11.1+5 - -* Fix `updatePhoneNumberCredential` on Android. - -## 0.11.1+4 - -* Fix `updatePhoneNumberCredential` on iOS. - -## 0.11.1+3 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. -* FirebaseUser private constructor takes `Map` instead of `Map`. - -## 0.11.1+2 - -* Suppress deprecation warning for BinaryMessages. See: https://github.com/flutter/flutter/issues/33446 - -## 0.11.1+1 - -* Updated the error code documentation for `linkWithCredential`. - -## 0.11.1 - -* Support for `updatePhoneNumberCredential`. - -## 0.11.0 - -* **Breaking change**: `linkWithCredential` is now a function of `FirebaseUser`instead of - `FirebaseAuth`. -* Added test for newer `linkWithCredential` function. - -## 0.10.0+1 - -* Increase Firebase/Auth CocoaPod dependency to '~> 6.0'. - -## 0.10.0 - -* Update firebase_dynamic_links dependency. -* Update Android dependencies to latest. - -## 0.9.0 - -* **Breaking change**: `PhoneVerificationCompleted` now provides an `AuthCredential` that can - be used with `signInWithCredential` or `linkWithCredential` instead of signing in automatically. -* **Breaking change**: Remove internal counter `nextHandle` from public API. - -## 0.8.4+5 - -* Increase Firebase/Auth CocoaPod dependency to '~> 5.19'. - -## 0.8.4+4 - -* Update FirebaseAuth CocoaPod dependency to ensure availability of `FIRAuthErrorUserInfoNameKey`. - -## 0.8.4+3 - -* Updated deprecated API usage on iOS to use non-deprecated versions. -* Updated FirebaseAuth CocoaPod dependency to ensure a minimum version of 5.0. - -## 0.8.4+2 - -* Fixes an error in the documentation of createUserWithEmailAndPassword. - -## 0.8.4+1 - -* Adds credential for email authentication with link. - -## 0.8.4 - -* Adds support for email link authentication. - -## 0.8.3 - -* Make providerId 'const String' to use in 'case' statement. - -## 0.8.2+1 - -* Fixed bug where `PhoneCodeAutoRetrievalTimeout` callback was never called. - -## 0.8.2 - -* Fixed `linkWithCredential` on Android. - -## 0.8.1+5 - -* Added a driver test. - -## 0.8.1+4 - -* Update README. -* Update the example app with separate pages for registration and sign-in. - -## 0.8.1+3 - -* Reduce compiler warnings in Android plugin -* Raise errors early when accessing methods that require a Firebase User - -## 0.8.1+2 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.8.1+1 - -* Remove categories. - -## 0.8.1 - -* Fixes Firebase auth phone sign-in for Android. - -## 0.8.0+3 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.8.0+2 - -* Update Google sign-in example in the README. - -## 0.8.0+1 - -* Update a broken dependency. - -## 0.8.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.7.0 - -* Introduce third-party auth provider classes that generate `AuthCredential`s -* **Breaking Change** Signing in, linking, and reauthenticating now require an `AuthCredential` -* **Breaking Change** Unlinking now uses providerId -* **Breaking Change** Moved reauthentication to FirebaseUser - -## 0.6.7 - -* `FirebaseAuth` and `FirebaseUser` are now fully documented. -* `PlatformExceptions` now report error codes as stated in docs. -* Credentials can now be unlinked from Accounts with new methods on `FirebaseUser`. - -## 0.6.6 - -* Users can now reauthenticate in response to operations that require a recent sign-in. - -## 0.6.5 - -* Fixing async method `verifyPhoneNumber`, that would never return even in a successful call. - -## 0.6.4 - -* Added support for Github signin and linking Github accounts to existing users. - -## 0.6.3 - -* Add multi app support. - -## 0.6.2+1 - -* Bump Android dependencies to latest. - -## 0.6.2 - -* Add access to user metadata. - -## 0.6.1 - -* Adding support for linkWithTwitterCredential in FirebaseAuth. - -## 0.6.0 - -* Added support for `updatePassword` in `FirebaseUser`. -* **Breaking Change** Moved `updateEmail` and `updateProfile` to `FirebaseUser`. - This brings the `firebase_auth` package inline with other implementations and documentation. - -## 0.5.20 - -* Replaced usages of guava's: ImmutableList and ImmutableMap with platform -Collections.unmodifiableList() and Collections.unmodifiableMap(). - -## 0.5.19 - -* Update test package dependency to pick up Dart 2 support. -* Modified dependency on google_sign_in to point to a published - version instead of a relative path. - -## 0.5.18 - -* Adding support for updateEmail in FirebaseAuth. - -## 0.5.17 - -* Adding support for FirebaseUser.delete. - -## 0.5.16 - -* Adding support for setLanguageCode in FirebaseAuth. - -## 0.5.15 - -* Bump Android and Firebase dependency versions. - -## 0.5.14 - -* Fixed handling of auto phone number verification. - -## 0.5.13 - -* Add support for phone number authentication. - -## 0.5.12 - -* Fixed ArrayIndexOutOfBoundsException in handleStopListeningAuthState - -## 0.5.11 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.5.10 - -* Updated iOS implementation to reflect Firebase API changes. - -## 0.5.9 - -* Added support for signing in with a Twitter account. - -## 0.5.8 - -* Added support to reload firebase user - -## 0.5.7 - -* Added support to sendEmailVerification - -## 0.5.6 - -* Added support for linkWithFacebookCredential - -## 0.5.5 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.5.4 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.5.3 - -* Secure fetchProvidersForEmail (no providers) - -## 0.5.2 - -* Fixed Dart 2 type error in fetchProvidersForEmail. - -## 0.5.1 - -* Added support to fetchProvidersForEmail - -## 0.5.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.4.7 - -* Fixed Dart 2 type errors. - -## 0.4.6 - -* Fixed Dart 2 type errors. - -## 0.4.5 - -* Enabled use in Swift projects. - -## 0.4.4 - -* Added support for sendPasswordResetEmail - -## 0.4.3 - -* Moved to the io.flutter.plugins organization. - -## 0.4.2 - -* Added support for changing user data - -## 0.4.1 - -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.4.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). -* Relaxed GMS dependency to [11.4.0,12.0[ - -## 0.3.2 - -* Added FLT prefix to iOS types -* Change GMS dependency to 11.4.+ - -## 0.3.1 - -* Change GMS dependency to 11.+ - -## 0.3.0 - -* **Breaking Change**: Method FirebaseUser getToken was renamed to getIdToken. - -## 0.2.5 - -* Added support for linkWithCredential with Google credential - -## 0.2.4 - -* Added support for `signInWithCustomToken` -* Added `Stream onAuthStateChanged` event to listen when the user change - -## 0.2.3+1 - -* Aligned author name with rest of repo. - -## 0.2.3 - -* Remove dependency on Google/SignIn - -## 0.2.2 - -* Remove dependency on FirebaseUI - -## 0.2.1 - -* Added support for linkWithEmailAndPassword - -## 0.2.0 - -* **Breaking Change**: Method currentUser is async now. - -## 0.1.2 - -* Added support for signInWithFacebook - -## 0.1.1 - -* Updated to Firebase SDK to always use latest patch version for 11.0.x builds - -## 0.1.0 - -* Updated to Firebase SDK Version 11.0.1 -* **Breaking Change**: You need to add a maven section with the "https://maven.google.com" endpoint to the repository section of your `android/build.gradle`. For example: -```gradle -allprojects { - repositories { - jcenter() - maven { // NEW - url "https://maven.google.com" // NEW - } // NEW - } -} -``` - -## 0.0.4 - -* Add method getToken() to FirebaseUser - -## 0.0.3+1 - -* Updated README.md - -## 0.0.3 - -* Added support for createUserWithEmailAndPassword, signInWithEmailAndPassword, and signOut Firebase methods - -## 0.0.2+1 - -* Updated README.md - -## 0.0.2 - -* Bump buildToolsVersion to 25.0.3 - -## 0.0.1 - -* Initial Release diff --git a/packages/firebase_auth/LICENSE b/packages/firebase_auth/LICENSE deleted file mode 100755 index 000b4618d2bd..000000000000 --- a/packages/firebase_auth/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_auth/README.md b/packages/firebase_auth/README.md deleted file mode 100755 index 5c1e80f8181f..000000000000 --- a/packages/firebase_auth/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# firebase_auth plugin -A Flutter plugin to use the [Firebase Authentication API](https://firebase.google.com/products/auth/). - -[![pub package](https://img.shields.io/pub/v/firebase_auth.svg)](https://pub.dartlang.org/packages/firebase_auth) - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -### Configure the Google sign-in plugin -The Google Sign-in plugin is required to use the firebase_auth plugin for Google authentication. Follow the [Google sign-in plugin installation instructions](https://pub.dartlang.org/packages/google_sign_in#pub-pkg-tab-installing). - -If you're using Google Sign-in with Firebase auth, be sure to include all required fields in the [OAuth consent screen](https://console.developers.google.com/apis/credentials/consent). If you don't, you may encounter an `ApiException`. - -### Import the firebase_auth plugin -To use the firebase_auth plugin, follow the [plugin installation instructions](https://pub.dartlang.org/packages/firebase_auth#pub-pkg-tab-installing). - -### Android integration - -Enable the Google services by configuring the Gradle scripts as such. - -1. Add the classpath to the `[project]/android/build.gradle` file. -```gradle -dependencies { - // Example existing classpath - classpath 'com.android.tools.build:gradle:3.2.1' - // Add the google services classpath - classpath 'com.google.gms:google-services:4.3.0' -} -``` - -2. Add the apply plugin to the `[project]/android/app/build.gradle` file. -```gradle -// ADD THIS AT THE BOTTOM -apply plugin: 'com.google.gms.google-services' -``` - -*Note:* If this section is not completed you will get an error like this: -``` -java.lang.IllegalStateException: -Default FirebaseApp is not initialized in this process [package name]. -Make sure to call FirebaseApp.initializeApp(Context) first. -``` - -*Note:* When you are debugging on android, use a device or AVD with Google Play services. -Otherwise you will not be able to authenticate. - -### Use the plugin - -Add the following imports to your Dart code: -```dart -import 'package:firebase_auth/firebase_auth.dart'; -``` - -Initialize `GoogleSignIn` and `FirebaseAuth`: -```dart -final GoogleSignIn _googleSignIn = GoogleSignIn(); -final FirebaseAuth _auth = FirebaseAuth.instance; -``` - -You can now use the Firebase `_auth` to authenticate in your Dart code, e.g. -```dart -Future _handleSignIn() async { - final GoogleSignInAccount googleUser = await _googleSignIn.signIn(); - final GoogleSignInAuthentication googleAuth = await googleUser.authentication; - - final AuthCredential credential = GoogleAuthProvider.getCredential( - accessToken: googleAuth.accessToken, - idToken: googleAuth.idToken, - ); - - final FirebaseUser user = (await _auth.signInWithCredential(credential)).user; - print("signed in " + user.displayName); - return user; -} -``` - -Then from the sign in button onPress, call the `_handleSignIn` method using a future -callback for both the `FirebaseUser` and possible exception. -```dart -_handleSignIn() - .then((FirebaseUser user) => print(user)) - .catchError((e) => print(e)); -``` - -### Register a user - -```dart -final FirebaseUser user = await _auth.createUserWithEmailAndPassword( - email: 'an email', - password: 'a password', - ); -``` - -### Supported Firebase authentication methods - -* Google -* Email and Password -* Phone -* Anonymously -* GitHub -* Facebook -* Twitter - -### Phone Auth - -You can use Firebase Authentication to sign in a user by sending an SMS message to -the user's phone. The user signs in using a one-time code contained in the SMS message. - -### After authentication - -After a successful authentication, you will receive a `FirebaseUser` object. You can use this object to check if the email is verified, to update email, to send verification email and so on. See the [FirebaseUser](https://pub.dartlang.org/documentation/firebase_auth/latest/firebase_auth/FirebaseUser-class.html) API documentation for more details on the `FirebaseUser` object. - - -#### iOS setup - -1. Enable Phone as a Sign-In method in the [Firebase console](https://console.firebase.google.com/u/0/project/_/authentication/providers) - - - When testing you can add test phone numbers and verification codes to the Firebase console. - -1. [Enable App verification](https://firebase.google.com/docs/auth/ios/phone-auth#enable-app-verification) - -**Note:** App verification may use APNs, if using a simulator (where APNs does not work) or APNs is not setup on the -device you are using you must set the `URL Schemes` to the `REVERSE_CLIENT_ID` from the GoogleServices-Info.plist file. - -#### Android setup - -1. Enable Phone as a Sign-In method in the [Firebase console](https://console.firebase.google.com/u/0/project/_/authentication/providers) - - - When testing you can add test phone numbers and verification codes to the Firebase console. - -## Example - -See the [example application](https://github.com/flutter/plugins/tree/master/packages/firebase_auth/example) source -for a complete sample app using the Firebase authentication. - -## Issues and feedback - -Please file [issues](https://github.com/flutter/flutter/issues/new) -to send feedback or report a bug. Thank you! diff --git a/packages/firebase_auth/android/build.gradle b/packages/firebase_auth/android/build.gradle deleted file mode 100755 index 3e1822be799e..000000000000 --- a/packages/firebase_auth/android/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -def PLUGIN = "firebase_auth"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - - -group 'io.flutter.plugins.firebaseauth' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.1' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - implementation 'androidx.annotation:annotation:1.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - api 'com.google.firebase:firebase-auth:17.0.0' - api 'com.google.code.gson:gson:2.8.5' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_auth/android/gradle.properties b/packages/firebase_auth/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_auth/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_auth/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_auth/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_auth/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_auth/android/settings.gradle b/packages/firebase_auth/android/settings.gradle deleted file mode 100755 index acfe1855910f..000000000000 --- a/packages/firebase_auth/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_auth' diff --git a/packages/firebase_auth/android/src/main/AndroidManifest.xml b/packages/firebase_auth/android/src/main/AndroidManifest.xml deleted file mode 100755 index 2c6eb8c0f06e..000000000000 --- a/packages/firebase_auth/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_auth/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java b/packages/firebase_auth/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java deleted file mode 100755 index c135259f22d1..000000000000 --- a/packages/firebase_auth/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java +++ /dev/null @@ -1,807 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseauth; - -import android.net.Uri; -import android.util.SparseArray; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.FirebaseApiNotAvailableException; -import com.google.firebase.FirebaseApp; -import com.google.firebase.FirebaseException; -import com.google.firebase.FirebaseNetworkException; -import com.google.firebase.FirebaseTooManyRequestsException; -import com.google.firebase.auth.ActionCodeSettings; -import com.google.firebase.auth.AdditionalUserInfo; -import com.google.firebase.auth.AuthCredential; -import com.google.firebase.auth.AuthResult; -import com.google.firebase.auth.EmailAuthProvider; -import com.google.firebase.auth.FacebookAuthProvider; -import com.google.firebase.auth.FirebaseAuth; -import com.google.firebase.auth.FirebaseAuth.AuthStateListener; -import com.google.firebase.auth.FirebaseAuthException; -import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException; -import com.google.firebase.auth.FirebaseUser; -import com.google.firebase.auth.FirebaseUserMetadata; -import com.google.firebase.auth.GetTokenResult; -import com.google.firebase.auth.GithubAuthProvider; -import com.google.firebase.auth.GoogleAuthProvider; -import com.google.firebase.auth.PhoneAuthCredential; -import com.google.firebase.auth.PhoneAuthProvider; -import com.google.firebase.auth.PhoneAuthProvider.ForceResendingToken; -import com.google.firebase.auth.SignInMethodQueryResult; -import com.google.firebase.auth.TwitterAuthProvider; -import com.google.firebase.auth.UserInfo; -import com.google.firebase.auth.UserProfileChangeRequest; -import com.google.gson.Gson; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** Flutter plugin for Firebase Auth. */ -public class FirebaseAuthPlugin implements MethodCallHandler { - private final PluginRegistry.Registrar registrar; - private final SparseArray authStateListeners = new SparseArray<>(); - private final SparseArray forceResendingTokens = new SparseArray<>(); - private final MethodChannel channel; - - // Handles are ints used as indexes into the sparse array of active observers - private int nextHandle = 0; - - public static void registerWith(PluginRegistry.Registrar registrar) { - MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_auth"); - channel.setMethodCallHandler(new FirebaseAuthPlugin(registrar, channel)); - } - - private FirebaseAuthPlugin(PluginRegistry.Registrar registrar, MethodChannel channel) { - this.registrar = registrar; - this.channel = channel; - FirebaseApp.initializeApp(registrar.context()); - } - - private FirebaseAuth getAuth(MethodCall call) { - Map arguments = call.arguments(); - String appName = (String) arguments.get("app"); - FirebaseApp app = FirebaseApp.getInstance(appName); - return FirebaseAuth.getInstance(app); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - switch (call.method) { - case "currentUser": - handleCurrentUser(call, result, getAuth(call)); - break; - case "signInAnonymously": - handleSignInAnonymously(call, result, getAuth(call)); - break; - case "createUserWithEmailAndPassword": - handleCreateUserWithEmailAndPassword(call, result, getAuth(call)); - break; - case "fetchSignInMethodsForEmail": - handleFetchSignInMethodsForEmail(call, result, getAuth(call)); - break; - case "sendPasswordResetEmail": - handleSendPasswordResetEmail(call, result, getAuth(call)); - break; - case "sendLinkToEmail": - handleSendLinkToEmail(call, result, getAuth(call)); - break; - case "isSignInWithEmailLink": - handleIsSignInWithEmailLink(call, result, getAuth(call)); - break; - case "signInWithEmailAndLink": - handleSignInWithEmailAndLink(call, result, getAuth(call)); - break; - case "sendEmailVerification": - handleSendEmailVerification(call, result, getAuth(call)); - break; - case "reload": - handleReload(call, result, getAuth(call)); - break; - case "delete": - handleDelete(call, result, getAuth(call)); - break; - case "signInWithCredential": - handleSignInWithCredential(call, result, getAuth(call)); - break; - case "signInWithCustomToken": - handleSignInWithCustomToken(call, result, getAuth(call)); - break; - case "signOut": - handleSignOut(call, result, getAuth(call)); - break; - case "getIdToken": - handleGetToken(call, result, getAuth(call)); - break; - case "reauthenticateWithCredential": - handleReauthenticateWithCredential(call, result, getAuth(call)); - break; - case "linkWithCredential": - handleLinkWithCredential(call, result, getAuth(call)); - break; - case "unlinkFromProvider": - handleUnlinkFromProvider(call, result, getAuth(call)); - break; - case "updateEmail": - handleUpdateEmail(call, result, getAuth(call)); - break; - case "updatePhoneNumberCredential": - handleUpdatePhoneNumber(call, result, getAuth(call)); - break; - case "updatePassword": - handleUpdatePassword(call, result, getAuth(call)); - break; - case "updateProfile": - handleUpdateProfile(call, result, getAuth(call)); - break; - case "startListeningAuthState": - handleStartListeningAuthState(call, result, getAuth(call)); - break; - case "stopListeningAuthState": - handleStopListeningAuthState(call, result, getAuth(call)); - break; - case "verifyPhoneNumber": - handleVerifyPhoneNumber(call, result, getAuth(call)); - break; - case "signInWithPhoneNumber": - handleSignInWithPhoneNumber(call, result, getAuth(call)); - break; - case "setLanguageCode": - handleSetLanguageCode(call, result, getAuth(call)); - break; - default: - result.notImplemented(); - break; - } - } - - private void handleSignInWithPhoneNumber( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String verificationId = arguments.get("verificationId"); - String smsCode = arguments.get("smsCode"); - - PhoneAuthCredential phoneAuthCredential = - PhoneAuthProvider.getCredential(verificationId, smsCode); - firebaseAuth - .signInWithCredential(phoneAuthCredential) - .addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleVerifyPhoneNumber( - MethodCall call, Result result, final FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - final int handle = (int) arguments.get("handle"); - String phoneNumber = (String) arguments.get("phoneNumber"); - int timeout = (int) arguments.get("timeout"); - - PhoneAuthProvider.OnVerificationStateChangedCallbacks verificationCallbacks = - new PhoneAuthProvider.OnVerificationStateChangedCallbacks() { - @Override - public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) { - Map arguments = new HashMap<>(); - arguments.put("handle", handle); - String parsedJson = new Gson().toJson(phoneAuthCredential); - arguments.put("phoneAuthCredential", parsedJson); - channel.invokeMethod("phoneVerificationCompleted", arguments); - } - - @Override - public void onVerificationFailed(FirebaseException e) { - Map arguments = new HashMap<>(); - arguments.put("handle", handle); - arguments.put("exception", getVerifyPhoneNumberExceptionMap(e)); - channel.invokeMethod("phoneVerificationFailed", arguments); - } - - @Override - public void onCodeSent( - String verificationId, PhoneAuthProvider.ForceResendingToken forceResendingToken) { - Map arguments = new HashMap<>(); - arguments.put("handle", handle); - arguments.put("verificationId", verificationId); - arguments.put("forceResendingToken", forceResendingToken.hashCode()); - channel.invokeMethod("phoneCodeSent", arguments); - } - - @Override - public void onCodeAutoRetrievalTimeOut(String verificationId) { - Map arguments = new HashMap<>(); - arguments.put("handle", handle); - arguments.put("verificationId", verificationId); - channel.invokeMethod("phoneCodeAutoRetrievalTimeout", arguments); - } - }; - - if (call.argument("forceResendingToken") != null) { - int forceResendingTokenKey = (int) arguments.get("forceResendingToken"); - PhoneAuthProvider.ForceResendingToken forceResendingToken = - forceResendingTokens.get(forceResendingTokenKey); - PhoneAuthProvider.getInstance() - .verifyPhoneNumber( - phoneNumber, - timeout, - TimeUnit.MILLISECONDS, - registrar.activity(), - verificationCallbacks, - forceResendingToken); - } else { - PhoneAuthProvider.getInstance() - .verifyPhoneNumber( - phoneNumber, - timeout, - TimeUnit.MILLISECONDS, - registrar.activity(), - verificationCallbacks); - } - - result.success(null); - } - - private Map getVerifyPhoneNumberExceptionMap(FirebaseException e) { - String errorCode = "verifyPhoneNumberError"; - if (e instanceof FirebaseAuthInvalidCredentialsException) { - errorCode = "invalidCredential"; - } else if (e instanceof FirebaseAuthException) { - errorCode = "firebaseAuth"; - } else if (e instanceof FirebaseTooManyRequestsException) { - errorCode = "quotaExceeded"; - } else if (e instanceof FirebaseApiNotAvailableException) { - errorCode = "apiNotAvailable"; - } - - Map exceptionMap = new HashMap<>(); - exceptionMap.put("code", errorCode); - exceptionMap.put("message", e.getMessage()); - return exceptionMap; - } - - private void handleLinkWithCredential(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - @SuppressWarnings("unchecked") - AuthCredential credential = getCredential((Map) call.arguments); - - currentUser - .linkWithCredential(credential) - .addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleCurrentUser( - @SuppressWarnings("unused") MethodCall call, final Result result, FirebaseAuth firebaseAuth) { - FirebaseUser user = firebaseAuth.getCurrentUser(); - if (user == null) { - result.success(null); - return; - } - Map userMap = mapFromUser(user); - result.success(userMap); - } - - private void handleSignInAnonymously( - @SuppressWarnings("unused") MethodCall call, Result result, FirebaseAuth firebaseAuth) { - firebaseAuth.signInAnonymously().addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleCreateUserWithEmailAndPassword( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String email = arguments.get("email"); - String password = arguments.get("password"); - - firebaseAuth - .createUserWithEmailAndPassword(email, password) - .addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleFetchSignInMethodsForEmail( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String email = arguments.get("email"); - - firebaseAuth - .fetchSignInMethodsForEmail(email) - .addOnCompleteListener(new GetSignInMethodsCompleteListener(result)); - } - - private void handleSendPasswordResetEmail( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String email = arguments.get("email"); - - firebaseAuth - .sendPasswordResetEmail(email) - .addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleSendLinkToEmail(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String email = arguments.get("email").toString(); - ActionCodeSettings actionCodeSettings = - ActionCodeSettings.newBuilder() - .setUrl(arguments.get("url").toString()) - .setHandleCodeInApp((Boolean) arguments.get("handleCodeInApp")) - .setIOSBundleId(arguments.get("iOSBundleID").toString()) - .setAndroidPackageName( - arguments.get("androidPackageName").toString(), - (Boolean) arguments.get("androidInstallIfNotAvailable"), - arguments.get("androidMinimumVersion").toString()) - .build(); - - firebaseAuth - .sendSignInLinkToEmail(email, actionCodeSettings) - .addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleIsSignInWithEmailLink( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String link = arguments.get("link"); - Boolean isSignInWithEmailLink = firebaseAuth.isSignInWithEmailLink(link); - result.success(isSignInWithEmailLink); - } - - private void handleSignInWithEmailAndLink( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String email = arguments.get("email"); - String link = arguments.get("link"); - firebaseAuth - .signInWithEmailLink(email, link) - .addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleSendEmailVerification( - @SuppressWarnings("unused") MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - currentUser.sendEmailVerification().addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleReload( - @SuppressWarnings("unused") MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - currentUser.reload().addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleDelete( - @SuppressWarnings("unused") MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - currentUser.delete().addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private AuthCredential getCredential(Map arguments) { - AuthCredential credential; - - @SuppressWarnings("unchecked") - Map data = (Map) arguments.get("data"); - - switch ((String) arguments.get("provider")) { - case EmailAuthProvider.PROVIDER_ID: - { - String email = data.get("email"); - if (data.containsKey("password")) { - String password = data.get("password"); - credential = EmailAuthProvider.getCredential(email, password); - } else { - String link = data.get("link"); - credential = EmailAuthProvider.getCredentialWithLink(email, link); - } - break; - } - case GoogleAuthProvider.PROVIDER_ID: - { - String idToken = data.get("idToken"); - String accessToken = data.get("accessToken"); - credential = GoogleAuthProvider.getCredential(idToken, accessToken); - break; - } - case FacebookAuthProvider.PROVIDER_ID: - { - String accessToken = data.get("accessToken"); - credential = FacebookAuthProvider.getCredential(accessToken); - break; - } - case TwitterAuthProvider.PROVIDER_ID: - { - String authToken = data.get("authToken"); - String authTokenSecret = data.get("authTokenSecret"); - credential = TwitterAuthProvider.getCredential(authToken, authTokenSecret); - break; - } - case GithubAuthProvider.PROVIDER_ID: - { - String token = data.get("token"); - credential = GithubAuthProvider.getCredential(token); - break; - } - case PhoneAuthProvider.PROVIDER_ID: - { - if (data.containsKey("verificationId")) { - String accessToken = data.get("verificationId"); - String smsCode = data.get("smsCode"); - credential = PhoneAuthProvider.getCredential(accessToken, smsCode); - } else { - credential = new Gson().fromJson(data.get("jsonObject"), PhoneAuthCredential.class); - } - break; - } - default: - { - credential = null; - break; - } - } - return credential; - } - - private void handleSignInWithCredential( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - - @SuppressWarnings("unchecked") - AuthCredential credential = getCredential((Map) call.arguments()); - - firebaseAuth - .signInWithCredential(credential) - .addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleReauthenticateWithCredential( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - @SuppressWarnings("unchecked") - AuthCredential credential = getCredential((Map) call.arguments()); - - currentUser - .reauthenticate(credential) - .addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleUnlinkFromProvider(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - Map arguments = call.arguments(); - final String provider = arguments.get("provider"); - - currentUser.unlink(provider).addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleSignInWithCustomToken( - MethodCall call, final Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String token = arguments.get("token"); - - firebaseAuth - .signInWithCustomToken(token) - .addOnCompleteListener(new SignInCompleteListener(result)); - } - - private void handleSignOut( - @SuppressWarnings("unused") MethodCall call, final Result result, FirebaseAuth firebaseAuth) { - firebaseAuth.signOut(); - result.success(null); - } - - private void handleGetToken(MethodCall call, final Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - Map arguments = call.arguments(); - final boolean refresh = arguments.get("refresh"); - - currentUser - .getIdToken(refresh) - .addOnCompleteListener( - new OnCompleteListener() { - public void onComplete(@NonNull Task task) { - if (task.isSuccessful() && task.getResult() != null) { - final Map map = new HashMap<>(); - map.put("token", task.getResult().getToken()); - map.put("expirationTimestamp", task.getResult().getExpirationTimestamp()); - map.put("authTimestamp", task.getResult().getAuthTimestamp()); - map.put("issuedAtTimestamp", task.getResult().getIssuedAtTimestamp()); - map.put("claims", task.getResult().getClaims()); - - if (task.getResult().getSignInProvider() != null) { - map.put("signInProvider", task.getResult().getSignInProvider()); - } - - result.success(Collections.unmodifiableMap(map)); - } else { - reportException(result, task.getException()); - } - } - }); - } - - private void handleUpdateEmail(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - Map arguments = call.arguments(); - final String email = arguments.get("email"); - - currentUser.updateEmail(email).addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleUpdatePhoneNumber(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - @SuppressWarnings("unchecked") - AuthCredential credential = getCredential((Map) call.arguments); - - firebaseAuth - .getCurrentUser() - .updatePhoneNumber((PhoneAuthCredential) credential) - .addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleUpdatePassword(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - Map arguments = call.arguments(); - final String password = arguments.get("password"); - - currentUser - .updatePassword(password) - .addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleUpdateProfile(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final FirebaseUser currentUser = firebaseAuth.getCurrentUser(); - if (currentUser == null) { - markUserRequired(result); - return; - } - - Map arguments = call.arguments(); - - UserProfileChangeRequest.Builder builder = new UserProfileChangeRequest.Builder(); - if (arguments.containsKey("displayName")) { - builder.setDisplayName(arguments.get("displayName")); - } - if (arguments.containsKey("photoUrl")) { - builder.setPhotoUri(Uri.parse(arguments.get("photoUrl"))); - } - - currentUser - .updateProfile(builder.build()) - .addOnCompleteListener(new TaskVoidCompleteListener(result)); - } - - private void handleStartListeningAuthState( - @SuppressWarnings("unused") MethodCall call, Result result, FirebaseAuth firebaseAuth) { - final int handle = nextHandle++; - FirebaseAuth.AuthStateListener listener = - new FirebaseAuth.AuthStateListener() { - @Override - public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { - FirebaseUser user = firebaseAuth.getCurrentUser(); - Map userMap = mapFromUser(user); - Map map = new HashMap<>(); - map.put("id", handle); - if (userMap != null) { - map.put("user", userMap); - } - channel.invokeMethod("onAuthStateChanged", Collections.unmodifiableMap(map)); - } - }; - firebaseAuth.addAuthStateListener(listener); - authStateListeners.append(handle, listener); - result.success(handle); - } - - private void handleStopListeningAuthState( - MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - Integer id = arguments.get("id"); - - FirebaseAuth.AuthStateListener listener = authStateListeners.get(id); - if (listener != null) { - firebaseAuth.removeAuthStateListener(listener); - authStateListeners.remove(id); - result.success(null); - } else { - reportException( - result, - new FirebaseAuthException( - "ERROR_LISTENER_NOT_FOUND", - String.format(Locale.US, "Listener with identifier '%d' not found.", id))); - } - } - - private void handleSetLanguageCode(MethodCall call, Result result, FirebaseAuth firebaseAuth) { - Map arguments = call.arguments(); - String language = arguments.get("language"); - - firebaseAuth.setLanguageCode(language); - result.success(null); - } - - private class SignInCompleteListener implements OnCompleteListener { - private final Result result; - - SignInCompleteListener(Result result) { - this.result = result; - } - - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful() || task.getResult() == null) { - reportException(result, task.getException()); - } else { - AuthResult authResult = task.getResult(); - FirebaseUser user = authResult.getUser(); - AdditionalUserInfo additionalUserInfo = authResult.getAdditionalUserInfo(); - Map userMap = (mapFromUser(user)); - Map additionalUserInfoMap = mapFromAdditionalUserInfo(additionalUserInfo); - Map map = new HashMap<>(); - map.put("user", userMap); - map.put("additionalUserInfo", additionalUserInfoMap); - result.success(Collections.unmodifiableMap(map)); - } - } - } - - private class TaskVoidCompleteListener implements OnCompleteListener { - private final Result result; - - TaskVoidCompleteListener(Result result) { - this.result = result; - } - - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - reportException(result, task.getException()); - } else { - result.success(null); - } - } - } - - private class GetSignInMethodsCompleteListener - implements OnCompleteListener { - private final Result result; - - GetSignInMethodsCompleteListener(Result result) { - this.result = result; - } - - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful() || task.getResult() == null) { - reportException(result, task.getException()); - } else { - List providers = task.getResult().getSignInMethods(); - result.success(providers); - } - } - } - - private Map userInfoToMap(UserInfo userInfo) { - Map map = new HashMap<>(); - map.put("providerId", userInfo.getProviderId()); - map.put("uid", userInfo.getUid()); - if (userInfo.getDisplayName() != null) { - map.put("displayName", userInfo.getDisplayName()); - } - if (userInfo.getPhotoUrl() != null) { - map.put("photoUrl", userInfo.getPhotoUrl().toString()); - } - if (userInfo.getEmail() != null) { - map.put("email", userInfo.getEmail()); - } - if (userInfo.getPhoneNumber() != null) { - map.put("phoneNumber", userInfo.getPhoneNumber()); - } - return map; - } - - private Map mapFromUser(FirebaseUser user) { - if (user != null) { - List> providerData = new ArrayList<>(); - for (UserInfo userInfo : user.getProviderData()) { - providerData.add(Collections.unmodifiableMap(userInfoToMap(userInfo))); - } - Map userMap = userInfoToMap(user); - final FirebaseUserMetadata metadata = user.getMetadata(); - if (metadata != null) { - userMap.put("creationTimestamp", metadata.getCreationTimestamp()); - userMap.put("lastSignInTimestamp", metadata.getLastSignInTimestamp()); - } - userMap.put("isAnonymous", user.isAnonymous()); - userMap.put("isEmailVerified", user.isEmailVerified()); - userMap.put("providerData", Collections.unmodifiableList(providerData)); - return Collections.unmodifiableMap(userMap); - } else { - return null; - } - } - - private Map mapFromAdditionalUserInfo(AdditionalUserInfo info) { - if (info != null) { - Map additionalUserInfoMap = new HashMap<>(); - additionalUserInfoMap.put("profile", info.getProfile()); - additionalUserInfoMap.put("providerId", info.getProviderId()); - additionalUserInfoMap.put("username", info.getUsername()); - additionalUserInfoMap.put("isNewUser", info.isNewUser()); - return Collections.unmodifiableMap(additionalUserInfoMap); - } else { - return null; - } - } - - private void markUserRequired(Result result) { - result.error("USER_REQUIRED", "Please authenticate with Firebase first", null); - } - - private void reportException(Result result, @Nullable Exception exception) { - if (exception != null) { - if (exception instanceof FirebaseAuthException) { - final FirebaseAuthException authException = (FirebaseAuthException) exception; - result.error(authException.getErrorCode(), exception.getMessage(), null); - } else if (exception instanceof FirebaseApiNotAvailableException) { - result.error("ERROR_API_NOT_AVAILABLE", exception.getMessage(), null); - } else if (exception instanceof FirebaseTooManyRequestsException) { - result.error("ERROR_TOO_MANY_REQUESTS", exception.getMessage(), null); - } else if (exception instanceof FirebaseNetworkException) { - result.error("ERROR_NETWORK_REQUEST_FAILED", exception.getMessage(), null); - } else { - result.error(exception.getClass().getSimpleName(), exception.getMessage(), null); - } - } else { - result.error("ERROR_UNKNOWN", "An unknown error occurred.", null); - } - } -} diff --git a/packages/firebase_auth/android/src/main/java/io/flutter/plugins/firebaseauth/FlutterFirebaseAppRegistrar.java b/packages/firebase_auth/android/src/main/java/io/flutter/plugins/firebaseauth/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index cfe7c7386d3f..000000000000 --- a/packages/firebase_auth/android/src/main/java/io/flutter/plugins/firebaseauth/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseauth; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_auth/android/user-agent.gradle b/packages/firebase_auth/android/user-agent.gradle deleted file mode 100644 index 38e5e6469fa5..000000000000 --- a/packages/firebase_auth/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-auth" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_auth/example/README.md b/packages/firebase_auth/example/README.md deleted file mode 100755 index 0b475d086369..000000000000 --- a/packages/firebase_auth/example/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# firebase_auth_example - -[![pub package](https://img.shields.io/pub/v/firebase_auth.svg)](https://pub.dartlang.org/packages/firebase_auth) - -Demonstrates how to use the firebase_auth plugin. - -## Phone Auth - -1. Enable phone authentication in the [Firebase console]((https://console.firebase.google.com/u/0/project/_/authentication/providers)). -1. Add test phone number and verification code to the Firebase console. - - For this sample the number `+1 408-555-6969` and verification code `888888` are used. -1. For iOS set the `URL Schemes` to the `REVERSE_CLIENT_ID` from the `GoogleServices-Info.plist` file. -1. Click the `Test verifyPhoneNumber` button. - - If APNs is not enabled or a simulator is being used, verification - will be done via a Captcha. -1. Once the phone number is verified the app displays the test - verification code. -1. Click the `Test signInWithPhoneNumber` button. -1. Signed in user's details are displayed in the UI. - - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_auth/example/android.iml b/packages/firebase_auth/example/android.iml deleted file mode 100755 index 462b903e05b6..000000000000 --- a/packages/firebase_auth/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_auth/example/android/app/build.gradle b/packages/firebase_auth/example/android/app/build.gradle deleted file mode 100755 index 295870863a51..000000000000 --- a/packages/firebase_auth/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "dev.flutter.plugins.firebaseauthexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_auth/example/android/app/google-services.json b/packages/firebase_auth/example/android/app/google-services.json deleted file mode 100644 index 238110fbb63e..000000000000 --- a/packages/firebase_auth/example/android/app/google-services.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "project_info": { - "project_number": "159623150305", - "firebase_url": "https://flutter-firebase-plugins.firebaseio.com", - "project_id": "flutter-firebase-plugins", - "storage_bucket": "flutter-firebase-plugins.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:2e167f427b396288", - "android_client_info": { - "package_name": "dev.flutter.plugins.firebaseauthexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:236f9daea101f77e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:11e8f037a4a3ec3b", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseauthexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-6cf91dro1kro30hdlfp3rkod8mldc81c.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseauthexample", - "certificate_hash": "4ef1514a34a8edf0f5b3ff7108d3497fa3449f69" - } - }, - { - "client_id": "159623150305-pjkkv9ff9tgkmjs7kjalsqv2pp6ltj04.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseauthexample", - "certificate_hash": "9ee6a0388f780cf93a852248905d2d3d83d8e50d" - } - }, - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:c68d3ad04a4046db", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasedatabaseexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-j5cqghi5snpqptesd2mdjum7o35hiltb.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebasedatabaseexample", - "certificate_hash": "9ee6a0388f780cf93a852248905d2d3d83d8e50d" - } - }, - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:620f0e4ca16cbddd", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasemessagingexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-qubsrfqbnrp4vurajv72eujgk164nin0.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebasemessagingexample", - "certificate_hash": "f8323ac5fe6e7adc1ddc5612e16b5d04d7f1358b" - } - }, - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:ef48439a0cc0263d", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasestorageexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:5e9f1f89e134dc86", - "android_client_info": { - "package_name": "io.flutter.plugins.googlesigninexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-3suu3qq4vs3ki7uaigbtrh2aal1p9ram.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.googlesigninexample", - "certificate_hash": "f8323ac5fe6e7adc1ddc5612e16b5d04d7f1358b" - } - }, - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebaseAuthExample" - } - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_auth/example/android/app/gradle.properties b/packages/firebase_auth/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_auth/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_auth/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_auth/example/android/app/src/main/AndroidManifest.xml deleted file mode 100755 index f9ae68ab9d7a..000000000000 --- a/packages/firebase_auth/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/firebase_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore b/packages/firebase_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore deleted file mode 100755 index 9eb4563d2ae1..000000000000 --- a/packages/firebase_auth/example/android/app/src/main/java/io/flutter/plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -GeneratedPluginRegistrant.java diff --git a/packages/firebase_auth/example/android/app/src/main/java/io/flutter/plugins/firebaseauthexample/MainActivity.java b/packages/firebase_auth/example/android/app/src/main/java/io/flutter/plugins/firebaseauthexample/MainActivity.java deleted file mode 100644 index 7bc03239e243..000000000000 --- a/packages/firebase_auth/example/android/app/src/main/java/io/flutter/plugins/firebaseauthexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseauthexample; - -import android.os.Bundle; -import io.flutter.app.FlutterFragmentActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterFragmentActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_auth/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_auth/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_auth/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_auth/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_auth/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_auth/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_auth/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_auth/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 09d4391482be..000000000000 Binary files a/packages/firebase_auth/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_auth/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_auth/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_auth/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_auth/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_auth/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_auth/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_auth/example/android/build.gradle b/packages/firebase_auth/example/android/build.gradle deleted file mode 100755 index 47c36fc2c29c..000000000000 --- a/packages/firebase_auth/example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.1' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_auth/example/android/gradle.properties b/packages/firebase_auth/example/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_auth/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_auth/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_auth/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_auth/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_auth/example/android/settings.gradle b/packages/firebase_auth/example/android/settings.gradle deleted file mode 100755 index 115da6cb4f4d..000000000000 --- a/packages/firebase_auth/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_auth/example/firebase_auth_example.iml b/packages/firebase_auth/example/firebase_auth_example.iml deleted file mode 100755 index 1ae40a0f7f54..000000000000 --- a/packages/firebase_auth/example/firebase_auth_example.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_auth/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_auth/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100755 index 6c2de8086bcd..000000000000 --- a/packages/firebase_auth/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_auth/example/ios/Flutter/Debug.xcconfig b/packages/firebase_auth/example/ios/Flutter/Debug.xcconfig deleted file mode 100755 index 9803018ca79d..000000000000 --- a/packages/firebase_auth/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/firebase_auth/example/ios/Flutter/Release.xcconfig b/packages/firebase_auth/example/ios/Flutter/Release.xcconfig deleted file mode 100755 index a4a8c604e13d..000000000000 --- a/packages/firebase_auth/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/firebase_auth/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_auth/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index c143be24864c..000000000000 --- a/packages/firebase_auth/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,502 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0690AA46E879ED4CF7B7AEB4 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A6A0D603F1BEC33B95572EC3 /* libPods-Runner.a */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5C97AA501EC3F2C300D441D1 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C97AA4F1EC3F2C300D441D1 /* GeneratedPluginRegistrant.m */; }; - 7ABDE8F71EA727FA0074FEFB /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7ABDE8F61EA727FA0074FEFB /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5C97AA4E1EC3F2C300D441D1 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 5C97AA4F1EC3F2C300D441D1 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 7ABDE8F61EA727FA0074FEFB /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A6A0D603F1BEC33B95572EC3 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 0690AA46E879ED4CF7B7AEB4 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 840012C8B5EDBCF56B0E4AC1 /* Pods */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 5C97AA4E1EC3F2C300D441D1 /* GeneratedPluginRegistrant.h */, - 5C97AA4F1EC3F2C300D441D1 /* GeneratedPluginRegistrant.m */, - 7ABDE8F61EA727FA0074FEFB /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A6A0D603F1BEC33B95572EC3 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7ABDE8F71EA727FA0074FEFB /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", - "${PODS_ROOT}/GTMOAuth2/Source/Touch/GTMOAuth2ViewTouch.xib", - "${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMOAuth2ViewTouch.nib", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 5C97AA501EC3F2C300D441D1 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseAuthExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseAuthExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_auth/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index 1c9580788197..000000000000 --- a/packages/firebase_auth/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_auth/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_auth/example/ios/Runner.xcworkspace/xcshareddata/Runner.xcscmblueprint b/packages/firebase_auth/example/ios/Runner.xcworkspace/xcshareddata/Runner.xcscmblueprint deleted file mode 100644 index e3e216215014..000000000000 --- a/packages/firebase_auth/example/ios/Runner.xcworkspace/xcshareddata/Runner.xcscmblueprint +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "98A3C30ABC97D592882929FAF5EFB935A32282D9", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "B9BC852104FA5F3F91D8B12EB80D37232CB3B40D" : 9223372036854775807, - "98A3C30ABC97D592882929FAF5EFB935A32282D9" : 9223372036854775807 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "C0DA2E9A-1048-43E4-8878-41C685CFFA88", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "B9BC852104FA5F3F91D8B12EB80D37232CB3B40D" : "flutter\/", - "98A3C30ABC97D592882929FAF5EFB935A32282D9" : "plugins\/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "Runner", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "packages\/firebase_auth\/example\/ios\/Runner.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:flutter\/plugins", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "98A3C30ABC97D592882929FAF5EFB935A32282D9" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:flutter\/flutter", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B9BC852104FA5F3F91D8B12EB80D37232CB3B40D" - } - ] -} \ No newline at end of file diff --git a/packages/firebase_auth/example/ios/Runner/AppDelegate.h b/packages/firebase_auth/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/firebase_auth/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_auth/example/ios/Runner/AppDelegate.m b/packages/firebase_auth/example/ios/Runner/AppDelegate.m deleted file mode 100644 index a4b51c88eb60..000000000000 --- a/packages/firebase_auth/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index d22f10b2ab63..000000000000 --- a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100755 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100755 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100755 index 4cde12118dda..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100755 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100755 index dcdc2306c285..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100755 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100755 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100755 index c4df70d39da7..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100755 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100755 index d0e1f5853602..000000000000 Binary files a/packages/firebase_auth/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_auth/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_auth/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100755 index ebf48f603974..000000000000 --- a/packages/firebase_auth/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_auth/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_auth/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100755 index f3c28516fb38..000000000000 --- a/packages/firebase_auth/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_auth/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_auth/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 2f48146fd821..000000000000 --- a/packages/firebase_auth/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CLIENT_ID - 159623150305-h67j0o93bcctblfhde74r7fssmcobamr.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.159623150305-h67j0o93bcctblfhde74r7fssmcobamr - ANDROID_CLIENT_ID - 159623150305-j5cqghi5snpqptesd2mdjum7o35hiltb.apps.googleusercontent.com - API_KEY - AIzaSyDyzecVw1zXTpBKwfFHxpl7QyYBhimNhUk - GCM_SENDER_ID - 159623150305 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebaseAuthExample - PROJECT_ID - flutter-firebase-plugins - STORAGE_BUCKET - flutter-firebase-plugins.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:159623150305:ios:8d89e1b69d780386 - DATABASE_URL - https://flutter-firebase-plugins.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_auth/example/ios/Runner/Info.plist b/packages/firebase_auth/example/ios/Runner/Info.plist deleted file mode 100755 index dd78ab74aa6c..000000000000 --- a/packages/firebase_auth/example/ios/Runner/Info.plist +++ /dev/null @@ -1,63 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_auth_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - - com.googleusercontent.apps.466218294969-5mdmh6opkqd87a5m81nm83u4eqd3bvgk - - - - - - diff --git a/packages/firebase_auth/example/ios/Runner/main.m b/packages/firebase_auth/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/firebase_auth/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_auth/example/lib/main.dart b/packages/firebase_auth/example/lib/main.dart deleted file mode 100755 index f3eeb38cab6a..000000000000 --- a/packages/firebase_auth/example/lib/main.dart +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:firebase_auth/firebase_auth.dart'; -import './register_page.dart'; -import './signin_page.dart'; - -void main() { - runApp(MyApp()); -} - -class MyApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Firebase Auth Demo', - home: MyHomePage(title: 'Firebase Auth Demo'), - ); - } -} - -class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); - - final String title; - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - FirebaseUser user; - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RaisedButton( - child: const Text('Test registration'), - onPressed: () => _pushPage(context, RegisterPage()), - ), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - Container( - child: RaisedButton( - child: const Text('Test SignIn/SignOut'), - onPressed: () => _pushPage(context, SignInPage()), - ), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - ], - ), - ); - } - - void _pushPage(BuildContext context, Widget page) { - Navigator.of(context).push( - MaterialPageRoute(builder: (_) => page), - ); - } -} diff --git a/packages/firebase_auth/example/lib/register_page.dart b/packages/firebase_auth/example/lib/register_page.dart deleted file mode 100644 index 44c6be36cab6..000000000000 --- a/packages/firebase_auth/example/lib/register_page.dart +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:firebase_auth/firebase_auth.dart'; - -final FirebaseAuth _auth = FirebaseAuth.instance; - -class RegisterPage extends StatefulWidget { - final String title = 'Registration'; - @override - State createState() => RegisterPageState(); -} - -class RegisterPageState extends State { - final GlobalKey _formKey = GlobalKey(); - final TextEditingController _emailController = TextEditingController(); - final TextEditingController _passwordController = TextEditingController(); - bool _success; - String _userEmail; - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), - body: Form( - key: _formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextFormField( - controller: _emailController, - decoration: InputDecoration(labelText: 'Email'), - validator: (String value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - TextFormField( - controller: _passwordController, - decoration: InputDecoration(labelText: 'Password'), - validator: (String value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - if (_formKey.currentState.validate()) { - _register(); - } - }, - child: const Text('Submit'), - ), - ), - Container( - alignment: Alignment.center, - child: Text(_success == null - ? '' - : (_success - ? 'Successfully registered ' + _userEmail - : 'Registration failed')), - ) - ], - ), - ), - ); - } - - @override - void dispose() { - // Clean up the controller when the Widget is disposed - _emailController.dispose(); - _passwordController.dispose(); - super.dispose(); - } - - // Example code for registration. - void _register() async { - final FirebaseUser user = (await _auth.createUserWithEmailAndPassword( - email: _emailController.text, - password: _passwordController.text, - )) - .user; - if (user != null) { - setState(() { - _success = true; - _userEmail = user.email; - }); - } else { - _success = false; - } - } -} diff --git a/packages/firebase_auth/example/lib/signin_page.dart b/packages/firebase_auth/example/lib/signin_page.dart deleted file mode 100644 index 34d47f05f291..000000000000 --- a/packages/firebase_auth/example/lib/signin_page.dart +++ /dev/null @@ -1,772 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:io'; -import 'package:flutter/material.dart'; -import 'package:firebase_auth/firebase_auth.dart'; -import 'package:google_sign_in/google_sign_in.dart'; -import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; - -final FirebaseAuth _auth = FirebaseAuth.instance; -final GoogleSignIn _googleSignIn = GoogleSignIn(); - -class SignInPage extends StatefulWidget { - final String title = 'Registration'; - @override - State createState() => SignInPageState(); -} - -class SignInPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(widget.title), - actions: [ - Builder(builder: (BuildContext context) { - return FlatButton( - child: const Text('Sign out'), - textColor: Theme.of(context).buttonColor, - onPressed: () async { - final FirebaseUser user = await _auth.currentUser(); - if (user == null) { - Scaffold.of(context).showSnackBar(SnackBar( - content: const Text('No one has signed in.'), - )); - return; - } - _signOut(); - final String uid = user.uid; - Scaffold.of(context).showSnackBar(SnackBar( - content: Text(uid + ' has successfully signed out.'), - )); - }, - ); - }) - ], - ), - body: Builder(builder: (BuildContext context) { - return ListView( - scrollDirection: Axis.vertical, - children: [ - _EmailPasswordForm(), - _EmailLinkSignInSection(), - _AnonymouslySignInSection(), - _GoogleSignInSection(), - _PhoneSignInSection(Scaffold.of(context)), - _OtherProvidersSignInSection(), - ], - ); - }), - ); - } - - // Example code for sign out. - void _signOut() async { - await _auth.signOut(); - } -} - -class _EmailPasswordForm extends StatefulWidget { - @override - State createState() => _EmailPasswordFormState(); -} - -class _EmailPasswordFormState extends State<_EmailPasswordForm> { - final GlobalKey _formKey = GlobalKey(); - final TextEditingController _emailController = TextEditingController(); - final TextEditingController _passwordController = TextEditingController(); - bool _success; - String _userEmail; - @override - Widget build(BuildContext context) { - return Form( - key: _formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: const Text('Test sign in with email and password'), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - TextFormField( - controller: _emailController, - decoration: InputDecoration(labelText: 'Email'), - validator: (String value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - TextFormField( - controller: _passwordController, - decoration: InputDecoration(labelText: 'Password'), - validator: (String value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - if (_formKey.currentState.validate()) { - _signInWithEmailAndPassword(); - } - }, - child: const Text('Submit'), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - _success == null - ? '' - : (_success - ? 'Successfully signed in ' + _userEmail - : 'Sign in failed'), - style: TextStyle(color: Colors.red), - ), - ) - ], - ), - ); - } - - @override - void dispose() { - _emailController.dispose(); - _passwordController.dispose(); - super.dispose(); - } - - // Example code of how to sign in with email and password. - void _signInWithEmailAndPassword() async { - final FirebaseUser user = (await _auth.signInWithEmailAndPassword( - email: _emailController.text, - password: _passwordController.text, - )) - .user; - if (user != null) { - setState(() { - _success = true; - _userEmail = user.email; - }); - } else { - _success = false; - } - } -} - -class _EmailLinkSignInSection extends StatefulWidget { - @override - State createState() => _EmailLinkSignInSectionState(); -} - -class _EmailLinkSignInSectionState extends State<_EmailLinkSignInSection> - with WidgetsBindingObserver { - final GlobalKey _formKey = GlobalKey(); - final TextEditingController _emailController = TextEditingController(); - - bool _success; - String _userEmail; - String _userID; - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addObserver(this); - } - - @override - void dispose() { - _emailController.dispose(); - WidgetsBinding.instance.removeObserver(this); - super.dispose(); - } - - @override - void didChangeAppLifecycleState(AppLifecycleState state) async { - if (state == AppLifecycleState.resumed) { - final Uri link = await _retrieveDynamicLink(); - - if (link != null) { - final FirebaseUser user = (await _auth.signInWithEmailAndLink( - email: _userEmail, - link: link.toString(), - )) - .user; - - if (user != null) { - _userID = user.uid; - _success = true; - } else { - _success = false; - } - } else { - _success = false; - } - - setState(() {}); - } - } - - Future _retrieveDynamicLink() async { - final PendingDynamicLinkData data = - await FirebaseDynamicLinks.instance.retrieveDynamicLink(); - return data?.link; - } - - @override - Widget build(BuildContext context) { - return Form( - key: _formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: const Text('Test sign in with email and link'), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - TextFormField( - controller: _emailController, - decoration: InputDecoration(labelText: 'Email'), - validator: (String value) { - if (value.isEmpty) { - return 'Please enter your email.'; - } - return null; - }, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - if (_formKey.currentState.validate()) { - _signInWithEmailAndLink(); - } - }, - child: const Text('Submit'), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - _success == null - ? '' - : (_success - ? 'Successfully signed in, uid: ' + _userID - : 'Sign in failed'), - style: TextStyle(color: Colors.red), - ), - ) - ], - ), - ); - } - - Future _signInWithEmailAndLink() async { - _userEmail = _emailController.text; - - return await _auth.sendSignInWithEmailLink( - email: _userEmail, - url: '', - handleCodeInApp: true, - iOSBundleID: 'io.flutter.plugins.firebaseAuthExample', - androidPackageName: 'io.flutter.plugins.firebaseauthexample', - androidInstallIfNotAvailable: true, - androidMinimumVersion: "1", - ); - } -} - -class _AnonymouslySignInSection extends StatefulWidget { - @override - State createState() => _AnonymouslySignInSectionState(); -} - -class _AnonymouslySignInSectionState extends State<_AnonymouslySignInSection> { - bool _success; - String _userID; - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: const Text('Test sign in anonymously'), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - _signInAnonymously(); - }, - child: const Text('Sign in anonymously'), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - _success == null - ? '' - : (_success - ? 'Successfully signed in, uid: ' + _userID - : 'Sign in failed'), - style: TextStyle(color: Colors.red), - ), - ) - ], - ); - } - - // Example code of how to sign in anonymously. - void _signInAnonymously() async { - final FirebaseUser user = (await _auth.signInAnonymously()).user; - assert(user != null); - assert(user.isAnonymous); - assert(!user.isEmailVerified); - assert(await user.getIdToken() != null); - if (Platform.isIOS) { - // Anonymous auth doesn't show up as a provider on iOS - assert(user.providerData.isEmpty); - } else if (Platform.isAndroid) { - // Anonymous auth does show up as a provider on Android - assert(user.providerData.length == 1); - assert(user.providerData[0].providerId == 'firebase'); - assert(user.providerData[0].uid != null); - assert(user.providerData[0].displayName == null); - assert(user.providerData[0].photoUrl == null); - assert(user.providerData[0].email == null); - } - - final FirebaseUser currentUser = await _auth.currentUser(); - assert(user.uid == currentUser.uid); - setState(() { - if (user != null) { - _success = true; - _userID = user.uid; - } else { - _success = false; - } - }); - } -} - -class _GoogleSignInSection extends StatefulWidget { - @override - State createState() => _GoogleSignInSectionState(); -} - -class _GoogleSignInSectionState extends State<_GoogleSignInSection> { - bool _success; - String _userID; - @override - Widget build(BuildContext context) { - return Column( - children: [ - Container( - child: const Text('Test sign in with Google'), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - _signInWithGoogle(); - }, - child: const Text('Sign in with Google'), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - _success == null - ? '' - : (_success - ? 'Successfully signed in, uid: ' + _userID - : 'Sign in failed'), - style: TextStyle(color: Colors.red), - ), - ) - ], - ); - } - - // Example code of how to sign in with google. - void _signInWithGoogle() async { - final GoogleSignInAccount googleUser = await _googleSignIn.signIn(); - final GoogleSignInAuthentication googleAuth = - await googleUser.authentication; - final AuthCredential credential = GoogleAuthProvider.getCredential( - accessToken: googleAuth.accessToken, - idToken: googleAuth.idToken, - ); - final FirebaseUser user = - (await _auth.signInWithCredential(credential)).user; - assert(user.email != null); - assert(user.displayName != null); - assert(!user.isAnonymous); - assert(await user.getIdToken() != null); - - final FirebaseUser currentUser = await _auth.currentUser(); - assert(user.uid == currentUser.uid); - setState(() { - if (user != null) { - _success = true; - _userID = user.uid; - } else { - _success = false; - } - }); - } -} - -class _PhoneSignInSection extends StatefulWidget { - _PhoneSignInSection(this._scaffold); - - final ScaffoldState _scaffold; - @override - State createState() => _PhoneSignInSectionState(); -} - -class _PhoneSignInSectionState extends State<_PhoneSignInSection> { - final TextEditingController _phoneNumberController = TextEditingController(); - final TextEditingController _smsController = TextEditingController(); - - String _message = ''; - String _verificationId; - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: const Text('Test sign in with phone number'), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - TextFormField( - controller: _phoneNumberController, - decoration: - InputDecoration(labelText: 'Phone number (+x xxx-xxx-xxxx)'), - validator: (String value) { - if (value.isEmpty) { - return 'Phone number (+x xxx-xxx-xxxx)'; - } - return null; - }, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - _verifyPhoneNumber(); - }, - child: const Text('Verify phone number'), - ), - ), - TextField( - controller: _smsController, - decoration: InputDecoration(labelText: 'Verification code'), - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - _signInWithPhoneNumber(); - }, - child: const Text('Sign in with phone number'), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - _message, - style: TextStyle(color: Colors.red), - ), - ) - ], - ); - } - - // Example code of how to verify phone number - void _verifyPhoneNumber() async { - setState(() { - _message = ''; - }); - final PhoneVerificationCompleted verificationCompleted = - (AuthCredential phoneAuthCredential) { - _auth.signInWithCredential(phoneAuthCredential); - setState(() { - _message = 'Received phone auth credential: $phoneAuthCredential'; - }); - }; - - final PhoneVerificationFailed verificationFailed = - (AuthException authException) { - setState(() { - _message = - 'Phone number verification failed. Code: ${authException.code}. Message: ${authException.message}'; - }); - }; - - final PhoneCodeSent codeSent = - (String verificationId, [int forceResendingToken]) async { - widget._scaffold.showSnackBar(SnackBar( - content: - const Text('Please check your phone for the verification code.'), - )); - _verificationId = verificationId; - }; - - final PhoneCodeAutoRetrievalTimeout codeAutoRetrievalTimeout = - (String verificationId) { - _verificationId = verificationId; - }; - - await _auth.verifyPhoneNumber( - phoneNumber: _phoneNumberController.text, - timeout: const Duration(seconds: 5), - verificationCompleted: verificationCompleted, - verificationFailed: verificationFailed, - codeSent: codeSent, - codeAutoRetrievalTimeout: codeAutoRetrievalTimeout); - } - - // Example code of how to sign in with phone. - void _signInWithPhoneNumber() async { - final AuthCredential credential = PhoneAuthProvider.getCredential( - verificationId: _verificationId, - smsCode: _smsController.text, - ); - final FirebaseUser user = - (await _auth.signInWithCredential(credential)).user; - final FirebaseUser currentUser = await _auth.currentUser(); - assert(user.uid == currentUser.uid); - setState(() { - if (user != null) { - _message = 'Successfully signed in, uid: ' + user.uid; - } else { - _message = 'Sign in failed'; - } - }); - } -} - -class _OtherProvidersSignInSection extends StatefulWidget { - _OtherProvidersSignInSection(); - - @override - State createState() => _OtherProvidersSignInSectionState(); -} - -class _OtherProvidersSignInSectionState - extends State<_OtherProvidersSignInSection> { - final TextEditingController _tokenController = TextEditingController(); - final TextEditingController _tokenSecretController = TextEditingController(); - - String _message = ''; - int _selection = 0; - bool _showAuthSecretTextField = false; - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: const Text( - 'Test other providers authentication. (We do not provide an API to obtain the token for below providers. Please use a third party service to obtain token for below providers.)'), - padding: const EdgeInsets.all(16), - alignment: Alignment.center, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Radio( - value: 0, - groupValue: _selection, - onChanged: _handleRadioButtonSelected, - ), - Text( - 'Github', - style: TextStyle(fontSize: 16.0), - ), - Radio( - value: 1, - groupValue: _selection, - onChanged: _handleRadioButtonSelected, - ), - Text( - 'Facebook', - style: TextStyle( - fontSize: 16.0, - ), - ), - Radio( - value: 2, - groupValue: _selection, - onChanged: _handleRadioButtonSelected, - ), - Text( - 'Twitter', - style: TextStyle(fontSize: 16.0), - ), - ], - ), - ), - TextField( - controller: _tokenController, - decoration: InputDecoration(labelText: 'Enter provider\'s token'), - ), - Container( - child: _showAuthSecretTextField - ? TextField( - controller: _tokenSecretController, - decoration: InputDecoration( - labelText: 'Enter provider\'s authTokenSecret'), - ) - : null, - ), - Container( - padding: const EdgeInsets.symmetric(vertical: 16.0), - alignment: Alignment.center, - child: RaisedButton( - onPressed: () async { - _signInWithOtherProvider(); - }, - child: const Text('Sign in'), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Text( - _message, - style: TextStyle(color: Colors.red), - ), - ) - ], - ); - } - - void _handleRadioButtonSelected(int value) { - setState(() { - _selection = value; - if (_selection == 2) { - _showAuthSecretTextField = true; - } else { - _showAuthSecretTextField = false; - } - }); - } - - void _signInWithOtherProvider() { - switch (_selection) { - case 0: - _signInWithGithub(); - break; - case 1: - _signInWithFacebook(); - break; - case 2: - _signInWithTwitter(); - break; - default: - } - } - - // Example code of how to sign in with Github. - void _signInWithGithub() async { - final AuthCredential credential = GithubAuthProvider.getCredential( - token: _tokenController.text, - ); - final FirebaseUser user = - (await _auth.signInWithCredential(credential)).user; - assert(user.email != null); - assert(user.displayName != null); - assert(!user.isAnonymous); - assert(await user.getIdToken() != null); - - final FirebaseUser currentUser = await _auth.currentUser(); - assert(user.uid == currentUser.uid); - setState(() { - if (user != null) { - _message = 'Successfully signed in with Github. ' + user.uid; - } else { - _message = 'Failed to sign in with Github. '; - } - }); - } - - // Example code of how to sign in with Facebook. - void _signInWithFacebook() async { - final AuthCredential credential = FacebookAuthProvider.getCredential( - accessToken: _tokenController.text, - ); - final FirebaseUser user = - (await _auth.signInWithCredential(credential)).user; - assert(user.email != null); - assert(user.displayName != null); - assert(!user.isAnonymous); - assert(await user.getIdToken() != null); - - final FirebaseUser currentUser = await _auth.currentUser(); - assert(user.uid == currentUser.uid); - setState(() { - if (user != null) { - _message = 'Successfully signed in with Facebook. ' + user.uid; - } else { - _message = 'Failed to sign in with Facebook. '; - } - }); - } - - // Example code of how to sign in with Twitter. - void _signInWithTwitter() async { - final AuthCredential credential = TwitterAuthProvider.getCredential( - authToken: _tokenController.text, - authTokenSecret: _tokenSecretController.text); - final FirebaseUser user = - (await _auth.signInWithCredential(credential)).user; - assert(user.email != null); - assert(user.displayName != null); - assert(!user.isAnonymous); - assert(await user.getIdToken() != null); - - final FirebaseUser currentUser = await _auth.currentUser(); - assert(user.uid == currentUser.uid); - setState(() { - if (user != null) { - _message = 'Successfully signed in with Twitter. ' + user.uid; - } else { - _message = 'Failed to sign in with Twitter. '; - } - }); - } -} diff --git a/packages/firebase_auth/example/pubspec.yaml b/packages/firebase_auth/example/pubspec.yaml deleted file mode 100755 index 9478c9b1f34f..000000000000 --- a/packages/firebase_auth/example/pubspec.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: firebase_auth_example -description: Demonstrates how to use the firebase_auth plugin. -author: Flutter Team - -dependencies: - flutter: - sdk: flutter - firebase_auth: - path: ../ - google_sign_in: ^4.0.0 - firebase_core: ^0.4.0+8 - firebase_dynamic_links: ^0.3.0 - uuid: ^2.0.2 - -dev_dependencies: - flutter_driver: - sdk: flutter - test: any - -flutter: - uses-material-design: true diff --git a/packages/firebase_auth/example/test/firebase_auth.dart b/packages/firebase_auth/example/test/firebase_auth.dart deleted file mode 100644 index ab969daaf2e4..000000000000 --- a/packages/firebase_auth/example/test/firebase_auth.dart +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flutter/services.dart'; -import 'package:uuid/uuid.dart'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$FirebaseAuth', () { - final FirebaseAuth auth = FirebaseAuth.instance; - - setUp(() async { - await auth.signOut(); - }); - - test('signInAnonymously', () async { - final AuthResult result = await auth.signInAnonymously(); - final FirebaseUser user = result.user; - final AdditionalUserInfo additionalUserInfo = result.additionalUserInfo; - expect(additionalUserInfo.username, isNull); - expect(additionalUserInfo.isNewUser, isNotNull); - expect(additionalUserInfo.profile, isNull); - // TODO(jackson): Fix behavior to be consistent across platforms - // https://github.com/firebase/firebase-ios-sdk/issues/3450 - expect( - additionalUserInfo.providerId == null || - additionalUserInfo.providerId == 'password', - isTrue); - expect(user.uid, isNotNull); - expect(user.isAnonymous, isTrue); - expect(user.metadata.creationTime.isAfter(DateTime(2018, 1, 1)), isTrue); - expect(user.metadata.creationTime.isBefore(DateTime.now()), isTrue); - final IdTokenResult tokenResult = await user.getIdToken(); - expect(tokenResult.token, isNotNull); - expect(tokenResult.expirationTime.isAfter(DateTime.now()), isTrue); - expect(tokenResult.authTime, isNotNull); - expect(tokenResult.issuedAtTime, isNotNull); - // TODO(jackson): Fix behavior to be consistent across platforms - // https://github.com/firebase/firebase-ios-sdk/issues/3445 - expect( - tokenResult.signInProvider == null || - tokenResult.signInProvider == 'anonymous', - isTrue); - expect(tokenResult.claims['provider_id'], 'anonymous'); - expect(tokenResult.claims['firebase']['sign_in_provider'], 'anonymous'); - expect(tokenResult.claims['user_id'], user.uid); - await auth.signOut(); - final FirebaseUser user2 = (await auth.signInAnonymously()).user; - expect(user2.uid, isNot(equals(user.uid))); - expect(user2.metadata.creationTime.isBefore(user.metadata.creationTime), - isFalse); - expect( - user2.metadata.lastSignInTime, equals(user2.metadata.creationTime)); - }); - - test('email auth', () async { - final String testEmail = 'testuser${Uuid().v4()}@example.com'; - final String testPassword = 'testpassword'; - AuthResult result = await auth.createUserWithEmailAndPassword( - email: testEmail, - password: testPassword, - ); - final FirebaseUser user = result.user; - expect(user.uid, isNotNull); - expect(user.isAnonymous, isFalse); - auth.signOut(); - final Future failedResult = auth.signInWithEmailAndPassword( - email: testEmail, - password: 'incorrect password', - ); - expect(failedResult, throwsA(isInstanceOf())); - result = await auth.signInWithEmailAndPassword( - email: testEmail, - password: testPassword, - ); - expect(result.user.uid, equals(user.uid)); - await user.delete(); - }); - - test('isSignInWithEmailLink', () async { - final String emailLink1 = 'https://www.example.com/action?mode=signIn&' - 'oobCode=oobCode&apiKey=API_KEY'; - final String emailLink2 = - 'https://www.example.com/action?mode=verifyEmail&' - 'oobCode=oobCode&apiKey=API_KEY'; - final String emailLink3 = 'https://www.example.com/action?mode=signIn'; - expect(await auth.isSignInWithEmailLink(emailLink1), true); - expect(await auth.isSignInWithEmailLink(emailLink2), false); - expect(await auth.isSignInWithEmailLink(emailLink3), false); - }); - }); -} diff --git a/packages/firebase_auth/example/test/firebase_auth_test.dart b/packages/firebase_auth/example/test/firebase_auth_test.dart deleted file mode 100644 index 2bc4ea19a1e7..000000000000 --- a/packages/firebase_auth/example/test/firebase_auth_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; - -import '../lib/main.dart'; - -void main() { - testWidgets('FirebaseAuth example widget test', (WidgetTester tester) async { - await tester.pumpWidget(MyApp()); - await tester.tap(find.text('Test registration')); - await tester.pumpAndSettle(); - expect(find.text('Registration'), findsOneWidget); - }); -} diff --git a/packages/firebase_auth/example/test_driver/firebase_auth_test.dart b/packages/firebase_auth/example/test_driver/firebase_auth_test.dart deleted file mode 100644 index db46258dfebe..000000000000 --- a/packages/firebase_auth/example/test_driver/firebase_auth_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_auth/ios/Assets/.gitkeep b/packages/firebase_auth/ios/Assets/.gitkeep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h b/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h deleted file mode 100644 index 1383a169fa81..000000000000 --- a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseAuthPlugin : NSObject -@end diff --git a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m b/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m deleted file mode 100644 index 28a3f3e18b03..000000000000 --- a/packages/firebase_auth/ios/Classes/FirebaseAuthPlugin.m +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseAuthPlugin.h" -#import "UserAgent.h" - -#import "Firebase/Firebase.h" - -static NSString *getFlutterErrorCode(NSError *error) { - NSString *code = [error userInfo][FIRAuthErrorUserInfoNameKey]; - if (code != nil) { - return code; - } - return [NSString stringWithFormat:@"ERROR_%d", (int)error.code]; -} - -NSDictionary *toDictionary(id userInfo) { - return @{ - @"providerId" : userInfo.providerID, - @"displayName" : userInfo.displayName ?: [NSNull null], - @"uid" : userInfo.uid ?: [NSNull null], - @"photoUrl" : userInfo.photoURL.absoluteString ?: [NSNull null], - @"email" : userInfo.email ?: [NSNull null], - @"phoneNumber" : userInfo.phoneNumber ?: [NSNull null], - }; -} - -@interface FLTFirebaseAuthPlugin () -@property(nonatomic, retain) NSMutableDictionary *authStateChangeListeners; -@property(nonatomic, retain) FlutterMethodChannel *channel; -@end - -@implementation FLTFirebaseAuthPlugin - -// Handles are ints used as indexes into the NSMutableDictionary of active observers -int nextHandle = 0; - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_auth" - binaryMessenger:[registrar messenger]]; - FLTFirebaseAuthPlugin *instance = [[FLTFirebaseAuthPlugin alloc] init]; - instance.channel = channel; - instance.authStateChangeListeners = [[NSMutableDictionary alloc] init]; - [registrar addApplicationDelegate:instance]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (FIRAuth *_Nullable)getAuth:(NSDictionary *)args { - NSString *appName = [args objectForKey:@"app"]; - return [FIRAuth authWithApp:[FIRApp appNamed:appName]]; -} - -- (bool)application:(UIApplication *)application - didReceiveRemoteNotification:(NSDictionary *)notification - fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - if ([[FIRAuth auth] canHandleNotification:notification]) { - completionHandler(UIBackgroundFetchResultNoData); - return YES; - } - return NO; -} - -- (void)application:(UIApplication *)application - didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeProd]; -} - -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - return [[FIRAuth auth] canHandleURL:url]; -} - -// TODO(jackson): We should use the renamed versions of the following methods -// when they are available in the Firebase SDK that this plugin is dependent on. -// * fetchSignInMethodsForEmail:completion: -// * reauthenticateAndRetrieveDataWithCredential:completion: -// * linkAndRetrieveDataWithCredential:completion: -// * signInAndRetrieveDataWithCredential:completion: -// See discussion at https://github.com/flutter/plugins/pull/1487 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"currentUser" isEqualToString:call.method]) { - id __block listener = [[self getAuth:call.arguments] - addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, FIRUser *_Nullable user) { - [self sendResult:result forUser:user error:nil]; - [auth removeAuthStateDidChangeListener:listener]; - }]; - } else if ([@"signInAnonymously" isEqualToString:call.method]) { - [[self getAuth:call.arguments] - signInAnonymouslyWithCompletion:^(FIRAuthDataResult *authResult, NSError *error) { - [self sendResult:result forAuthDataResult:authResult error:error]; - }]; - } else if ([@"signInWithCredential" isEqualToString:call.method]) { - [[self getAuth:call.arguments] - signInAndRetrieveDataWithCredential:[self getCredential:call.arguments] - completion:^(FIRAuthDataResult *authResult, NSError *error) { - [self sendResult:result - forAuthDataResult:authResult - error:error]; - }]; - } else if ([@"createUserWithEmailAndPassword" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - NSString *password = call.arguments[@"password"]; - [[self getAuth:call.arguments] - createUserWithEmail:email - password:password - completion:^(FIRAuthDataResult *authResult, NSError *error) { - [self sendResult:result forAuthDataResult:authResult error:error]; - }]; - } else if ([@"fetchSignInMethodsForEmail" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - [[self getAuth:call.arguments] - fetchProvidersForEmail:email - completion:^(NSArray *providers, NSError *error) { - [self sendResult:result forObject:providers error:error]; - }]; - } else if ([@"sendEmailVerification" isEqualToString:call.method]) { - [[self getAuth:call.arguments].currentUser - sendEmailVerificationWithCompletion:^(NSError *_Nullable error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"reload" isEqualToString:call.method]) { - [[self getAuth:call.arguments].currentUser reloadWithCompletion:^(NSError *_Nullable error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"delete" isEqualToString:call.method]) { - [[self getAuth:call.arguments].currentUser deleteWithCompletion:^(NSError *_Nullable error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"sendPasswordResetEmail" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - [[self getAuth:call.arguments] sendPasswordResetWithEmail:email - completion:^(NSError *error) { - [self sendResult:result - forObject:nil - error:error]; - }]; - } else if ([@"sendLinkToEmail" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - FIRActionCodeSettings *actionCodeSettings = [FIRActionCodeSettings new]; - actionCodeSettings.URL = [NSURL URLWithString:call.arguments[@"url"]]; - actionCodeSettings.handleCodeInApp = call.arguments[@"handleCodeInApp"]; - [actionCodeSettings setIOSBundleID:call.arguments[@"iOSBundleID"]]; - [actionCodeSettings setAndroidPackageName:call.arguments[@"androidPackageName"] - installIfNotAvailable:call.arguments[@"androidInstallIfNotAvailable"] - minimumVersion:call.arguments[@"androidMinimumVersion"]]; - [[self getAuth:call.arguments] sendSignInLinkToEmail:email - actionCodeSettings:actionCodeSettings - completion:^(NSError *_Nullable error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"isSignInWithEmailLink" isEqualToString:call.method]) { - NSString *link = call.arguments[@"link"]; - BOOL status = [[self getAuth:call.arguments] isSignInWithEmailLink:link]; - [self sendResult:result forObject:[NSNumber numberWithBool:status] error:nil]; - } else if ([@"signInWithEmailAndLink" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - NSString *link = call.arguments[@"link"]; - [[self getAuth:call.arguments] - signInWithEmail:email - link:link - completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error) { - [self sendResult:result forAuthDataResult:authResult error:error]; - }]; - } else if ([@"signInWithEmailAndPassword" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - NSString *password = call.arguments[@"password"]; - [[self getAuth:call.arguments] - signInWithEmail:email - password:password - completion:^(FIRAuthDataResult *authResult, NSError *error) { - [self sendResult:result forAuthDataResult:authResult error:error]; - }]; - } else if ([@"signOut" isEqualToString:call.method]) { - NSError *signOutError; - BOOL status = [[self getAuth:call.arguments] signOut:&signOutError]; - if (!status) { - NSLog(@"Error signing out: %@", signOutError); - [self sendResult:result forObject:nil error:signOutError]; - } else { - [self sendResult:result forObject:nil error:nil]; - } - } else if ([@"getIdToken" isEqualToString:call.method]) { - NSDictionary *args = call.arguments; - BOOL refresh = [args objectForKey:@"refresh"]; - [[self getAuth:call.arguments].currentUser - getIDTokenResultForcingRefresh:refresh - completion:^(FIRAuthTokenResult *_Nullable tokenResult, - NSError *_Nullable error) { - NSMutableDictionary *tokenData = nil; - if (tokenResult != nil) { - long expirationTimestamp = - [tokenResult.expirationDate timeIntervalSince1970]; - long authTimestamp = [tokenResult.authDate timeIntervalSince1970]; - long issuedAtTimestamp = - [tokenResult.issuedAtDate timeIntervalSince1970]; - - tokenData = [[NSMutableDictionary alloc] initWithDictionary:@{ - @"token" : tokenResult.token, - @"expirationTimestamp" : - [NSNumber numberWithLong:expirationTimestamp], - @"authTimestamp" : [NSNumber numberWithLong:authTimestamp], - @"issuedAtTimestamp" : - [NSNumber numberWithLong:issuedAtTimestamp], - @"claims" : tokenResult.claims, - }]; - - if (tokenResult.signInProvider != nil) { - tokenData[@"signInProvider"] = tokenResult.signInProvider; - } - } - - [self sendResult:result forObject:tokenData error:error]; - }]; - } else if ([@"reauthenticateWithCredential" isEqualToString:call.method]) { - [[self getAuth:call.arguments].currentUser - reauthenticateAndRetrieveDataWithCredential:[self getCredential:call.arguments] - completion:^(FIRAuthDataResult *r, - NSError *_Nullable error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"linkWithCredential" isEqualToString:call.method]) { - [[self getAuth:call.arguments].currentUser - linkAndRetrieveDataWithCredential:[self getCredential:call.arguments] - completion:^(FIRAuthDataResult *authResult, NSError *error) { - [self sendResult:result forAuthDataResult:authResult error:error]; - }]; - } else if ([@"unlinkFromProvider" isEqualToString:call.method]) { - NSString *provider = call.arguments[@"provider"]; - [[self getAuth:call.arguments].currentUser - unlinkFromProvider:provider - completion:^(FIRUser *_Nullable user, NSError *_Nullable error) { - [self sendResult:result forUser:user error:error]; - }]; - } else if ([@"updateEmail" isEqualToString:call.method]) { - NSString *email = call.arguments[@"email"]; - [[self getAuth:call.arguments].currentUser updateEmail:email - completion:^(NSError *error) { - [self sendResult:result - forObject:nil - error:error]; - }]; - } else if ([@"updatePhoneNumberCredential" isEqualToString:call.method]) { - FIRPhoneAuthCredential *credential = - (FIRPhoneAuthCredential *)[self getCredential:call.arguments]; - [[self getAuth:call.arguments].currentUser - updatePhoneNumberCredential:credential - completion:^(NSError *_Nullable error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"updatePassword" isEqualToString:call.method]) { - NSString *password = call.arguments[@"password"]; - [[self getAuth:call.arguments].currentUser updatePassword:password - completion:^(NSError *error) { - [self sendResult:result - forObject:nil - error:error]; - }]; - } else if ([@"updateProfile" isEqualToString:call.method]) { - FIRUserProfileChangeRequest *changeRequest = - [[self getAuth:call.arguments].currentUser profileChangeRequest]; - if (call.arguments[@"displayName"]) { - changeRequest.displayName = call.arguments[@"displayName"]; - } - if (call.arguments[@"photoUrl"]) { - changeRequest.photoURL = [NSURL URLWithString:call.arguments[@"photoUrl"]]; - } - [changeRequest commitChangesWithCompletion:^(NSError *error) { - [self sendResult:result forObject:nil error:error]; - }]; - } else if ([@"signInWithCustomToken" isEqualToString:call.method]) { - NSString *token = call.arguments[@"token"]; - [[self getAuth:call.arguments] - signInWithCustomToken:token - completion:^(FIRAuthDataResult *authResult, NSError *error) { - [self sendResult:result forAuthDataResult:authResult error:error]; - }]; - - } else if ([@"startListeningAuthState" isEqualToString:call.method]) { - NSNumber *identifier = [NSNumber numberWithInteger:nextHandle++]; - - FIRAuthStateDidChangeListenerHandle listener = [[self getAuth:call.arguments] - addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, FIRUser *_Nullable user) { - NSMutableDictionary *response = [[NSMutableDictionary alloc] init]; - response[@"id"] = identifier; - if (user) { - response[@"user"] = [self dictionaryFromUser:user]; - } - [self.channel invokeMethod:@"onAuthStateChanged" arguments:response]; - }]; - [self.authStateChangeListeners setObject:listener forKey:identifier]; - result(identifier); - } else if ([@"stopListeningAuthState" isEqualToString:call.method]) { - NSNumber *identifier = - [NSNumber numberWithInteger:[call.arguments[@"id"] unsignedIntegerValue]]; - - FIRAuthStateDidChangeListenerHandle listener = self.authStateChangeListeners[identifier]; - if (listener) { - [[self getAuth:call.arguments] - removeAuthStateDidChangeListener:self.authStateChangeListeners]; - [self.authStateChangeListeners removeObjectForKey:identifier]; - result(nil); - } else { - result([FlutterError - errorWithCode:@"ERROR_LISTENER_NOT_FOUND" - message:[NSString stringWithFormat:@"Listener with identifier '%d' not found.", - identifier.intValue] - details:nil]); - } - } else if ([@"verifyPhoneNumber" isEqualToString:call.method]) { - NSString *phoneNumber = call.arguments[@"phoneNumber"]; - NSNumber *handle = call.arguments[@"handle"]; - [[FIRPhoneAuthProvider provider] - verifyPhoneNumber:phoneNumber - UIDelegate:nil - completion:^(NSString *verificationID, NSError *error) { - if (error) { - [self.channel invokeMethod:@"phoneVerificationFailed" - arguments:@{ - @"exception" : [self mapVerifyPhoneError:error], - @"handle" : handle - }]; - } else { - [self.channel - invokeMethod:@"phoneCodeSent" - arguments:@{@"verificationId" : verificationID, @"handle" : handle}]; - } - }]; - result(nil); - } else if ([@"signInWithPhoneNumber" isEqualToString:call.method]) { - NSString *verificationId = call.arguments[@"verificationId"]; - NSString *smsCode = call.arguments[@"smsCode"]; - - FIRPhoneAuthCredential *credential = - [[FIRPhoneAuthProvider provider] credentialWithVerificationID:verificationId - verificationCode:smsCode]; - [[self getAuth:call.arguments] - signInAndRetrieveDataWithCredential:credential - completion:^(FIRAuthDataResult *authResult, - NSError *_Nullable error) { - [self sendResult:result - forAuthDataResult:authResult - error:error]; - }]; - } else if ([@"setLanguageCode" isEqualToString:call.method]) { - NSString *language = call.arguments[@"language"]; - [[self getAuth:call.arguments] setLanguageCode:language]; - [self sendResult:result forObject:nil error:nil]; - } else { - result(FlutterMethodNotImplemented); - } -} - -- (NSMutableDictionary *)dictionaryFromUser:(FIRUser *)user { - NSMutableArray *> *providerData = - [NSMutableArray arrayWithCapacity:user.providerData.count]; - for (id userInfo in user.providerData) { - [providerData addObject:toDictionary(userInfo)]; - } - - long creationDate = [user.metadata.creationDate timeIntervalSince1970] * 1000; - long lastSignInDate = [user.metadata.lastSignInDate timeIntervalSince1970] * 1000; - - NSMutableDictionary *userData = [toDictionary(user) mutableCopy]; - userData[@"creationTimestamp"] = [NSNumber numberWithLong:creationDate]; - userData[@"lastSignInTimestamp"] = [NSNumber numberWithLong:lastSignInDate]; - userData[@"isAnonymous"] = [NSNumber numberWithBool:user.isAnonymous]; - userData[@"isEmailVerified"] = [NSNumber numberWithBool:user.isEmailVerified]; - userData[@"providerData"] = providerData; - return userData; -} -#pragma clang diagnostic pop - -- (void)sendResult:(FlutterResult)result - forAuthDataResult:(FIRAuthDataResult *)authResult - error:(NSError *)error { - FIRUser *user = authResult.user; - FIRAdditionalUserInfo *additionalUserInfo = authResult.additionalUserInfo; - [self sendResult:result - forObject:@{ - @"user" : (user != nil ? [self dictionaryFromUser:user] : [NSNull null]), - @"additionalUserInfo" : additionalUserInfo ? @{ - @"isNewUser" : [NSNumber numberWithBool:additionalUserInfo.isNewUser], - @"username" : additionalUserInfo.username ?: [NSNull null], - @"providerId" : additionalUserInfo.providerID ?: [NSNull null], - @"profile" : additionalUserInfo.profile ?: [NSNull null], - } - : [NSNull null], - } - error:error]; -} - -- (void)sendResult:(FlutterResult)result forUser:(FIRUser *)user error:(NSError *)error { - [self sendResult:result - forObject:(user != nil ? [self dictionaryFromUser:user] : nil) - error:error]; -} - -- (void)sendResult:(FlutterResult)result forObject:(NSObject *)object error:(NSError *)error { - if (error != nil) { - result([FlutterError errorWithCode:getFlutterErrorCode(error) - message:error.localizedDescription - details:nil]); - } else if (object == nil) { - result(nil); - } else { - result(object); - } -} - -- (id)mapVerifyPhoneError:(NSError *)error { - NSString *errorCode = @"verifyPhoneNumberError"; - - if (error.code == FIRAuthErrorCodeCaptchaCheckFailed) { - errorCode = @"captchaCheckFailed"; - } else if (error.code == FIRAuthErrorCodeQuotaExceeded) { - errorCode = @"quotaExceeded"; - } else if (error.code == FIRAuthErrorCodeInvalidPhoneNumber) { - errorCode = @"invalidPhoneNumber"; - } else if (error.code == FIRAuthErrorCodeMissingPhoneNumber) { - errorCode = @"missingPhoneNumber"; - } - return @{@"code" : errorCode, @"message" : error.localizedDescription}; -} - -- (FIRAuthCredential *)getCredential:(NSDictionary *)arguments { - NSString *provider = arguments[@"provider"]; - NSDictionary *data = arguments[@"data"]; - FIRAuthCredential *credential; - if ([FIREmailAuthProviderID isEqualToString:provider]) { - NSString *email = data[@"email"]; - if ([data objectForKey:@"password"]) { - NSString *password = data[@"password"]; - credential = [FIREmailAuthProvider credentialWithEmail:email password:password]; - } else { - NSString *link = data[@"link"]; - credential = [FIREmailAuthProvider credentialWithEmail:email link:link]; - } - } else if ([FIRGoogleAuthProviderID isEqualToString:provider]) { - NSString *idToken = data[@"idToken"]; - NSString *accessToken = data[@"accessToken"]; - credential = [FIRGoogleAuthProvider credentialWithIDToken:idToken accessToken:accessToken]; - } else if ([FIRFacebookAuthProviderID isEqualToString:provider]) { - NSString *accessToken = data[@"accessToken"]; - credential = [FIRFacebookAuthProvider credentialWithAccessToken:accessToken]; - } else if ([FIRTwitterAuthProviderID isEqualToString:provider]) { - NSString *authToken = data[@"authToken"]; - NSString *authTokenSecret = data[@"authTokenSecret"]; - credential = [FIRTwitterAuthProvider credentialWithToken:authToken secret:authTokenSecret]; - } else if ([FIRGitHubAuthProviderID isEqualToString:provider]) { - NSString *token = data[@"token"]; - credential = [FIRGitHubAuthProvider credentialWithToken:token]; - } else if ([FIRPhoneAuthProviderID isEqualToString:provider]) { - NSString *verificationId = data[@"verificationId"]; - NSString *smsCode = data[@"smsCode"]; - credential = [[FIRPhoneAuthProvider providerWithAuth:[self getAuth:arguments]] - credentialWithVerificationID:verificationId - verificationCode:smsCode]; - } else { - NSLog(@"Support for an auth provider with identifier '%@' is not implemented.", provider); - } - return credential; -} -@end diff --git a/packages/firebase_auth/ios/firebase_auth.podspec b/packages/firebase_auth/ios/firebase_auth.podspec deleted file mode 100755 index 760e8bd85bc2..000000000000 --- a/packages/firebase_auth/ios/firebase_auth.podspec +++ /dev/null @@ -1,33 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_auth' - s.version = '0.0.1' - s.summary = 'Firebase Auth plugin for Flutter.' - s.description = <<-DESC -Firebase Auth plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_auth' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/Auth', '~> 6.0' - s.dependency 'Firebase/Core' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-auth\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_auth/lib/firebase_auth.dart b/packages/firebase_auth/lib/firebase_auth.dart deleted file mode 100755 index 5eff0e4ae27d..000000000000 --- a/packages/firebase_auth/lib/firebase_auth.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_auth; - -import 'dart:async'; - -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -part 'src/auth_provider/email_auth_provider.dart'; -part 'src/auth_provider/facebook_auth_provider.dart'; -part 'src/auth_provider/github_auth_provider.dart'; -part 'src/auth_provider/google_auth_provider.dart'; -part 'src/auth_provider/phone_auth_provider.dart'; -part 'src/auth_provider/twitter_auth_provider.dart'; -part 'src/additional_user_info.dart'; -part 'src/auth_credential.dart'; -part 'src/auth_exception.dart'; -part 'src/auth_result.dart'; -part 'src/firebase_auth.dart'; -part 'src/firebase_user.dart'; -part 'src/id_token_result.dart'; -part 'src/user_info.dart'; -part 'src/user_metadata.dart'; -part 'src/user_update_info.dart'; diff --git a/packages/firebase_auth/lib/src/additional_user_info.dart b/packages/firebase_auth/lib/src/additional_user_info.dart deleted file mode 100644 index 2fb0f7707fc4..000000000000 --- a/packages/firebase_auth/lib/src/additional_user_info.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Interface representing a user's additional information -class AdditionalUserInfo { - AdditionalUserInfo._(this._data); - - final Map _data; - - /// Returns whether the user is new or existing - bool get isNewUser => _data['isNewUser']; - - /// Returns the username if the provider is GitHub or Twitter - String get username => _data['username']; - - /// Returns the provider ID for specifying which provider the - /// information in [profile] is for. - String get providerId => _data['providerId']; - - /// Returns a Map containing IDP-specific user data if the provider - /// is one of Facebook, GitHub, Google, Twitter, Microsoft, or Yahoo. - Map get profile => _data['profile']?.cast(); -} diff --git a/packages/firebase_auth/lib/src/auth_credential.dart b/packages/firebase_auth/lib/src/auth_credential.dart deleted file mode 100644 index cf9e943e2e4d..000000000000 --- a/packages/firebase_auth/lib/src/auth_credential.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Represents the credentials returned by calling the `getCredential` method of -/// an auth provider. -class AuthCredential { - AuthCredential._(this._provider, this._data); - final String _provider; - final Map _data; -} diff --git a/packages/firebase_auth/lib/src/auth_exception.dart b/packages/firebase_auth/lib/src/auth_exception.dart deleted file mode 100644 index bbdc746fe40c..000000000000 --- a/packages/firebase_auth/lib/src/auth_exception.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Generic exception related to Firebase Authentication. -/// Check the error code and message for more details. -class AuthException implements Exception { - const AuthException(this.code, this.message); - - final String code; - final String message; -} diff --git a/packages/firebase_auth/lib/src/auth_provider/email_auth_provider.dart b/packages/firebase_auth/lib/src/auth_provider/email_auth_provider.dart deleted file mode 100644 index 1187923abffc..000000000000 --- a/packages/firebase_auth/lib/src/auth_provider/email_auth_provider.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -class EmailAuthProvider { - static const String providerId = 'password'; - - static AuthCredential getCredential({ - String email, - String password, - }) { - return AuthCredential._(providerId, { - 'email': email, - 'password': password, - }); - } - - static AuthCredential getCredentialWithLink({ - String email, - String link, - }) { - return AuthCredential._(providerId, { - 'email': email, - 'link': link, - }); - } -} diff --git a/packages/firebase_auth/lib/src/auth_provider/facebook_auth_provider.dart b/packages/firebase_auth/lib/src/auth_provider/facebook_auth_provider.dart deleted file mode 100644 index 5f1a4f0866bd..000000000000 --- a/packages/firebase_auth/lib/src/auth_provider/facebook_auth_provider.dart +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -class FacebookAuthProvider { - static const String providerId = 'facebook.com'; - - static AuthCredential getCredential({String accessToken}) { - return AuthCredential._( - providerId, - {'accessToken': accessToken}, - ); - } -} diff --git a/packages/firebase_auth/lib/src/auth_provider/github_auth_provider.dart b/packages/firebase_auth/lib/src/auth_provider/github_auth_provider.dart deleted file mode 100644 index 448862f22528..000000000000 --- a/packages/firebase_auth/lib/src/auth_provider/github_auth_provider.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -class GithubAuthProvider { - static const String providerId = 'github.com'; - - static AuthCredential getCredential({@required String token}) { - return AuthCredential._(providerId, {'token': token}); - } -} diff --git a/packages/firebase_auth/lib/src/auth_provider/google_auth_provider.dart b/packages/firebase_auth/lib/src/auth_provider/google_auth_provider.dart deleted file mode 100644 index 4dca135291f5..000000000000 --- a/packages/firebase_auth/lib/src/auth_provider/google_auth_provider.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -class GoogleAuthProvider { - static const String providerId = 'google.com'; - - static AuthCredential getCredential({ - @required String idToken, - @required String accessToken, - }) { - return AuthCredential._(providerId, { - 'idToken': idToken, - 'accessToken': accessToken, - }); - } -} diff --git a/packages/firebase_auth/lib/src/auth_provider/phone_auth_provider.dart b/packages/firebase_auth/lib/src/auth_provider/phone_auth_provider.dart deleted file mode 100644 index 95055e1f80ba..000000000000 --- a/packages/firebase_auth/lib/src/auth_provider/phone_auth_provider.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -class PhoneAuthProvider { - static const String providerId = 'phone'; - - static AuthCredential getCredential({ - @required String verificationId, - @required String smsCode, - }) { - return AuthCredential._(providerId, { - 'verificationId': verificationId, - 'smsCode': smsCode, - }); - } - - // PhoneAuthProvider uses JSON serialization on Android when the SMS code was - // detected automatically. - static AuthCredential _getCredentialFromObject({ - @required String jsonObject, - }) { - return AuthCredential._(providerId, { - "jsonObject": jsonObject, - }); - } -} diff --git a/packages/firebase_auth/lib/src/auth_provider/twitter_auth_provider.dart b/packages/firebase_auth/lib/src/auth_provider/twitter_auth_provider.dart deleted file mode 100644 index 9b349ccf6fb4..000000000000 --- a/packages/firebase_auth/lib/src/auth_provider/twitter_auth_provider.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -class TwitterAuthProvider { - static const String providerId = 'twitter.com'; - - static AuthCredential getCredential({ - @required String authToken, - @required String authTokenSecret, - }) { - return AuthCredential._(providerId, { - 'authToken': authToken, - 'authTokenSecret': authTokenSecret, - }); - } -} diff --git a/packages/firebase_auth/lib/src/auth_result.dart b/packages/firebase_auth/lib/src/auth_result.dart deleted file mode 100644 index dd003dac0791..000000000000 --- a/packages/firebase_auth/lib/src/auth_result.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Result object obtained from operations that can affect the authentication -/// state. Contains a method that returns the currently signed-in user after -/// the operation has completed. -class AuthResult { - AuthResult._(this._data, FirebaseApp app) - : user = FirebaseUser._(_data['user'].cast(), app); - - final Map _data; - - /// Returns the currently signed-in [FirebaseUser], or `null` if there isn't - /// any (i.e. the user is signed out). - final FirebaseUser user; - - /// Returns IDP-specific information for the user if the provider is one of - /// Facebook, Github, Google, or Twitter. - AdditionalUserInfo get additionalUserInfo => - _data['additionalUserInfo'] == null - ? null - : AdditionalUserInfo._(_data['additionalUserInfo']); - - @override - String toString() { - return '$runtimeType($_data)'; - } -} diff --git a/packages/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/lib/src/firebase_auth.dart deleted file mode 100644 index 8f0c30a13544..000000000000 --- a/packages/firebase_auth/lib/src/firebase_auth.dart +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -typedef void PhoneVerificationCompleted(AuthCredential phoneAuthCredential); -typedef void PhoneVerificationFailed(AuthException error); -typedef void PhoneCodeSent(String verificationId, [int forceResendingToken]); -typedef void PhoneCodeAutoRetrievalTimeout(String verificationId); - -/// The entry point of the Firebase Authentication SDK. -class FirebaseAuth { - FirebaseAuth._(this.app) { - channel.setMethodCallHandler(_callHandler); - } - - /// Provides an instance of this class corresponding to `app`. - factory FirebaseAuth.fromApp(FirebaseApp app) { - assert(app != null); - return FirebaseAuth._(app); - } - - /// Provides an instance of this class corresponding to the default app. - static final FirebaseAuth instance = FirebaseAuth._(FirebaseApp.instance); - - @visibleForTesting - static const MethodChannel channel = MethodChannel( - 'plugins.flutter.io/firebase_auth', - ); - - final Map> _authStateChangedControllers = - >{}; - - static int _nextHandle = 0; - final Map> _phoneAuthCallbacks = - >{}; - - final FirebaseApp app; - - /// Receive [FirebaseUser] each time the user signIn or signOut - Stream get onAuthStateChanged { - Future _handle; - - StreamController controller; - controller = StreamController.broadcast(onListen: () { - _handle = channel.invokeMethod('startListeningAuthState', - {"app": app.name}).then((dynamic v) => v); - _handle.then((int handle) { - _authStateChangedControllers[handle] = controller; - }); - }, onCancel: () { - _handle.then((int handle) async { - await channel.invokeMethod("stopListeningAuthState", - {"id": handle, "app": app.name}); - _authStateChangedControllers.remove(handle); - }); - }); - - return controller.stream; - } - - /// Asynchronously creates and becomes an anonymous user. - /// - /// If there is already an anonymous user signed in, that user will be - /// returned instead. If there is any other existing user signed in, that - /// user will be signed out. - /// - /// **Important**: You must enable Anonymous accounts in the Auth section - /// of the Firebase console before being able to use them. - /// - /// Errors: - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. - Future signInAnonymously() async { - final Map data = await channel - .invokeMapMethod( - 'signInAnonymously', {"app": app.name}); - final AuthResult authResult = AuthResult._(data, app); - return authResult; - } - - /// Tries to create a new user account with the given email address and password. - /// - /// If successful, it also signs the user in into the app and updates - /// the [onAuthStateChanged] stream. - /// - /// Errors: - /// • `ERROR_WEAK_PASSWORD` - If the password is not strong enough. - /// • `ERROR_INVALID_EMAIL` - If the email address is malformed. - /// • `ERROR_EMAIL_ALREADY_IN_USE` - If the email is already in use by a different account. - Future createUserWithEmailAndPassword({ - @required String email, - @required String password, - }) async { - assert(email != null); - assert(password != null); - final Map data = - await channel.invokeMapMethod( - 'createUserWithEmailAndPassword', - {'email': email, 'password': password, 'app': app.name}, - ); - final AuthResult authResult = AuthResult._(data, app); - return authResult; - } - - /// Returns a list of sign-in methods that can be used to sign in a given - /// user (identified by its main email address). - /// - /// This method is useful when you support multiple authentication mechanisms - /// if you want to implement an email-first authentication flow. - /// - /// Errors: - /// • `ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed. - /// • `ERROR_USER_NOT_FOUND` - If there is no user corresponding to the given [email] address. - Future> fetchSignInMethodsForEmail({ - @required String email, - }) async { - assert(email != null); - return await channel.invokeListMethod( - 'fetchSignInMethodsForEmail', - {'email': email, 'app': app.name}, - ); - } - - /// Triggers the Firebase Authentication backend to send a password-reset - /// email to the given email address, which must correspond to an existing - /// user of your app. - /// - /// Errors: - /// • `ERROR_INVALID_EMAIL` - If the [email] address is malformed. - /// • `ERROR_USER_NOT_FOUND` - If there is no user corresponding to the given [email] address. - Future sendPasswordResetEmail({ - @required String email, - }) async { - assert(email != null); - return await channel.invokeMethod( - 'sendPasswordResetEmail', - {'email': email, 'app': app.name}, - ); - } - - /// Sends a sign in with email link to provided email address. - Future sendSignInWithEmailLink({ - @required String email, - @required String url, - @required bool handleCodeInApp, - @required String iOSBundleID, - @required String androidPackageName, - @required bool androidInstallIfNotAvailable, - @required String androidMinimumVersion, - }) async { - assert(email != null); - assert(url != null); - assert(handleCodeInApp != null); - assert(iOSBundleID != null); - assert(androidPackageName != null); - assert(androidInstallIfNotAvailable != null); - assert(androidMinimumVersion != null); - await channel.invokeMethod( - 'sendLinkToEmail', - { - 'email': email, - 'url': url, - 'handleCodeInApp': handleCodeInApp, - 'iOSBundleID': iOSBundleID, - 'androidPackageName': androidPackageName, - 'androidInstallIfNotAvailable': androidInstallIfNotAvailable, - 'androidMinimumVersion': androidMinimumVersion, - 'app': app.name, - }, - ); - } - - /// Checks if link is an email sign-in link. - Future isSignInWithEmailLink(String link) async { - return await channel.invokeMethod( - 'isSignInWithEmailLink', - {'link': link, 'app': app.name}, - ); - } - - /// Signs in using an email address and email sign-in link. - /// - /// Errors: - /// • `ERROR_NOT_ALLOWED` - Indicates that email and email sign-in link - /// accounts are not enabled. Enable them in the Auth section of the - /// Firebase console. - /// • `ERROR_DISABLED` - Indicates the user's account is disabled. - /// • `ERROR_INVALID` - Indicates the email address is invalid. - Future signInWithEmailAndLink({String email, String link}) async { - final Map data = - await channel.invokeMapMethod( - 'signInWithEmailAndLink', - { - 'app': app.name, - 'email': email, - 'link': link, - }, - ); - final AuthResult authResult = AuthResult._(data, app); - return authResult; - } - - /// Tries to sign in a user with the given email address and password. - /// - /// If successful, it also signs the user in into the app and updates - /// the [onAuthStateChanged] stream. - /// - /// **Important**: You must enable Email & Password accounts in the Auth - /// section of the Firebase console before being able to use them. - /// - /// Errors: - /// • `ERROR_INVALID_EMAIL` - If the [email] address is malformed. - /// • `ERROR_WRONG_PASSWORD` - If the [password] is wrong. - /// • `ERROR_USER_NOT_FOUND` - If there is no user corresponding to the given [email] address, or if the user has been deleted. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_TOO_MANY_REQUESTS` - If there was too many attempts to sign in as this user. - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Email & Password accounts are not enabled. - Future signInWithEmailAndPassword({ - @required String email, - @required String password, - }) { - assert(email != null); - assert(password != null); - final AuthCredential credential = EmailAuthProvider.getCredential( - email: email, - password: password, - ); - return signInWithCredential(credential); - } - - /// Asynchronously signs in to Firebase with the given 3rd-party credentials - /// (e.g. a Facebook login Access Token, a Google ID Token/Access Token pair, - /// etc.) and returns additional identity provider data. - /// - /// If successful, it also signs the user in into the app and updates - /// the [onAuthStateChanged] stream. - /// - /// If the user doesn't have an account already, one will be created automatically. - /// - /// **Important**: You must enable the relevant accounts in the Auth section - /// of the Firebase console before being able to use them. - /// - /// Errors: - /// • `ERROR_INVALID_CREDENTIAL` - If the credential data is malformed or has expired. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL` - If there already exists an account with the email address asserted by Google. - /// Resolve this case by calling [fetchSignInMethodsForEmail] and then asking the user to sign in using one of them. - /// This error will only be thrown if the "One account per email address" setting is enabled in the Firebase console (recommended). - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Google accounts are not enabled. - /// • `ERROR_INVALID_ACTION_CODE` - If the action code in the link is malformed, expired, or has already been used. - /// This can only occur when using [EmailAuthProvider.getCredentialWithLink] to obtain the credential. - Future signInWithCredential(AuthCredential credential) async { - assert(credential != null); - final Map data = - await channel.invokeMapMethod( - 'signInWithCredential', - { - 'app': app.name, - 'provider': credential._provider, - 'data': credential._data, - }, - ); - final AuthResult authResult = AuthResult._(data, app); - return authResult; - } - - /// Starts the phone number verification process for the given phone number. - /// - /// Either sends an SMS with a 6 digit code to the phone number specified, - /// or sign's the user in and [verificationCompleted] is called. - /// - /// No duplicated SMS will be sent out upon re-entry (before timeout). - /// - /// Make sure to test all scenarios below: - /// • You directly get logged in if Google Play Services verified the phone - /// number instantly or helped you auto-retrieve the verification code. - /// • Auto-retrieve verification code timed out. - /// • Error cases when you receive [verificationFailed] callback. - /// - /// [phoneNumber] The phone number for the account the user is signing up - /// for or signing into. Make sure to pass in a phone number with country - /// code prefixed with plus sign ('+'). - /// - /// [timeout] The maximum amount of time you are willing to wait for SMS - /// auto-retrieval to be completed by the library. Maximum allowed value - /// is 2 minutes. Use 0 to disable SMS-auto-retrieval. Setting this to 0 - /// will also cause [codeAutoRetrievalTimeout] to be called immediately. - /// If you specified a positive value less than 30 seconds, library will - /// default to 30 seconds. - /// - /// [forceResendingToken] The [forceResendingToken] obtained from [codeSent] - /// callback to force re-sending another verification SMS before the - /// auto-retrieval timeout. - /// - /// [verificationCompleted] This callback must be implemented. - /// It will trigger when an SMS is auto-retrieved or the phone number has - /// been instantly verified. The callback will receive an [AuthCredential] - /// that can be passed to [signInWithCredential] or [linkWithCredential]. - /// - /// [verificationFailed] This callback must be implemented. - /// Triggered when an error occurred during phone number verification. - /// - /// [codeSent] Optional callback. - /// It will trigger when an SMS has been sent to the users phone, - /// and will include a [verificationId] and [forceResendingToken]. - /// - /// [codeAutoRetrievalTimeout] Optional callback. - /// It will trigger when SMS auto-retrieval times out and provide a - /// [verificationId]. - Future verifyPhoneNumber({ - @required String phoneNumber, - @required Duration timeout, - int forceResendingToken, - @required PhoneVerificationCompleted verificationCompleted, - @required PhoneVerificationFailed verificationFailed, - @required PhoneCodeSent codeSent, - @required PhoneCodeAutoRetrievalTimeout codeAutoRetrievalTimeout, - }) async { - final Map callbacks = { - 'PhoneVerificationCompleted': verificationCompleted, - 'PhoneVerificationFailed': verificationFailed, - 'PhoneCodeSent': codeSent, - 'PhoneCodeAuthRetrievalTimeout': codeAutoRetrievalTimeout, - }; - _nextHandle += 1; - _phoneAuthCallbacks[_nextHandle] = callbacks; - - final Map params = { - 'handle': _nextHandle, - 'phoneNumber': phoneNumber, - 'timeout': timeout.inMilliseconds, - 'forceResendingToken': forceResendingToken, - 'app': app.name, - }; - - await channel.invokeMethod('verifyPhoneNumber', params); - } - - /// Tries to sign in a user with a given Custom Token [token]. - /// - /// If successful, it also signs the user in into the app and updates - /// the [onAuthStateChanged] stream. - /// - /// Use this method after you retrieve a Firebase Auth Custom Token from your server. - /// - /// If the user identified by the [uid] specified in the token doesn't - /// have an account already, one will be created automatically. - /// - /// Read how to use Custom Token authentication and the cases where it is - /// useful in [the guides](https://firebase.google.com/docs/auth/android/custom-auth). - /// - /// Errors: - /// • `ERROR_INVALID_CUSTOM_TOKEN` - The custom token format is incorrect. - /// Please check the documentation. - /// • `ERROR_CUSTOM_TOKEN_MISMATCH` - Invalid configuration. - /// Ensure your app's SHA1 is correct in the Firebase console. - Future signInWithCustomToken({@required String token}) async { - assert(token != null); - final Map data = - await channel.invokeMapMethod( - 'signInWithCustomToken', - {'token': token, 'app': app.name}, - ); - final AuthResult authResult = AuthResult._(data, app); - return authResult; - } - - /// Signs out the current user and clears it from the disk cache. - /// - /// If successful, it signs the user out of the app and updates - /// the [onAuthStateChanged] stream. - Future signOut() async { - return await channel - .invokeMethod("signOut", {'app': app.name}); - } - - /// Returns the currently signed-in [FirebaseUser] or [null] if there is none. - Future currentUser() async { - final Map data = await channel - .invokeMapMethod( - "currentUser", {'app': app.name}); - final FirebaseUser currentUser = - data == null ? null : FirebaseUser._(data, app); - return currentUser; - } - - /// Sets the user-facing language code for auth operations that can be - /// internationalized, such as [sendEmailVerification]. This language - /// code should follow the conventions defined by the IETF in BCP47. - Future setLanguageCode(String language) async { - assert(language != null); - await FirebaseAuth.channel - .invokeMethod('setLanguageCode', { - 'language': language, - 'app': app.name, - }); - } - - Future _callHandler(MethodCall call) async { - switch (call.method) { - case 'onAuthStateChanged': - _onAuthStageChangedHandler(call); - break; - case 'phoneVerificationCompleted': - final int handle = call.arguments['handle']; - final PhoneVerificationCompleted verificationCompleted = - _phoneAuthCallbacks[handle]['PhoneVerificationCompleted']; - verificationCompleted(PhoneAuthProvider._getCredentialFromObject( - jsonObject: call.arguments["phoneAuthCredential"].toString())); - break; - case 'phoneVerificationFailed': - final int handle = call.arguments['handle']; - final PhoneVerificationFailed verificationFailed = - _phoneAuthCallbacks[handle]['PhoneVerificationFailed']; - final Map exception = call.arguments['exception']; - verificationFailed( - AuthException(exception['code'], exception['message'])); - break; - case 'phoneCodeSent': - final int handle = call.arguments['handle']; - final String verificationId = call.arguments['verificationId']; - final int forceResendingToken = call.arguments['forceResendingToken']; - - final PhoneCodeSent codeSent = - _phoneAuthCallbacks[handle]['PhoneCodeSent']; - if (forceResendingToken == null) { - codeSent(verificationId); - } else { - codeSent(verificationId, forceResendingToken); - } - break; - case 'phoneCodeAutoRetrievalTimeout': - final int handle = call.arguments['handle']; - final PhoneCodeAutoRetrievalTimeout codeAutoRetrievalTimeout = - _phoneAuthCallbacks[handle]['PhoneCodeAuthRetrievalTimeout']; - final String verificationId = call.arguments['verificationId']; - codeAutoRetrievalTimeout(verificationId); - break; - } - } - - void _onAuthStageChangedHandler(MethodCall call) { - final Map data = call.arguments["user"]; - final int id = call.arguments["id"]; - - final FirebaseUser currentUser = - data != null ? FirebaseUser._(data.cast(), app) : null; - _authStateChangedControllers[id].add(currentUser); - } -} diff --git a/packages/firebase_auth/lib/src/firebase_user.dart b/packages/firebase_auth/lib/src/firebase_user.dart deleted file mode 100644 index b9e4c8c244ef..000000000000 --- a/packages/firebase_auth/lib/src/firebase_user.dart +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Represents a user. -class FirebaseUser extends UserInfo { - FirebaseUser._(Map data, FirebaseApp app) - : providerData = data['providerData'] - .map((dynamic item) => UserInfo._(item, app)) - .toList(), - _metadata = FirebaseUserMetadata._(data), - super._(data, app); - - final List providerData; - final FirebaseUserMetadata _metadata; - - // Returns true if the user is anonymous; that is, the user account was - // created with signInAnonymously() and has not been linked to another - // account. - FirebaseUserMetadata get metadata => _metadata; - - bool get isAnonymous => _data['isAnonymous']; - - /// Returns true if the user's email is verified. - bool get isEmailVerified => _data['isEmailVerified']; - - /// Obtains the id token result for the current user, forcing a [refresh] if desired. - /// - /// Useful when authenticating against your own backend. Use our server - /// SDKs or follow the official documentation to securely verify the - /// integrity and validity of this token. - /// - /// Completes with an error if the user is signed out. - Future getIdToken({bool refresh = false}) async { - final Map data = await FirebaseAuth.channel - .invokeMapMethod('getIdToken', { - 'refresh': refresh, - 'app': _app.name, - }); - - return IdTokenResult(data, _app); - } - - /// Associates a user account from a third-party identity provider with this - /// user and returns additional identity provider data. - /// - /// This allows the user to sign in to this account in the future with - /// the given account. - /// - /// Errors: - /// • `ERROR_WEAK_PASSWORD` - If the password is not strong enough. - /// • `ERROR_INVALID_CREDENTIAL` - If the credential is malformed or has expired. - /// • `ERROR_EMAIL_ALREADY_IN_USE` - If the email is already in use by a different account. - /// • `ERROR_CREDENTIAL_ALREADY_IN_USE` - If the account is already in use by a different account, e.g. with phone auth. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_REQUIRES_RECENT_LOGIN` - If the user's last sign-in time does not meet the security threshold. Use reauthenticate methods to resolve. - /// • `ERROR_PROVIDER_ALREADY_LINKED` - If the current user already has an account of this type linked. - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that this type of account is not enabled. - /// • `ERROR_INVALID_ACTION_CODE` - If the action code in the link is malformed, expired, or has already been used. - /// This can only occur when using [EmailAuthProvider.getCredentialWithLink] to obtain the credential. - Future linkWithCredential(AuthCredential credential) async { - assert(credential != null); - final Map data = - await FirebaseAuth.channel.invokeMapMethod( - 'linkWithCredential', - { - 'app': _app.name, - 'provider': credential._provider, - 'data': credential._data, - }, - ); - final AuthResult result = AuthResult._(data, _app); - return result; - } - - /// Initiates email verification for the user. - Future sendEmailVerification() async { - await FirebaseAuth.channel.invokeMethod( - 'sendEmailVerification', {'app': _app.name}); - } - - /// Manually refreshes the data of the current user (for example, - /// attached providers, display name, and so on). - Future reload() async { - await FirebaseAuth.channel - .invokeMethod('reload', {'app': _app.name}); - } - - /// Deletes the current user (also signs out the user). - /// - /// Errors: - /// • `ERROR_REQUIRES_RECENT_LOGIN` - If the user's last sign-in time does not meet the security threshold. Use reauthenticate methods to resolve. - /// • `ERROR_INVALID_CREDENTIAL` - If the credential is malformed or has expired. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_USER_NOT_FOUND` - If the user has been deleted (for example, in the Firebase console) - Future delete() async { - await FirebaseAuth.channel - .invokeMethod('delete', {'app': _app.name}); - } - - /// Updates the email address of the user. - /// - /// The original email address recipient will receive an email that allows - /// them to revoke the email address change, in order to protect them - /// from account hijacking. - /// - /// **Important**: This is a security sensitive operation that requires - /// the user to have recently signed in. - /// - /// Errors: - /// • `ERROR_INVALID_CREDENTIAL` - If the email address is malformed. - /// • `ERROR_EMAIL_ALREADY_IN_USE` - If the email is already in use by a different account. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_USER_NOT_FOUND` - If the user has been deleted (for example, in the Firebase console) - /// • `ERROR_REQUIRES_RECENT_LOGIN` - If the user's last sign-in time does not meet the security threshold. Use reauthenticate methods to resolve. - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Email & Password accounts are not enabled. - Future updateEmail(String email) async { - assert(email != null); - return await FirebaseAuth.channel.invokeMethod( - 'updateEmail', - {'email': email, 'app': _app.name}, - ); - } - - /// Updates the phone number of the user. - /// - /// The new phone number credential corresponding to the phone number - /// to be added to the Firebase account, if a phone number is already linked to the account. - /// this new phone number will replace it. - /// - /// **Important**: This is a security sensitive operation that requires - /// the user to have recently signed in. - /// - Future updatePhoneNumberCredential(AuthCredential credential) async { - assert(credential != null); - await FirebaseAuth.channel.invokeMethod( - 'updatePhoneNumberCredential', - { - 'app': _app.name, - 'provider': credential._provider, - 'data': credential._data, - }, - ); - } - - /// Updates the password of the user. - /// - /// Anonymous users who update both their email and password will no - /// longer be anonymous. They will be able to log in with these credentials. - /// - /// **Important**: This is a security sensitive operation that requires - /// the user to have recently signed in. - /// - /// Errors: - /// • `ERROR_WEAK_PASSWORD` - If the password is not strong enough. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_USER_NOT_FOUND` - If the user has been deleted (for example, in the Firebase console) - /// • `ERROR_REQUIRES_RECENT_LOGIN` - If the user's last sign-in time does not meet the security threshold. Use reauthenticate methods to resolve. - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Email & Password accounts are not enabled. - Future updatePassword(String password) async { - assert(password != null); - return await FirebaseAuth.channel.invokeMethod( - 'updatePassword', - {'password': password, 'app': _app.name}, - ); - } - - /// Updates the user profile information. - /// - /// Errors: - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_USER_NOT_FOUND` - If the user has been deleted (for example, in the Firebase console) - Future updateProfile(UserUpdateInfo userUpdateInfo) async { - assert(userUpdateInfo != null); - final Map data = userUpdateInfo._updateData; - data['app'] = _app.name; - return await FirebaseAuth.channel.invokeMethod( - 'updateProfile', - data, - ); - } - - /// Renews the user’s authentication tokens by validating a fresh set of - /// [credential]s supplied by the user and returns additional identity provider - /// data. - /// - /// This is used to prevent or resolve `ERROR_REQUIRES_RECENT_LOGIN` - /// response to operations that require a recent sign-in. - /// - /// If the user associated with the supplied credential is different from the - /// current user, or if the validation of the supplied credentials fails; an - /// error is returned and the current user remains signed in. - /// - /// Errors: - /// • `ERROR_INVALID_CREDENTIAL` - If the [authToken] or [authTokenSecret] is malformed or has expired. - /// • `ERROR_USER_DISABLED` - If the user has been disabled (for example, in the Firebase console) - /// • `ERROR_USER_NOT_FOUND` - If the user has been deleted (for example, in the Firebase console) - /// • `ERROR_OPERATION_NOT_ALLOWED` - Indicates that Email & Password accounts are not enabled. - Future reauthenticateWithCredential( - AuthCredential credential) async { - assert(credential != null); - final Map data = - await FirebaseAuth.channel.invokeMapMethod( - 'reauthenticateWithCredential', - { - 'app': _app.name, - 'provider': credential._provider, - 'data': credential._data, - }, - ); - return AuthResult._(data, _app); - } - - /// Detaches the [provider] account from the current user. - /// - /// This will prevent the user from signing in to this account with those - /// credentials. - /// - /// **Important**: This is a security sensitive operation that requires - /// the user to have recently signed in. - /// - /// Use the `providerId` method of an auth provider for [provider]. - /// - /// Errors: - /// • `ERROR_NO_SUCH_PROVIDER` - If the user does not have a Github Account linked to their account. - /// • `ERROR_REQUIRES_RECENT_LOGIN` - If the user's last sign-in time does not meet the security threshold. Use reauthenticate methods to resolve. - Future unlinkFromProvider(String provider) async { - assert(provider != null); - return await FirebaseAuth.channel.invokeMethod( - 'unlinkFromProvider', - {'provider': provider, 'app': _app.name}, - ); - } - - @override - String toString() { - return '$runtimeType($_data)'; - } -} diff --git a/packages/firebase_auth/lib/src/id_token_result.dart b/packages/firebase_auth/lib/src/id_token_result.dart deleted file mode 100644 index c53e9ae5bb4d..000000000000 --- a/packages/firebase_auth/lib/src/id_token_result.dart +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Represents ID token result obtained from [FirebaseUser], containing the -/// ID token JWT string and other helper properties for getting different -/// data associated with the token as well as all the decoded payload claims. -/// -/// Note that these claims are not to be trusted as they are parsed client side. -/// Only server side verification can guarantee the integrity of the token -/// claims. -class IdTokenResult { - @visibleForTesting - IdTokenResult(this._data, this._app); - - final FirebaseApp _app; - - final Map _data; - - /// The Firebase Auth ID token JWT string. - String get token => _data['token']; - - /// The time when the ID token expires. - DateTime get expirationTime => - DateTime.fromMillisecondsSinceEpoch(_data['expirationTimestamp'] * 1000); - - /// The time the user authenticated (signed in). - /// - /// Note that this is not the time the token was refreshed. - DateTime get authTime => - DateTime.fromMillisecondsSinceEpoch(_data['authTimestamp'] * 1000); - - /// The time when ID token was issued. - DateTime get issuedAtTime => - DateTime.fromMillisecondsSinceEpoch(_data['issuedAtTimestamp'] * 1000); - - /// The sign-in provider through which the ID token was obtained (anonymous, - /// custom, phone, password, etc). Note, this does not map to provider IDs. - String get signInProvider => _data['signInProvider']; - - /// The entire payload claims of the ID token including the standard reserved - /// claims as well as the custom claims. - Map get claims => _data['claims']; - - @override - String toString() { - return '$runtimeType($_data)'; - } -} diff --git a/packages/firebase_auth/lib/src/user_info.dart b/packages/firebase_auth/lib/src/user_info.dart deleted file mode 100644 index d7e440aaeee0..000000000000 --- a/packages/firebase_auth/lib/src/user_info.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Represents user data returned from an identity provider. -class UserInfo { - UserInfo._(this._data, this._app); - - final FirebaseApp _app; - - final Map _data; - - /// The provider identifier. - String get providerId => _data['providerId']; - - /// The provider’s user ID for the user. - String get uid => _data['uid']; - - /// The name of the user. - String get displayName => _data['displayName']; - - /// The URL of the user’s profile photo. - String get photoUrl => _data['photoUrl']; - - /// The user’s email address. - String get email => _data['email']; - - /// The user's phone number. - String get phoneNumber => _data['phoneNumber']; - - @override - String toString() { - return '$runtimeType($_data)'; - } -} diff --git a/packages/firebase_auth/lib/src/user_metadata.dart b/packages/firebase_auth/lib/src/user_metadata.dart deleted file mode 100644 index 293d294b6ecb..000000000000 --- a/packages/firebase_auth/lib/src/user_metadata.dart +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Interface representing a user's metadata. -class FirebaseUserMetadata { - FirebaseUserMetadata._(this._data); - - final Map _data; - - /// When this account was created as dictated by the server clock. - DateTime get creationTime => - DateTime.fromMillisecondsSinceEpoch(_data['creationTimestamp']); - - /// When the user last signed in as dictated by the server clock. - /// - /// This is only accurate up to a granularity of 2 minutes for consecutive sign-in attempts. - DateTime get lastSignInTime => - DateTime.fromMillisecondsSinceEpoch(_data['lastSignInTimestamp']); -} diff --git a/packages/firebase_auth/lib/src/user_update_info.dart b/packages/firebase_auth/lib/src/user_update_info.dart deleted file mode 100644 index 0b290b912970..000000000000 --- a/packages/firebase_auth/lib/src/user_update_info.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_auth; - -/// Represents user profile data that can be updated by [updateProfile] -/// -/// The purpose of having separate class with a map is to give possibility -/// to check if value was set to null or not provided -class UserUpdateInfo { - /// Container of data that will be send in update request - final Map _updateData = {}; - - set displayName(String displayName) => - _updateData['displayName'] = displayName; - - String get displayName => _updateData['displayName']; - - set photoUrl(String photoUri) => _updateData['photoUrl'] = photoUri; - - String get photoUrl => _updateData['photoUrl']; -} diff --git a/packages/firebase_auth/pubspec.yaml b/packages/firebase_auth/pubspec.yaml deleted file mode 100755 index 163957b97e9b..000000000000 --- a/packages/firebase_auth/pubspec.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: firebase_auth -description: Flutter plugin for Firebase Auth, enabling Android and iOS - authentication using passwords, phone numbers and identity providers - like Google, Facebook and Twitter. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth -version: 0.14.0+2 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebaseauth - iosPrefix: FLT - pluginClass: FirebaseAuthPlugin - -dependencies: - meta: ^1.0.4 - firebase_core: ^0.4.0 - - flutter: - sdk: flutter - -dev_dependencies: - google_sign_in: ^3.0.4 - firebase_dynamic_links: ^0.3.0 - uuid: ^2.0.2 - test: ^1.3.0 - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_auth/test/firebase_auth_test.dart b/packages/firebase_auth/test/firebase_auth_test.dart deleted file mode 100755 index 5573302c62b6..000000000000 --- a/packages/firebase_auth/test/firebase_auth_test.dart +++ /dev/null @@ -1,1326 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_auth/firebase_auth.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -const String kMockProviderId = 'firebase'; -const String kMockUid = '12345'; -const String kMockDisplayName = 'Flutter Test User'; -const String kMockPhotoUrl = 'http://www.example.com/'; -const String kMockEmail = 'test@example.com'; -const String kMockPassword = 'passw0rd'; -const String kMockIdToken = '12345'; -const String kMockAccessToken = '67890'; -const String kMockGithubToken = 'github'; -const String kMockAuthToken = '23456'; -const String kMockAuthTokenSecret = '78901'; -const String kMockCustomToken = '12345'; -const String kMockPhoneNumber = '5555555555'; -const String kMockVerificationId = '12345'; -const String kMockSmsCode = '123456'; -const String kMockLanguage = 'en'; -const String kMockIdTokenResultSignInProvider = 'password'; -const Map kMockIdTokenResultClaims = { - 'claim1': 'value1', -}; -const int kMockIdTokenResultExpirationTimestamp = 123456; -const int kMockIdTokenResultAuthTimestamp = 1234567; -const int kMockIdTokenResultIssuedAtTimestamp = 12345678; -const Map kMockIdTokenResult = { - 'token': kMockIdToken, - 'expirationTimestamp': kMockIdTokenResultExpirationTimestamp, - 'authTimestamp': kMockIdTokenResultAuthTimestamp, - 'issuedAtTimestamp': kMockIdTokenResultIssuedAtTimestamp, - 'signInProvider': kMockIdTokenResultSignInProvider, - 'claims': kMockIdTokenResultClaims, -}; - -final int kMockCreationTimestamp = DateTime(2019, 1, 1).millisecondsSinceEpoch; -final int kMockLastSignInTimestamp = - DateTime.now().subtract(const Duration(days: 1)).millisecondsSinceEpoch; -final Map kMockUser = { - 'isAnonymous': true, - 'isEmailVerified': false, - 'creationTimestamp': kMockCreationTimestamp, - 'lastSignInTimestamp': kMockLastSignInTimestamp, - 'providerData': >[ - { - 'providerId': kMockProviderId, - 'uid': kMockUid, - 'displayName': kMockDisplayName, - 'photoUrl': kMockPhotoUrl, - 'email': kMockEmail, - }, - ], -}; -const Map kMockAdditionalUserInfo = { - 'isNewUser': false, - 'username': 'flutterUser', - 'providerId': 'testProvider', - 'profile': {'foo': 'bar'}, -}; - -void main() { - group('$FirebaseAuth', () { - final String appName = 'testApp'; - final FirebaseApp app = FirebaseApp(name: appName); - final FirebaseAuth auth = FirebaseAuth.fromApp(app); - final List log = []; - - int mockHandleId = 0; - - setUp(() { - log.clear(); - FirebaseAuth.channel.setMockMethodCallHandler((MethodCall call) async { - log.add(call); - switch (call.method) { - case "getIdToken": - return kMockIdTokenResult; - break; - case "isSignInWithEmailLink": - return true; - case "startListeningAuthState": - return mockHandleId++; - break; - case "currentUser": - return kMockUser; - case "sendLinkToEmail": - case "sendPasswordResetEmail": - case "updateEmail": - case "updatePhoneNumberCredential": - case "updatePassword": - case "updateProfile": - return null; - break; - case "fetchSignInMethodsForEmail": - return List(0); - break; - case "verifyPhoneNumber": - return null; - break; - default: - return { - 'user': kMockUser, - 'additionalUserInfo': kMockAdditionalUserInfo, - }; - break; - } - }); - }); - void verifyUser(FirebaseUser user) { - expect(user, isNotNull); - expect(user.isAnonymous, isTrue); - expect(user.isEmailVerified, isFalse); - expect(user.providerData.length, 1); - final UserInfo userInfo = user.providerData[0]; - expect(userInfo.providerId, kMockProviderId); - expect(userInfo.uid, kMockUid); - expect(userInfo.displayName, kMockDisplayName); - expect(userInfo.photoUrl, kMockPhotoUrl); - expect(userInfo.email, kMockEmail); - expect(user.metadata.creationTime.millisecondsSinceEpoch, - kMockCreationTimestamp); - expect(user.metadata.lastSignInTime.millisecondsSinceEpoch, - kMockLastSignInTimestamp); - } - - void verifyAuthResult(AuthResult result) { - verifyUser(result.user); - final AdditionalUserInfo additionalUserInfo = result.additionalUserInfo; - expect( - additionalUserInfo.isNewUser, kMockAdditionalUserInfo['isNewUser']); - expect(additionalUserInfo.username, kMockAdditionalUserInfo['username']); - expect( - additionalUserInfo.providerId, kMockAdditionalUserInfo['providerId']); - expect(additionalUserInfo.profile, kMockAdditionalUserInfo['profile']); - } - - test('getIdToken', () async { - void verifyIdTokenResult(IdTokenResult idTokenResult) { - expect(idTokenResult.token, equals(kMockIdToken)); - expect( - idTokenResult.expirationTime, - equals(DateTime.fromMillisecondsSinceEpoch( - kMockIdTokenResultExpirationTimestamp * 1000))); - expect( - idTokenResult.authTime, - equals(DateTime.fromMillisecondsSinceEpoch( - kMockIdTokenResultAuthTimestamp * 1000))); - expect( - idTokenResult.issuedAtTime, - equals(DateTime.fromMillisecondsSinceEpoch( - kMockIdTokenResultIssuedAtTimestamp * 1000))); - expect(idTokenResult.signInProvider, - equals(kMockIdTokenResultSignInProvider)); - expect(idTokenResult.claims, equals(kMockIdTokenResultClaims)); - } - - final FirebaseUser user = await auth.currentUser(); - verifyIdTokenResult(await user.getIdToken()); - verifyIdTokenResult(await user.getIdToken(refresh: true)); - expect( - log, - [ - isMethodCall('currentUser', - arguments: {'app': auth.app.name}), - isMethodCall( - 'getIdToken', - arguments: { - 'refresh': false, - 'app': auth.app.name - }, - ), - isMethodCall( - 'getIdToken', - arguments: {'refresh': true, 'app': auth.app.name}, - ), - ], - ); - }); - - test('signInAnonymously', () async { - final AuthResult result = await auth.signInAnonymously(); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall('signInAnonymously', - arguments: {'app': auth.app.name}), - ], - ); - }); - - test('sendSignInWithEmailLink', () async { - await auth.sendSignInWithEmailLink( - email: 'test@example.com', - url: 'http://www.example.com/', - handleCodeInApp: true, - iOSBundleID: 'com.example.app', - androidPackageName: 'com.example.app', - androidInstallIfNotAvailable: false, - androidMinimumVersion: "12", - ); - expect( - log, - [ - isMethodCall('sendLinkToEmail', arguments: { - 'email': 'test@example.com', - 'url': 'http://www.example.com/', - 'handleCodeInApp': true, - 'iOSBundleID': 'com.example.app', - 'androidPackageName': 'com.example.app', - 'androidInstallIfNotAvailable': false, - 'androidMinimumVersion': '12', - 'app': auth.app.name, - }), - ], - ); - }); - - test('isSignInWithEmailLink', () async { - final bool result = await auth.isSignInWithEmailLink('foo'); - expect(result, true); - expect( - log, - [ - isMethodCall('isSignInWithEmailLink', - arguments: {'link': 'foo', 'app': auth.app.name}), - ], - ); - }); - - test('signInWithEmailAndLink', () async { - final AuthResult result = await auth.signInWithEmailAndLink( - email: 'test@example.com', - link: '', - ); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall('signInWithEmailAndLink', arguments: { - 'email': 'test@example.com', - 'link': '', - 'app': auth.app.name, - }), - ], - ); - }); - - test('createUserWithEmailAndPassword', () async { - final AuthResult result = await auth.createUserWithEmailAndPassword( - email: kMockEmail, - password: kMockPassword, - ); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'createUserWithEmailAndPassword', - arguments: { - 'email': kMockEmail, - 'password': kMockPassword, - 'app': auth.app.name, - }, - ), - ], - ); - }); - - test('fetchSignInMethodsForEmail', () async { - final List providers = - await auth.fetchSignInMethodsForEmail(email: kMockEmail); - expect(providers, isNotNull); - expect(providers.length, 0); - expect( - log, - [ - isMethodCall( - 'fetchSignInMethodsForEmail', - arguments: { - 'email': kMockEmail, - 'app': auth.app.name - }, - ), - ], - ); - }); - - test('EmailAuthProvider (withLink) linkWithCredential', () async { - final AuthCredential credential = EmailAuthProvider.getCredentialWithLink( - email: 'test@example.com', - link: '', - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - 'data': { - 'email': 'test@example.com', - 'link': '', - }, - }, - ), - ], - ); - }); - - test('EmailAuthProvider (withLink) signInWithCredential', () async { - final AuthCredential credential = EmailAuthProvider.getCredentialWithLink( - email: 'test@example.com', - link: '', - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - 'data': { - 'email': 'test@example.com', - 'link': '', - }, - }, - ), - ], - ); - }); - - test('EmailAuthProvider (withLink) reauthenticateWithCredential', () async { - final FirebaseUser user = await auth.currentUser(); - log.clear(); - final AuthCredential credential = EmailAuthProvider.getCredentialWithLink( - email: 'test@example.com', - link: '', - ); - await user.reauthenticateWithCredential(credential); - expect( - log, - [ - isMethodCall( - 'reauthenticateWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - 'data': { - 'email': 'test@example.com', - 'link': '', - } - }, - ), - ], - ); - }); - - test('TwitterAuthProvider linkWithCredential', () async { - final AuthCredential credential = TwitterAuthProvider.getCredential( - authToken: kMockIdToken, - authTokenSecret: kMockAccessToken, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'twitter.com', - 'data': { - 'authToken': kMockIdToken, - 'authTokenSecret': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('TwitterAuthProvider signInWithCredential', () async { - final AuthCredential credential = TwitterAuthProvider.getCredential( - authToken: kMockIdToken, - authTokenSecret: kMockAccessToken, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'twitter.com', - 'data': { - 'authToken': kMockIdToken, - 'authTokenSecret': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('GithubAuthProvider linkWithCredential', () async { - final AuthCredential credential = GithubAuthProvider.getCredential( - token: kMockGithubToken, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'github.com', - 'data': { - 'token': kMockGithubToken, - } - }, - ), - ], - ); - }); - - test('GitHubAuthProvider signInWithCredential', () async { - final AuthCredential credential = GithubAuthProvider.getCredential( - token: kMockGithubToken, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'github.com', - 'data': { - 'token': kMockGithubToken, - }, - }, - ), - ], - ); - }); - - test('EmailAuthProvider linkWithCredential', () async { - final AuthCredential credential = EmailAuthProvider.getCredential( - email: kMockEmail, - password: kMockPassword, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - 'data': { - 'email': kMockEmail, - 'password': kMockPassword, - }, - }, - ), - ], - ); - }); - - test('GoogleAuthProvider signInWithCredential', () async { - final AuthCredential credential = GoogleAuthProvider.getCredential( - idToken: kMockIdToken, - accessToken: kMockAccessToken, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'google.com', - 'data': { - 'idToken': kMockIdToken, - 'accessToken': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('PhoneAuthProvider signInWithCredential', () async { - final AuthCredential credential = PhoneAuthProvider.getCredential( - verificationId: kMockVerificationId, - smsCode: kMockSmsCode, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect(log, [ - isMethodCall('signInWithCredential', arguments: { - 'app': auth.app.name, - 'provider': 'phone', - 'data': { - 'verificationId': kMockVerificationId, - 'smsCode': kMockSmsCode, - }, - }) - ]); - }); - - test('verifyPhoneNumber', () async { - await auth.verifyPhoneNumber( - phoneNumber: kMockPhoneNumber, - timeout: const Duration(seconds: 5), - verificationCompleted: null, - verificationFailed: null, - codeSent: null, - codeAutoRetrievalTimeout: null); - expect(log, [ - isMethodCall('verifyPhoneNumber', arguments: { - 'handle': 1, - 'phoneNumber': kMockPhoneNumber, - 'timeout': 5000, - 'forceResendingToken': null, - 'app': auth.app.name, - }) - ]); - }); - - test('EmailAuthProvider reauthenticateWithCredential', () async { - final FirebaseUser user = await auth.currentUser(); - log.clear(); - final AuthCredential credential = EmailAuthProvider.getCredential( - email: kMockEmail, - password: kMockPassword, - ); - final AuthResult result = - await user.reauthenticateWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'reauthenticateWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - 'data': { - 'email': kMockEmail, - 'password': kMockPassword, - } - }, - ), - ], - ); - }); - test('GoogleAuthProvider reauthenticateWithCredential', () async { - final FirebaseUser user = await auth.currentUser(); - log.clear(); - final AuthCredential credential = GoogleAuthProvider.getCredential( - idToken: kMockIdToken, - accessToken: kMockAccessToken, - ); - final AuthResult result = - await user.reauthenticateWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'reauthenticateWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'google.com', - 'data': { - 'idToken': kMockIdToken, - 'accessToken': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('FacebookAuthProvider reauthenticateWithCredential', () async { - final FirebaseUser user = await auth.currentUser(); - log.clear(); - final AuthCredential credential = FacebookAuthProvider.getCredential( - accessToken: kMockAccessToken, - ); - final AuthResult result = - await user.reauthenticateWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'reauthenticateWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'facebook.com', - 'data': { - 'accessToken': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('TwitterAuthProvider reauthenticateWithCredential', () async { - final FirebaseUser user = await auth.currentUser(); - log.clear(); - final AuthCredential credential = TwitterAuthProvider.getCredential( - authToken: kMockAuthToken, - authTokenSecret: kMockAuthTokenSecret, - ); - final AuthResult result = - await user.reauthenticateWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'reauthenticateWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'twitter.com', - 'data': { - 'authToken': kMockAuthToken, - 'authTokenSecret': kMockAuthTokenSecret, - }, - }, - ), - ], - ); - }); - - test('GithubAuthProvider reauthenticateWithCredential', () async { - final FirebaseUser user = await auth.currentUser(); - log.clear(); - final AuthCredential credential = GithubAuthProvider.getCredential( - token: kMockGithubToken, - ); - final AuthResult result = - await user.reauthenticateWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'reauthenticateWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'github.com', - 'data': { - 'token': kMockGithubToken, - }, - }, - ), - ], - ); - }); - - test('GoogleAuthProvider linkWithCredential', () async { - final AuthCredential credential = GoogleAuthProvider.getCredential( - idToken: kMockIdToken, - accessToken: kMockAccessToken, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'google.com', - 'data': { - 'idToken': kMockIdToken, - 'accessToken': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('FacebookAuthProvider linkWithCredential', () async { - final AuthCredential credential = FacebookAuthProvider.getCredential( - accessToken: kMockAccessToken, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'facebook.com', - 'data': { - 'accessToken': kMockAccessToken, - }, - }, - ), - ], - ); - }); - - test('FacebookAuthProvider signInWithCredential', () async { - final AuthCredential credential = FacebookAuthProvider.getCredential( - accessToken: kMockAccessToken, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'facebook.com', - 'data': { - 'accessToken': kMockAccessToken, - } - }, - ), - ], - ); - }); - - test('TwitterAuthProvider linkWithCredential', () async { - final AuthCredential credential = TwitterAuthProvider.getCredential( - authToken: kMockAuthToken, - authTokenSecret: kMockAuthTokenSecret, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'twitter.com', - 'data': { - 'authToken': kMockAuthToken, - 'authTokenSecret': kMockAuthTokenSecret, - }, - }, - ), - ], - ); - }); - - test('TwitterAuthProvider signInWithCredential', () async { - final AuthCredential credential = TwitterAuthProvider.getCredential( - authToken: kMockAuthToken, - authTokenSecret: kMockAuthTokenSecret, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'twitter.com', - 'data': { - 'authToken': kMockAuthToken, - 'authTokenSecret': kMockAuthTokenSecret, - }, - }, - ), - ], - ); - }); - - test('GithubAuthProvider linkWithCredential', () async { - final AuthCredential credential = GithubAuthProvider.getCredential( - token: kMockGithubToken, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'github.com', - 'data': { - 'token': kMockGithubToken, - }, - }, - ), - ], - ); - }); - - test('GithubAuthProvider signInWithCredential', () async { - final AuthCredential credential = GithubAuthProvider.getCredential( - token: kMockGithubToken, - ); - final AuthResult result = await auth.signInWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'signInWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'github.com', - 'data': { - 'token': kMockGithubToken, - }, - }, - ), - ], - ); - }); - - test('EmailAuthProvider linkWithCredential', () async { - final AuthCredential credential = EmailAuthProvider.getCredential( - email: kMockEmail, - password: kMockPassword, - ); - final FirebaseUser user = await auth.currentUser(); - final AuthResult result = await user.linkWithCredential(credential); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: { - 'app': auth.app.name, - }, - ), - isMethodCall( - 'linkWithCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - 'data': { - 'email': kMockEmail, - 'password': kMockPassword, - }, - }, - ), - ], - ); - }); - - test('sendEmailVerification', () async { - final FirebaseUser user = await auth.currentUser(); - await user.sendEmailVerification(); - - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'sendEmailVerification', - arguments: {'app': auth.app.name}, - ), - ], - ); - }); - - test('reload', () async { - final FirebaseUser user = await auth.currentUser(); - await user.reload(); - - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'reload', - arguments: {'app': auth.app.name}, - ), - ], - ); - }); - - test('delete', () async { - final FirebaseUser user = await auth.currentUser(); - await user.delete(); - - expect( - log, - [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'delete', - arguments: {'app': auth.app.name}, - ), - ], - ); - }); - - test('sendPasswordResetEmail', () async { - await auth.sendPasswordResetEmail( - email: kMockEmail, - ); - expect( - log, - [ - isMethodCall( - 'sendPasswordResetEmail', - arguments: { - 'email': kMockEmail, - 'app': auth.app.name - }, - ), - ], - ); - }); - - test('updateEmail', () async { - final FirebaseUser user = await auth.currentUser(); - await user.updateEmail(kMockEmail); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'updateEmail', - arguments: { - 'email': kMockEmail, - 'app': auth.app.name, - }, - ), - ]); - }); - - test('updatePhoneNumberCredential', () async { - final FirebaseUser user = await auth.currentUser(); - final AuthCredential credentials = PhoneAuthProvider.getCredential( - verificationId: kMockVerificationId, - smsCode: kMockSmsCode, - ); - await user.updatePhoneNumberCredential(credentials); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'updatePhoneNumberCredential', - arguments: { - 'app': auth.app.name, - 'provider': 'phone', - 'data': { - 'verificationId': kMockVerificationId, - 'smsCode': kMockSmsCode, - }, - }, - ), - ]); - }); - - test('updatePassword', () async { - final FirebaseUser user = await auth.currentUser(); - await user.updatePassword(kMockPassword); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'updatePassword', - arguments: { - 'password': kMockPassword, - 'app': auth.app.name, - }, - ), - ]); - }); - - test('updateProfile', () async { - final UserUpdateInfo userUpdateInfo = UserUpdateInfo(); - userUpdateInfo.photoUrl = kMockPhotoUrl; - userUpdateInfo.displayName = kMockDisplayName; - - final FirebaseUser user = await auth.currentUser(); - await user.updateProfile(userUpdateInfo); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'updateProfile', - arguments: { - 'photoUrl': kMockPhotoUrl, - 'displayName': kMockDisplayName, - 'app': auth.app.name, - }, - ), - ]); - }); - - test('EmailAuthProvider unlinkFromProvider', () async { - final FirebaseUser user = await auth.currentUser(); - await user.unlinkFromProvider(EmailAuthProvider.providerId); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'unlinkFromProvider', - arguments: { - 'app': auth.app.name, - 'provider': 'password', - }, - ), - ]); - }); - - test('GoogleAuthProvider unlinkFromProvider', () async { - final FirebaseUser user = await auth.currentUser(); - await user.unlinkFromProvider(GoogleAuthProvider.providerId); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'unlinkFromProvider', - arguments: { - 'app': auth.app.name, - 'provider': 'google.com', - }, - ), - ]); - }); - - test('FacebookAuthProvider unlinkFromProvider', () async { - final FirebaseUser user = await auth.currentUser(); - await user.unlinkFromProvider(FacebookAuthProvider.providerId); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'unlinkFromProvider', - arguments: { - 'app': auth.app.name, - 'provider': 'facebook.com', - }, - ), - ]); - }); - - test('PhoneAuthProvider unlinkFromProvider', () async { - final FirebaseUser user = await auth.currentUser(); - await user.unlinkFromProvider(PhoneAuthProvider.providerId); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'unlinkFromProvider', - arguments: { - 'app': auth.app.name, - 'provider': 'phone', - }, - ), - ]); - }); - - test('TwitterAuthProvider unlinkFromProvider', () async { - final FirebaseUser user = await auth.currentUser(); - await user.unlinkFromProvider(TwitterAuthProvider.providerId); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'unlinkFromProvider', - arguments: { - 'app': auth.app.name, - 'provider': 'twitter.com', - }, - ), - ]); - }); - - test('GithubAuthProvider unlinkFromProvider', () async { - final FirebaseUser user = await auth.currentUser(); - await user.unlinkFromProvider(GithubAuthProvider.providerId); - expect(log, [ - isMethodCall( - 'currentUser', - arguments: {'app': auth.app.name}, - ), - isMethodCall( - 'unlinkFromProvider', - arguments: { - 'app': auth.app.name, - 'provider': 'github.com', - }, - ), - ]); - }); - - test('signInWithCustomToken', () async { - final AuthResult result = - await auth.signInWithCustomToken(token: kMockCustomToken); - verifyAuthResult(result); - expect( - log, - [ - isMethodCall('signInWithCustomToken', arguments: { - 'token': kMockCustomToken, - 'app': auth.app.name, - }) - ], - ); - }); - - test('onAuthStateChanged', () async { - mockHandleId = 42; - - Future simulateEvent(Map user) async { - // TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. - // https://github.com/flutter/flutter/issues/33446 - // ignore: deprecated_member_use - await BinaryMessages.handlePlatformMessage( - FirebaseAuth.channel.name, - FirebaseAuth.channel.codec.encodeMethodCall( - MethodCall( - 'onAuthStateChanged', - {'id': 42, 'user': user, 'app': auth.app.name}, - ), - ), - (_) {}, - ); - } - - final AsyncQueue events = AsyncQueue(); - - // Subscribe and allow subscription to complete. - final StreamSubscription subscription = - auth.onAuthStateChanged.listen(events.add); - await Future.delayed(const Duration(seconds: 0)); - - await simulateEvent(null); - await simulateEvent(kMockUser); - - final FirebaseUser user1 = await events.remove(); - expect(user1, isNull); - - final FirebaseUser user2 = await events.remove(); - verifyUser(user2); - - // Cancel subscription and allow cancellation to complete. - subscription.cancel(); - await Future.delayed(const Duration(seconds: 0)); - - expect( - log, - [ - isMethodCall('startListeningAuthState', arguments: { - 'app': auth.app.name, - }), - isMethodCall( - 'stopListeningAuthState', - arguments: { - 'id': 42, - 'app': auth.app.name, - }, - ), - ], - ); - }); - - test('setLanguageCode', () async { - await auth.setLanguageCode(kMockLanguage); - - expect( - log, - [ - isMethodCall( - 'setLanguageCode', - arguments: { - 'language': kMockLanguage, - 'app': auth.app.name, - }, - ), - ], - ); - }); - }); -} - -/// Queue whose remove operation is asynchronous, awaiting a corresponding add. -class AsyncQueue { - Map> _completers = >{}; - int _nextToRemove = 0; - int _nextToAdd = 0; - - void add(T element) { - _completer(_nextToAdd++).complete(element); - } - - Future remove() { - final Future result = _completer(_nextToRemove++).future; - return result; - } - - Completer _completer(int index) { - if (_completers.containsKey(index)) { - return _completers.remove(index); - } else { - return _completers[index] = Completer(); - } - } -} diff --git a/packages/firebase_core/.gitignore b/packages/firebase_core/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_core/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_core/CHANGELOG.md b/packages/firebase_core/CHANGELOG.md deleted file mode 100644 index 04845d383e94..000000000000 --- a/packages/firebase_core/CHANGELOG.md +++ /dev/null @@ -1,153 +0,0 @@ -## 0.4.0+8 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.4.0+7 - -* Fix Android compilation warning. - -## 0.4.0+6 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.4.0+5 - -* Rollback of automatic plugin version retrieval. - -## 0.4.0+4 - -* Automate the retrieval of the plugin's version when reporting usage to Firebase. - -## 0.4.0+3 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 0.4.0+2 - -* Update user agent name. Set to `flutter-fire-core` for consistency with other - libraries. - -## 0.4.0+1 - -* Send user agent to Firebase. - -## 0.4.0 - -* Update Android dependencies to latest. - -## 0.3.4 - -* Updates Android firebase-core dependency to a version that is compatible with other Flutterfire plugins. - -## 0.3.3 - -* Remove Gradle BoM to avoid Gradle version issues. - -## 0.3.2 - -* Move Android dependency to Gradle BoM to help maintain compatability - with other FlutterFire plugins. - -## 0.3.1+1 - -* Add nil check on static functions to prevent crashes or unwanted behaviors. - -## 0.3.1 - -* Remove an assertion that can interfere with hot-restart. - -## 0.3.0+2 - -* Remove categories. - -## 0.3.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.3.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.2.5+1 - -* Bump Android dependencies to latest. - -## 0.2.5 - -* Bump Android and Firebase dependency versions. - -## 0.2.4 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.2.3 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.2.2 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.2.1 - -* Fix setting project ID on Android. - -## 0.2.0 - -* **Breaking change**. Options API is now async to interoperate with native code that configures Firebase apps. -* Provide a getter for the default app -* Fix setting of GCM sender ID on iOS - -## 0.1.2 - -* Fix projectID on iOS - -## 0.1.1 - -* Fix behavior of constructor for named Firebase apps. - -## 0.1.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.0.7 - -* Fixed Dart 2 type errors. - -## 0.0.6 - -* Enabled use in Swift projects. - -## 0.0.5 - -* Moved to the io.flutter.plugins org. - -## 0.0.4 - -* Fixed warnings from the Dart 2.0 analyzer. -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -# 0.0.3 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). - -## 0.0.2 - -* Fixes for database URL on Android -* Make GCM sender id optional on Android -* Relax GMS dependency to 11.+ - -## 0.0.1 - -* Initial Release diff --git a/packages/firebase_core/LICENSE b/packages/firebase_core/LICENSE deleted file mode 100644 index 000b4618d2bd..000000000000 --- a/packages/firebase_core/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_core/README.md b/packages/firebase_core/README.md deleted file mode 100644 index bc72824024d7..000000000000 --- a/packages/firebase_core/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Firebase Core for Flutter - -[![pub package](https://img.shields.io/pub/v/firebase_core.svg)](https://pub.dartlang.org/packages/firebase_core) - -A Flutter plugin to use the Firebase Core API, which enables connecting to multiple Firebase apps. - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage -To use this plugin, add `firebase_core` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). - -## Getting Started - -See the `example` directory for a complete sample app using Firebase Core. diff --git a/packages/firebase_core/android/build.gradle b/packages/firebase_core/android/build.gradle deleted file mode 100644 index 34fb94a90904..000000000000 --- a/packages/firebase_core/android/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -def PLUGIN = "firebase_core"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebase.core' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-core:16.0.9' - implementation 'com.google.firebase:firebase-common:16.1.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_core/android/gradle.properties b/packages/firebase_core/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_core/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_core/android/settings.gradle b/packages/firebase_core/android/settings.gradle deleted file mode 100644 index 6b9f7039d668..000000000000 --- a/packages/firebase_core/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_core' diff --git a/packages/firebase_core/android/src/main/AndroidManifest.xml b/packages/firebase_core/android/src/main/AndroidManifest.xml deleted file mode 100644 index 25d4e417f6bc..000000000000 --- a/packages/firebase_core/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java b/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java deleted file mode 100644 index ef82fbf92573..000000000000 --- a/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.core; - -import android.content.Context; -import com.google.firebase.FirebaseApp; -import com.google.firebase.FirebaseOptions; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry; -import java.lang.String; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FirebaseCorePlugin implements MethodCallHandler { - - private final Context context; - - public static void registerWith(PluginRegistry.Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_core"); - channel.setMethodCallHandler(new FirebaseCorePlugin(registrar.context())); - } - - private FirebaseCorePlugin(Context context) { - this.context = context; - } - - private Map asMap(FirebaseApp app) { - Map appMap = new HashMap<>(); - appMap.put("name", app.getName()); - FirebaseOptions options = app.getOptions(); - Map optionsMap = new HashMap<>(); - optionsMap.put("googleAppID", options.getApplicationId()); - optionsMap.put("GCMSenderID", options.getGcmSenderId()); - optionsMap.put("APIKey", options.getApiKey()); - optionsMap.put("databaseURL", options.getDatabaseUrl()); - optionsMap.put("storageBucket", options.getStorageBucket()); - optionsMap.put("projectID", options.getProjectId()); - appMap.put("options", optionsMap); - return appMap; - } - - @Override - public void onMethodCall(MethodCall call, final Result result) { - switch (call.method) { - case "FirebaseApp#configure": - { - Map arguments = call.arguments(); - String name = (String) arguments.get("name"); - @SuppressWarnings("unchecked") - Map optionsMap = (Map) arguments.get("options"); - FirebaseOptions options = - new FirebaseOptions.Builder() - .setApiKey(optionsMap.get("APIKey")) - .setApplicationId(optionsMap.get("googleAppID")) - .setDatabaseUrl(optionsMap.get("databaseURL")) - .setGcmSenderId(optionsMap.get("GCMSenderID")) - .setProjectId(optionsMap.get("projectID")) - .setStorageBucket(optionsMap.get("storageBucket")) - .build(); - FirebaseApp.initializeApp(context, options, name); - result.success(null); - break; - } - case "FirebaseApp#allApps": - { - List> apps = new ArrayList<>(); - for (FirebaseApp app : FirebaseApp.getApps(context)) { - apps.add(asMap(app)); - } - result.success(apps); - break; - } - case "FirebaseApp#appNamed": - { - String name = call.arguments(); - try { - FirebaseApp app = FirebaseApp.getInstance(name); - result.success(asMap(app)); - } catch (IllegalStateException ex) { - // App doesn't exist, so successfully return null. - result.success(null); - } - break; - } - default: - { - result.notImplemented(); - break; - } - } - } -} diff --git a/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FlutterFirebaseAppRegistrar.java b/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 4057e7dc9a62..000000000000 --- a/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.core; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_core/android/user-agent.gradle b/packages/firebase_core/android/user-agent.gradle deleted file mode 100644 index 095f0af535b7..000000000000 --- a/packages/firebase_core/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-core" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_core/example/.metadata b/packages/firebase_core/example/.metadata deleted file mode 100644 index 28ce4e53c4dd..000000000000 --- a/packages/firebase_core/example/.metadata +++ /dev/null @@ -1,8 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: f993cc36dd4fdb8e3c741cbf66fd0cdeea975e37 - channel: unknown diff --git a/packages/firebase_core/example/README.md b/packages/firebase_core/example/README.md deleted file mode 100644 index ea0fa78cf4f5..000000000000 --- a/packages/firebase_core/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_core_example - -Demonstrates how to use the firebase_core plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_core/example/android.iml b/packages/firebase_core/example/android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/firebase_core/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_core/example/android/app/build.gradle b/packages/firebase_core/example/android/app/build.gradle deleted file mode 100644 index bcd12c9f12cf..000000000000 --- a/packages/firebase_core/example/android/app/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebasecoreexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} diff --git a/packages/firebase_core/example/android/app/gradle.properties b/packages/firebase_core/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_core/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_core/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_core/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_core/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_core/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_core/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 48cbadd2a13b..000000000000 --- a/packages/firebase_core/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/firebase_core/example/android/app/src/main/java/io/flutter/plugins/firebasecoreexample/MainActivity.java b/packages/firebase_core/example/android/app/src/main/java/io/flutter/plugins/firebasecoreexample/MainActivity.java deleted file mode 100644 index 7af8a0947345..000000000000 --- a/packages/firebase_core/example/android/app/src/main/java/io/flutter/plugins/firebasecoreexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebasecoreexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_core/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_core/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_core/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_core/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_core/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_core/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_core/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_core/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_core/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_core/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_core/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_core/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_core/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_core/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_core/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_core/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_core/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_core/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_core/example/android/app/src/main/res/values/styles.xml b/packages/firebase_core/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_core/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_core/example/android/build.gradle b/packages/firebase_core/example/android/build.gradle deleted file mode 100644 index 541636cc492a..000000000000 --- a/packages/firebase_core/example/android/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_core/example/android/gradle.properties b/packages/firebase_core/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_core/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_core/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_core/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2819f022f1fd..000000000000 --- a/packages/firebase_core/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_core/example/android/settings.gradle b/packages/firebase_core/example/android/settings.gradle deleted file mode 100644 index 840d7be6e176..000000000000 --- a/packages/firebase_core/example/android/settings.gradle +++ /dev/null @@ -1,16 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} - diff --git a/packages/firebase_core/example/firebase_core_example.iml b/packages/firebase_core/example/firebase_core_example.iml deleted file mode 100644 index 4881df8aeff2..000000000000 --- a/packages/firebase_core/example/firebase_core_example.iml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_core/example/firebase_core_example_android.iml b/packages/firebase_core/example/firebase_core_example_android.iml deleted file mode 100644 index 0ca70ed93eaf..000000000000 --- a/packages/firebase_core/example/firebase_core_example_android.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_core/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_core/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6c2de8086bcd..000000000000 --- a/packages/firebase_core/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_core/example/ios/Flutter/Debug.xcconfig b/packages/firebase_core/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_core/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_core/example/ios/Flutter/Release.xcconfig b/packages/firebase_core/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_core/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_core/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_core/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 01bbb60f5add..000000000000 --- a/packages/firebase_core/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,478 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2AE3C69805AB6FB8C037C7BA /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 39D23D0C629B8A857DE66538 /* libPods-Runner.a */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 39D23D0C629B8A857DE66538 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8C05BEBBACF658542A507F21 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BBD18D8969E712FE54BB6E20 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 2AE3C69805AB6FB8C037C7BA /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 39F1FF2B4D76A033C08A8FD9 /* Pods */ = { - isa = PBXGroup; - children = ( - 8C05BEBBACF658542A507F21 /* Pods-Runner.debug.xcconfig */, - BBD18D8969E712FE54BB6E20 /* Pods-Runner.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 39F1FF2B4D76A033C08A8FD9 /* Pods */, - C5757EE16C6DD6ADC639F4D9 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - C5757EE16C6DD6ADC639F4D9 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 39D23D0C629B8A857DE66538 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 4A37569BEFBE2FD279304116 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 531483E699D87EBBC063AF7F /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 4A37569BEFBE2FD279304116 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 531483E699D87EBBC063AF7F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseCoreExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseCoreExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_core/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_core/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_core/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_core/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_core/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1c9580788197..000000000000 --- a/packages/firebase_core/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_core/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_core/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_core/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_core/example/ios/Runner/AppDelegate.h b/packages/firebase_core/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_core/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_core/example/ios/Runner/AppDelegate.m b/packages/firebase_core/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_core/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d22f10b2ab63..000000000000 --- a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_core/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_core/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_core/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_core/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_core/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_core/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_core/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_core/example/ios/Runner/Info.plist b/packages/firebase_core/example/ios/Runner/Info.plist deleted file mode 100644 index 02b271480b86..000000000000 --- a/packages/firebase_core/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_core_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_core/example/ios/Runner/main.m b/packages/firebase_core/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_core/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_core/example/lib/main.dart b/packages/firebase_core/example/lib/main.dart deleted file mode 100644 index 80da9e02a056..000000000000 --- a/packages/firebase_core/example/lib/main.dart +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'package:flutter/material.dart'; -import 'package:firebase_core/firebase_core.dart'; - -void main() => runApp(MyApp()); - -class MyApp extends StatelessWidget { - final String name = 'foo'; - final FirebaseOptions options = const FirebaseOptions( - googleAppID: '1:297855924061:ios:c6de2b69b03a5be8', - gcmSenderID: '297855924061', - apiKey: 'AIzaSyBq6mcufFXfyqr79uELCiqM_O_1-G72PVU', - ); - - Future _configure() async { - final FirebaseApp app = await FirebaseApp.configure( - name: name, - options: options, - ); - assert(app != null); - print('Configured $app'); - } - - Future _allApps() async { - final List apps = await FirebaseApp.allApps(); - print('Currently configured apps: $apps'); - } - - Future _options() async { - final FirebaseApp app = await FirebaseApp.appNamed(name); - final FirebaseOptions options = await app?.options; - print('Current options for app $name: $options'); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Firebase Core example app'), - ), - body: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - RaisedButton( - onPressed: _configure, child: const Text('initialize')), - RaisedButton(onPressed: _allApps, child: const Text('allApps')), - RaisedButton(onPressed: _options, child: const Text('options')), - ], - ), - ), - ), - ); - } -} diff --git a/packages/firebase_core/example/pubspec.yaml b/packages/firebase_core/example/pubspec.yaml deleted file mode 100644 index a020d145fcc2..000000000000 --- a/packages/firebase_core/example/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: firebase_core_example -description: Demonstrates how to use the firebase_core plugin. - -dependencies: - flutter: - sdk: flutter - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.0 - -dev_dependencies: - flutter_test: - sdk: flutter - - firebase_core: - path: ../ - -# For information on the generic Dart part of this file, see the -# following page: https://www.dartlang.org/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - uses-material-design: true diff --git a/packages/firebase_core/firebase_core_android.iml b/packages/firebase_core/firebase_core_android.iml deleted file mode 100644 index 0ebb6c9fe763..000000000000 --- a/packages/firebase_core/firebase_core_android.iml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_core/ios/Assets/.gitkeep b/packages/firebase_core/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h b/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h deleted file mode 100644 index 42a71d29f641..000000000000 --- a/packages/firebase_core/ios/Classes/FirebaseCorePlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseCorePlugin : NSObject -@end diff --git a/packages/firebase_core/ios/Classes/FirebaseCorePlugin.m b/packages/firebase_core/ios/Classes/FirebaseCorePlugin.m deleted file mode 100644 index ccf06bf111ed..000000000000 --- a/packages/firebase_core/ios/Classes/FirebaseCorePlugin.m +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseCorePlugin.h" -#import "UserAgent.h" - -#import - -static NSDictionary *getDictionaryFromFIROptions(FIROptions *options) { - if (!options) { - return nil; - } - return @{ - @"googleAppID" : options.googleAppID ?: [NSNull null], - @"bundleID" : options.bundleID ?: [NSNull null], - @"GCMSenderID" : options.GCMSenderID ?: [NSNull null], - @"APIKey" : options.APIKey ?: [NSNull null], - @"clientID" : options.clientID ?: [NSNull null], - @"trackingID" : options.trackingID ?: [NSNull null], - @"projectID" : options.projectID ?: [NSNull null], - @"androidClientID" : options.androidClientID ?: [NSNull null], - @"databaseUrl" : options.databaseURL ?: [NSNull null], - @"storageBucket" : options.storageBucket ?: [NSNull null], - @"deepLinkURLScheme" : options.deepLinkURLScheme ?: [NSNull null], - }; -} - -static NSDictionary *getDictionaryFromFIRApp(FIRApp *app) { - if (!app) { - return nil; - } - return @{@"name" : app.name, @"options" : getDictionaryFromFIROptions(app.options)}; -} - -@implementation FLTFirebaseCorePlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_core" - binaryMessenger:[registrar messenger]]; - FLTFirebaseCorePlugin *instance = [[FLTFirebaseCorePlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"FirebaseApp#configure" isEqualToString:call.method]) { - NSString *name = call.arguments[@"name"]; - NSDictionary *optionsDictionary = call.arguments[@"options"]; - FIROptions *options = - [[FIROptions alloc] initWithGoogleAppID:optionsDictionary[@"googleAppID"] - GCMSenderID:optionsDictionary[@"GCMSenderID"]]; - if (![optionsDictionary[@"bundleID"] isEqual:[NSNull null]]) - options.bundleID = optionsDictionary[@"bundleID"]; - if (![optionsDictionary[@"APIKey"] isEqual:[NSNull null]]) - options.APIKey = optionsDictionary[@"APIKey"]; - if (![optionsDictionary[@"clientID"] isEqual:[NSNull null]]) - options.clientID = optionsDictionary[@"clientID"]; - if (![optionsDictionary[@"trackingID"] isEqual:[NSNull null]]) - options.trackingID = optionsDictionary[@"trackingID"]; - if (![optionsDictionary[@"projectID"] isEqual:[NSNull null]]) - options.projectID = optionsDictionary[@"projectID"]; - if (![optionsDictionary[@"androidClientID"] isEqual:[NSNull null]]) - options.androidClientID = optionsDictionary[@"androidClientID"]; - if (![optionsDictionary[@"databaseURL"] isEqual:[NSNull null]]) - options.databaseURL = optionsDictionary[@"databaseURL"]; - if (![optionsDictionary[@"storageBucket"] isEqual:[NSNull null]]) - options.storageBucket = optionsDictionary[@"storageBucket"]; - if (![optionsDictionary[@"deepLinkURLScheme"] isEqual:[NSNull null]]) - options.deepLinkURLScheme = optionsDictionary[@"deepLinkURLScheme"]; - [FIRApp configureWithName:name options:options]; - result(nil); - } else if ([@"FirebaseApp#allApps" isEqualToString:call.method]) { - NSDictionary *allApps = [FIRApp allApps]; - NSMutableArray *appsList = [NSMutableArray array]; - for (NSString *name in allApps) { - FIRApp *app = allApps[name]; - [appsList addObject:getDictionaryFromFIRApp(app)]; - } - result(appsList.count > 0 ? appsList : nil); - } else if ([@"FirebaseApp#appNamed" isEqualToString:call.method]) { - NSString *name = call.arguments; - FIRApp *app = [FIRApp appNamed:name]; - result(getDictionaryFromFIRApp(app)); - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/packages/firebase_core/ios/firebase_core.podspec b/packages/firebase_core/ios/firebase_core.podspec deleted file mode 100644 index 9454fb541be8..000000000000 --- a/packages/firebase_core/ios/firebase_core.podspec +++ /dev/null @@ -1,32 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_core' - s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.ios.deployment_target = '8.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-core\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_core/lib/firebase_core.dart b/packages/firebase_core/lib/firebase_core.dart deleted file mode 100644 index 7a8d76191744..000000000000 --- a/packages/firebase_core/lib/firebase_core.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_core; - -import 'dart:async'; -import 'dart:io' show Platform; -import 'dart:ui' show hashValues; - -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -part 'src/firebase_app.dart'; -part 'src/firebase_options.dart'; diff --git a/packages/firebase_core/lib/src/firebase_app.dart b/packages/firebase_core/lib/src/firebase_app.dart deleted file mode 100644 index f5b5069f8aec..000000000000 --- a/packages/firebase_core/lib/src/firebase_app.dart +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_core; - -class FirebaseApp { - @visibleForTesting - const FirebaseApp({@required this.name}) : assert(name != null); - - /// The name of this app. - final String name; - - static final String defaultAppName = - Platform.isIOS ? '__FIRAPP_DEFAULT' : '[DEFAULT]'; - - @visibleForTesting - static const MethodChannel channel = MethodChannel( - 'plugins.flutter.io/firebase_core', - ); - - /// A copy of the options for this app. These are non-modifiable. - /// - /// This getter is asynchronous because apps can also be configured by native - /// code. - Future get options async { - final Map app = - await channel.invokeMapMethod( - 'FirebaseApp#appNamed', - name, - ); - assert(app != null); - return FirebaseOptions.from(app['options']); - } - - /// Returns a previously created FirebaseApp instance with the given name, - /// or null if no such app exists. - static Future appNamed(String name) async { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map app = - await channel.invokeMapMethod( - 'FirebaseApp#appNamed', - name, - ); - return app == null ? null : FirebaseApp(name: app['name']); - } - - /// Returns the default (first initialized) instance of the FirebaseApp. - static final FirebaseApp instance = FirebaseApp(name: defaultAppName); - - /// Configures an app with the given [name] and [options]. - /// - /// Configuring the default app is not currently supported. Plugins that - /// can interact with the default app should configure it automatically at - /// plugin registration time. - /// - /// Changing the options of a configured app is not supported. - static Future configure({ - @required String name, - @required FirebaseOptions options, - }) async { - assert(name != null); - assert(name != defaultAppName); - assert(options != null); - assert(options.googleAppID != null); - final FirebaseApp existingApp = await FirebaseApp.appNamed(name); - if (existingApp != null) { - return existingApp; - } - await channel.invokeMethod( - 'FirebaseApp#configure', - {'name': name, 'options': options.asMap}, - ); - return FirebaseApp(name: name); - } - - /// Returns a list of all extant FirebaseApp instances, or null if there are - /// no FirebaseApp instances. - static Future> allApps() async { - final List result = await channel.invokeListMethod( - 'FirebaseApp#allApps', - ); - return result - ?.map( - (dynamic app) => FirebaseApp(name: app['name']), - ) - ?.toList(); - } - - @override - bool operator ==(dynamic other) { - if (identical(this, other)) return true; - if (other is! FirebaseApp) return false; - return other.name == name; - } - - @override - int get hashCode => name.hashCode; - - @override - String toString() => '$FirebaseApp($name)'; -} diff --git a/packages/firebase_core/lib/src/firebase_options.dart b/packages/firebase_core/lib/src/firebase_options.dart deleted file mode 100644 index 33aea5ced5b6..000000000000 --- a/packages/firebase_core/lib/src/firebase_options.dart +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_core; - -class FirebaseOptions { - const FirebaseOptions({ - this.apiKey, - this.bundleID, - this.clientID, - this.trackingID, - this.gcmSenderID, - this.projectID, - this.androidClientID, - @required this.googleAppID, - this.databaseURL, - this.deepLinkURLScheme, - this.storageBucket, - }) : assert(googleAppID != null); - - @visibleForTesting - FirebaseOptions.from(Map map) - : apiKey = map['APIKey'], - bundleID = map['bundleID'], - clientID = map['clientID'], - trackingID = map['trackingID'], - gcmSenderID = map['GCMSenderID'], - projectID = map['projectID'], - androidClientID = map['androidClientID'], - googleAppID = map['googleAppID'], - databaseURL = map['databaseURL'], - deepLinkURLScheme = map['deepLinkURLScheme'], - storageBucket = map['storageBucket'] { - assert(googleAppID != null); - } - - /// An API key used for authenticating requests from your app, e.g. - /// "AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to - /// Google servers. - /// - /// This property is required on Android. - final String apiKey; - - /// The iOS bundle ID for the application. Defaults to - /// `[[NSBundle mainBundle] bundleID]` when not set manually or in a plist. - /// - /// This property is used on iOS only. - final String bundleID; - - /// The OAuth2 client ID for iOS application used to authenticate Google - /// users, for example "12345.apps.googleusercontent.com", used for signing in - /// with Google. - /// - /// This property is used on iOS only. - final String clientID; - - /// The tracking ID for Google Analytics, e.g. "UA-12345678-1", used to - /// configure Google Analytics. - /// - /// This property is used on iOS only. - final String trackingID; - - /// The Project Number from the Google Developer’s console, for example - /// "012345678901", used to configure Google Cloud Messaging. - /// - /// This property is required on iOS. - final String gcmSenderID; - - /// The Project ID from the Firebase console, for example "abc-xyz-123." - final String projectID; - - /// The Android client ID, for example "12345.apps.googleusercontent.com." - /// - /// This property is used on iOS only. - final String androidClientID; - - /// The Google App ID that is used to uniquely identify an instance of an app. - /// - /// This property cannot be `null`. - final String googleAppID; - - /// The database root URL, e.g. "http://abc-xyz-123.firebaseio.com." - /// - /// This property should be set for apps that use Firebase Database. - final String databaseURL; - - /// The URL scheme used to set up Durable Deep Link service. - /// - /// This property is used on iOS only. - final String deepLinkURLScheme; - - /// The Google Cloud Storage bucket name, e.g. - /// "abc-xyz-123.storage.firebase.com." - final String storageBucket; - - @visibleForTesting - Map get asMap { - return { - 'APIKey': apiKey, - 'bundleID': bundleID, - 'clientID': clientID, - 'trackingID': trackingID, - 'GCMSenderID': gcmSenderID, - 'projectID': projectID, - 'androidClientID': androidClientID, - 'googleAppID': googleAppID, - 'databaseURL': databaseURL, - 'deepLinkURLScheme': deepLinkURLScheme, - 'storageBucket': storageBucket, - }; - } - - @override - bool operator ==(dynamic other) { - if (identical(this, other)) return true; - if (other is! FirebaseOptions) return false; - return other.apiKey == apiKey && - other.bundleID == bundleID && - other.clientID == clientID && - other.trackingID == trackingID && - other.gcmSenderID == gcmSenderID && - other.projectID == projectID && - other.androidClientID == androidClientID && - other.googleAppID == googleAppID && - other.databaseURL == databaseURL && - other.deepLinkURLScheme == deepLinkURLScheme && - other.storageBucket == storageBucket; - } - - @override - int get hashCode { - return hashValues( - apiKey, - bundleID, - clientID, - trackingID, - gcmSenderID, - projectID, - androidClientID, - googleAppID, - databaseURL, - deepLinkURLScheme, - storageBucket, - ); - } - - @override - String toString() => asMap.toString(); -} diff --git a/packages/firebase_core/pubspec.yaml b/packages/firebase_core/pubspec.yaml deleted file mode 100644 index aa8f37e26ba1..000000000000 --- a/packages/firebase_core/pubspec.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: firebase_core -description: Flutter plugin for Firebase Core, enabling connecting to multiple - Firebase apps. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_core -version: 0.4.0+8 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.core - iosPrefix: FLT - pluginClass: FirebaseCorePlugin - -dependencies: - flutter: - sdk: flutter - meta: "^1.0.5" - -dev_dependencies: - flutter_test: - sdk: flutter - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_core/test/firebase_core_test.dart b/packages/firebase_core/test/firebase_core_test.dart deleted file mode 100755 index d09a8c99629d..000000000000 --- a/packages/firebase_core/test/firebase_core_test.dart +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebaseApp', () { - final List log = []; - const FirebaseApp testApp = FirebaseApp( - name: 'testApp', - ); - const FirebaseOptions testOptions = FirebaseOptions( - apiKey: 'testAPIKey', - bundleID: 'testBundleID', - clientID: 'testClientID', - trackingID: 'testTrackingID', - gcmSenderID: 'testGCMSenderID', - projectID: 'testProjectID', - androidClientID: 'testAndroidClientID', - googleAppID: 'testGoogleAppID', - databaseURL: 'testDatabaseURL', - deepLinkURLScheme: 'testDeepLinkURLScheme', - storageBucket: 'testStorageBucket', - ); - - setUp(() async { - FirebaseApp.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'FirebaseApp#appNamed': - if (methodCall.arguments != 'testApp') return null; - return { - 'name': 'testApp', - 'options': { - 'APIKey': 'testAPIKey', - 'bundleID': 'testBundleID', - 'clientID': 'testClientID', - 'trackingID': 'testTrackingID', - 'GCMSenderID': 'testGCMSenderID', - 'projectID': 'testProjectID', - 'androidClientID': 'testAndroidClientID', - 'googleAppID': 'testGoogleAppID', - 'databaseURL': 'testDatabaseURL', - 'deepLinkURLScheme': 'testDeepLinkURLScheme', - 'storageBucket': 'testStorageBucket', - }, - }; - case 'FirebaseApp#allApps': - return >[ - { - 'name': 'testApp', - }, - ]; - default: - return null; - } - }); - log.clear(); - }); - - test('configure', () async { - final FirebaseApp reconfiguredApp = await FirebaseApp.configure( - name: 'testApp', - options: testOptions, - ); - expect(reconfiguredApp, equals(testApp)); - final FirebaseApp newApp = await FirebaseApp.configure( - name: 'newApp', - options: testOptions, - ); - expect(newApp.name, equals('newApp')); - expect( - log, - [ - isMethodCall( - 'FirebaseApp#appNamed', - arguments: 'testApp', - ), - isMethodCall( - 'FirebaseApp#appNamed', - arguments: 'newApp', - ), - isMethodCall( - 'FirebaseApp#configure', - arguments: { - 'name': 'newApp', - 'options': testOptions.asMap, - }, - ), - ], - ); - }); - - test('appNamed', () async { - final FirebaseApp existingApp = await FirebaseApp.appNamed('testApp'); - expect(existingApp.name, equals('testApp')); - expect((await existingApp.options), equals(testOptions)); - final FirebaseApp missingApp = await FirebaseApp.appNamed('missingApp'); - expect(missingApp, isNull); - expect( - log, - [ - isMethodCall( - 'FirebaseApp#appNamed', - arguments: 'testApp', - ), - isMethodCall( - 'FirebaseApp#appNamed', - arguments: 'testApp', - ), - isMethodCall( - 'FirebaseApp#appNamed', - arguments: 'missingApp', - ), - ], - ); - }); - - test('allApps', () async { - final List allApps = await FirebaseApp.allApps(); - expect(allApps, equals([testApp])); - expect( - log, - [ - isMethodCall( - 'FirebaseApp#allApps', - arguments: null, - ), - ], - ); - }); - }); -} diff --git a/packages/firebase_crashlytics/.gitignore b/packages/firebase_crashlytics/.gitignore deleted file mode 100644 index 2ece5a414cb5..000000000000 --- a/packages/firebase_crashlytics/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.DS_Store -.dart_tool/ - -.packages -.pub/ -pubspec.lock - -build/ - -ios/Classes/UserAgent.h - diff --git a/packages/firebase_crashlytics/.metadata b/packages/firebase_crashlytics/.metadata deleted file mode 100644 index fbc1f3952e5d..000000000000 --- a/packages/firebase_crashlytics/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b - channel: beta - -project_type: plugin diff --git a/packages/firebase_crashlytics/CHANGELOG.md b/packages/firebase_crashlytics/CHANGELOG.md deleted file mode 100644 index 6b85c00fea17..000000000000 --- a/packages/firebase_crashlytics/CHANGELOG.md +++ /dev/null @@ -1,94 +0,0 @@ -## 0.1.0+2 - -* [iOS] Fixes crash when trying to report a crash without any context - -## 0.1.0+1 - -* Added additional exception information from the Flutter framework to the reports. -* Refactored debug printing of exceptions to be human-readable. -* Passing `null` stack traces is now supported. -* Added the "Error reported to Crashlytics." print statement that was previously missing. -* Updated `README.md` to include both the breaking change from `0.1.0` and the newly added - `recordError` function in the setup section. -* Adjusted `README.md` formatting. -* Fixed `recordFlutterError` method name in the `0.1.0` changelog entry. - -## 0.1.0 - -* **Breaking Change** Renamed `onError` to `recordFlutterError`. -* Added `recordError` method for errors caught using `runZoned`'s `onError`. - -## 0.0.4+12 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.0.4+11 - -* Fixed an issue where `Crashlytics#getStackTraceElements` didn't handle functions without classes. - -## 0.0.4+10 - -* Update README. - -## 0.0.4+9 - -* Fixed custom keys implementation. -* Added tests for custom keys implementation. -* Removed a print statement. - -## 0.0.4+8 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.0.4+7 - -* Fixed an issue where `Crashlytics#setUserIdentifier` incorrectly called `setUserEmail` on iOS. - -## 0.0.4+6 - -* On Android, use actual the Dart exception name instead of "Dart error." - -## 0.0.4+5 - -* Fix parsing stacktrace. - -## 0.0.4+4 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. - -## 0.0.4+3 - -* Migrate our handling of `FlutterErrorDetails` to work on both Flutter stable - and master. - -## 0.0.4+2 - -* Keep debug log formatting. - -## 0.0.4+1 - -* Added an integration test. - -## 0.0.4 - -* Initialize Fabric automatically, preventing crashes that could occur when setting user data. - -## 0.0.3 - -* Rely on firebase_core to add the Android dependency on Firebase instead of hardcoding the version ourselves. - -## 0.0.2+1 - -* Update variable name `enableInDevMode` in README. - -## 0.0.2 - -* Updated the iOS podspec to a static framework to support compatibility with Swift plugins. -* Updated the Android gradle dependencies to prevent build errors. - -## 0.0.1 - -* Initial release of Firebase Crashlytics plugin. -This version reports uncaught errors as non-fatal exceptions in the -Firebase console. diff --git a/packages/firebase_crashlytics/LICENSE b/packages/firebase_crashlytics/LICENSE deleted file mode 100644 index 03118dc2b39b..000000000000 --- a/packages/firebase_crashlytics/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_crashlytics/README.md b/packages/firebase_crashlytics/README.md deleted file mode 100644 index 9f3980a0d16b..000000000000 --- a/packages/firebase_crashlytics/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# firebase_crashlytics plugin - -A Flutter plugin to use the [Firebase Crashlytics Service](https://firebase.google.com/docs/crashlytics/). - -[![pub package](https://img.shields.io/pub/v/firebase_crashlytics.svg)](https://pub.dartlang.org/packages/firebase_crashlytics) - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -### Import the firebase_crashlytics plugin - -To use the `firebase_crashlytics` plugin, follow the [plugin installation instructions](https://pub.dartlang.org/packages/firebase_crashlytics#pub-pkg-tab-installing). - -### Android integration - -Enable the Google services by configuring the Gradle scripts as such: - -1. Add the Fabric repository to the `[project]/android/build.gradle` file. -``` -repositories { - google() - jcenter() - // Additional repository for fabric resources - maven { - url 'https://maven.fabric.io/public' - } -} -``` - -2. Add the following classpaths to the `[project]/android/build.gradle` file. -```gradle -dependencies { - // Example existing classpath - classpath 'com.android.tools.build:gradle:3.2.1' - // Add the google services classpath - classpath 'com.google.gms:google-services:4.3.0' - // Add fabric classpath - classpath 'io.fabric.tools:gradle:1.26.1' -} -``` - -2. Apply the following plugins in the `[project]/android/app/build.gradle` file. -```gradle -// ADD THIS AT THE BOTTOM -apply plugin: 'io.fabric' -apply plugin: 'com.google.gms.google-services' -``` - -*Note:* If this section is not completed, you will get an error like this: -``` -java.lang.IllegalStateException: -Default FirebaseApp is not initialized in this process [package name]. -Make sure to call FirebaseApp.initializeApp(Context) first. -``` - -*Note:* When you are debugging on Android, use a device or AVD with Google Play services. -Otherwise, you will not be able to use Firebase Crashlytics. - -### iOS Integration - -Add the Crashlytics run scripts: - -1. From Xcode select `Runner` from the project navigation. -1. Select the `Build Phases` tab. -1. Click `+ Add a new build phase`, and select `New Run Script Phase`. -1. Add `${PODS_ROOT}/Fabric/run` to the `Type a script...` text box. -1. If you are using Xcode 10, add the location of `Info.plist`, built by your app, to the `Build Phase's Input Files` field. - E.g.: `$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)` - -### Use the plugin - -Add the following imports to your Dart code: -```dart -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; -``` - -Setup `Crashlytics`: -```dart -void main() { - // Set `enableInDevMode` to true to see reports while in debug mode - // This is only to be used for confirming that reports are being - // submitted as expected. It is not intended to be used for everyday - // development. - Crashlytics.instance.enableInDevMode = true; - - // Pass all uncaught errors from the framework to Crashlytics. - FlutterError.onError = Crashlytics.instance.recordFlutterError; - - runApp(MyApp()); -} -``` - -Overriding `FlutterError.onError` with `Crashlytics.instance.recordFlutterError` will automatically catch all -errors that are thrown from within the Flutter framework. -If you want to catch errors that occur in `runZoned`, -you can supply `Crashlytics.instance.recordError` to the `onError` parameter: -```dart -runZoned>(() async { - // ... - }, onError: Crashlytics.instance.recordError); -``` - -## Result - -If an error is caught, you should see the following messages in your logs: -``` -flutter: Flutter error caught by Crashlytics plugin: -// OR if you use recordError for runZoned: -flutter: Error caught by Crashlytics plugin : -// Exception, context, information, and stack trace in debug mode -// OR if not in debug mode: -flutter: Error reported to Crashlytics. -``` - -*Note:* It may take awhile (up to 24 hours) before you will be able to see the logs appear in your Firebase console. - -## Example - -See the [example application](https://github.com/flutter/plugins/tree/master/packages/firebase_crashlytics/example) source -for a complete sample app using `firebase_crashlytics`. - -## Issues and feedback - -Please file [issues](https://github.com/flutter/flutter/issues/new) -to send feedback or report a bug. Thank you! diff --git a/packages/firebase_crashlytics/android/.gitignore b/packages/firebase_crashlytics/android/.gitignore deleted file mode 100644 index c6cbe562a427..000000000000 --- a/packages/firebase_crashlytics/android/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/packages/firebase_crashlytics/android/build.gradle b/packages/firebase_crashlytics/android/build.gradle deleted file mode 100644 index 4e8fe907794c..000000000000 --- a/packages/firebase_crashlytics/android/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -group 'io.flutter.plugins.firebase.crashlytics.firebasecrashlytics' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - maven { - url 'https://maven.fabric.io/public' - } - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } -} - -dependencies { - implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9' - implementation 'com.google.firebase:firebase-common:16.1.0' -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_crashlytics/android/gradle.properties b/packages/firebase_crashlytics/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_crashlytics/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_crashlytics/android/settings.gradle b/packages/firebase_crashlytics/android/settings.gradle deleted file mode 100644 index 0db0f63e40fd..000000000000 --- a/packages/firebase_crashlytics/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_crashlytics' diff --git a/packages/firebase_crashlytics/android/src/main/AndroidManifest.xml b/packages/firebase_crashlytics/android/src/main/AndroidManifest.xml deleted file mode 100644 index 535d778d3920..000000000000 --- a/packages/firebase_crashlytics/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_crashlytics/android/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlytics/FirebaseCrashlyticsPlugin.java b/packages/firebase_crashlytics/android/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlytics/FirebaseCrashlyticsPlugin.java deleted file mode 100644 index 0c3edff9991f..000000000000 --- a/packages/firebase_crashlytics/android/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlytics/FirebaseCrashlyticsPlugin.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.crashlytics.firebasecrashlytics; - -import android.util.Log; -import com.crashlytics.android.Crashlytics; -import io.fabric.sdk.android.Fabric; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** FirebaseCrashlyticsPlugin */ -public class FirebaseCrashlyticsPlugin implements MethodCallHandler { - - public static final String TAG = "CrashlyticsPlugin"; - - /** Plugin registration. */ - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_crashlytics"); - channel.setMethodCallHandler(new FirebaseCrashlyticsPlugin()); - - if (!Fabric.isInitialized()) { - Fabric.with(registrar.context(), new Crashlytics()); - } - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - if (call.method.equals("Crashlytics#onError")) { - // Add logs. - List logs = call.argument("logs"); - for (String log : logs) { - Crashlytics.log(log); - } - - // Set keys. - List> keys = call.argument("keys"); - for (Map key : keys) { - switch ((String) key.get("type")) { - case "int": - Crashlytics.setInt((String) key.get("key"), (int) key.get("value")); - break; - case "double": - Crashlytics.setDouble((String) key.get("key"), (double) key.get("value")); - break; - case "string": - Crashlytics.setString((String) key.get("key"), (String) key.get("value")); - break; - case "boolean": - Crashlytics.setBool((String) key.get("key"), (boolean) key.get("value")); - break; - } - } - - // Report crash. - String dartExceptionMessage = (String) call.argument("exception"); - Exception exception = new Exception(dartExceptionMessage); - List> errorElements = call.argument("stackTraceElements"); - List elements = new ArrayList<>(); - for (Map errorElement : errorElements) { - StackTraceElement stackTraceElement = generateStackTraceElement(errorElement); - if (stackTraceElement != null) { - elements.add(stackTraceElement); - } - } - exception.setStackTrace(elements.toArray(new StackTraceElement[elements.size()])); - - Crashlytics.setString("exception", (String) call.argument("exception")); - - // Set a "reason" (to match iOS) to show where the exception was thrown. - final String context = call.argument("context"); - if (context != null) Crashlytics.setString("reason", "thrown " + context); - - // Log information. - final String information = call.argument("information"); - if (information != null && !information.isEmpty()) Crashlytics.log(information); - - Crashlytics.logException(exception); - result.success("Error reported to Crashlytics."); - } else if (call.method.equals("Crashlytics#isDebuggable")) { - result.success(Fabric.isDebuggable()); - } else if (call.method.equals("Crashlytics#getVersion")) { - result.success(Crashlytics.getInstance().getVersion()); - } else if (call.method.equals("Crashlytics#setUserEmail")) { - Crashlytics.setUserEmail((String) call.argument("email")); - result.success(null); - } else if (call.method.equals("Crashlytics#setUserIdentifier")) { - Crashlytics.setUserIdentifier((String) call.argument("identifier")); - result.success(null); - } else if (call.method.equals("Crashlytics#setUserName")) { - Crashlytics.setUserName((String) call.argument("name")); - result.success(null); - } else { - result.notImplemented(); - } - } - - /** - * Extract StackTraceElement from Dart stack trace element. - * - * @param errorElement Map representing the parts of a Dart error. - * @return Stack trace element to be used as part of an Exception stack trace. - */ - private StackTraceElement generateStackTraceElement(Map errorElement) { - try { - String fileName = errorElement.get("file"); - String lineNumber = errorElement.get("line"); - String className = errorElement.get("class"); - String methodName = errorElement.get("method"); - - return new StackTraceElement( - className == null ? "" : className, methodName, fileName, Integer.parseInt(lineNumber)); - } catch (Exception e) { - Log.e(TAG, "Unable to generate stack trace element from Dart side error."); - return null; - } - } -} diff --git a/packages/firebase_crashlytics/android/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlytics/FlutterFirebaseAppRegistrar.java b/packages/firebase_crashlytics/android/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlytics/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index fdcf9d6b6737..000000000000 --- a/packages/firebase_crashlytics/android/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlytics/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.crashlytics.firebasecrashlytics; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_crashlytics/android/user-agent.gradle b/packages/firebase_crashlytics/android/user-agent.gradle deleted file mode 100644 index e947d9605bb6..000000000000 --- a/packages/firebase_crashlytics/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-cls" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_crashlytics/example/.gitignore b/packages/firebase_crashlytics/example/.gitignore deleted file mode 100644 index 47e0b4d62146..000000000000 --- a/packages/firebase_crashlytics/example/.gitignore +++ /dev/null @@ -1,71 +0,0 @@ -# Miscellaneous -*.class -*.lock -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# Visual Studio Code related -.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.packages -.pub-cache/ -.pub/ -build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/firebase_crashlytics/example/.metadata b/packages/firebase_crashlytics/example/.metadata deleted file mode 100644 index fd2a86fddab1..000000000000 --- a/packages/firebase_crashlytics/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b - channel: beta - -project_type: app diff --git a/packages/firebase_crashlytics/example/README.md b/packages/firebase_crashlytics/example/README.md deleted file mode 100644 index 6b284ab319b7..000000000000 --- a/packages/firebase_crashlytics/example/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# firebase_crashlytics_example - -Demonstrates how to use the firebase_crashlytics plugin. - -## Getting Started - -### Add your own Firebase project - -This example initially uses a default project for CI purposes. You must -replace the default project with your own so that you can review the error -reports submitted to the Firebase console. - -See [docs](https://firebase.google.com/docs/flutter/setup) for how to add -Firebase to a Flutter project. - -For further help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_crashlytics/example/android/app/build.gradle b/packages/firebase_crashlytics/example/android/app/build.gradle deleted file mode 100644 index 3811065ae4d4..000000000000 --- a/packages/firebase_crashlytics/example/android/app/build.gradle +++ /dev/null @@ -1,61 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 27 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "io.flutter.plugins.firebase.crashlytics.firebasecrashlyticsexample" - minSdkVersion 16 - targetSdkVersion 27 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { -} - -apply plugin: 'io.fabric' -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_crashlytics/example/android/app/google-services.json b/packages/firebase_crashlytics/example/android/app/google-services.json deleted file mode 100644 index 4f8ed237b31b..000000000000 --- a/packages/firebase_crashlytics/example/android/app/google-services.json +++ /dev/null @@ -1,545 +0,0 @@ -{ - "project_info": { - "project_number": "380450695418", - "firebase_url": "https://fir-for-flutter-xry.firebaseio.com", - "project_id": "firebase-for-flutter-xry", - "storage_bucket": "firebase-for-flutter-xry.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:df22ebedafef81e5", - "android_client_info": { - "package_name": "com.example.myapp" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:c1f0f09aa42eba16", - "android_client_info": { - "package_name": "com.google.firebase.example.fireeats" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-680tdukm5lmsvqdgfjf35oooapesp5qe.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.google.firebase.example.fireeats", - "certificate_hash": "13b46061adbac6fccea79893f1eeff8f94b17318" - } - }, - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:cdde97911ac112a2", - "android_client_info": { - "package_name": "com.google.firehunt" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-56dso58q89k1u1g4jr2csjvu0t0s5sah.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.google.firehunt", - "certificate_hash": "13b46061adbac6fccea79893f1eeff8f94b17318" - } - }, - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:66cfa0cc55000185", - "android_client_info": { - "package_name": "io.flutter.plugins.crashlytics.crashlyticsexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:7521d73664dc56fc", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.cloudfunctions.cloudfunctionsexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:534a419926d9c345", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.crashlytics.firebasecrashlyticsexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:b46d52db5a4d815e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firebaseremoteconfig" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:6ef94ae486218531", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firebaseremoteconfigexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:236f9daea101f77e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-s5i0ce3nvtebsqc43fdjq7rub7m5kl52.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample", - "certificate_hash": "1da568611fe7dcfeafc0f35ad42f585c0a32012d" - } - }, - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:faccb3c5e155ce04", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.mlkit.firebasemlkitexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:11e8f037a4a3ec3b", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseauthexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-1r77qvo64360tkatfaimd7jsge6ookui.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseauthexample", - "certificate_hash": "13b46061adbac6fccea79893f1eeff8f94b17318" - } - }, - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:c68d3ad04a4046db", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasedatabaseexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-nva3tg4js1gmdrm0egas2dlbj3go6nsk.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebasedatabaseexample", - "certificate_hash": "1da568611fe7dcfeafc0f35ad42f585c0a32012d" - } - }, - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:620f0e4ca16cbddd", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasemessagingexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:380450695418:android:ef48439a0cc0263d", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasestorageexample" - } - }, - "oauth_client": [ - { - "client_id": "380450695418-17gd38vnvfrt9ak76bfdeu4jsb0h6is5.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD-qW3X8rktjbW3BPEX8KlpqYNCUdlTtGQ" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_crashlytics/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_crashlytics/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 0c7d86680639..000000000000 --- a/packages/firebase_crashlytics/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_crashlytics/example/android/app/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlyticsexample/MainActivity.java b/packages/firebase_crashlytics/example/android/app/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlyticsexample/MainActivity.java deleted file mode 100644 index e70d93f30b57..000000000000 --- a/packages/firebase_crashlytics/example/android/app/src/main/java/io/flutter/plugins/firebase/crashlytics/firebasecrashlyticsexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebase.crashlytics.firebasecrashlyticsexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_crashlytics/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_crashlytics/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_crashlytics/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/android/app/src/main/res/values/styles.xml b/packages/firebase_crashlytics/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_crashlytics/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_crashlytics/example/android/build.gradle b/packages/firebase_crashlytics/example/android/build.gradle deleted file mode 100644 index faeab902b866..000000000000 --- a/packages/firebase_crashlytics/example/android/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - maven { - url 'https://maven.fabric.io/public' - } - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.2' - classpath 'com.google.gms:google-services:4.3.0' - classpath 'io.fabric.tools:gradle:1.26.1' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_crashlytics/example/android/gradle.properties b/packages/firebase_crashlytics/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_crashlytics/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_crashlytics/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_crashlytics/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2819f022f1fd..000000000000 --- a/packages/firebase_crashlytics/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_crashlytics/example/android/settings.gradle b/packages/firebase_crashlytics/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/firebase_crashlytics/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_crashlytics/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_crashlytics/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9367d483e44e..000000000000 --- a/packages/firebase_crashlytics/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_crashlytics/example/ios/Flutter/Debug.xcconfig b/packages/firebase_crashlytics/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_crashlytics/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_crashlytics/example/ios/Flutter/Release.xcconfig b/packages/firebase_crashlytics/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_crashlytics/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_crashlytics/example/ios/GoogleService-Info.plist b/packages/firebase_crashlytics/example/ios/GoogleService-Info.plist deleted file mode 100644 index c9c6c3ae12aa..000000000000 --- a/packages/firebase_crashlytics/example/ios/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.380450695418-j9bquuvdhv7iimnca4n7mhrp9a0kv9un - API_KEY - AIzaSyDKzrI_W_MaUt46jthsPB7FTG-RdSKeKEw - GCM_SENDER_ID - 380450695418 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample - PROJECT_ID - firebase-for-flutter-xry - STORAGE_BUCKET - firebase-for-flutter-xry.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:380450695418:ios:2693ad5ab6a23cde - DATABASE_URL - https://fir-for-flutter-xry.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 40c572dde0ed..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,605 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - C402FAF4F184B60574825BEF /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C402FD7E9DA6F279205D8C27 /* GoogleService-Info.plist */; }; - F3CD36E5DA207BF24A9BECE5 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 90669E7218FC80716B8D1896 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; - 3483EF1253077C699E331BE4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 76260442B9364E9433AC028C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 90669E7218FC80716B8D1896 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C402FD7E9DA6F279205D8C27 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.info; path = "GoogleService-Info.plist"; sourceTree = ""; }; - D14C8104C6F6DBC16421D2F4 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - F3CD36E5DA207BF24A9BECE5 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 578F13DB49C24452CA02A630 /* Pods */ = { - isa = PBXGroup; - children = ( - 76260442B9364E9433AC028C /* Pods-Runner.debug.xcconfig */, - D14C8104C6F6DBC16421D2F4 /* Pods-Runner.release.xcconfig */, - 3483EF1253077C699E331BE4 /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - 9278C72542532A6D4853596F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 90669E7218FC80716B8D1896 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 578F13DB49C24452CA02A630 /* Pods */, - 9278C72542532A6D4853596F /* Frameworks */, - C402FD7E9DA6F279205D8C27 /* GoogleService-Info.plist */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - FF93E33FF58D2AD673D0393E /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 048FD65633588382F9E468AC /* [CP] Embed Pods Frameworks */, - 324E062721E4156B000CBB4D /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - C402FAF4F184B60574825BEF /* GoogleService-Info.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 048FD65633588382F9E468AC /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 324E062721E4156B000CBB4D /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "$(SRCROOT)/newInputFile", - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/Fabric/run\"\n"; - }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; - }; - FF93E33FF58D2AD673D0393E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = S8QB4VV633; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.crashlytics.firebaseCrashlyticsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index ec99067959e0..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 949b67898200..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - BuildSystemType - Original - - diff --git a/packages/firebase_crashlytics/example/ios/Runner/AppDelegate.h b/packages/firebase_crashlytics/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_crashlytics/example/ios/Runner/AppDelegate.m b/packages/firebase_crashlytics/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_crashlytics/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_crashlytics/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_crashlytics/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner/Info.plist b/packages/firebase_crashlytics/example/ios/Runner/Info.plist deleted file mode 100644 index 0f5908f87367..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_crashlytics_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_crashlytics/example/ios/Runner/main.m b/packages/firebase_crashlytics/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_crashlytics/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_crashlytics/example/lib/main.dart b/packages/firebase_crashlytics/example/lib/main.dart deleted file mode 100644 index f13881facfc6..000000000000 --- a/packages/firebase_crashlytics/example/lib/main.dart +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/material.dart'; - -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; - -void main() { - // Set `enableInDevMode` to true to see reports while in debug mode - // This is only to be used for confirming that reports are being - // submitted as expected. It is not intended to be used for everyday - // development. - Crashlytics.instance.enableInDevMode = true; - - // Pass all uncaught errors to Crashlytics. - FlutterError.onError = Crashlytics.instance.recordFlutterError; - - runZoned>(() async { - runApp(MyApp()); - }, onError: Crashlytics.instance.recordError); -} - -class MyApp extends StatefulWidget { - @override - _MyAppState createState() => _MyAppState(); -} - -class _MyAppState extends State { - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Crashlytics example app'), - ), - body: Center( - child: Column( - children: [ - FlatButton( - child: const Text('Key'), - onPressed: () { - Crashlytics.instance.setString('foo', 'bar'); - }), - FlatButton( - child: const Text('Log'), - onPressed: () { - Crashlytics.instance.log('baz'); - }), - FlatButton( - child: const Text('Crash'), - onPressed: () { - // Use Crashlytics to throw an error. Use this for - // confirmation that errors are being correctly reported. - Crashlytics.instance.crash(); - }), - FlatButton( - child: const Text('Throw Error'), - onPressed: () { - // Example of thrown error, it will be caught and sent to - // Crashlytics. - throw StateError('Uncaught error thrown by app.'); - }), - FlatButton( - child: const Text('Async out of bounds'), - onPressed: () { - // Example of an exception that does not get caught - // by `FlutterError.onError` but is caught by the `onError` handler of - // `runZoned`. - Future.delayed(Duration(seconds: 2), () { - final List list = []; - print(list[100]); - }); - }), - ], - ), - ), - ), - ); - } -} diff --git a/packages/firebase_crashlytics/example/pubspec.yaml b/packages/firebase_crashlytics/example/pubspec.yaml deleted file mode 100644 index 8a12ba4d4bd6..000000000000 --- a/packages/firebase_crashlytics/example/pubspec.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: firebase_crashlytics_example -description: Demonstrates how to use the firebase_crashlytics plugin. - -environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - - cupertino_icons: ^0.1.2 - - firebase_crashlytics: - path: ../ - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - -flutter: - uses-material-design: true diff --git a/packages/firebase_crashlytics/example/test_driver/crashlytics.dart b/packages/firebase_crashlytics/example/test_driver/crashlytics.dart deleted file mode 100644 index 2cd26d0a1612..000000000000 --- a/packages/firebase_crashlytics/example/test_driver/crashlytics.dart +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/widgets.dart'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; - -void main() { - final Completer allTestsCompleter = Completer(); - enableFlutterDriverExtension(handler: (_) => allTestsCompleter.future); - tearDownAll(() => allTestsCompleter.complete(null)); - - test('recordFlutterError', () async { - // This is currently only testing that we can log errors without crashing. - final Crashlytics crashlytics = Crashlytics.instance; - await crashlytics.setUserName('testing'); - await crashlytics.setUserIdentifier('hello'); - crashlytics.setBool('testBool', true); - crashlytics.setInt('testInt', 42); - crashlytics.setDouble('testDouble', 42.0); - crashlytics.setString('testString', 'bar'); - Crashlytics.instance.log('testing'); - await crashlytics.recordFlutterError(FlutterErrorDetails( - exception: 'testing', - stack: StackTrace.fromString(''), - context: DiagnosticsNode.message('during testing'), - informationCollector: () => [ - DiagnosticsNode.message('testing'), - DiagnosticsNode.message('information'), - ])); - }); -} diff --git a/packages/firebase_crashlytics/example/test_driver/crashlytics_test.dart b/packages/firebase_crashlytics/example/test_driver/crashlytics_test.dart deleted file mode 100644 index b0d3305cd652..000000000000 --- a/packages/firebase_crashlytics/example/test_driver/crashlytics_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2019, the Chromium project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_crashlytics/ios/.gitignore b/packages/firebase_crashlytics/ios/.gitignore deleted file mode 100644 index 710ec6cf1c71..000000000000 --- a/packages/firebase_crashlytics/ios/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig diff --git a/packages/firebase_crashlytics/ios/Assets/.gitkeep b/packages/firebase_crashlytics/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.h b/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.h deleted file mode 100644 index c0b268534401..000000000000 --- a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FirebaseCrashlyticsPlugin : NSObject -@end diff --git a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m b/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m deleted file mode 100644 index 01f233cbd347..000000000000 --- a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseCrashlyticsPlugin.h" -#import "UserAgent.h" - -#import - -@interface FirebaseCrashlyticsPlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@end - -@implementation FirebaseCrashlyticsPlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_crashlytics" - binaryMessenger:[registrar messenger]]; - FirebaseCrashlyticsPlugin *instance = [[FirebaseCrashlyticsPlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; - - [Fabric with:@[ [Crashlytics self] ]]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp defaultApp]) { - [FIRApp configure]; - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"Crashlytics#onError" isEqualToString:call.method]) { - // Add logs. - NSArray *logs = call.arguments[@"logs"]; - for (NSString *log in logs) { - CLS_LOG(@"%@", log); - } - - // Set keys. - NSArray *keys = call.arguments[@"keys"]; - for (NSDictionary *key in keys) { - if ([@"int" isEqualToString:key[@"type"]]) { - [[Crashlytics sharedInstance] setIntValue:(int)call.arguments[@"value"] - forKey:call.arguments[@"key"]]; - } else if ([@"double" isEqualToString:key[@"type"]]) { - [[Crashlytics sharedInstance] setFloatValue:[call.arguments[@"value"] floatValue] - forKey:call.arguments[@"key"]]; - } else if ([@"string" isEqualToString:key[@"type"]]) { - [[Crashlytics sharedInstance] setObjectValue:call.arguments[@"value"] - forKey:call.arguments[@"key"]]; - } else if ([@"boolean" isEqualToString:key[@"type"]]) { - [[Crashlytics sharedInstance] setBoolValue:[call.arguments[@"value"] boolValue] - forKey:call.arguments[@"key"]]; - } - } - - // Add additional information from the Flutter framework to the exception reported in - // Crashlytics. Using CLSLog instead of CLS_LOG to try to avoid the automatic inclusion of the - // line number. It also ensures that the log is only written to Crashlytics and not also to the - // offline log as explained here: - // https://support.crashlytics.com/knowledgebase/articles/92519-how-do-i-use-logging - // Although, that would only happen in debug mode, which this method call is never called in. - NSString *information = call.arguments[@"information"]; - if ([information length] != 0) { - CLSLog(information); - } - - // Report crash. - NSArray *errorElements = call.arguments[@"stackTraceElements"]; - NSMutableArray *frames = [NSMutableArray array]; - for (NSDictionary *errorElement in errorElements) { - [frames addObject:[self generateFrame:errorElement]]; - } - - NSString *context = call.arguments[@"context"]; - NSString *reason; - if (context != nil) { - reason = [NSString stringWithFormat:@"thrown %@", context]; - } - - [[Crashlytics sharedInstance] recordCustomExceptionName:call.arguments[@"exception"] - reason:reason - frameArray:frames]; - result(@"Error reported to Crashlytics."); - } else if ([@"Crashlytics#isDebuggable" isEqualToString:call.method]) { - result([NSNumber numberWithBool:[Crashlytics sharedInstance].debugMode]); - } else if ([@"Crashlytics#getVersion" isEqualToString:call.method]) { - result([Crashlytics sharedInstance].version); - } else if ([@"Crashlytics#setUserEmail" isEqualToString:call.method]) { - [[Crashlytics sharedInstance] setUserEmail:call.arguments[@"email"]]; - result(nil); - } else if ([@"Crashlytics#setUserName" isEqualToString:call.method]) { - [[Crashlytics sharedInstance] setUserName:call.arguments[@"name"]]; - result(nil); - } else if ([@"Crashlytics#setUserIdentifier" isEqualToString:call.method]) { - [[Crashlytics sharedInstance] setUserIdentifier:call.arguments[@"identifier"]]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -- (CLSStackFrame *)generateFrame:(NSDictionary *)errorElement { - CLSStackFrame *frame = [CLSStackFrame stackFrame]; - - frame.library = [errorElement valueForKey:@"class"]; - frame.symbol = [errorElement valueForKey:@"method"]; - frame.fileName = [errorElement valueForKey:@"file"]; - frame.lineNumber = [[errorElement valueForKey:@"line"] intValue]; - - return frame; -} - -@end diff --git a/packages/firebase_crashlytics/ios/firebase_crashlytics.podspec b/packages/firebase_crashlytics/ios/firebase_crashlytics.podspec deleted file mode 100644 index b611165b73d8..000000000000 --- a/packages/firebase_crashlytics/ios/firebase_crashlytics.podspec +++ /dev/null @@ -1,34 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_crashlytics' - s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.static_framework = true - s.dependency 'Flutter' - s.dependency 'Fabric' - s.dependency 'Crashlytics' - s.dependency 'Firebase/Core' - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-cls\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_crashlytics/lib/firebase_crashlytics.dart b/packages/firebase_crashlytics/lib/firebase_crashlytics.dart deleted file mode 100644 index a57738b63f43..000000000000 --- a/packages/firebase_crashlytics/lib/firebase_crashlytics.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_crashlytics; - -import 'dart:async'; -import 'dart:collection'; -import 'dart:typed_data'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:stack_trace/stack_trace.dart'; - -part 'src/firebase_crashlytics.dart'; diff --git a/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart b/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart deleted file mode 100644 index 2d853c9b40f6..000000000000 --- a/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -part of firebase_crashlytics; - -/// The entry point for accessing Crashlytics. -/// -/// You can get an instance by calling `Crashlytics.instance`. -class Crashlytics { - static final Crashlytics instance = Crashlytics(); - - /// Set to true to have errors sent to Crashlytics while in debug mode. By - /// default this is false. - bool enableInDevMode = false; - - /// Keys to be included with report. - final Map _keys = {}; - - /// Logs to be included with report. - final ListQueue _logs = ListQueue(15); - int _logSize = 0; - - @visibleForTesting - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_crashlytics'); - - /// Submits report of a non-fatal error caught by the Flutter framework. - /// to Firebase Crashlytics. - Future recordFlutterError(FlutterErrorDetails details) async { - print('Flutter error caught by Crashlytics plugin:'); - - _recordError(details.exceptionAsString(), details.stack, - context: details.context, - information: details.informationCollector == null - ? null - : details.informationCollector()); - } - - /// Submits a report of a non-fatal error. - /// - /// For errors generated by the Flutter framework, use [recordFlutterError] instead. - Future recordError(dynamic exception, StackTrace stack, - {dynamic context}) async { - print('Error caught by Crashlytics plugin :'); - - _recordError(exception, stack, context: context); - } - - void crash() { - throw StateError('Error thrown by Crashlytics plugin'); - } - - /// Reports the global value for debug mode. - /// TODO(kroikie): Clarify what this means in context of both Android and iOS. - Future isDebuggable() async { - final bool result = - await channel.invokeMethod('Crashlytics#isDebuggable'); - return result; - } - - /// Returns Crashlytics SDK version. - Future getVersion() async { - final String result = - await channel.invokeMethod('Crashlytics#getVersion'); - return result; - } - - /// Add text logging that will be sent with your next report. `msg` will be - /// printed to the console when in debug mode. Each report has a rolling max - /// of 64k of logs, older logs are removed to allow newer logs to fit within - /// the limit. - void log(String msg) { - _logSize += Uint8List.fromList(msg.codeUnits).length; - _logs.add(msg); - // Remove oldest log till logSize is no more than 64K. - while (_logSize > 65536) { - final String first = _logs.removeFirst(); - _logSize -= Uint8List.fromList(first.codeUnits).length; - } - } - - void _setValue(String key, dynamic value) { - // Check that only 64 keys are set. - if (_keys.containsKey(key) || _keys.length <= 64) { - _keys[key] = value; - } - } - - /// Sets a value to be associated with a given key for your crash data. - void setBool(String key, bool value) { - _setValue(key, value); - } - - /// Sets a value to be associated with a given key for your crash data. - void setDouble(String key, double value) { - _setValue(key, value); - } - - /// Sets a value to be associated with a given key for your crash data. - void setInt(String key, int value) { - _setValue(key, value); - } - - /// Sets a value to be associated with a given key for your crash data. - void setString(String key, String value) { - _setValue(key, value); - } - - /// Optionally set a end-user's name or username for display within the - /// Crashlytics UI. Please be mindful of end-user's privacy. - Future setUserEmail(String email) async { - await channel.invokeMethod( - 'Crashlytics#setUserEmail', {'email': email}); - } - - /// Specify a user identifier which will be visible in the Crashlytics UI. - /// Please be mindful of end-user's privacy. - Future setUserIdentifier(String identifier) async { - await channel.invokeMethod('Crashlytics#setUserIdentifier', - {'identifier': identifier}); - } - - /// Specify a user name which will be visible in the Crashlytics UI. Please - /// be mindful of end-user's privacy. - Future setUserName(String name) async { - await channel.invokeMethod( - 'Crashlytics#setUserName', {'name': name}); - } - - List> _prepareKeys() { - final List> crashlyticsKeys = >[]; - for (String key in _keys.keys) { - final dynamic value = _keys[key]; - - final Map crashlyticsKey = { - 'key': key, - 'value': value - }; - - if (value is int) { - crashlyticsKey['type'] = 'int'; - } else if (value is double) { - crashlyticsKey['type'] = 'double'; - } else if (value is String) { - crashlyticsKey['type'] = 'string'; - } else if (value is bool) { - crashlyticsKey['type'] = 'boolean'; - } - crashlyticsKeys.add(crashlyticsKey); - } - - return crashlyticsKeys; - } - - @visibleForTesting - List> getStackTraceElements(List lines) { - final List> elements = >[]; - for (String line in lines) { - final List lineParts = line.split(RegExp('\\s+')); - try { - final String fileName = lineParts[0]; - final String lineNumber = lineParts[1].contains(":") - ? lineParts[1].substring(0, lineParts[1].indexOf(":")).trim() - : lineParts[1]; - - final Map element = { - 'file': fileName, - 'line': lineNumber, - }; - - // The next section would throw an exception in some cases if there was no stop here. - if (lineParts.length < 3) { - elements.add(element); - continue; - } - - if (lineParts[2].contains(".")) { - final String className = - lineParts[2].substring(0, lineParts[2].indexOf(".")).trim(); - final String methodName = - lineParts[2].substring(lineParts[2].indexOf(".") + 1).trim(); - - element['class'] = className; - element['method'] = methodName; - } else { - element['method'] = lineParts[2]; - } - - elements.add(element); - } catch (e) { - print(e.toString()); - } - } - return elements; - } - - // On top of the default exception components, [information] can be passed as well. - // This allows the developer to get a better understanding of exceptions thrown - // by the Flutter framework. [FlutterErrorDetails] often explain why an exception - // occurred and give useful background information in [FlutterErrorDetails.informationCollector]. - // Crashlytics will log this information in addition to the stack trace. - // If [information] is `null` or empty, it will be ignored. - Future _recordError(dynamic exception, StackTrace stack, - {dynamic context, Iterable information}) async { - bool inDebugMode = false; - if (!enableInDevMode) { - assert(inDebugMode = true); - } - - final String _information = (information == null || information.isEmpty) - ? '' - : (StringBuffer()..writeAll(information, '\n')).toString(); - - if (inDebugMode && !enableInDevMode) { - // If available, give context to the exception. - if (context != null) - print('The following exception was thrown $context:'); - - // Need to print the exception to explain why the exception was thrown. - print(exception); - - // Print information provided by the Flutter framework about the exception. - if (_information.isNotEmpty) print('\n$_information'); - - // Not using Trace.format here to stick to the default stack trace format - // that Flutter developers are used to seeing. - if (stack != null) print('\n$stack'); - } else { - // The stack trace can be null. To avoid the following exception: - // Invalid argument(s): Cannot create a Trace from null. - // To avoid that exception, we can check for null and provide an empty stack trace. - stack ??= StackTrace.fromString(''); - - // Report error. - final List stackTraceLines = - Trace.format(stack).trimRight().split('\n'); - final List> stackTraceElements = - getStackTraceElements(stackTraceLines); - - // The context is a string that "should be in a form that will make sense in - // English when following the word 'thrown'" according to the documentation for - // [FlutterErrorDetails.context]. It is displayed to the user on Crashlytics - // as the "reason", which is forced by iOS, with the "thrown" prefix added. - final String result = await channel - .invokeMethod('Crashlytics#onError', { - 'exception': "${exception.toString()}", - 'context': '$context', - 'information': _information, - 'stackTraceElements': stackTraceElements, - 'logs': _logs.toList(), - 'keys': _prepareKeys(), - }); - - // Print result. - print(result); - } - } -} diff --git a/packages/firebase_crashlytics/pubspec.yaml b/packages/firebase_crashlytics/pubspec.yaml deleted file mode 100644 index 5b1542554213..000000000000 --- a/packages/firebase_crashlytics/pubspec.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: firebase_crashlytics -description: - Flutter plugin for Firebase Crashlytics. It reports uncaught errors to the - Firebase console. -version: 0.1.0+2 -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_crashlytics - -environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" - flutter: ">=1.5.0" - -dependencies: - flutter: - sdk: flutter - stack_trace: ^1.9.3 - -dev_dependencies: - flutter_test: - sdk: flutter - test: ^1.5.1 - flutter_driver: - sdk: flutter - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.crashlytics.firebasecrashlytics - pluginClass: FirebaseCrashlyticsPlugin diff --git a/packages/firebase_crashlytics/test/firebase_crashlytics_test.dart b/packages/firebase_crashlytics/test/firebase_crashlytics_test.dart deleted file mode 100644 index ed3bce48c5aa..000000000000 --- a/packages/firebase_crashlytics/test/firebase_crashlytics_test.dart +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$Crashlytics', () { - final List log = []; - - final Crashlytics crashlytics = Crashlytics.instance; - - setUp(() async { - Crashlytics.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'Crashlytics#onError': - return 'Error reported to Crashlytics.'; - case 'Crashlytics#isDebuggable': - return true; - case 'Crashlytics#setUserEmail': - return true; - case 'Crashlytics#setUserIdentifier': - return true; - case 'Crashlytics#setUserName': - return true; - case 'Crashlytics#getVersion': - return '0.0.0+1'; - default: - return false; - } - }); - log.clear(); - }); - - test('recordFlutterError', () async { - final FlutterErrorDetails details = FlutterErrorDetails( - exception: 'foo exception', - stack: StackTrace.current, - library: 'foo library', - informationCollector: () => [ - DiagnosticsNode.message('test message'), - DiagnosticsNode.message('second message'), - ], - context: ErrorDescription('foo context'), - ); - crashlytics.enableInDevMode = true; - crashlytics.log('foo'); - crashlytics.setBool('testBool', true); - crashlytics.setInt('testInt', 42); - crashlytics.setDouble('testDouble', 42.0); - crashlytics.setString('testString', 'bar'); - await crashlytics.recordFlutterError(details); - expect(log[0].method, 'Crashlytics#onError'); - expect(log[0].arguments['exception'], 'foo exception'); - expect(log[0].arguments['context'], 'foo context'); - expect(log[0].arguments['information'], 'test message\nsecond message'); - expect(log[0].arguments['logs'], isNotEmpty); - expect(log[0].arguments['logs'], contains('foo')); - expect(log[0].arguments['keys'][0]['key'], 'testBool'); - expect(log[0].arguments['keys'][0]['value'], isTrue); - expect(log[0].arguments['keys'][0]['type'], 'boolean'); - expect(log[0].arguments['keys'][1]['key'], 'testInt'); - expect(log[0].arguments['keys'][1]['value'], 42); - expect(log[0].arguments['keys'][1]['type'], 'int'); - expect(log[0].arguments['keys'][2]['key'], 'testDouble'); - expect(log[0].arguments['keys'][2]['value'], 42.0); - expect(log[0].arguments['keys'][2]['type'], 'double'); - expect(log[0].arguments['keys'][3]['key'], 'testString'); - expect(log[0].arguments['keys'][3]['value'], 'bar'); - expect(log[0].arguments['keys'][3]['type'], 'string'); - }); - - test('recordError', () async { - crashlytics.enableInDevMode = true; - crashlytics.log('foo'); - await crashlytics.recordError('foo exception', StackTrace.current, - context: "context"); - expect(log[0].method, 'Crashlytics#onError'); - expect(log[0].arguments['exception'], 'foo exception'); - expect(log[0].arguments['context'], "context"); - expect(log[0].arguments['logs'], isNotEmpty); - expect(log[0].arguments['logs'], contains('foo')); - expect(log[0].arguments['keys'][0]['key'], 'testBool'); - expect(log[0].arguments['keys'][0]['value'], isTrue); - expect(log[0].arguments['keys'][0]['type'], 'boolean'); - expect(log[0].arguments['keys'][1]['key'], 'testInt'); - expect(log[0].arguments['keys'][1]['value'], 42); - expect(log[0].arguments['keys'][1]['type'], 'int'); - expect(log[0].arguments['keys'][2]['key'], 'testDouble'); - expect(log[0].arguments['keys'][2]['value'], 42.0); - expect(log[0].arguments['keys'][2]['type'], 'double'); - expect(log[0].arguments['keys'][3]['key'], 'testString'); - expect(log[0].arguments['keys'][3]['value'], 'bar'); - expect(log[0].arguments['keys'][3]['type'], 'string'); - }); - - test('isDebuggable', () async { - expect(await crashlytics.isDebuggable(), true); - expect( - log, - [ - isMethodCall( - 'Crashlytics#isDebuggable', - arguments: null, - ) - ], - ); - }); - - test('crash', () { - expect(() => crashlytics.crash(), throwsStateError); - }); - - test('getVersion', () async { - await crashlytics.getVersion(); - expect(log, - [isMethodCall('Crashlytics#getVersion', arguments: null)]); - }); - - test('setUserEmail', () async { - await crashlytics.setUserEmail('foo'); - expect(log, [ - isMethodCall('Crashlytics#setUserEmail', - arguments: {'email': 'foo'}) - ]); - }); - - test('setUserIdentifier', () async { - await crashlytics.setUserIdentifier('foo'); - expect(log, [ - isMethodCall('Crashlytics#setUserIdentifier', - arguments: {'identifier': 'foo'}) - ]); - }); - - test('setUserName', () async { - await crashlytics.setUserName('foo'); - expect(log, [ - isMethodCall('Crashlytics#setUserName', - arguments: {'name': 'foo'}) - ]); - }); - - test('getStackTraceElements with character index', () async { - final List lines = [ - 'package:flutter/src/widgets/framework.dart 3825:27 StatefulElement.build' - ]; - final List> elements = - crashlytics.getStackTraceElements(lines); - expect(elements.length, 1); - expect(elements.first, { - 'class': 'StatefulElement', - 'method': 'build', - 'file': 'package:flutter/src/widgets/framework.dart', - 'line': '3825', - }); - }); - - test('getStackTraceElements without character index', () async { - final List lines = [ - 'package:flutter/src/widgets/framework.dart 3825 StatefulElement.build' - ]; - final List> elements = - crashlytics.getStackTraceElements(lines); - expect(elements.length, 1); - expect(elements.first, { - 'class': 'StatefulElement', - 'method': 'build', - 'file': 'package:flutter/src/widgets/framework.dart', - 'line': '3825', - }); - }); - - test('getStackTraceElements without class', () async { - final List lines = [ - 'package:firebase_crashlytics/test/main.dart 12 main' - ]; - final List> elements = - crashlytics.getStackTraceElements(lines); - expect(elements.length, 1); - expect(elements.first, { - 'method': 'main', - 'file': 'package:firebase_crashlytics/test/main.dart', - 'line': '12', - }); - }); - }); -} diff --git a/packages/firebase_database/.gitignore b/packages/firebase_database/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_database/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_database/CHANGELOG.md b/packages/firebase_database/CHANGELOG.md deleted file mode 100644 index eedce557e0f1..000000000000 --- a/packages/firebase_database/CHANGELOG.md +++ /dev/null @@ -1,268 +0,0 @@ -## 3.0.5 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 3.0.4 - -* Updated transactions implementation on Android for compatibility with - newer versions of Flutter engine that require channel calls be made - on the UI thread. - -## 3.0.3 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 3.0.2 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. - -## 3.0.1 - -* Suppress deprecation warning for BinaryMessages. See: https://github.com/flutter/flutter/issues/33446 - -## 3.0.0 - -* Update Android dependencies to latest. - -## 2.0.3 - -* Provide a `toString` implementation for `DatabaseError`. - -## 2.0.2+1 - -* Added an integration test for transactions. - -## 2.0.2 - -* Fix the issue that `getDictionaryFromError` always returns non nil result even when the parameter is nil. - -## 2.0.1+3 - -* Fixing DatabaseReference.set unhandled exception which happened when a successful operation was performed. - -## 2.0.1+2 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 2.0.1+1 - -* Remove categories. - -## 2.0.1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 2.0.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - - This was originally incorrectly pushed in the `1.1.0` update. - -## 1.1.0+1 - -* **Revert the breaking 1.1.0 update**. 1.1.0 was known to be breaking and - should have incremented the major version number instead of the minor. This - revert is in and of itself breaking for anyone that has already migrated - however. Anyone who has already migrated their app to AndroidX should - immediately update to `2.0.0` instead. That's the correctly versioned new push - of `1.1.0`. - -## 1.1.0 - -* **BAD**. This was a breaking change that was incorrectly published on a minor - version upgrade, should never have happened. Reverted by 1.1.0+1. - - "**Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library." - -## 1.0.5 - -* Bumped Android dependencies to latest. - -## 1.0.4 - -* Bumped test and mockito versions to pick up Dart 2 support. - -## 1.0.3 - -* Bump Android and Firebase dependency versions. - -## 1.0.2 - -* Add `onDisconnect` support. - -## 1.0.1 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 1.0.0 - -* Bump to released version - -## 0.4.6 - -* Allow null value for `startAt`, `endAt` and `equalTo` queries on Android. - -## 0.4.5 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.4.4 - -* Updated firebase_core dependency to ^0.2.2 - -## 0.4.3 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.4.2 - -* Updated `firebase_core` dependency. -* Removed `meta` dependency. - -## 0.4.1 - -* Fixes Dart 2 runtime cast error. - -## 0.4.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.3.6 - -* Fixed Dart 2 type errors. - -## 0.3.5 - -* Enabled use in Swift projects. - -## 0.3.4 - -* Allow null values for Query startAt, endAt, and equalTo - -## 0.3.3 - -* Support to specify a database by URL if required - -## 0.3.2 - -* Fix warnings from the Dart 2.0 analyzer. -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.3.1 - -* Fix function name collision when using Firebase Database and Cloud Firestore together on iOS. - -## 0.3.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). - -## 0.2.0 - -* Support for multiple databases, new dependency on firebase_core -* Relax GMS dependency to 11.+ - -## 0.1.4 - -* Add FLT prefix to iOS types -* Avoid error when clearing FirebaseSortedList - -## 0.1.3 - -* Fix memory leak in FirebaseAnimatedList -* Change GMS dependency to 11.4.+ - -## 0.1.2 - -* Change GMS dependency to 11.+ - -## 0.1.1 - -* Add RTDB transaction support. - -## 0.1.0+1 - -* Aligned author name with rest of repo. - -## 0.1.0 - -* **Breaking Change**: Added current list index to the type signature of itemBuilder for FirebaseAnimatedList. - -## 0.0.14 - -* Fix FirebaseSortedList to show data changes. - -## 0.0.13 - -* Fixed lingering value/child listeners. - -## 0.0.12 - -* Updated to Firebase SDK to always use latest patch version for 11.0.x builds - -## 0.0.11 - -* Fixes startAt/endAt on iOS when used without a key - -## 0.0.10 - -* Added workaround for inconsistent numeric types when using keepSynced on iOS -* Bug fixes to Query handling - -## 0.0.9 - -* Updated to Firebase SDK Version 11.0.1 - -## 0.0.8 - -* Added missing offline persistence and query functionality on Android -* Fixed startAt query behavior on iOS -* Persistence methods no longer throw errors on failure, return false instead -* Updates to docs and tests - -## 0.0.7 - -* Fixed offline persistence on iOS - -## 0.0.6 - -* Various APIs added to FirebaseDatabase and Query -* Added removal and priority to DatabaseReference -* Improved documentation -* Added unit tests - -## 0.0.5 - -* Fixed analyzer warnings - -## 0.0.4 - -* Removed stub code and replaced it with support for more event types, paths, auth -* Improved example - -## 0.0.3 - -* Updated README.md -* Bumped buildToolsVersion to 25.0.3 -* Added example app - -## 0.0.2 - -* Fix compilation error - -## 0.0.1 - -* Initial Release diff --git a/packages/firebase_database/LICENSE b/packages/firebase_database/LICENSE deleted file mode 100755 index 000b4618d2bd..000000000000 --- a/packages/firebase_database/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_database/README.md b/packages/firebase_database/README.md deleted file mode 100755 index 107f7869ddd1..000000000000 --- a/packages/firebase_database/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Firebase Realtime Database for Flutter - -[![pub package](https://img.shields.io/pub/v/firebase_database.svg)](https://pub.dartlang.org/packages/firebase_database) - -A Flutter plugin to use the [Firebase Realtime Database API](https://firebase.google.com/products/database/). - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage -To use this plugin, add `firebase_database` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). - -## Getting Started - -See the `example` directory for a complete sample app using Firebase Realtime Database. diff --git a/packages/firebase_database/android/build.gradle b/packages/firebase_database/android/build.gradle deleted file mode 100755 index 484c0976d1e3..000000000000 --- a/packages/firebase_database/android/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -def PLUGIN = "firebase_database"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebase.database' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-database:17.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_database/android/gradle.properties b/packages/firebase_database/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_database/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_database/android/settings.gradle b/packages/firebase_database/android/settings.gradle deleted file mode 100755 index 853b33390159..000000000000 --- a/packages/firebase_database/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_database' diff --git a/packages/firebase_database/android/src/main/AndroidManifest.xml b/packages/firebase_database/android/src/main/AndroidManifest.xml deleted file mode 100755 index c4c6517bd637..000000000000 --- a/packages/firebase_database/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FirebaseDatabasePlugin.java b/packages/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FirebaseDatabasePlugin.java deleted file mode 100644 index c3fb751e5070..000000000000 --- a/packages/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FirebaseDatabasePlugin.java +++ /dev/null @@ -1,531 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.database; - -import android.app.Activity; -import android.util.Log; -import android.util.SparseArray; -import com.google.android.gms.tasks.Task; -import com.google.android.gms.tasks.TaskCompletionSource; -import com.google.android.gms.tasks.Tasks; -import com.google.firebase.FirebaseApp; -import com.google.firebase.database.ChildEventListener; -import com.google.firebase.database.DataSnapshot; -import com.google.firebase.database.DatabaseError; -import com.google.firebase.database.DatabaseException; -import com.google.firebase.database.DatabaseReference; -import com.google.firebase.database.FirebaseDatabase; -import com.google.firebase.database.MutableData; -import com.google.firebase.database.Query; -import com.google.firebase.database.Transaction; -import com.google.firebase.database.ValueEventListener; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -/** FirebaseDatabasePlugin */ -public class FirebaseDatabasePlugin implements MethodCallHandler { - - private static final String TAG = "FirebaseDatabasePlugin"; - - private final MethodChannel channel; - private final Activity activity; - private static final String EVENT_TYPE_CHILD_ADDED = "_EventType.childAdded"; - private static final String EVENT_TYPE_CHILD_REMOVED = "_EventType.childRemoved"; - private static final String EVENT_TYPE_CHILD_CHANGED = "_EventType.childChanged"; - private static final String EVENT_TYPE_CHILD_MOVED = "_EventType.childMoved"; - private static final String EVENT_TYPE_VALUE = "_EventType.value"; - - // Handles are ints used as indexes into the sparse array of active observers - private int nextHandle = 0; - private final SparseArray observers = new SparseArray<>(); - - public static void registerWith(PluginRegistry.Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_database"); - channel.setMethodCallHandler(new FirebaseDatabasePlugin(channel, registrar.activity())); - } - - private FirebaseDatabasePlugin(MethodChannel channel, Activity activity) { - this.channel = channel; - this.activity = activity; - } - - private DatabaseReference getReference(FirebaseDatabase database, Map arguments) { - String path = (String) arguments.get("path"); - DatabaseReference reference = database.getReference(); - if (path != null) reference = reference.child(path); - return reference; - } - - private Query getQuery(FirebaseDatabase database, Map arguments) { - Query query = getReference(database, arguments); - @SuppressWarnings("unchecked") - Map parameters = (Map) arguments.get("parameters"); - if (parameters == null) return query; - Object orderBy = parameters.get("orderBy"); - if ("child".equals(orderBy)) { - query = query.orderByChild((String) parameters.get("orderByChildKey")); - } else if ("key".equals(orderBy)) { - query = query.orderByKey(); - } else if ("value".equals(orderBy)) { - query = query.orderByValue(); - } else if ("priority".equals(orderBy)) { - query = query.orderByPriority(); - } - if (parameters.containsKey("startAt")) { - Object startAt = parameters.get("startAt"); - if (parameters.containsKey("startAtKey")) { - String startAtKey = (String) parameters.get("startAtKey"); - if (startAt instanceof Boolean) { - query = query.startAt((Boolean) startAt, startAtKey); - } else if (startAt instanceof Number) { - query = query.startAt(((Number) startAt).doubleValue(), startAtKey); - } else { - query = query.startAt((String) startAt, startAtKey); - } - } else { - if (startAt instanceof Boolean) { - query = query.startAt((Boolean) startAt); - } else if (startAt instanceof Number) { - query = query.startAt(((Number) startAt).doubleValue()); - } else { - query = query.startAt((String) startAt); - } - } - } - if (parameters.containsKey("endAt")) { - Object endAt = parameters.get("endAt"); - if (parameters.containsKey("endAtKey")) { - String endAtKey = (String) parameters.get("endAtKey"); - if (endAt instanceof Boolean) { - query = query.endAt((Boolean) endAt, endAtKey); - } else if (endAt instanceof Number) { - query = query.endAt(((Number) endAt).doubleValue(), endAtKey); - } else { - query = query.endAt((String) endAt, endAtKey); - } - } else { - if (endAt instanceof Boolean) { - query = query.endAt((Boolean) endAt); - } else if (endAt instanceof Number) { - query = query.endAt(((Number) endAt).doubleValue()); - } else { - query = query.endAt((String) endAt); - } - } - } - if (parameters.containsKey("equalTo")) { - Object equalTo = parameters.get("equalTo"); - if (parameters.containsKey("equalToKey")) { - String equalToKey = (String) parameters.get("equalToKey"); - if (equalTo instanceof Boolean) { - query = query.equalTo((Boolean) equalTo, equalToKey); - } else if (equalTo instanceof Number) { - query = query.equalTo(((Number) equalTo).doubleValue(), equalToKey); - } else { - query = query.equalTo((String) equalTo, equalToKey); - } - } else { - if (equalTo instanceof Boolean) { - query = query.equalTo((Boolean) equalTo); - } else if (equalTo instanceof Number) { - query = query.equalTo(((Number) equalTo).doubleValue()); - } else { - query = query.equalTo((String) equalTo); - } - } - } - if (parameters.containsKey("limitToFirst")) { - query = query.limitToFirst((int) parameters.get("limitToFirst")); - } - if (parameters.containsKey("limitToLast")) { - query = query.limitToLast((int) parameters.get("limitToLast")); - } - return query; - } - - private class DefaultCompletionListener implements DatabaseReference.CompletionListener { - private final Result result; - - DefaultCompletionListener(Result result) { - this.result = result; - } - - @Override - public void onComplete(DatabaseError error, DatabaseReference ref) { - if (error != null) { - result.error(String.valueOf(error.getCode()), error.getMessage(), error.getDetails()); - } else { - result.success(null); - } - } - } - - private class EventObserver implements ChildEventListener, ValueEventListener { - private String requestedEventType; - private int handle; - - EventObserver(String requestedEventType, int handle) { - this.requestedEventType = requestedEventType; - this.handle = handle; - } - - private void sendEvent(String eventType, DataSnapshot snapshot, String previousChildName) { - if (eventType.equals(requestedEventType)) { - Map arguments = new HashMap<>(); - Map snapshotMap = new HashMap<>(); - snapshotMap.put("key", snapshot.getKey()); - snapshotMap.put("value", snapshot.getValue()); - arguments.put("handle", handle); - arguments.put("snapshot", snapshotMap); - arguments.put("previousSiblingKey", previousChildName); - channel.invokeMethod("Event", arguments); - } - } - - @Override - public void onCancelled(DatabaseError error) { - Map arguments = new HashMap<>(); - arguments.put("handle", handle); - arguments.put("error", asMap(error)); - channel.invokeMethod("Error", arguments); - } - - @Override - public void onChildAdded(DataSnapshot snapshot, String previousChildName) { - sendEvent(EVENT_TYPE_CHILD_ADDED, snapshot, previousChildName); - } - - @Override - public void onChildRemoved(DataSnapshot snapshot) { - sendEvent(EVENT_TYPE_CHILD_REMOVED, snapshot, null); - } - - @Override - public void onChildChanged(DataSnapshot snapshot, String previousChildName) { - sendEvent(EVENT_TYPE_CHILD_CHANGED, snapshot, previousChildName); - } - - @Override - public void onChildMoved(DataSnapshot snapshot, String previousChildName) { - sendEvent(EVENT_TYPE_CHILD_MOVED, snapshot, previousChildName); - } - - @Override - public void onDataChange(DataSnapshot snapshot) { - sendEvent(EVENT_TYPE_VALUE, snapshot, null); - } - } - - @Override - public void onMethodCall(final MethodCall call, final Result result) { - final Map arguments = call.arguments(); - FirebaseDatabase database; - String appName = (String) arguments.get("app"); - String databaseURL = (String) arguments.get("databaseURL"); - if (appName != null && databaseURL != null) { - database = FirebaseDatabase.getInstance(FirebaseApp.getInstance(appName), databaseURL); - } else if (appName != null) { - database = FirebaseDatabase.getInstance(FirebaseApp.getInstance(appName)); - } else if (databaseURL != null) { - database = FirebaseDatabase.getInstance(databaseURL); - } else { - database = FirebaseDatabase.getInstance(); - } - switch (call.method) { - case "FirebaseDatabase#goOnline": - { - database.goOnline(); - result.success(null); - break; - } - - case "FirebaseDatabase#goOffline": - { - database.goOffline(); - result.success(null); - break; - } - - case "FirebaseDatabase#purgeOutstandingWrites": - { - database.purgeOutstandingWrites(); - result.success(null); - break; - } - - case "FirebaseDatabase#setPersistenceEnabled": - { - Boolean isEnabled = (Boolean) arguments.get("enabled"); - try { - database.setPersistenceEnabled(isEnabled); - result.success(true); - } catch (DatabaseException e) { - // Database is already in use, e.g. after hot reload/restart. - result.success(false); - } - break; - } - - case "FirebaseDatabase#setPersistenceCacheSizeBytes": - { - long cacheSize = (Integer) arguments.get("cacheSize"); - try { - database.setPersistenceCacheSizeBytes(cacheSize); - result.success(true); - } catch (DatabaseException e) { - // Database is already in use, e.g. after hot reload/restart. - result.success(false); - } - break; - } - - case "DatabaseReference#set": - { - Object value = arguments.get("value"); - Object priority = arguments.get("priority"); - DatabaseReference reference = getReference(database, arguments); - if (priority != null) { - reference.setValue(value, priority, new DefaultCompletionListener(result)); - } else { - reference.setValue(value, new DefaultCompletionListener(result)); - } - break; - } - - case "DatabaseReference#update": - { - @SuppressWarnings("unchecked") - Map value = (Map) arguments.get("value"); - DatabaseReference reference = getReference(database, arguments); - reference.updateChildren(value, new DefaultCompletionListener(result)); - break; - } - - case "DatabaseReference#setPriority": - { - Object priority = arguments.get("priority"); - DatabaseReference reference = getReference(database, arguments); - reference.setPriority(priority, new DefaultCompletionListener(result)); - break; - } - - case "DatabaseReference#runTransaction": - { - final DatabaseReference reference = getReference(database, arguments); - - // Initiate native transaction. - reference.runTransaction( - new Transaction.Handler() { - @Override - public Transaction.Result doTransaction(MutableData mutableData) { - // Tasks are used to allow native execution of doTransaction to wait while Snapshot is - // processed by logic on the Dart side. - final TaskCompletionSource> updateMutableDataTCS = - new TaskCompletionSource<>(); - final Task> updateMutableDataTCSTask = - updateMutableDataTCS.getTask(); - - final Map doTransactionMap = new HashMap<>(); - doTransactionMap.put("transactionKey", arguments.get("transactionKey")); - - final Map snapshotMap = new HashMap<>(); - snapshotMap.put("key", mutableData.getKey()); - snapshotMap.put("value", mutableData.getValue()); - doTransactionMap.put("snapshot", snapshotMap); - - // Return snapshot to Dart side for update. - activity.runOnUiThread( - new Runnable() { - @Override - public void run() { - channel.invokeMethod( - "DoTransaction", - doTransactionMap, - new MethodChannel.Result() { - @Override - @SuppressWarnings("unchecked") - public void success(Object result) { - updateMutableDataTCS.setResult((Map) result); - } - - @Override - public void error( - String errorCode, String errorMessage, Object errorDetails) { - String exceptionMessage = - "Error code: " - + errorCode - + "\nError message: " - + errorMessage - + "\nError details: " - + errorDetails; - updateMutableDataTCS.setException( - new Exception(exceptionMessage)); - } - - @Override - public void notImplemented() { - updateMutableDataTCS.setException( - new Exception("DoTransaction not implemented on Dart side.")); - } - }); - } - }); - - try { - // Wait for updated snapshot from the Dart side. - final Map updatedSnapshotMap = - Tasks.await( - updateMutableDataTCSTask, - (int) arguments.get("transactionTimeout"), - TimeUnit.MILLISECONDS); - // Set value of MutableData to value returned from the Dart side. - mutableData.setValue(updatedSnapshotMap.get("value")); - } catch (ExecutionException | InterruptedException | TimeoutException e) { - Log.e(TAG, "Unable to commit Snapshot update. Transaction failed.", e); - if (e instanceof TimeoutException) { - Log.e(TAG, "Transaction at " + reference.toString() + " timed out."); - } - return Transaction.abort(); - } - return Transaction.success(mutableData); - } - - @Override - public void onComplete( - DatabaseError databaseError, boolean committed, DataSnapshot dataSnapshot) { - final Map completionMap = new HashMap<>(); - completionMap.put("transactionKey", arguments.get("transactionKey")); - if (databaseError != null) { - completionMap.put("error", asMap(databaseError)); - } - completionMap.put("committed", committed); - if (dataSnapshot != null) { - Map snapshotMap = new HashMap<>(); - snapshotMap.put("key", dataSnapshot.getKey()); - snapshotMap.put("value", dataSnapshot.getValue()); - completionMap.put("snapshot", snapshotMap); - } - - // Invoke transaction completion on the Dart side. - activity.runOnUiThread( - new Runnable() { - public void run() { - result.success(completionMap); - } - }); - } - }); - break; - } - - case "OnDisconnect#set": - { - Object value = arguments.get("value"); - Object priority = arguments.get("priority"); - DatabaseReference reference = getReference(database, arguments); - if (priority != null) { - if (priority instanceof String) { - reference - .onDisconnect() - .setValue(value, (String) priority, new DefaultCompletionListener(result)); - } else if (priority instanceof Double) { - reference - .onDisconnect() - .setValue(value, (double) priority, new DefaultCompletionListener(result)); - } else if (priority instanceof Map) { - reference - .onDisconnect() - .setValue(value, (Map) priority, new DefaultCompletionListener(result)); - } - } else { - reference.onDisconnect().setValue(value, new DefaultCompletionListener(result)); - } - break; - } - - case "OnDisconnect#update": - { - @SuppressWarnings("unchecked") - Map value = (Map) arguments.get("value"); - DatabaseReference reference = getReference(database, arguments); - reference.onDisconnect().updateChildren(value, new DefaultCompletionListener(result)); - break; - } - - case "OnDisconnect#cancel": - { - DatabaseReference reference = getReference(database, arguments); - reference.onDisconnect().cancel(new DefaultCompletionListener(result)); - break; - } - - case "Query#keepSynced": - { - boolean value = (Boolean) arguments.get("value"); - getQuery(database, arguments).keepSynced(value); - result.success(null); - break; - } - - case "Query#observe": - { - String eventType = (String) arguments.get("eventType"); - int handle = nextHandle++; - EventObserver observer = new EventObserver(eventType, handle); - observers.put(handle, observer); - if (eventType.equals(EVENT_TYPE_VALUE)) { - getQuery(database, arguments).addValueEventListener(observer); - } else { - getQuery(database, arguments).addChildEventListener(observer); - } - result.success(handle); - break; - } - - case "Query#removeObserver": - { - Query query = getQuery(database, arguments); - int handle = (Integer) arguments.get("handle"); - EventObserver observer = observers.get(handle); - if (observer != null) { - if (observer.requestedEventType.equals(EVENT_TYPE_VALUE)) { - query.removeEventListener((ValueEventListener) observer); - } else { - query.removeEventListener((ChildEventListener) observer); - } - observers.delete(handle); - result.success(null); - break; - } else { - result.error("unknown_handle", "removeObserver called on an unknown handle", null); - break; - } - } - - default: - { - result.notImplemented(); - break; - } - } - } - - private static Map asMap(DatabaseError error) { - Map map = new HashMap<>(); - map.put("code", error.getCode()); - map.put("message", error.getMessage()); - map.put("details", error.getDetails()); - return map; - } -} diff --git a/packages/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FlutterFirebaseAppRegistrar.java b/packages/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 2016d286ccdc..000000000000 --- a/packages/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.database; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_database/android/user-agent.gradle b/packages/firebase_database/android/user-agent.gradle deleted file mode 100644 index 4c70fc14a2fe..000000000000 --- a/packages/firebase_database/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-rtdb" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_database/example/README.md b/packages/firebase_database/example/README.md deleted file mode 100755 index 46c4d1b17e06..000000000000 --- a/packages/firebase_database/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_database_example - -Demonstrates how to use the firebase_database plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_database/example/android.iml b/packages/firebase_database/example/android.iml deleted file mode 100755 index 462b903e05b6..000000000000 --- a/packages/firebase_database/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_database/example/android/app/build.gradle b/packages/firebase_database/example/android/app/build.gradle deleted file mode 100755 index fef467aa8a1a..000000000000 --- a/packages/firebase_database/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId 'io.flutter.plugins.firebasedatabaseexample' - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_database/example/android/app/google-services.json b/packages/firebase_database/example/android/app/google-services.json deleted file mode 100644 index 223cb29b8f38..000000000000 --- a/packages/firebase_database/example/android/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "159623150305", - "firebase_url": "https://flutter-firebase-plugins.firebaseio.com", - "project_id": "flutter-firebase-plugins", - "storage_bucket": "flutter-firebase-plugins.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:c68d3ad04a4046db", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasedatabaseexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} diff --git a/packages/firebase_database/example/android/app/gradle.properties b/packages/firebase_database/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_database/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_database/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_database/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_database/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_database/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_database/example/android/app/src/main/AndroidManifest.xml deleted file mode 100755 index 794bfa20d51d..000000000000 --- a/packages/firebase_database/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/firebase_database/example/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java b/packages/firebase_database/example/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java deleted file mode 100644 index 0c58e26a5c1b..000000000000 --- a/packages/firebase_database/example/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasedatabaseexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_database/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_database/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_database/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_database/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_database/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_database/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_database/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_database/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 09d4391482be..000000000000 Binary files a/packages/firebase_database/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_database/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_database/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_database/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_database/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_database/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_database/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_database/example/android/build.gradle b/packages/firebase_database/example/android/build.gradle deleted file mode 100755 index 359119307d55..000000000000 --- a/packages/firebase_database/example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_database/example/android/gradle.properties b/packages/firebase_database/example/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_database/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_database/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_database/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_database/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_database/example/android/settings.gradle b/packages/firebase_database/example/android/settings.gradle deleted file mode 100755 index 115da6cb4f4d..000000000000 --- a/packages/firebase_database/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_database/example/firebase_database_example.iml b/packages/firebase_database/example/firebase_database_example.iml deleted file mode 100755 index 1ae40a0f7f54..000000000000 --- a/packages/firebase_database/example/firebase_database_example.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_database/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_database/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100755 index 6c2de8086bcd..000000000000 --- a/packages/firebase_database/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_database/example/ios/Flutter/Debug.xcconfig b/packages/firebase_database/example/ios/Flutter/Debug.xcconfig deleted file mode 100755 index 9803018ca79d..000000000000 --- a/packages/firebase_database/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/firebase_database/example/ios/Flutter/Release.xcconfig b/packages/firebase_database/example/ios/Flutter/Release.xcconfig deleted file mode 100755 index a4a8c604e13d..000000000000 --- a/packages/firebase_database/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/firebase_database/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_database/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 9ad834907b41..000000000000 --- a/packages/firebase_database/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,481 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */; }; - 7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 840012C8B5EDBCF56B0E4AC1 /* Pods */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */, - 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */, - 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { - isa = PBXGroup; - children = ( - E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseDatabaseExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseDatabaseExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_database/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_database/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_database/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_database/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_database/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index 1c9580788197..000000000000 --- a/packages/firebase_database/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_database/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_database/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_database/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_database/example/ios/Runner/AppDelegate.h b/packages/firebase_database/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/firebase_database/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_database/example/ios/Runner/AppDelegate.m b/packages/firebase_database/example/ios/Runner/AppDelegate.m deleted file mode 100644 index a4b51c88eb60..000000000000 --- a/packages/firebase_database/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index d22f10b2ab63..000000000000 --- a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100755 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100755 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100755 index 4cde12118dda..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100755 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100755 index dcdc2306c285..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100755 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100755 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100755 index c4df70d39da7..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100755 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100755 index d0e1f5853602..000000000000 Binary files a/packages/firebase_database/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_database/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_database/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100755 index ebf48f603974..000000000000 --- a/packages/firebase_database/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_database/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_database/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100755 index f3c28516fb38..000000000000 --- a/packages/firebase_database/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_database/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_database/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 3e13a9908257..000000000000 --- a/packages/firebase_database/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 159623150305-1l2uq0jjcvricku3ah3fuav0v0nvrakp.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.159623150305-1l2uq0jjcvricku3ah3fuav0v0nvrakp - API_KEY - AIzaSyDyzecVw1zXTpBKwfFHxpl7QyYBhimNhUk - GCM_SENDER_ID - 159623150305 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebaseDatabaseExample - PROJECT_ID - flutter-firebase-plugins - STORAGE_BUCKET - flutter-firebase-plugins.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:159623150305:ios:a837cdfe238b8a54 - DATABASE_URL - https://flutter-firebase-plugins.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_database/example/ios/Runner/Info.plist b/packages/firebase_database/example/ios/Runner/Info.plist deleted file mode 100755 index adc773132365..000000000000 --- a/packages/firebase_database/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_database_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_database/example/ios/Runner/main.m b/packages/firebase_database/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/firebase_database/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_database/example/lib/main.dart b/packages/firebase_database/example/lib/main.dart deleted file mode 100755 index c22374aa3e94..000000000000 --- a/packages/firebase_database/example/lib/main.dart +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:io' show Platform; - -import 'package:flutter/material.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:firebase_database/firebase_database.dart'; -import 'package:firebase_database/ui/firebase_animated_list.dart'; - -Future main() async { - final FirebaseApp app = await FirebaseApp.configure( - name: 'db2', - options: Platform.isIOS - ? const FirebaseOptions( - googleAppID: '1:297855924061:ios:c6de2b69b03a5be8', - gcmSenderID: '297855924061', - databaseURL: 'https://flutterfire-cd2f7.firebaseio.com', - ) - : const FirebaseOptions( - googleAppID: '1:297855924061:android:669871c998cc21bd', - apiKey: 'AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk', - databaseURL: 'https://flutterfire-cd2f7.firebaseio.com', - ), - ); - runApp(MaterialApp( - title: 'Flutter Database Example', - home: MyHomePage(app: app), - )); -} - -class MyHomePage extends StatefulWidget { - MyHomePage({this.app}); - final FirebaseApp app; - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter; - DatabaseReference _counterRef; - DatabaseReference _messagesRef; - StreamSubscription _counterSubscription; - StreamSubscription _messagesSubscription; - bool _anchorToBottom = false; - - String _kTestKey = 'Hello'; - String _kTestValue = 'world!'; - DatabaseError _error; - - @override - void initState() { - super.initState(); - // Demonstrates configuring to the database using a file - _counterRef = FirebaseDatabase.instance.reference().child('counter'); - // Demonstrates configuring the database directly - final FirebaseDatabase database = FirebaseDatabase(app: widget.app); - _messagesRef = database.reference().child('messages'); - database.reference().child('counter').once().then((DataSnapshot snapshot) { - print('Connected to second database and read ${snapshot.value}'); - }); - database.setPersistenceEnabled(true); - database.setPersistenceCacheSizeBytes(10000000); - _counterRef.keepSynced(true); - _counterSubscription = _counterRef.onValue.listen((Event event) { - setState(() { - _error = null; - _counter = event.snapshot.value ?? 0; - }); - }, onError: (Object o) { - final DatabaseError error = o; - setState(() { - _error = error; - }); - }); - _messagesSubscription = - _messagesRef.limitToLast(10).onChildAdded.listen((Event event) { - print('Child added: ${event.snapshot.value}'); - }, onError: (Object o) { - final DatabaseError error = o; - print('Error: ${error.code} ${error.message}'); - }); - } - - @override - void dispose() { - super.dispose(); - _messagesSubscription.cancel(); - _counterSubscription.cancel(); - } - - Future _increment() async { - // Increment counter in transaction. - final TransactionResult transactionResult = - await _counterRef.runTransaction((MutableData mutableData) async { - mutableData.value = (mutableData.value ?? 0) + 1; - return mutableData; - }); - - if (transactionResult.committed) { - _messagesRef.push().set({ - _kTestKey: '$_kTestValue ${transactionResult.dataSnapshot.value}' - }); - } else { - print('Transaction not committed.'); - if (transactionResult.error != null) { - print(transactionResult.error.message); - } - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Flutter Database Example'), - ), - body: Column( - children: [ - Flexible( - child: Center( - child: _error == null - ? Text( - 'Button tapped $_counter time${_counter == 1 ? '' : 's'}.\n\n' - 'This includes all devices, ever.', - ) - : Text( - 'Error retrieving button tap count:\n${_error.message}', - ), - ), - ), - ListTile( - leading: Checkbox( - onChanged: (bool value) { - setState(() { - _anchorToBottom = value; - }); - }, - value: _anchorToBottom, - ), - title: const Text('Anchor to bottom'), - ), - Flexible( - child: FirebaseAnimatedList( - key: ValueKey(_anchorToBottom), - query: _messagesRef, - reverse: _anchorToBottom, - sort: _anchorToBottom - ? (DataSnapshot a, DataSnapshot b) => b.key.compareTo(a.key) - : null, - itemBuilder: (BuildContext context, DataSnapshot snapshot, - Animation animation, int index) { - return SizeTransition( - sizeFactor: animation, - child: Text("$index: ${snapshot.value.toString()}"), - ); - }, - ), - ), - ], - ), - floatingActionButton: FloatingActionButton( - onPressed: _increment, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), - ); - } -} diff --git a/packages/firebase_database/example/pubspec.yaml b/packages/firebase_database/example/pubspec.yaml deleted file mode 100755 index 3c1735eab718..000000000000 --- a/packages/firebase_database/example/pubspec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: firebase_database_example -description: Demonstrates how to use the firebase_database plugin. - -dependencies: - flutter: - sdk: flutter - firebase_database: - path: ../ - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_driver: - sdk: flutter - test: any - -flutter: - uses-material-design: true diff --git a/packages/firebase_database/example/test_driver/firebase_database.dart b/packages/firebase_database/example/test_driver/firebase_database.dart deleted file mode 100644 index c40cc0823d90..000000000000 --- a/packages/firebase_database/example/test_driver/firebase_database.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'dart:async'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_database/firebase_database.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$FirebaseDatabase', () { - final FirebaseDatabase database = FirebaseDatabase.instance; - - test('runTransaction', () async { - final DatabaseReference ref = database.reference().child('counter'); - final DataSnapshot snapshot = await ref.once(); - final int value = snapshot.value ?? 0; - final TransactionResult transactionResult = - await ref.runTransaction((MutableData mutableData) async { - mutableData.value = (mutableData.value ?? 0) + 1; - return mutableData; - }); - expect(transactionResult.committed, true); - expect(transactionResult.dataSnapshot.value > value, true); - }); - }); -} diff --git a/packages/firebase_database/example/test_driver/firebase_database_test.dart b/packages/firebase_database/example/test_driver/firebase_database_test.dart deleted file mode 100644 index 08cdadbd0809..000000000000 --- a/packages/firebase_database/example/test_driver/firebase_database_test.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:flutter_driver/flutter_driver.dart'; -import 'package:test/test.dart'; - -void main() { - test('FirebaseDatabase driver test', () async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); - }); -} diff --git a/packages/firebase_database/ios/Assets/.gitkeep b/packages/firebase_database/ios/Assets/.gitkeep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h b/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h deleted file mode 100644 index adc9034e88f2..000000000000 --- a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseDatabasePlugin : NSObject - -@property(nonatomic) NSMutableDictionary *updatedSnapshots; - -@end diff --git a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m b/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m deleted file mode 100644 index 8a0d173d1fb8..000000000000 --- a/packages/firebase_database/ios/Classes/FirebaseDatabasePlugin.m +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseDatabasePlugin.h" -#import "UserAgent.h" - -#import - -static FlutterError *getFlutterError(NSError *error) { - if (error == nil) return nil; - - return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", error.code] - message:error.domain - details:error.localizedDescription]; -} - -static NSDictionary *getDictionaryFromError(NSError *error) { - if (!error) { - return nil; - } - return @{ - @"code" : @(error.code), - @"message" : error.domain ?: [NSNull null], - @"details" : error.localizedDescription ?: [NSNull null], - }; -} - -@interface FLTFirebaseDatabasePlugin () - -@end - -FIRDatabaseReference *getReference(FIRDatabase *database, NSDictionary *arguments) { - NSString *path = arguments[@"path"]; - FIRDatabaseReference *ref = database.reference; - if ([path length] > 0) ref = [ref child:path]; - return ref; -} - -FIRDatabaseQuery *getDatabaseQuery(FIRDatabase *database, NSDictionary *arguments) { - FIRDatabaseQuery *query = getReference(database, arguments); - NSDictionary *parameters = arguments[@"parameters"]; - NSString *orderBy = parameters[@"orderBy"]; - if ([orderBy isEqualToString:@"child"]) { - query = [query queryOrderedByChild:parameters[@"orderByChildKey"]]; - } else if ([orderBy isEqualToString:@"key"]) { - query = [query queryOrderedByKey]; - } else if ([orderBy isEqualToString:@"value"]) { - query = [query queryOrderedByValue]; - } else if ([orderBy isEqualToString:@"priority"]) { - query = [query queryOrderedByPriority]; - } - id startAt = parameters[@"startAt"]; - if (startAt) { - id startAtKey = parameters[@"startAtKey"]; - if (startAtKey) { - query = [query queryStartingAtValue:startAt childKey:startAtKey]; - } else { - query = [query queryStartingAtValue:startAt]; - } - } - id endAt = parameters[@"endAt"]; - if (endAt) { - id endAtKey = parameters[@"endAtKey"]; - if (endAtKey) { - query = [query queryEndingAtValue:endAt childKey:endAtKey]; - } else { - query = [query queryEndingAtValue:endAt]; - } - } - id equalTo = parameters[@"equalTo"]; - if (equalTo) { - id equalToKey = parameters[@"equalToKey"]; - if (equalToKey) { - query = [query queryEqualToValue:equalTo childKey:equalToKey]; - } else { - query = [query queryEqualToValue:equalTo]; - } - } - NSNumber *limitToFirst = parameters[@"limitToFirst"]; - if (limitToFirst) { - query = [query queryLimitedToFirst:limitToFirst.intValue]; - } - NSNumber *limitToLast = parameters[@"limitToLast"]; - if (limitToLast) { - query = [query queryLimitedToLast:limitToLast.intValue]; - } - return query; -} - -FIRDataEventType parseEventType(NSString *eventTypeString) { - if ([@"_EventType.childAdded" isEqual:eventTypeString]) { - return FIRDataEventTypeChildAdded; - } else if ([@"_EventType.childRemoved" isEqual:eventTypeString]) { - return FIRDataEventTypeChildRemoved; - } else if ([@"_EventType.childChanged" isEqual:eventTypeString]) { - return FIRDataEventTypeChildChanged; - } else if ([@"_EventType.childMoved" isEqual:eventTypeString]) { - return FIRDataEventTypeChildMoved; - } else if ([@"_EventType.value" isEqual:eventTypeString]) { - return FIRDataEventTypeValue; - } - assert(false); - return 0; -} - -id roundDoubles(id value) { - // Workaround for https://github.com/firebase/firebase-ios-sdk/issues/91 - // The Firebase iOS SDK sometimes returns doubles when ints were stored. - // We detect doubles that can be converted to ints without loss of precision - // and convert them. - if ([value isKindOfClass:[NSNumber class]]) { - CFNumberType type = CFNumberGetType((CFNumberRef)value); - if (type == kCFNumberDoubleType || type == kCFNumberFloatType) { - if ((double)(long long)[value doubleValue] == [value doubleValue]) { - return [NSNumber numberWithLongLong:(long long)[value doubleValue]]; - } - } - } else if ([value isKindOfClass:[NSArray class]]) { - NSMutableArray *result = [NSMutableArray arrayWithCapacity:[value count]]; - [value enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [result addObject:roundDoubles(obj)]; - }]; - return result; - } else if ([value isKindOfClass:[NSDictionary class]]) { - NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:[value count]]; - [value enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - result[key] = roundDoubles(obj); - }]; - return result; - } - return value; -} - -@interface FLTFirebaseDatabasePlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@end - -@implementation FLTFirebaseDatabasePlugin - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_database" - binaryMessenger:[registrar messenger]]; - FLTFirebaseDatabasePlugin *instance = [[FLTFirebaseDatabasePlugin alloc] init]; - instance.channel = channel; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - self.updatedSnapshots = [NSMutableDictionary new]; - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - FIRDatabase *database; - NSString *appName = call.arguments[@"app"]; - NSString *databaseURL = call.arguments[@"databaseURL"]; - if (![appName isEqual:[NSNull null]] && ![databaseURL isEqual:[NSNull null]]) { - database = [FIRDatabase databaseForApp:[FIRApp appNamed:appName] URL:databaseURL]; - } else if (![appName isEqual:[NSNull null]]) { - database = [FIRDatabase databaseForApp:[FIRApp appNamed:appName]]; - } else if (![databaseURL isEqual:[NSNull null]]) { - database = [FIRDatabase databaseWithURL:databaseURL]; - } else { - database = [FIRDatabase database]; - } - void (^defaultCompletionBlock)(NSError *, FIRDatabaseReference *) = - ^(NSError *error, FIRDatabaseReference *ref) { - result(getFlutterError(error)); - }; - if ([@"FirebaseDatabase#goOnline" isEqualToString:call.method]) { - [database goOnline]; - result(nil); - } else if ([@"FirebaseDatabase#goOffline" isEqualToString:call.method]) { - [database goOffline]; - result(nil); - } else if ([@"FirebaseDatabase#purgeOutstandingWrites" isEqualToString:call.method]) { - [database purgeOutstandingWrites]; - result(nil); - } else if ([@"FirebaseDatabase#setPersistenceEnabled" isEqualToString:call.method]) { - NSNumber *value = call.arguments[@"enabled"]; - @try { - database.persistenceEnabled = value.boolValue; - result([NSNumber numberWithBool:YES]); - } @catch (NSException *exception) { - if ([@"FIRDatabaseAlreadyInUse" isEqualToString:exception.name]) { - // Database is already in use, e.g. after hot reload/restart. - result([NSNumber numberWithBool:NO]); - } else { - @throw; - } - } - } else if ([@"FirebaseDatabase#setPersistenceCacheSizeBytes" isEqualToString:call.method]) { - NSNumber *value = call.arguments[@"cacheSize"]; - @try { - database.persistenceCacheSizeBytes = value.unsignedIntegerValue; - result([NSNumber numberWithBool:YES]); - } @catch (NSException *exception) { - if ([@"FIRDatabaseAlreadyInUse" isEqualToString:exception.name]) { - // Database is already in use, e.g. after hot reload/restart. - result([NSNumber numberWithBool:NO]); - } else { - @throw; - } - } - } else if ([@"DatabaseReference#set" isEqualToString:call.method]) { - [getReference(database, call.arguments) setValue:call.arguments[@"value"] - andPriority:call.arguments[@"priority"] - withCompletionBlock:defaultCompletionBlock]; - } else if ([@"DatabaseReference#update" isEqualToString:call.method]) { - [getReference(database, call.arguments) updateChildValues:call.arguments[@"value"] - withCompletionBlock:defaultCompletionBlock]; - } else if ([@"DatabaseReference#setPriority" isEqualToString:call.method]) { - [getReference(database, call.arguments) setPriority:call.arguments[@"priority"] - withCompletionBlock:defaultCompletionBlock]; - } else if ([@"DatabaseReference#runTransaction" isEqualToString:call.method]) { - [getReference(database, call.arguments) - runTransactionBlock:^FIRTransactionResult *_Nonnull(FIRMutableData *_Nonnull currentData) { - // Create semaphore to allow native side to wait while snapshot - // updates occur on the Dart side. - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); - - NSObject *snapshot = - @{@"key" : currentData.key ?: [NSNull null], @"value" : currentData.value}; - - __block bool shouldAbort = false; - - [self.channel invokeMethod:@"DoTransaction" - arguments:@{ - @"transactionKey" : call.arguments[@"transactionKey"], - @"snapshot" : snapshot - } - result:^(id _Nullable result) { - if ([result isKindOfClass:[FlutterError class]]) { - FlutterError *flutterError = ((FlutterError *)result); - NSLog(@"Error code: %@", flutterError.code); - NSLog(@"Error message: %@", flutterError.message); - NSLog(@"Error details: %@", flutterError.details); - shouldAbort = true; - } else if ([result isEqual:FlutterMethodNotImplemented]) { - NSLog(@"DoTransaction not implemented on the Dart side."); - shouldAbort = true; - } else { - [self.updatedSnapshots - setObject:result - forKey:call.arguments[@"transactionKey"]]; - } - dispatch_semaphore_signal(semaphore); - }]; - - // Wait while Dart side updates the snapshot. Incoming transactionTimeout is in - // milliseconds so converting to nanoseconds for use with dispatch_semaphore_wait. - long result = dispatch_semaphore_wait( - semaphore, - dispatch_time(DISPATCH_TIME_NOW, - [call.arguments[@"transactionTimeout"] integerValue] * 1000000)); - - if (result == 0 && !shouldAbort) { - // Set FIRMutableData value to value returned from the Dart side. - currentData.value = - [self.updatedSnapshots objectForKey:call.arguments[@"transactionKey"]][@"value"]; - } else { - if (result != 0) { - NSLog(@"Transaction at %@ timed out.", [getReference(database, call.arguments) URL]); - } - return [FIRTransactionResult abort]; - } - - return [FIRTransactionResult successWithValue:currentData]; - } - andCompletionBlock:^(NSError *_Nullable error, BOOL committed, - FIRDataSnapshot *_Nullable snapshot) { - // Invoke transaction completion on the Dart side. - result(@{ - @"transactionKey" : call.arguments[@"transactionKey"], - @"error" : getDictionaryFromError(error) ?: [NSNull null], - @"committed" : [NSNumber numberWithBool:committed], - @"snapshot" : @{@"key" : snapshot.key ?: [NSNull null], @"value" : snapshot.value} - }); - }]; - } else if ([@"OnDisconnect#set" isEqualToString:call.method]) { - [getReference(database, call.arguments) onDisconnectSetValue:call.arguments[@"value"] - andPriority:call.arguments[@"priority"] - withCompletionBlock:defaultCompletionBlock]; - } else if ([@"OnDisconnect#update" isEqualToString:call.method]) { - [getReference(database, call.arguments) onDisconnectUpdateChildValues:call.arguments[@"value"] - withCompletionBlock:defaultCompletionBlock]; - } else if ([@"OnDisconnect#cancel" isEqualToString:call.method]) { - [getReference(database, call.arguments) - cancelDisconnectOperationsWithCompletionBlock:defaultCompletionBlock]; - } else if ([@"Query#observe" isEqualToString:call.method]) { - FIRDataEventType eventType = parseEventType(call.arguments[@"eventType"]); - __block FIRDatabaseHandle handle = [getDatabaseQuery(database, call.arguments) - observeEventType:eventType - andPreviousSiblingKeyWithBlock:^(FIRDataSnapshot *snapshot, NSString *previousSiblingKey) { - [self.channel invokeMethod:@"Event" - arguments:@{ - @"handle" : [NSNumber numberWithUnsignedInteger:handle], - @"snapshot" : @{ - @"key" : snapshot.key ?: [NSNull null], - @"value" : roundDoubles(snapshot.value) ?: [NSNull null], - }, - @"previousSiblingKey" : previousSiblingKey ?: [NSNull null], - }]; - } - withCancelBlock:^(NSError *error) { - [self.channel invokeMethod:@"Error" - arguments:@{ - @"handle" : [NSNumber numberWithUnsignedInteger:handle], - @"error" : getDictionaryFromError(error), - }]; - }]; - result([NSNumber numberWithUnsignedInteger:handle]); - } else if ([@"Query#removeObserver" isEqualToString:call.method]) { - FIRDatabaseHandle handle = [call.arguments[@"handle"] unsignedIntegerValue]; - [getDatabaseQuery(database, call.arguments) removeObserverWithHandle:handle]; - result(nil); - } else if ([@"Query#keepSynced" isEqualToString:call.method]) { - NSNumber *value = call.arguments[@"value"]; - [getDatabaseQuery(database, call.arguments) keepSynced:value.boolValue]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/packages/firebase_database/ios/firebase_database.podspec b/packages/firebase_database/ios/firebase_database.podspec deleted file mode 100755 index eab0bfacedab..000000000000 --- a/packages/firebase_database/ios/firebase_database.podspec +++ /dev/null @@ -1,32 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_database' - s.version = '0.0.1' - s.summary = 'Firebase Database plugin for Flutter.' - s.description = <<-DESC -Firebase Database plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_database' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/Database' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-rtdb\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_database/lib/firebase_database.dart b/packages/firebase_database/lib/firebase_database.dart deleted file mode 100755 index 9ae46229e71d..000000000000 --- a/packages/firebase_database/lib/firebase_database.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_database; - -import 'dart:async'; - -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -import 'src/utils/push_id_generator.dart'; - -part 'src/database_reference.dart'; -part 'src/event.dart'; -part 'src/firebase_database.dart'; -part 'src/query.dart'; -part 'src/on_disconnect.dart'; diff --git a/packages/firebase_database/lib/src/database_reference.dart b/packages/firebase_database/lib/src/database_reference.dart deleted file mode 100644 index ddf22325e32a..000000000000 --- a/packages/firebase_database/lib/src/database_reference.dart +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_database; - -/// DatabaseReference represents a particular location in your Firebase -/// Database and can be used for reading or writing data to that location. -/// -/// This class is the starting point for all Firebase Database operations. -/// After you’ve obtained your first DatabaseReference via -/// `FirebaseDatabase.reference()`, you can use it to read data -/// (ie. `onChildAdded`), write data (ie. `setValue`), and to create new -/// `DatabaseReference`s (ie. `child`). -class DatabaseReference extends Query { - DatabaseReference._(FirebaseDatabase database, List pathComponents) - : super._(database: database, pathComponents: pathComponents); - - /// Gets a DatabaseReference for the location at the specified relative - /// path. The relative path can either be a simple child key (e.g. ‘fred’) or - /// a deeper slash-separated path (e.g. ‘fred/name/first’). - DatabaseReference child(String path) { - return DatabaseReference._(_database, - (List.from(_pathComponents)..addAll(path.split('/')))); - } - - /// Gets a DatabaseReference for the parent location. If this instance - /// refers to the root of your Firebase Database, it has no parent, and - /// therefore parent() will return null. - DatabaseReference parent() { - if (_pathComponents.isEmpty) { - return null; - } - return DatabaseReference._( - _database, (List.from(_pathComponents)..removeLast())); - } - - /// Gets a FIRDatabaseReference for the root location. - DatabaseReference root() { - return DatabaseReference._(_database, []); - } - - /// Gets the last token in a Firebase Database location (e.g. ‘fred’ in - /// https://SampleChat.firebaseIO-demo.com/users/fred) - String get key => _pathComponents.last; - - /// Generates a new child location using a unique key and returns a - /// DatabaseReference to it. This is useful when the children of a Firebase - /// Database location represent a list of items. - /// - /// The unique key generated by childByAutoId: is prefixed with a - /// client-generated timestamp so that the resulting list will be - /// chronologically-sorted. - DatabaseReference push() { - final String key = PushIdGenerator.generatePushChildName(); - final List childPath = List.from(_pathComponents)..add(key); - return DatabaseReference._(_database, childPath); - } - - /// Write `value` to the location with the specified `priority` if applicable. - /// - /// This will overwrite any data at this location and all child locations. - /// - /// Data types that are allowed are String, boolean, int, double, Map, List. - /// - /// The effect of the write will be visible immediately and the corresponding - /// events will be triggered. Synchronization of the data to the Firebase - /// Database servers will also be started. - /// - /// Passing null for the new value means all data at this location or any - /// child location will be deleted. - Future set(dynamic value, {dynamic priority}) { - return _database._channel.invokeMethod( - 'DatabaseReference#set', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'value': value, - 'priority': priority, - }, - ); - } - - /// Update the node with the `value` - Future update(Map value) { - return _database._channel.invokeMethod( - 'DatabaseReference#update', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'value': value, - }, - ); - } - - /// Sets a priority for the data at this Firebase Database location. - /// - /// Priorities can be used to provide a custom ordering for the children at a - /// location (if no priorities are specified, the children are ordered by - /// key). - /// - /// You cannot set a priority on an empty location. For this reason - /// set() should be used when setting initial data with a specific priority - /// and setPriority() should be used when updating the priority of existing - /// data. - /// - /// Children are sorted based on this priority using the following rules: - /// - /// Children with no priority come first. Children with a number as their - /// priority come next. They are sorted numerically by priority (small to - /// large). Children with a string as their priority come last. They are - /// sorted lexicographically by priority. Whenever two children have the same - /// priority (including no priority), they are sorted by key. Numeric keys - /// come first (sorted numerically), followed by the remaining keys (sorted - /// lexicographically). - /// - /// Note that priorities are parsed and ordered as IEEE 754 double-precision - /// floating-point numbers. Keys are always stored as strings and are treated - /// as numbers only when they can be parsed as a 32-bit integer. - Future setPriority(dynamic priority) async { - return _database._channel.invokeMethod( - 'DatabaseReference#setPriority', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'priority': priority, - }, - ); - } - - /// Remove the data at this Firebase Database location. Any data at child - /// locations will also be deleted. - /// - /// The effect of the delete will be visible immediately and the corresponding - /// events will be triggered. Synchronization of the delete to the Firebase - /// Database servers will also be started. - /// - /// remove() is equivalent to calling set(null) - Future remove() => set(null); - - /// Performs an optimistic-concurrency transactional update to the data at - /// this Firebase Database location. - Future runTransaction( - TransactionHandler transactionHandler, - {Duration timeout = const Duration(seconds: 5)}) async { - assert(timeout.inMilliseconds > 0, - 'Transaction timeout must be more than 0 milliseconds.'); - - final Completer completer = - Completer(); - - final int transactionKey = FirebaseDatabase._transactions.isEmpty - ? 0 - : FirebaseDatabase._transactions.keys.last + 1; - - FirebaseDatabase._transactions[transactionKey] = transactionHandler; - - TransactionResult toTransactionResult(Map map) { - final DatabaseError databaseError = - map['error'] != null ? DatabaseError._(map['error']) : null; - final bool committed = map['committed']; - final DataSnapshot dataSnapshot = - map['snapshot'] != null ? DataSnapshot._(map['snapshot']) : null; - - FirebaseDatabase._transactions.remove(transactionKey); - - return TransactionResult._(databaseError, committed, dataSnapshot); - } - - _database._channel.invokeMethod( - 'DatabaseReference#runTransaction', { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'transactionKey': transactionKey, - 'transactionTimeout': timeout.inMilliseconds - }).then((dynamic response) { - completer.complete(toTransactionResult(response)); - }); - - return completer.future; - } - - OnDisconnect onDisconnect() { - return OnDisconnect._(_database, this); - } -} - -class ServerValue { - static const Map timestamp = { - '.sv': 'timestamp' - }; -} - -typedef Future TransactionHandler(MutableData mutableData); - -class TransactionResult { - const TransactionResult._(this.error, this.committed, this.dataSnapshot); - final DatabaseError error; - final bool committed; - final DataSnapshot dataSnapshot; -} diff --git a/packages/firebase_database/lib/src/event.dart b/packages/firebase_database/lib/src/event.dart deleted file mode 100644 index c8bf7c540f91..000000000000 --- a/packages/firebase_database/lib/src/event.dart +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_database; - -enum _EventType { - childAdded, - childRemoved, - childChanged, - childMoved, - value, -} - -/// `Event` encapsulates a DataSnapshot and possibly also the key of its -/// previous sibling, which can be used to order the snapshots. -class Event { - Event._(this._data) : snapshot = DataSnapshot._(_data['snapshot']); - - final DataSnapshot snapshot; - Map _data; - - String get previousSiblingKey => _data['previousSiblingKey']; -} - -/// A DataSnapshot contains data from a Firebase Database location. -/// Any time you read Firebase data, you receive the data as a DataSnapshot. -class DataSnapshot { - DataSnapshot._(this._data); - - final Map _data; - - /// The key of the location that generated this DataSnapshot. - String get key => _data['key']; - - /// Returns the contents of this data snapshot as native types. - dynamic get value => _data['value']; -} - -class MutableData { - @visibleForTesting - MutableData.private(this._data); - - final Map _data; - - /// The key of the location that generated this MutableData. - String get key => _data['key']; - - /// Returns the mutable contents of this MutableData as native types. - dynamic get value => _data['value']; - set value(dynamic newValue) => _data['value'] = newValue; -} - -/// A DatabaseError contains code, message and details of a Firebase Database -/// Error that results from a transaction operation at a Firebase Database -/// location. -class DatabaseError { - DatabaseError._(this._data); - - Map _data; - - /// One of the defined status codes, depending on the error. - int get code => _data['code']; - - /// A human-readable description of the error. - String get message => _data['message']; - - /// Human-readable details on the error and additional information. - String get details => _data['details']; - - @override - String toString() => "$runtimeType($code, $message, $details)"; -} diff --git a/packages/firebase_database/lib/src/firebase_database.dart b/packages/firebase_database/lib/src/firebase_database.dart deleted file mode 100644 index f7681c19b618..000000000000 --- a/packages/firebase_database/lib/src/firebase_database.dart +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_database; - -/// The entry point for accessing a Firebase Database. You can get an instance -/// by calling `FirebaseDatabase.instance`. To access a location in the database -/// and read or write data, use `reference()`. -class FirebaseDatabase { - /// Gets an instance of [FirebaseDatabase]. - /// - /// If [app] is specified, its options should include a [databaseURL]. - FirebaseDatabase({this.app, this.databaseURL}) { - if (_initialized) return; - _channel.setMethodCallHandler((MethodCall call) async { - switch (call.method) { - case 'Event': - final Event event = Event._(call.arguments); - _observers[call.arguments['handle']].add(event); - return null; - case 'Error': - final DatabaseError error = DatabaseError._(call.arguments['error']); - _observers[call.arguments['handle']].addError(error); - return null; - case 'DoTransaction': - final MutableData mutableData = - MutableData.private(call.arguments['snapshot']); - final MutableData updated = - await _transactions[call.arguments['transactionKey']]( - mutableData); - return {'value': updated.value}; - default: - throw MissingPluginException( - '${call.method} method not implemented on the Dart side.', - ); - } - }); - _initialized = true; - } - - static final Map> _observers = - >{}; - - static final Map _transactions = - {}; - - static bool _initialized = false; - - static FirebaseDatabase _instance = FirebaseDatabase(); - - final MethodChannel _channel = const MethodChannel( - 'plugins.flutter.io/firebase_database', - ); - - /// The [FirebaseApp] instance to which this [FirebaseDatabase] belongs. - /// - /// If null, the default [FirebaseApp] is used. - final FirebaseApp app; - - /// The URL to which this [FirebaseDatabase] belongs - /// - /// If null, the URL of the specified [FirebaseApp] is used - final String databaseURL; - - /// Gets the instance of FirebaseDatabase for the default Firebase app. - static FirebaseDatabase get instance => _instance; - - /// Gets a DatabaseReference for the root of your Firebase Database. - DatabaseReference reference() => DatabaseReference._(this, []); - - /// Attempts to sets the database persistence to [enabled]. - /// - /// This property must be set before calling methods on database references - /// and only needs to be called once per application. The returned [Future] - /// will complete with `true` if the operation was successful or `false` if - /// the persistence could not be set (because database references have - /// already been created). - /// - /// The Firebase Database client will cache synchronized data and keep track - /// of all writes you’ve initiated while your application is running. It - /// seamlessly handles intermittent network connections and re-sends write - /// operations when the network connection is restored. - /// - /// However by default your write operations and cached data are only stored - /// in-memory and will be lost when your app restarts. By setting [enabled] - /// to `true`, the data will be persisted to on-device (disk) storage and will - /// thus be available again when the app is restarted (even when there is no - /// network connectivity at that time). - Future setPersistenceEnabled(bool enabled) async { - final bool result = await _channel.invokeMethod( - 'FirebaseDatabase#setPersistenceEnabled', - { - 'app': app?.name, - 'databaseURL': databaseURL, - 'enabled': enabled, - }, - ); - return result; - } - - /// Attempts to set the size of the persistence cache. - /// - /// By default the Firebase Database client will use up to 10MB of disk space - /// to cache data. If the cache grows beyond this size, the client will start - /// removing data that hasn’t been recently used. If you find that your - /// application caches too little or too much data, call this method to change - /// the cache size. - /// - /// This property must be set before calling methods on database references - /// and only needs to be called once per application. The returned [Future] - /// will complete with `true` if the operation was successful or `false` if - /// the value could not be set (because database references have already been - /// created). - /// - /// Note that the specified cache size is only an approximation and the size - /// on disk may temporarily exceed it at times. Cache sizes smaller than 1 MB - /// or greater than 100 MB are not supported. - Future setPersistenceCacheSizeBytes(int cacheSize) async { - final bool result = await _channel.invokeMethod( - 'FirebaseDatabase#setPersistenceCacheSizeBytes', - { - 'app': app?.name, - 'databaseURL': databaseURL, - 'cacheSize': cacheSize, - }, - ); - return result; - } - - /// Resumes our connection to the Firebase Database backend after a previous - /// [goOffline] call. - Future goOnline() { - return _channel.invokeMethod( - 'FirebaseDatabase#goOnline', - { - 'app': app?.name, - 'databaseURL': databaseURL, - }, - ); - } - - /// Shuts down our connection to the Firebase Database backend until - /// [goOnline] is called. - Future goOffline() { - return _channel.invokeMethod( - 'FirebaseDatabase#goOffline', - { - 'app': app?.name, - 'databaseURL': databaseURL, - }, - ); - } - - /// The Firebase Database client automatically queues writes and sends them to - /// the server at the earliest opportunity, depending on network connectivity. - /// In some cases (e.g. offline usage) there may be a large number of writes - /// waiting to be sent. Calling this method will purge all outstanding writes - /// so they are abandoned. - /// - /// All writes will be purged, including transactions and onDisconnect writes. - /// The writes will be rolled back locally, perhaps triggering events for - /// affected event listeners, and the client will not (re-)send them to the - /// Firebase Database backend. - Future purgeOutstandingWrites() { - return _channel.invokeMethod( - 'FirebaseDatabase#purgeOutstandingWrites', - { - 'app': app?.name, - 'databaseURL': databaseURL, - }, - ); - } -} diff --git a/packages/firebase_database/lib/src/on_disconnect.dart b/packages/firebase_database/lib/src/on_disconnect.dart deleted file mode 100644 index 2d44315e069e..000000000000 --- a/packages/firebase_database/lib/src/on_disconnect.dart +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_database; - -class OnDisconnect { - OnDisconnect._(this._database, DatabaseReference reference) - : path = reference.path; - - final FirebaseDatabase _database; - final String path; - - Future set(dynamic value, {dynamic priority}) { - return _database._channel.invokeMethod( - 'OnDisconnect#set', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'value': value, - 'priority': priority - }, - ); - } - - Future remove() => set(null); - - Future cancel() { - return _database._channel.invokeMethod( - 'OnDisconnect#cancel', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path - }, - ); - } - - Future update(Map value) { - return _database._channel.invokeMethod( - 'OnDisconnect#update', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'value': value - }, - ); - } -} diff --git a/packages/firebase_database/lib/src/query.dart b/packages/firebase_database/lib/src/query.dart deleted file mode 100644 index f91c5d4cf7d4..000000000000 --- a/packages/firebase_database/lib/src/query.dart +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_database; - -/// Represents a query over the data at a particular location. -class Query { - Query._( - {@required FirebaseDatabase database, - @required List pathComponents, - Map parameters}) - : _database = database, - _pathComponents = pathComponents, - _parameters = parameters ?? - Map.unmodifiable({}), - assert(database != null); - - final FirebaseDatabase _database; - final List _pathComponents; - final Map _parameters; - - /// Slash-delimited path representing the database location of this query. - String get path => _pathComponents.join('/'); - - Query _copyWithParameters(Map parameters) { - return Query._( - database: _database, - pathComponents: _pathComponents, - parameters: Map.unmodifiable( - Map.from(_parameters)..addAll(parameters), - ), - ); - } - - Map buildArguments() { - return Map.from(_parameters) - ..addAll({ - 'path': path, - }); - } - - Stream _observe(_EventType eventType) { - Future _handle; - // It's fine to let the StreamController be garbage collected once all the - // subscribers have cancelled; this analyzer warning is safe to ignore. - StreamController controller; // ignore: close_sinks - controller = StreamController.broadcast( - onListen: () { - _handle = _database._channel.invokeMethod( - 'Query#observe', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'parameters': _parameters, - 'eventType': eventType.toString(), - }, - ).then((dynamic result) => result); - _handle.then((int handle) { - FirebaseDatabase._observers[handle] = controller; - }); - }, - onCancel: () { - _handle.then((int handle) async { - await _database._channel.invokeMethod( - 'Query#removeObserver', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'parameters': _parameters, - 'handle': handle, - }, - ); - FirebaseDatabase._observers.remove(handle); - }); - }, - ); - return controller.stream; - } - - /// Listens for a single value event and then stops listening. - Future once() async => (await onValue.first).snapshot; - - /// Fires when children are added. - Stream get onChildAdded => _observe(_EventType.childAdded); - - /// Fires when children are removed. `previousChildKey` is null. - Stream get onChildRemoved => _observe(_EventType.childRemoved); - - /// Fires when children are changed. - Stream get onChildChanged => _observe(_EventType.childChanged); - - /// Fires when children are moved. - Stream get onChildMoved => _observe(_EventType.childMoved); - - /// Fires when the data at this location is updated. `previousChildKey` is null. - Stream get onValue => _observe(_EventType.value); - - /// Create a query constrained to only return child nodes with a value greater - /// than or equal to the given value, using the given orderBy directive or - /// priority as default, and optionally only child nodes with a key greater - /// than or equal to the given key. - Query startAt(dynamic value, {String key}) { - assert(!_parameters.containsKey('startAt')); - assert(value is String || - value is bool || - value is double || - value is int || - value == null); - final Map parameters = {'startAt': value}; - if (key != null) parameters['startAtKey'] = key; - return _copyWithParameters(parameters); - } - - /// Create a query constrained to only return child nodes with a value less - /// than or equal to the given value, using the given orderBy directive or - /// priority as default, and optionally only child nodes with a key less - /// than or equal to the given key. - Query endAt(dynamic value, {String key}) { - assert(!_parameters.containsKey('endAt')); - assert(value is String || - value is bool || - value is double || - value is int || - value == null); - final Map parameters = {'endAt': value}; - if (key != null) parameters['endAtKey'] = key; - return _copyWithParameters(parameters); - } - - /// Create a query constrained to only return child nodes with the given - /// `value` (and `key`, if provided). - /// - /// If a key is provided, there is at most one such child as names are unique. - Query equalTo(dynamic value, {String key}) { - assert(!_parameters.containsKey('equalTo')); - assert(value is String || - value is bool || - value is double || - value is int || - value == null); - final Map parameters = {'equalTo': value}; - if (key != null) parameters['equalToKey'] = key; - return _copyWithParameters(parameters); - } - - /// Create a query with limit and anchor it to the start of the window. - Query limitToFirst(int limit) { - assert(!_parameters.containsKey('limitToFirst')); - return _copyWithParameters({'limitToFirst': limit}); - } - - /// Create a query with limit and anchor it to the end of the window. - Query limitToLast(int limit) { - assert(!_parameters.containsKey('limitToLast')); - return _copyWithParameters({'limitToLast': limit}); - } - - /// Generate a view of the data sorted by values of a particular child key. - /// - /// Intended to be used in combination with [startAt], [endAt], or - /// [equalTo]. - Query orderByChild(String key) { - assert(key != null); - assert(!_parameters.containsKey('orderBy')); - return _copyWithParameters( - {'orderBy': 'child', 'orderByChildKey': key}, - ); - } - - /// Generate a view of the data sorted by key. - /// - /// Intended to be used in combination with [startAt], [endAt], or - /// [equalTo]. - Query orderByKey() { - assert(!_parameters.containsKey('orderBy')); - return _copyWithParameters({'orderBy': 'key'}); - } - - /// Generate a view of the data sorted by value. - /// - /// Intended to be used in combination with [startAt], [endAt], or - /// [equalTo]. - Query orderByValue() { - assert(!_parameters.containsKey('orderBy')); - return _copyWithParameters({'orderBy': 'value'}); - } - - /// Generate a view of the data sorted by priority. - /// - /// Intended to be used in combination with [startAt], [endAt], or - /// [equalTo]. - Query orderByPriority() { - assert(!_parameters.containsKey('orderBy')); - return _copyWithParameters({'orderBy': 'priority'}); - } - - /// Obtains a DatabaseReference corresponding to this query's location. - DatabaseReference reference() => - DatabaseReference._(_database, _pathComponents); - - /// By calling keepSynced(true) on a location, the data for that location will - /// automatically be downloaded and kept in sync, even when no listeners are - /// attached for that location. Additionally, while a location is kept synced, - /// it will not be evicted from the persistent disk cache. - Future keepSynced(bool value) { - return _database._channel.invokeMethod( - 'Query#keepSynced', - { - 'app': _database.app?.name, - 'databaseURL': _database.databaseURL, - 'path': path, - 'parameters': _parameters, - 'value': value - }, - ); - } -} diff --git a/packages/firebase_database/lib/src/utils/push_id_generator.dart b/packages/firebase_database/lib/src/utils/push_id_generator.dart deleted file mode 100644 index 187c9b7845d9..000000000000 --- a/packages/firebase_database/lib/src/utils/push_id_generator.dart +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:math'; - -/// Utility class for generating Firebase child node keys. -/// -/// Since the Flutter plugin API is asynchronous, there's no way for us -/// to use the native SDK to generate the node key synchronously and we -/// have to do it ourselves if we want to be able to reference the -/// newly-created node synchronously. -/// -/// This code is based on a Firebase blog post and ported to Dart. -/// https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html -class PushIdGenerator { - static const String PUSH_CHARS = - '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; - - static final Random _random = Random(); - - static int _lastPushTime; - - static final List _lastRandChars = List(12); - - static String generatePushChildName() { - int now = DateTime.now().millisecondsSinceEpoch; - final bool duplicateTime = (now == _lastPushTime); - _lastPushTime = now; - - final List timeStampChars = List(8); - for (int i = 7; i >= 0; i--) { - timeStampChars[i] = PUSH_CHARS[now % 64]; - now = (now / 64).floor(); - } - assert(now == 0); - - final StringBuffer result = StringBuffer(timeStampChars.join()); - - if (!duplicateTime) { - for (int i = 0; i < 12; i++) { - _lastRandChars[i] = _random.nextInt(64); - } - } else { - _incrementArray(); - } - for (int i = 0; i < 12; i++) { - result.write(PUSH_CHARS[_lastRandChars[i]]); - } - assert(result.length == 20); - return result.toString(); - } - - static void _incrementArray() { - for (int i = 11; i >= 0; i--) { - if (_lastRandChars[i] != 63) { - _lastRandChars[i] = _lastRandChars[i] + 1; - return; - } - _lastRandChars[i] = 0; - } - } -} diff --git a/packages/firebase_database/lib/ui/firebase_animated_list.dart b/packages/firebase_database/lib/ui/firebase_animated_list.dart deleted file mode 100755 index 3fa8a375313c..000000000000 --- a/packages/firebase_database/lib/ui/firebase_animated_list.dart +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import '../firebase_database.dart'; -import 'firebase_list.dart'; -import 'firebase_sorted_list.dart'; - -typedef Widget FirebaseAnimatedListItemBuilder( - BuildContext context, - DataSnapshot snapshot, - Animation animation, - int index, -); - -/// An AnimatedList widget that is bound to a query -class FirebaseAnimatedList extends StatefulWidget { - /// Creates a scrolling container that animates items when they are inserted or removed. - FirebaseAnimatedList({ - Key key, - @required this.query, - @required this.itemBuilder, - this.sort, - this.defaultChild, - this.scrollDirection = Axis.vertical, - this.reverse = false, - this.controller, - this.primary, - this.physics, - this.shrinkWrap = false, - this.padding, - this.duration = const Duration(milliseconds: 300), - }) : super(key: key) { - assert(itemBuilder != null); - } - - /// A Firebase query to use to populate the animated list - final Query query; - - /// Optional function used to compare snapshots when sorting the list - /// - /// The default is to sort the snapshots by key. - final Comparator sort; - - /// A widget to display while the query is loading. Defaults to an empty - /// Container(). - final Widget defaultChild; - - /// Called, as needed, to build list item widgets. - /// - /// List items are only built when they're scrolled into view. - /// - /// The [DataSnapshot] parameter indicates the snapshot that should be used - /// to build the item. - /// - /// Implementations of this callback should assume that [AnimatedList.removeItem] - /// removes an item immediately. - final FirebaseAnimatedListItemBuilder itemBuilder; - - /// The axis along which the scroll view scrolls. - /// - /// Defaults to [Axis.vertical]. - final Axis scrollDirection; - - /// Whether the scroll view scrolls in the reading direction. - /// - /// For example, if the reading direction is left-to-right and - /// [scrollDirection] is [Axis.horizontal], then the scroll view scrolls from - /// left to right when [reverse] is false and from right to left when - /// [reverse] is true. - /// - /// Similarly, if [scrollDirection] is [Axis.vertical], then the scroll view - /// scrolls from top to bottom when [reverse] is false and from bottom to top - /// when [reverse] is true. - /// - /// Defaults to false. - final bool reverse; - - /// An object that can be used to control the position to which this scroll - /// view is scrolled. - /// - /// Must be null if [primary] is true. - final ScrollController controller; - - /// Whether this is the primary scroll view associated with the parent - /// [PrimaryScrollController]. - /// - /// On iOS, this identifies the scroll view that will scroll to top in - /// response to a tap in the status bar. - /// - /// Defaults to true when [scrollDirection] is [Axis.vertical] and - /// [controller] is null. - final bool primary; - - /// How the scroll view should respond to user input. - /// - /// For example, determines how the scroll view continues to animate after the - /// user stops dragging the scroll view. - /// - /// Defaults to matching platform conventions. - final ScrollPhysics physics; - - /// Whether the extent of the scroll view in the [scrollDirection] should be - /// determined by the contents being viewed. - /// - /// If the scroll view does not shrink wrap, then the scroll view will expand - /// to the maximum allowed size in the [scrollDirection]. If the scroll view - /// has unbounded constraints in the [scrollDirection], then [shrinkWrap] must - /// be true. - /// - /// Shrink wrapping the content of the scroll view is significantly more - /// expensive than expanding to the maximum allowed size because the content - /// can expand and contract during scrolling, which means the size of the - /// scroll view needs to be recomputed whenever the scroll position changes. - /// - /// Defaults to false. - final bool shrinkWrap; - - /// The amount of space by which to inset the children. - final EdgeInsets padding; - - /// The duration of the insert and remove animation. - /// - /// Defaults to const Duration(milliseconds: 300). - final Duration duration; - - @override - FirebaseAnimatedListState createState() => FirebaseAnimatedListState(); -} - -class FirebaseAnimatedListState extends State { - final GlobalKey _animatedListKey = - GlobalKey(); - List _model; - bool _loaded = false; - - @override - void didChangeDependencies() { - if (widget.sort != null) { - _model = FirebaseSortedList( - query: widget.query, - comparator: widget.sort, - onChildAdded: _onChildAdded, - onChildRemoved: _onChildRemoved, - onChildChanged: _onChildChanged, - onValue: _onValue, - ); - } else { - _model = FirebaseList( - query: widget.query, - onChildAdded: _onChildAdded, - onChildRemoved: _onChildRemoved, - onChildChanged: _onChildChanged, - onChildMoved: _onChildMoved, - onValue: _onValue, - ); - } - super.didChangeDependencies(); - } - - @override - void dispose() { - // Cancel the Firebase stream subscriptions - _model.clear(); - - super.dispose(); - } - - void _onChildAdded(int index, DataSnapshot snapshot) { - if (!_loaded) { - return; // AnimatedList is not created yet - } - _animatedListKey.currentState.insertItem(index, duration: widget.duration); - } - - void _onChildRemoved(int index, DataSnapshot snapshot) { - // The child should have already been removed from the model by now - assert(index >= _model.length || _model[index].key != snapshot.key); - _animatedListKey.currentState.removeItem( - index, - (BuildContext context, Animation animation) { - return widget.itemBuilder(context, snapshot, animation, index); - }, - duration: widget.duration, - ); - } - - // No animation, just update contents - void _onChildChanged(int index, DataSnapshot snapshot) { - setState(() {}); - } - - // No animation, just update contents - void _onChildMoved(int fromIndex, int toIndex, DataSnapshot snapshot) { - setState(() {}); - } - - void _onValue(DataSnapshot _) { - setState(() { - _loaded = true; - }); - } - - Widget _buildItem( - BuildContext context, int index, Animation animation) { - return widget.itemBuilder(context, _model[index], animation, index); - } - - @override - Widget build(BuildContext context) { - if (!_loaded) { - return widget.defaultChild ?? Container(); - } - return AnimatedList( - key: _animatedListKey, - itemBuilder: _buildItem, - initialItemCount: _model.length, - scrollDirection: widget.scrollDirection, - reverse: widget.reverse, - controller: widget.controller, - primary: widget.primary, - physics: widget.physics, - shrinkWrap: widget.shrinkWrap, - padding: widget.padding, - ); - } -} diff --git a/packages/firebase_database/lib/ui/firebase_list.dart b/packages/firebase_database/lib/ui/firebase_list.dart deleted file mode 100644 index 2ac087a42988..000000000000 --- a/packages/firebase_database/lib/ui/firebase_list.dart +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:collection'; - -import 'package:flutter/foundation.dart'; - -import '../firebase_database.dart' - show DatabaseError, DataSnapshot, Event, Query; -import 'utils/stream_subscriber_mixin.dart'; - -typedef void ChildCallback(int index, DataSnapshot snapshot); -typedef void ChildMovedCallback( - int fromIndex, int toIndex, DataSnapshot snapshot); -typedef void ValueCallback(DataSnapshot snapshot); -typedef void ErrorCallback(DatabaseError error); - -/// Sorts the results of `query` on the client side using `DataSnapshot.key`. -class FirebaseList extends ListBase - with StreamSubscriberMixin { - FirebaseList({ - @required this.query, - this.onChildAdded, - this.onChildRemoved, - this.onChildChanged, - this.onChildMoved, - this.onValue, - this.onError, - }) { - assert(query != null); - listen(query.onChildAdded, _onChildAdded, onError: _onError); - listen(query.onChildRemoved, _onChildRemoved, onError: _onError); - listen(query.onChildChanged, _onChildChanged, onError: _onError); - listen(query.onChildMoved, _onChildMoved, onError: _onError); - listen(query.onValue, _onValue, onError: _onError); - } - - /// Database query used to populate the list - final Query query; - - /// Called when the child has been added - final ChildCallback onChildAdded; - - /// Called when the child has been removed - final ChildCallback onChildRemoved; - - /// Called when the child has changed - final ChildCallback onChildChanged; - - /// Called when the child has moved - final ChildMovedCallback onChildMoved; - - /// Called when the data of the list has finished loading - final ValueCallback onValue; - - /// Called when an error is reported (e.g. permission denied) - final ErrorCallback onError; - - // ListBase implementation - final List _snapshots = []; - - @override - int get length => _snapshots.length; - - @override - set length(int value) { - throw UnsupportedError("List cannot be modified."); - } - - @override - DataSnapshot operator [](int index) => _snapshots[index]; - - @override - void operator []=(int index, DataSnapshot value) { - throw UnsupportedError("List cannot be modified."); - } - - @override - void clear() { - cancelSubscriptions(); - - // Do not call super.clear(), it will set the length, it's unsupported. - } - - int _indexForKey(String key) { - assert(key != null); - for (int index = 0; index < _snapshots.length; index++) { - if (key == _snapshots[index].key) { - return index; - } - } - return null; - } - - void _onChildAdded(Event event) { - int index = 0; - if (event.previousSiblingKey != null) { - index = _indexForKey(event.previousSiblingKey) + 1; - } - _snapshots.insert(index, event.snapshot); - onChildAdded(index, event.snapshot); - } - - void _onChildRemoved(Event event) { - final int index = _indexForKey(event.snapshot.key); - _snapshots.removeAt(index); - onChildRemoved(index, event.snapshot); - } - - void _onChildChanged(Event event) { - final int index = _indexForKey(event.snapshot.key); - _snapshots[index] = event.snapshot; - onChildChanged(index, event.snapshot); - } - - void _onChildMoved(Event event) { - final int fromIndex = _indexForKey(event.snapshot.key); - _snapshots.removeAt(fromIndex); - - int toIndex = 0; - if (event.previousSiblingKey != null) { - final int prevIndex = _indexForKey(event.previousSiblingKey); - if (prevIndex != null) { - toIndex = prevIndex + 1; - } - } - _snapshots.insert(toIndex, event.snapshot); - onChildMoved(fromIndex, toIndex, event.snapshot); - } - - void _onValue(Event event) { - onValue(event.snapshot); - } - - void _onError(Object o) { - final DatabaseError error = o; - onError?.call(error); - } -} diff --git a/packages/firebase_database/lib/ui/firebase_sorted_list.dart b/packages/firebase_database/lib/ui/firebase_sorted_list.dart deleted file mode 100644 index d9bb592555a9..000000000000 --- a/packages/firebase_database/lib/ui/firebase_sorted_list.dart +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:collection'; - -import 'package:flutter/foundation.dart'; - -import '../firebase_database.dart' - show DatabaseError, DataSnapshot, Event, Query; -import 'firebase_list.dart' show ChildCallback, ErrorCallback, ValueCallback; -import 'utils/stream_subscriber_mixin.dart'; - -/// Sorts the results of `query` on the client side using to the `comparator`. -/// -// TODO(jackson) We don't support children moving around. -// TODO(jackson) Right now this naively sorting the list after an insert. -// We can be smarter about how we handle insertion and keep the list always -// sorted. See example here: -// https://github.com/firebase/FirebaseUI-iOS/blob/master/FirebaseDatabaseUI/FUISortedArray.m -class FirebaseSortedList extends ListBase - with StreamSubscriberMixin { - FirebaseSortedList({ - @required this.query, - @required this.comparator, - this.onChildAdded, - this.onChildRemoved, - this.onChildChanged, - this.onValue, - this.onError, - }) { - assert(query != null); - assert(comparator != null); - listen(query.onChildAdded, _onChildAdded, onError: _onError); - listen(query.onChildRemoved, _onChildRemoved, onError: _onError); - listen(query.onChildChanged, _onChildChanged, onError: _onError); - listen(query.onValue, _onValue, onError: _onError); - } - - /// Database query used to populate the list - final Query query; - - /// The comparator used to sort the list on the client side - final Comparator comparator; - - /// Called when the child has been added - final ChildCallback onChildAdded; - - /// Called when the child has been removed - final ChildCallback onChildRemoved; - - /// Called when the child has changed - final ChildCallback onChildChanged; - - /// Called when the data of the list has finished loading - final ValueCallback onValue; - - /// Called when an error is reported (e.g. permission denied) - final ErrorCallback onError; - - // ListBase implementation - final List _snapshots = []; - - @override - int get length => _snapshots.length; - - @override - set length(int value) { - throw UnsupportedError("List cannot be modified."); - } - - @override - DataSnapshot operator [](int index) => _snapshots[index]; - - @override - void operator []=(int index, DataSnapshot value) { - throw UnsupportedError("List cannot be modified."); - } - - @override - void clear() { - cancelSubscriptions(); - - // Do not call super.clear(), it will set the length, it's unsupported. - } - - void _onChildAdded(Event event) { - _snapshots.add(event.snapshot); - _snapshots.sort(comparator); - onChildAdded(_snapshots.indexOf(event.snapshot), event.snapshot); - } - - void _onChildRemoved(Event event) { - final DataSnapshot snapshot = - _snapshots.firstWhere((DataSnapshot snapshot) { - return snapshot.key == event.snapshot.key; - }); - final int index = _snapshots.indexOf(snapshot); - _snapshots.removeAt(index); - onChildRemoved(index, snapshot); - } - - void _onChildChanged(Event event) { - final DataSnapshot snapshot = - _snapshots.firstWhere((DataSnapshot snapshot) { - return snapshot.key == event.snapshot.key; - }); - final int index = _snapshots.indexOf(snapshot); - _snapshots[index] = event.snapshot; - onChildChanged(index, event.snapshot); - } - - void _onValue(Event event) { - onValue(event.snapshot); - } - - void _onError(Object o) { - final DatabaseError error = o; - onError?.call(error); - } -} diff --git a/packages/firebase_database/lib/ui/utils/stream_subscriber_mixin.dart b/packages/firebase_database/lib/ui/utils/stream_subscriber_mixin.dart deleted file mode 100644 index cfc488da04a1..000000000000 --- a/packages/firebase_database/lib/ui/utils/stream_subscriber_mixin.dart +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -/// Mixin for classes that own `StreamSubscription`s and expose an API for -/// disposing of themselves by cancelling the subscriptions -abstract class StreamSubscriberMixin { - List> _subscriptions = >[]; - - /// Listens to a stream and saves it to the list of subscriptions. - void listen(Stream stream, void onData(T data), {Function onError}) { - if (stream != null) { - _subscriptions.add(stream.listen(onData, onError: onError)); - } - } - - /// Cancels all streams that were previously added with listen(). - void cancelSubscriptions() { - _subscriptions - .forEach((StreamSubscription subscription) => subscription.cancel()); - } -} diff --git a/packages/firebase_database/pubspec.yaml b/packages/firebase_database/pubspec.yaml deleted file mode 100755 index 19c3a4e88e76..000000000000 --- a/packages/firebase_database/pubspec.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: firebase_database -description: Flutter plugin for Firebase Database, a cloud-hosted NoSQL database - with realtime data syncing across Android and iOS clients, and offline access. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_database -version: 3.0.5 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.database - iosPrefix: FLT - pluginClass: FirebaseDatabasePlugin - -dependencies: - flutter: - sdk: flutter - firebase_core: ^0.4.0 - -dev_dependencies: - test: ^1.3.0 - mockito: ^3.0.0 - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_database/test/firebase_database_test.dart b/packages/firebase_database/test/firebase_database_test.dart deleted file mode 100755 index 66974ddc8adf..000000000000 --- a/packages/firebase_database/test/firebase_database_test.dart +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_core/firebase_core.dart'; -import 'package:firebase_database/firebase_database.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebaseDatabase', () { - const MethodChannel channel = MethodChannel( - 'plugins.flutter.io/firebase_database', - ); - - int mockHandleId = 0; - final List log = []; - final FirebaseApp app = const FirebaseApp( - name: 'testApp', - ); - final String databaseURL = 'https://fake-database-url2.firebaseio.com'; - final FirebaseDatabase database = - FirebaseDatabase(app: app, databaseURL: databaseURL); - - setUp(() async { - channel.setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'Query#observe': - return mockHandleId++; - case 'FirebaseDatabase#setPersistenceEnabled': - return true; - case 'FirebaseDatabase#setPersistenceCacheSizeBytes': - return true; - case 'DatabaseReference#runTransaction': - Map updatedValue; - Future simulateEvent( - int transactionKey, final MutableData mutableData) async { - // TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. - // https://github.com/flutter/flutter/issues/33446 - // ignore: deprecated_member_use - await BinaryMessages.handlePlatformMessage( - channel.name, - channel.codec.encodeMethodCall( - MethodCall( - 'DoTransaction', - { - 'transactionKey': transactionKey, - 'snapshot': { - 'key': mutableData.key, - 'value': mutableData.value, - }, - }, - ), - ), - (_) { - updatedValue = channel.codec - .decodeEnvelope(_)['value'] - .cast(); - }, - ); - } - - await simulateEvent( - 0, - MutableData.private({ - 'key': 'fakeKey', - 'value': {'fakeKey': 'fakeValue'}, - })); - - return { - 'error': null, - 'committed': true, - 'snapshot': { - 'key': 'fakeKey', - 'value': updatedValue, - } - }; - default: - return null; - } - }); - log.clear(); - }); - - test('setPersistenceEnabled', () async { - expect(await database.setPersistenceEnabled(false), true); - expect(await database.setPersistenceEnabled(true), true); - expect( - log, - [ - isMethodCall( - 'FirebaseDatabase#setPersistenceEnabled', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'enabled': false, - }, - ), - isMethodCall( - 'FirebaseDatabase#setPersistenceEnabled', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'enabled': true, - }, - ), - ], - ); - }); - - test('setPersistentCacheSizeBytes', () async { - expect(await database.setPersistenceCacheSizeBytes(42), true); - expect( - log, - [ - isMethodCall( - 'FirebaseDatabase#setPersistenceCacheSizeBytes', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'cacheSize': 42, - }, - ), - ], - ); - }); - - test('goOnline', () async { - await database.goOnline(); - expect( - log, - [ - isMethodCall( - 'FirebaseDatabase#goOnline', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - }, - ), - ], - ); - }); - - test('goOffline', () async { - await database.goOffline(); - expect( - log, - [ - isMethodCall( - 'FirebaseDatabase#goOffline', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - }, - ), - ], - ); - }); - - test('purgeOutstandingWrites', () async { - await database.purgeOutstandingWrites(); - expect( - log, - [ - isMethodCall( - 'FirebaseDatabase#purgeOutstandingWrites', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - }, - ), - ], - ); - }); - - group('$DatabaseReference', () { - test('set', () async { - final dynamic value = {'hello': 'world'}; - final int priority = 42; - await database.reference().child('foo').set(value); - await database.reference().child('bar').set(value, priority: priority); - expect( - log, - [ - isMethodCall( - 'DatabaseReference#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'value': value, - 'priority': null, - }, - ), - isMethodCall( - 'DatabaseReference#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'bar', - 'value': value, - 'priority': priority, - }, - ), - ], - ); - }); - test('update', () async { - final dynamic value = {'hello': 'world'}; - await database.reference().child("foo").update(value); - expect( - log, - [ - isMethodCall( - 'DatabaseReference#update', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'value': value, - }, - ), - ], - ); - }); - - test('setPriority', () async { - final int priority = 42; - await database.reference().child('foo').setPriority(priority); - expect( - log, - [ - isMethodCall( - 'DatabaseReference#setPriority', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'priority': priority, - }, - ), - ], - ); - }); - - test('runTransaction', () async { - final TransactionResult transactionResult = await database - .reference() - .child('foo') - .runTransaction((MutableData mutableData) { - return Future(() { - mutableData.value['fakeKey'] = - 'updated ' + mutableData.value['fakeKey']; - return mutableData; - }); - }); - expect( - log, - [ - isMethodCall( - 'DatabaseReference#runTransaction', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'transactionKey': 0, - 'transactionTimeout': 5000, - }, - ), - ], - ); - expect(transactionResult.committed, equals(true)); - expect(transactionResult.dataSnapshot.value, - equals({'fakeKey': 'updated fakeValue'})); - expect( - database.reference().child('foo').runTransaction( - (MutableData mutableData) async => null, - timeout: const Duration(milliseconds: 0), - ), - throwsA(isInstanceOf()), - ); - }); - }); - - group('$OnDisconnect', () { - test('set', () async { - final dynamic value = {'hello': 'world'}; - final int priority = 42; - final DatabaseReference ref = database.reference(); - await ref.child('foo').onDisconnect().set(value); - await ref.child('bar').onDisconnect().set(value, priority: priority); - await ref.child('psi').onDisconnect().set(value, priority: 'priority'); - await ref.child('por').onDisconnect().set(value, priority: value); - expect( - log, - [ - isMethodCall( - 'OnDisconnect#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'value': value, - 'priority': null, - }, - ), - isMethodCall( - 'OnDisconnect#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'bar', - 'value': value, - 'priority': priority, - }, - ), - isMethodCall( - 'OnDisconnect#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'psi', - 'value': value, - 'priority': 'priority', - }, - ), - isMethodCall( - 'OnDisconnect#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'por', - 'value': value, - 'priority': value, - }, - ), - ], - ); - }); - test('update', () async { - final dynamic value = {'hello': 'world'}; - await database.reference().child("foo").onDisconnect().update(value); - expect( - log, - [ - isMethodCall( - 'OnDisconnect#update', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'value': value, - }, - ), - ], - ); - }); - test('cancel', () async { - await database.reference().child("foo").onDisconnect().cancel(); - expect( - log, - [ - isMethodCall( - 'OnDisconnect#cancel', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - }, - ), - ], - ); - }); - test('remove', () async { - await database.reference().child("foo").onDisconnect().remove(); - expect( - log, - [ - isMethodCall( - 'OnDisconnect#set', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': 'foo', - 'value': null, - 'priority': null, - }, - ), - ], - ); - }); - }); - - group('$Query', () { - // TODO(jackson): Write more tests for queries - test('keepSynced, simple query', () async { - final String path = 'foo'; - final Query query = database.reference().child(path); - await query.keepSynced(true); - expect( - log, - [ - isMethodCall( - 'Query#keepSynced', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': path, - 'parameters': {}, - 'value': true, - }, - ), - ], - ); - }); - test('keepSynced, complex query', () async { - final int startAt = 42; - final String path = 'foo'; - final String childKey = 'bar'; - final bool endAt = true; - final String endAtKey = 'baz'; - final Query query = database - .reference() - .child(path) - .orderByChild(childKey) - .startAt(startAt) - .endAt(endAt, key: endAtKey); - await query.keepSynced(false); - final Map expectedParameters = { - 'orderBy': 'child', - 'orderByChildKey': childKey, - 'startAt': startAt, - 'endAt': endAt, - 'endAtKey': endAtKey, - }; - expect( - log, - [ - isMethodCall( - 'Query#keepSynced', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': path, - 'parameters': expectedParameters, - 'value': false - }, - ), - ], - ); - }); - test('observing error events', () async { - mockHandleId = 99; - const int errorCode = 12; - const String errorDetails = 'Some details'; - final Query query = database.reference().child('some path'); - Future simulateError(String errorMessage) async { - // TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. - // https://github.com/flutter/flutter/issues/33446 - // ignore: deprecated_member_use - await BinaryMessages.handlePlatformMessage( - channel.name, - channel.codec.encodeMethodCall( - MethodCall('Error', { - 'handle': 99, - 'error': { - 'code': errorCode, - 'message': errorMessage, - 'details': errorDetails, - }, - }), - ), - (_) {}, - ); - } - - final AsyncQueue errors = AsyncQueue(); - - // Subscribe and allow subscription to complete. - final StreamSubscription subscription = - query.onValue.listen((_) {}, onError: errors.add); - await Future.delayed(const Duration(seconds: 0)); - - await simulateError('Bad foo'); - await simulateError('Bad bar'); - final DatabaseError error1 = await errors.remove(); - final DatabaseError error2 = await errors.remove(); - subscription.cancel(); - expect(error1.toString(), 'DatabaseError(12, Bad foo, Some details)'); - expect(error1.code, errorCode); - expect(error1.message, 'Bad foo'); - expect(error1.details, errorDetails); - expect(error2.code, errorCode); - expect(error2.message, 'Bad bar'); - expect(error2.details, errorDetails); - }); - test('observing value events', () async { - mockHandleId = 87; - final String path = 'foo'; - final Query query = database.reference().child(path); - Future simulateEvent(String value) async { - // TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. - // https://github.com/flutter/flutter/issues/33446 - // ignore: deprecated_member_use - await BinaryMessages.handlePlatformMessage( - channel.name, - channel.codec.encodeMethodCall( - MethodCall('Event', { - 'handle': 87, - 'snapshot': { - 'key': path, - 'value': value, - }, - }), - ), - (_) {}, - ); - } - - final AsyncQueue events = AsyncQueue(); - - // Subscribe and allow subscription to complete. - final StreamSubscription subscription = - query.onValue.listen(events.add); - await Future.delayed(const Duration(seconds: 0)); - - await simulateEvent('1'); - await simulateEvent('2'); - final Event event1 = await events.remove(); - final Event event2 = await events.remove(); - expect(event1.snapshot.key, path); - expect(event1.snapshot.value, '1'); - expect(event2.snapshot.key, path); - expect(event2.snapshot.value, '2'); - - // Cancel subscription and allow cancellation to complete. - subscription.cancel(); - await Future.delayed(const Duration(seconds: 0)); - - expect( - log, - [ - isMethodCall( - 'Query#observe', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': path, - 'parameters': {}, - 'eventType': '_EventType.value', - }, - ), - isMethodCall( - 'Query#removeObserver', - arguments: { - 'app': app.name, - 'databaseURL': databaseURL, - 'path': path, - 'parameters': {}, - 'handle': 87, - }, - ), - ], - ); - }); - }); - }); -} - -/// Queue whose remove operation is asynchronous, awaiting a corresponding add. -class AsyncQueue { - Map> _completers = >{}; - int _nextToRemove = 0; - int _nextToAdd = 0; - - void add(T element) { - _completer(_nextToAdd++).complete(element); - } - - Future remove() { - return _completer(_nextToRemove++).future; - } - - Completer _completer(int index) { - if (_completers.containsKey(index)) { - return _completers.remove(index); - } else { - return _completers[index] = Completer(); - } - } -} diff --git a/packages/firebase_database/test/firebase_list_test.dart b/packages/firebase_database/test/firebase_list_test.dart deleted file mode 100644 index 559fe8138e31..000000000000 --- a/packages/firebase_database/test/firebase_list_test.dart +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_database/firebase_database.dart'; -import 'package:firebase_database/ui/firebase_list.dart'; -import 'package:mockito/mockito.dart'; -import 'package:test/test.dart'; - -void main() { - group('FirebaseList', () { - StreamController onChildAddedStreamController; - StreamController onChildRemovedStreamController; - StreamController onChildChangedStreamController; - StreamController onChildMovedStreamController; - MockQuery query; - FirebaseList list; - Completer callbackCompleter; - - setUp(() { - onChildAddedStreamController = StreamController(); - onChildRemovedStreamController = StreamController(); - onChildChangedStreamController = StreamController(); - onChildMovedStreamController = StreamController(); - query = MockQuery( - onChildAddedStreamController.stream, - onChildRemovedStreamController.stream, - onChildChangedStreamController.stream, - onChildMovedStreamController.stream, - ); - callbackCompleter = Completer(); - - void completeWithChange(int index, DataSnapshot snapshot) { - callbackCompleter.complete(ListChange.at(index, snapshot)); - } - - void completeWithMove(int from, int to, DataSnapshot snapshot) { - callbackCompleter.complete(ListChange.move(from, to, snapshot)); - } - - list = FirebaseList( - query: query, - onChildAdded: completeWithChange, - onChildRemoved: completeWithChange, - onChildChanged: completeWithChange, - onChildMoved: completeWithMove, - ); - }); - - Future resetCompleterOnCallback() async { - final ListChange result = await callbackCompleter.future; - callbackCompleter = Completer(); - return result; - } - - Future processChildAddedEvent(Event event) { - onChildAddedStreamController.add(event); - return resetCompleterOnCallback(); - } - - Future processChildRemovedEvent(Event event) { - onChildRemovedStreamController.add(event); - return resetCompleterOnCallback(); - } - - Future processChildChangedEvent(Event event) { - onChildChangedStreamController.add(event); - return resetCompleterOnCallback(); - } - - Future processChildMovedEvent(Event event) { - onChildMovedStreamController.add(event); - return resetCompleterOnCallback(); - } - - test('can add to empty list', () async { - final DataSnapshot snapshot = MockDataSnapshot('key10', 10); - expect( - await processChildAddedEvent(MockEvent(null, snapshot)), - ListChange.at(0, snapshot), - ); - expect(list, [snapshot]); - }); - - test('can add before first element', () async { - final DataSnapshot snapshot1 = MockDataSnapshot('key10', 10); - final DataSnapshot snapshot2 = MockDataSnapshot('key20', 20); - await processChildAddedEvent(MockEvent(null, snapshot2)); - expect( - await processChildAddedEvent(MockEvent(null, snapshot1)), - ListChange.at(0, snapshot1), - ); - expect(list, [snapshot1, snapshot2]); - }); - - test('can add after last element', () async { - final DataSnapshot snapshot1 = MockDataSnapshot('key10', 10); - final DataSnapshot snapshot2 = MockDataSnapshot('key20', 20); - await processChildAddedEvent(MockEvent(null, snapshot1)); - expect( - await processChildAddedEvent(MockEvent('key10', snapshot2)), - ListChange.at(1, snapshot2), - ); - expect(list, [snapshot1, snapshot2]); - }); - - test('can remove from singleton list', () async { - final DataSnapshot snapshot = MockDataSnapshot('key10', 10); - await processChildAddedEvent(MockEvent(null, snapshot)); - expect( - await processChildRemovedEvent(MockEvent(null, snapshot)), - ListChange.at(0, snapshot), - ); - expect(list, isEmpty); - }); - - test('can remove former of two elements', () async { - final DataSnapshot snapshot1 = MockDataSnapshot('key10', 10); - final DataSnapshot snapshot2 = MockDataSnapshot('key20', 20); - await processChildAddedEvent(MockEvent(null, snapshot2)); - await processChildAddedEvent(MockEvent(null, snapshot1)); - expect( - await processChildRemovedEvent(MockEvent(null, snapshot1)), - ListChange.at(0, snapshot1), - ); - expect(list, [snapshot2]); - }); - - test('can remove latter of two elements', () async { - final DataSnapshot snapshot1 = MockDataSnapshot('key10', 10); - final DataSnapshot snapshot2 = MockDataSnapshot('key20', 20); - await processChildAddedEvent(MockEvent(null, snapshot2)); - await processChildAddedEvent(MockEvent(null, snapshot1)); - expect( - await processChildRemovedEvent(MockEvent('key10', snapshot2)), - ListChange.at(1, snapshot2), - ); - expect(list, [snapshot1]); - }); - - test('can change child', () async { - final DataSnapshot snapshot1 = MockDataSnapshot('key10', 10); - final DataSnapshot snapshot2a = MockDataSnapshot('key20', 20); - final DataSnapshot snapshot2b = MockDataSnapshot('key20', 25); - final DataSnapshot snapshot3 = MockDataSnapshot('key30', 30); - await processChildAddedEvent(MockEvent(null, snapshot3)); - await processChildAddedEvent(MockEvent(null, snapshot2a)); - await processChildAddedEvent(MockEvent(null, snapshot1)); - expect( - await processChildChangedEvent(MockEvent('key10', snapshot2b)), - ListChange.at(1, snapshot2b), - ); - expect(list, [snapshot1, snapshot2b, snapshot3]); - }); - test('can move child', () async { - final DataSnapshot snapshot1 = MockDataSnapshot('key10', 10); - final DataSnapshot snapshot2 = MockDataSnapshot('key20', 20); - final DataSnapshot snapshot3 = MockDataSnapshot('key30', 30); - await processChildAddedEvent(MockEvent(null, snapshot3)); - await processChildAddedEvent(MockEvent(null, snapshot2)); - await processChildAddedEvent(MockEvent(null, snapshot1)); - expect( - await processChildMovedEvent(MockEvent('key30', snapshot1)), - ListChange.move(0, 2, snapshot1), - ); - expect(list, [snapshot2, snapshot3, snapshot1]); - }); - }); -} - -class MockQuery extends Mock implements Query { - MockQuery( - this.onChildAdded, - this.onChildRemoved, - this.onChildChanged, - this.onChildMoved, - ); - - @override - final Stream onChildAdded; - - @override - final Stream onChildRemoved; - - @override - final Stream onChildChanged; - - @override - final Stream onChildMoved; -} - -class ListChange { - ListChange.at(int index, DataSnapshot snapshot) - : this._(index, null, snapshot); - - ListChange.move(int from, int to, DataSnapshot snapshot) - : this._(from, to, snapshot); - - ListChange._(this.index, this.index2, this.snapshot); - - final int index; - final int index2; - final DataSnapshot snapshot; - - @override - String toString() => '$runtimeType[$index, $index2, $snapshot]'; - - @override - bool operator ==(Object o) { - return o is ListChange && - index == o.index && - index2 == o.index2 && - snapshot == o.snapshot; - } - - @override - int get hashCode => index; -} - -class MockEvent implements Event { - MockEvent(this.previousSiblingKey, this.snapshot); - - @override - final String previousSiblingKey; - - @override - final DataSnapshot snapshot; - - @override - String toString() => '$runtimeType[$previousSiblingKey, $snapshot]'; - - @override - bool operator ==(Object o) { - return o is MockEvent && - previousSiblingKey == o.previousSiblingKey && - snapshot == o.snapshot; - } - - @override - int get hashCode => previousSiblingKey.hashCode; -} - -class MockDataSnapshot implements DataSnapshot { - MockDataSnapshot(this.key, this.value); - - @override - final String key; - - @override - final dynamic value; - - @override - String toString() => '$runtimeType[$key, $value]'; - - @override - bool operator ==(Object o) { - return o is MockDataSnapshot && key == o.key && value == o.value; - } - - @override - int get hashCode => key.hashCode; -} diff --git a/packages/firebase_dynamic_links/.gitignore b/packages/firebase_dynamic_links/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_dynamic_links/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_dynamic_links/CHANGELOG.md b/packages/firebase_dynamic_links/CHANGELOG.md deleted file mode 100644 index 04e18d9e9815..000000000000 --- a/packages/firebase_dynamic_links/CHANGELOG.md +++ /dev/null @@ -1,112 +0,0 @@ -## 0.5.0 - -* **Breaking change**. Changed architecture and method names to be able to differentiate between -the dynamic link which opened the app and links clicked during app execution (active and background). -`retrieveDynamicLink` has been replaced with two different functions: -- `getInitialLink` a future to retrieve the link that opened the app -- `onLink` a callback to listen to links opened while the app is active or in background - -## 0.4.0+6 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.4.0+5 - -* Fix the bug below properly by allowing the activity to be null (but still registering the plugin). If activity is null, we don't get a latestIntent, instead we expect the intent listener to grab it. - -## 0.4.0+4 - -* Fixed bug on Android when a headless plugin tries to register this plugin causing a crash due no activity from the registrar. - -## 0.4.0+3 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.4.0+2 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 0.4.0+1 - -* Fixed bug where link persists after starting an app with a Dynamic Link. -* Fixed bug where retrieving a link would fail when app was already running. - -## 0.4.0 - -* Update dependency on firebase_core to 0.4.0. - -## 0.3.0. - -* Update Android dependencies to 16.1.7. -* **Breaking change**. Dynamic link parameter `domain` replaced with `uriPrefix`. - -## 0.2.1 - -* Throw `PlatformException` if there is an error retrieving dynamic link. - -## 0.2.0+4 - -* Fix crash when receiving `ShortDynamicLink` warnings. - -## 0.2.0+3 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.2.0+2 - -* Remove categories. - -## 0.2.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.2.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.1.1 - -* Update example to create a clickable and copyable link. - -## 0.1.0+2 - -* Change android `invites` dependency to `dynamic links` dependency. - -## 0.1.0+1 - -* Bump Android dependencies to latest. - -## 0.1.0 - -* **Breaking Change** Calls to retrieve dynamic links on iOS always returns null after first call. - -## 0.0.6 - -* Bump Android and Firebase dependency versions. - -## 0.0.5 - -* Added capability to receive dynamic links. - -## 0.0.4 - -* Fixed dynamic link dartdoc generation. - -## 0.0.3 - -* Fixed incorrect homepage link in pubspec. - -## 0.0.2 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.0.1 - -* Initial release with api to create long or short dynamic links. diff --git a/packages/firebase_dynamic_links/LICENSE b/packages/firebase_dynamic_links/LICENSE deleted file mode 100644 index b9f0ba5d5188..000000000000 --- a/packages/firebase_dynamic_links/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_dynamic_links/README.md b/packages/firebase_dynamic_links/README.md deleted file mode 100644 index e5b755d6f421..000000000000 --- a/packages/firebase_dynamic_links/README.md +++ /dev/null @@ -1,156 +0,0 @@ -# Google Dynamic Links for Firebase - -[![pub package](https://img.shields.io/pub/v/firebase_dynamic_links.svg)](https://pub.dartlang.org/packages/firebase_dynamic_links) - -A Flutter plugin to use the [Google Dynamic Links for Firebase API](https://firebase.google.com/docs/dynamic-links/). - -With Dynamic Links, your users get the best available experience for the platform they open your link on. If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app. If a user opens the same Dynamic Link in a desktop browser, they can be taken to the equivalent content on your website. - -In addition, Dynamic Links work across app installs: if a user opens a Dynamic Link on iOS or Android and doesn't have your app installed, the user can be prompted to install it; then, after installation, your app starts and can access the link. - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -To use this plugin, add `firebase_dynamic_links` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). You must also configure firebase dynamic links for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#4 for step by step details). - -## Create Dynamic Links - -You create a Dynamic Link either by using the Firebase console, using a REST API, iOS or Android Builder API, Flutter API, or by forming a URL by adding Dynamic Link parameters to a URI prefix specific to your app. These parameters specify the links you want to open, depending on the user's platform and whether your app is installed. - -Below are instructions to create Dynamic Links using Flutter with the Firebase Dynamic Links API. This API accepts either a long Dynamic Link or an object containing Dynamic Link parameters, and returns a URL like the following example: - -``` -https://example.page.link/WXYZ -``` - -You can create a Dynamic Link programmatically by setting the following parameters and using the `DynamicLinkParameters.buildUrl()` method. - -```dart -final DynamicLinkParameters parameters = DynamicLinkParameters( - uriPrefix: 'https://abc123.app.goo.gl', - link: Uri.parse('https://example.com/'), - androidParameters: AndroidParameters( - packageName: 'com.example.android', - minimumVersion: 125, - ), - iosParameters: IosParameters( - bundleId: 'com.example.ios', - minimumVersion: '1.0.1', - appStoreId: '123456789', - ), - googleAnalyticsParameters: GoogleAnalyticsParameters( - campaign: 'example-promo', - medium: 'social', - source: 'orkut', - ), - itunesConnectAnalyticsParameters: ItunesConnectAnalyticsParameters( - providerToken: '123456', - campaignToken: 'example-promo', - ), - socialMetaTagParameters: SocialMetaTagParameters( - title: 'Example of a Dynamic Link', - description: 'This link works whether app is installed or not!', - ), -); - -final Uri dynamicUrl = await parameters.buildUrl(); -``` - -To create a short Dynamic Link, build `DynamicLinkParameters` the same way, but use the `DynamicLinkParameters.buildShortLink()` method. - -```dart -final ShortDynamicLink shortDynamicLink = await parameters.buildShortLink(); -final Uri shortUrl = shortDynamicLink.shortUrl; -``` - -To shorten a long Dynamic Link, use the DynamicLinkParameters.shortenUrl method. - -```dart -final ShortDynamicLink shortenedLink = await DynamicLinkParameters.shortenUrl( - Uri.parse('https://example.page.link/?link=https://example.com/&apn=com.example.android&ibn=com.example.ios'), - DynamicLinkParametersOptions(ShortDynamicLinkPathLength.unguessable), -); - -final Uri shortUrl = shortenedLink.shortUrl; -``` - -## Handle Received Dynamic Links - -You can receive a Dynamic Link containing a deep link that takes the user to specific content within your app: - -1. In the [Firebase Console](https://console.firebase.google.com), open the Dynamic Links section. - - Accept the terms of service if you are prompted to do so. - - Take note of your project's Dynamic Links URL prefix, which is displayed at the top of the Dynamic Links page. You need your project's Dynamic Links URL prefix to programmatically create Dynamic Links. A Dynamic Links URL prefix looks like `https://YOUR_SUBDOMAIN.page.link`. - -Receiving dynamic links on *iOS* requires a couple more steps than *Android*. If you only want to receive dynamic links on *Android*, skip to step 4. You can also follow a video on the next two steps [here.](https://youtu.be/sFPo296OQqk?t=2m40s) - -2. In the **Info** tab of your *iOS* app's Xcode project: - - Create a new **URL Type** to be used for Dynamic Links. - - Set the **Identifier** field to a unique value and the **URL Schemes** field to be your bundle identifier, which is the default URL scheme used by Dynamic Links. - -3. In the **Capabilities** tab of your app's Xcode project, enable **Associated Domains** and add the following to the **Associated Domains** list: - -``` -applinks:YOUR_SUBDOMAIN.page.link -``` - -4. To receive a dynamic link, call the `getInitialLink()` method from `FirebaseDynamicLinks` which gets the link that opened the app (or null if it was not opened via a dynamic link) -and configure listeners for link callbacks when the application is active or in background calling `onLink`. - -```dart -void main() { - runApp(MaterialApp( - title: 'Dynamic Links Example', - routes: { - '/': (BuildContext context) => MyHomeWidget(), // Default home route - '/helloworld': (BuildContext context) => MyHelloWorldWidget(), - }, - )); -} - -class MyHomeWidgetState extends State { - . - . - . - @override - void initState() { - super.initState(); - this.initDynamicLinks(); - } - - void initDynamicLinks() async { - final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink(); - final Uri deepLink = data?.link; - - if (deepLink != null) { - Navigator.pushNamed(context, deepLink.path); - } - - FirebaseDynamicLinks.instance.onLink( - onSuccess: (PendingDynamicLinkData dynamicLink) async { - final Uri deepLink = dynamicLink?.link; - - if (deepLink != null) { - Navigator.pushNamed(context, deepLink.path); - } - }, - onError: (OnLinkErrorException e) async { - print('onLinkError'); - print(e.message); - } - ); - } - . - . - . -} -``` - -If your app did not open from a dynamic link, `getInitialLink()` will return `null`. - -## Getting Started - -See the `example` directory for a complete sample app using Google Dynamic Links for Firebase. diff --git a/packages/firebase_dynamic_links/android/build.gradle b/packages/firebase_dynamic_links/android/build.gradle deleted file mode 100644 index 01deb838f297..000000000000 --- a/packages/firebase_dynamic_links/android/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -def PLUGIN = "firebase_dynamic_links"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebasedynamiclinks' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-dynamic-links:16.1.8' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_dynamic_links/android/gradle.properties b/packages/firebase_dynamic_links/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_dynamic_links/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_dynamic_links/android/settings.gradle b/packages/firebase_dynamic_links/android/settings.gradle deleted file mode 100644 index 2a833554f85c..000000000000 --- a/packages/firebase_dynamic_links/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_dynamic_links' diff --git a/packages/firebase_dynamic_links/android/src/main/AndroidManifest.xml b/packages/firebase_dynamic_links/android/src/main/AndroidManifest.xml deleted file mode 100644 index 663e4f0f3de9..000000000000 --- a/packages/firebase_dynamic_links/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/packages/firebase_dynamic_links/android/src/main/java/io/flutter/plugins/firebasedynamiclinks/FirebaseDynamicLinksPlugin.java b/packages/firebase_dynamic_links/android/src/main/java/io/flutter/plugins/firebasedynamiclinks/FirebaseDynamicLinksPlugin.java deleted file mode 100644 index cd5c5ea2456f..000000000000 --- a/packages/firebase_dynamic_links/android/src/main/java/io/flutter/plugins/firebasedynamiclinks/FirebaseDynamicLinksPlugin.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasedynamiclinks; - -import android.content.Intent; -import android.net.Uri; -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.dynamiclinks.DynamicLink; -import com.google.firebase.dynamiclinks.FirebaseDynamicLinks; -import com.google.firebase.dynamiclinks.PendingDynamicLinkData; -import com.google.firebase.dynamiclinks.ShortDynamicLink; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.NewIntentListener; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** FirebaseDynamicLinksPlugin */ -public class FirebaseDynamicLinksPlugin implements MethodCallHandler, NewIntentListener { - private final Registrar registrar; - private final MethodChannel channel; - - private FirebaseDynamicLinksPlugin(Registrar registrar, MethodChannel channel) { - this.registrar = registrar; - this.channel = channel; - } - - @Override - public boolean onNewIntent(Intent intent) { - FirebaseDynamicLinks.getInstance() - .getDynamicLink(intent) - .addOnSuccessListener( - registrar.activity(), - new OnSuccessListener() { - @Override - public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) { - if (pendingDynamicLinkData != null) { - Map dynamicLink = - getMapFromPendingDynamicLinkData(pendingDynamicLinkData); - channel.invokeMethod("onLinkSuccess", dynamicLink); - } - } - }) - .addOnFailureListener( - registrar.activity(), - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - Map exception = new HashMap<>(); - exception.put("code", e.getClass().getSimpleName()); - exception.put("message", e.getMessage()); - exception.put("details", null); - channel.invokeMethod("onLinkError", exception); - } - }); - - return false; - } - - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_dynamic_links"); - final FirebaseDynamicLinksPlugin plugin = new FirebaseDynamicLinksPlugin(registrar, channel); - registrar.addNewIntentListener(plugin); - channel.setMethodCallHandler(plugin); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - switch (call.method) { - case "DynamicLinkParameters#buildUrl": - DynamicLink.Builder urlBuilder = setupParameters(call); - result.success(urlBuilder.buildDynamicLink().getUri().toString()); - break; - case "DynamicLinkParameters#buildShortLink": - DynamicLink.Builder shortLinkBuilder = setupParameters(call); - buildShortDynamicLink(shortLinkBuilder, call, createShortLinkListener(result)); - break; - case "DynamicLinkParameters#shortenUrl": - DynamicLink.Builder builder = FirebaseDynamicLinks.getInstance().createDynamicLink(); - - Uri url = Uri.parse((String) call.argument("url")); - builder.setLongLink(url); - buildShortDynamicLink(builder, call, createShortLinkListener(result)); - break; - case "FirebaseDynamicLinks#getInitialLink": - handleGetInitialDynamicLink(result); - break; - default: - result.notImplemented(); - break; - } - } - - private Map getMapFromPendingDynamicLinkData( - PendingDynamicLinkData pendingDynamicLinkData) { - Map dynamicLink = new HashMap<>(); - dynamicLink.put("link", pendingDynamicLinkData.getLink().toString()); - - Map androidData = new HashMap<>(); - androidData.put("clickTimestamp", pendingDynamicLinkData.getClickTimestamp()); - androidData.put("minimumVersion", pendingDynamicLinkData.getMinimumAppVersion()); - - dynamicLink.put("android", androidData); - return dynamicLink; - } - - private void handleGetInitialDynamicLink(final Result result) { - FirebaseDynamicLinks.getInstance() - .getDynamicLink(registrar.activity().getIntent()) - .addOnSuccessListener( - registrar.activity(), - new OnSuccessListener() { - @Override - public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) { - if (pendingDynamicLinkData != null) { - Map dynamicLink = - getMapFromPendingDynamicLinkData(pendingDynamicLinkData); - result.success(dynamicLink); - return; - } - result.success(null); - } - }) - .addOnFailureListener( - registrar.activity(), - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error(e.getClass().getSimpleName(), e.getMessage(), null); - } - }); - } - - private OnCompleteListener createShortLinkListener(final Result result) { - return new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (task.isSuccessful()) { - Map url = new HashMap<>(); - url.put("url", task.getResult().getShortLink().toString()); - - List warnings = new ArrayList<>(); - if (task.getResult().getWarnings() != null) { - for (ShortDynamicLink.Warning warning : task.getResult().getWarnings()) { - warnings.add(warning.getMessage()); - } - } - - url.put("warnings", warnings); - - result.success(url); - } else { - Exception exception = task.getException(); - String errMsg = "Unable to create short link"; - if (exception != null && exception.getLocalizedMessage() != null) { - errMsg = exception.getLocalizedMessage(); - } - result.error("short_link_error", errMsg, null); - } - } - }; - } - - private void buildShortDynamicLink( - DynamicLink.Builder builder, MethodCall call, OnCompleteListener listener) { - Integer suffix = null; - - Map dynamicLinkParametersOptions = - call.argument("dynamicLinkParametersOptions"); - if (dynamicLinkParametersOptions != null) { - Integer shortDynamicLinkPathLength = - (Integer) dynamicLinkParametersOptions.get("shortDynamicLinkPathLength"); - if (shortDynamicLinkPathLength != null) { - switch (shortDynamicLinkPathLength) { - case 0: - suffix = ShortDynamicLink.Suffix.UNGUESSABLE; - break; - case 1: - suffix = ShortDynamicLink.Suffix.SHORT; - break; - default: - break; - } - } - } - - if (suffix != null) { - builder.buildShortDynamicLink(suffix).addOnCompleteListener(listener); - } else { - builder.buildShortDynamicLink().addOnCompleteListener(listener); - } - } - - private DynamicLink.Builder setupParameters(MethodCall call) { - DynamicLink.Builder dynamicLinkBuilder = FirebaseDynamicLinks.getInstance().createDynamicLink(); - - String uriPrefix = call.argument("uriPrefix"); - String link = call.argument("link"); - - dynamicLinkBuilder.setDomainUriPrefix(uriPrefix); - dynamicLinkBuilder.setLink(Uri.parse(link)); - - Map androidParameters = call.argument("androidParameters"); - if (androidParameters != null) { - String packageName = valueFor("packageName", androidParameters); - String fallbackUrl = valueFor("fallbackUrl", androidParameters); - Integer minimumVersion = valueFor("minimumVersion", androidParameters); - - DynamicLink.AndroidParameters.Builder builder = - new DynamicLink.AndroidParameters.Builder(packageName); - - if (fallbackUrl != null) builder.setFallbackUrl(Uri.parse(fallbackUrl)); - if (minimumVersion != null) builder.setMinimumVersion(minimumVersion); - - dynamicLinkBuilder.setAndroidParameters(builder.build()); - } - - Map googleAnalyticsParameters = call.argument("googleAnalyticsParameters"); - if (googleAnalyticsParameters != null) { - String campaign = valueFor("campaign", googleAnalyticsParameters); - String content = valueFor("content", googleAnalyticsParameters); - String medium = valueFor("medium", googleAnalyticsParameters); - String source = valueFor("source", googleAnalyticsParameters); - String term = valueFor("term", googleAnalyticsParameters); - - DynamicLink.GoogleAnalyticsParameters.Builder builder = - new DynamicLink.GoogleAnalyticsParameters.Builder(); - - if (campaign != null) builder.setCampaign(campaign); - if (content != null) builder.setContent(content); - if (medium != null) builder.setMedium(medium); - if (source != null) builder.setSource(source); - if (term != null) builder.setTerm(term); - - dynamicLinkBuilder.setGoogleAnalyticsParameters(builder.build()); - } - - Map iosParameters = call.argument("iosParameters"); - if (iosParameters != null) { - String bundleId = valueFor("bundleId", iosParameters); - String appStoreId = valueFor("appStoreId", iosParameters); - String customScheme = valueFor("customScheme", iosParameters); - String fallbackUrl = valueFor("fallbackUrl", iosParameters); - String ipadBundleId = valueFor("ipadBundleId", iosParameters); - String ipadFallbackUrl = valueFor("ipadFallbackUrl", iosParameters); - String minimumVersion = valueFor("minimumVersion", iosParameters); - - DynamicLink.IosParameters.Builder builder = new DynamicLink.IosParameters.Builder(bundleId); - - if (appStoreId != null) builder.setAppStoreId(appStoreId); - if (customScheme != null) builder.setCustomScheme(customScheme); - if (fallbackUrl != null) builder.setFallbackUrl(Uri.parse(fallbackUrl)); - if (ipadBundleId != null) builder.setIpadBundleId(ipadBundleId); - if (ipadFallbackUrl != null) builder.setIpadFallbackUrl(Uri.parse(ipadFallbackUrl)); - if (minimumVersion != null) builder.setMinimumVersion(minimumVersion); - - dynamicLinkBuilder.setIosParameters(builder.build()); - } - - Map itunesConnectAnalyticsParameters = - call.argument("itunesConnectAnalyticsParameters"); - if (itunesConnectAnalyticsParameters != null) { - String affiliateToken = valueFor("affiliateToken", itunesConnectAnalyticsParameters); - String campaignToken = valueFor("campaignToken", itunesConnectAnalyticsParameters); - String providerToken = valueFor("providerToken", itunesConnectAnalyticsParameters); - - DynamicLink.ItunesConnectAnalyticsParameters.Builder builder = - new DynamicLink.ItunesConnectAnalyticsParameters.Builder(); - - if (affiliateToken != null) builder.setAffiliateToken(affiliateToken); - if (campaignToken != null) builder.setCampaignToken(campaignToken); - if (providerToken != null) builder.setProviderToken(providerToken); - - dynamicLinkBuilder.setItunesConnectAnalyticsParameters(builder.build()); - } - - Map navigationInfoParameters = call.argument("navigationInfoParameters"); - if (navigationInfoParameters != null) { - Boolean forcedRedirectEnabled = valueFor("forcedRedirectEnabled", navigationInfoParameters); - - DynamicLink.NavigationInfoParameters.Builder builder = - new DynamicLink.NavigationInfoParameters.Builder(); - - if (forcedRedirectEnabled != null) builder.setForcedRedirectEnabled(forcedRedirectEnabled); - - dynamicLinkBuilder.setNavigationInfoParameters(builder.build()); - } - - Map socialMetaTagParameters = call.argument("socialMetaTagParameters"); - if (socialMetaTagParameters != null) { - String description = valueFor("description", socialMetaTagParameters); - String imageUrl = valueFor("imageUrl", socialMetaTagParameters); - String title = valueFor("title", socialMetaTagParameters); - - DynamicLink.SocialMetaTagParameters.Builder builder = - new DynamicLink.SocialMetaTagParameters.Builder(); - - if (description != null) builder.setDescription(description); - if (imageUrl != null) builder.setImageUrl(Uri.parse(imageUrl)); - if (title != null) builder.setTitle(title); - - dynamicLinkBuilder.setSocialMetaTagParameters(builder.build()); - } - - return dynamicLinkBuilder; - } - - private static T valueFor(String key, Map map) { - @SuppressWarnings("unchecked") - T result = (T) map.get(key); - return result; - } -} diff --git a/packages/firebase_dynamic_links/android/src/main/java/io/flutter/plugins/firebasedynamiclinks/FlutterFirebaseAppRegistrar.java b/packages/firebase_dynamic_links/android/src/main/java/io/flutter/plugins/firebasedynamiclinks/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index e3a643252ec9..000000000000 --- a/packages/firebase_dynamic_links/android/src/main/java/io/flutter/plugins/firebasedynamiclinks/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasedynamiclinks; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_dynamic_links/android/user-agent.gradle b/packages/firebase_dynamic_links/android/user-agent.gradle deleted file mode 100644 index 06d7f9075b82..000000000000 --- a/packages/firebase_dynamic_links/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-dl" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_dynamic_links/example/.metadata b/packages/firebase_dynamic_links/example/.metadata deleted file mode 100644 index 866a061a7a7f..000000000000 --- a/packages/firebase_dynamic_links/example/.metadata +++ /dev/null @@ -1,8 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: f408bb06f9361793ca85493c38d809ee1e2f7e30 - channel: master diff --git a/packages/firebase_dynamic_links/example/README.md b/packages/firebase_dynamic_links/example/README.md deleted file mode 100644 index e098704eddc5..000000000000 --- a/packages/firebase_dynamic_links/example/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# firebase_dynamic_links_example - -Demonstrates how to use the firebase_dynamic_links plugin. - -## *Important* - -The example app for this plugin only receives links on Android. Xcode has signing requirements that must be configured with an iOS app developer team id. Check the `firebase_dynamic_links/README.md` for more details. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](https://flutter.io/). diff --git a/packages/firebase_dynamic_links/example/android/app/build.gradle b/packages/firebase_dynamic_links/example/android/app/build.gradle deleted file mode 100644 index 75ab78059c1c..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebasedynamiclinksexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_dynamic_links/example/android/app/google-services.json b/packages/firebase_dynamic_links/example/android/app/google-services.json deleted file mode 100644 index 7123ea9b2ebd..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/google-services.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "project_info": { - "project_number": "479882132969", - "firebase_url": "https://my-flutter-proj.firebaseio.com", - "project_id": "my-flutter-proj", - "storage_bucket": "my-flutter-proj.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:479882132969:android:632cdf3fc0a17139", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasedynamiclinksexample" - } - }, - "oauth_client": [ - { - "client_id": "479882132969-32qusitiag53931ck80h121ajhlc5a7e.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebasedynamiclinksexample", - "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "479882132969-pkn7lcq09ln9vfk4k52r634vh805dk3g.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "cvbxvzv" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:479882132969:android:215a22700e1b466b", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseperformanceexample" - } - }, - "oauth_client": [ - { - "client_id": "479882132969-8h4kiv8m7ho4tvn6uuujsfcrf69unuf7.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseperformanceexample", - "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "479882132969-pkn7lcq09ln9vfk4k52r634vh805dk3g.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "cvbxvzv" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_dynamic_links/example/android/app/gradle.properties b/packages/firebase_dynamic_links/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_dynamic_links/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_dynamic_links/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_dynamic_links/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index ed3cca73d5d3..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/java/io/flutter/plugins/firebasedynamiclinksexample/MainActivity.java b/packages/firebase_dynamic_links/example/android/app/src/main/java/io/flutter/plugins/firebasedynamiclinksexample/MainActivity.java deleted file mode 100644 index 885f28ec4efc..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/src/main/java/io/flutter/plugins/firebasedynamiclinksexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebasedynamiclinksexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_dynamic_links/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_dynamic_links/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/android/app/src/main/res/values/styles.xml b/packages/firebase_dynamic_links/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_dynamic_links/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_dynamic_links/example/android/build.gradle b/packages/firebase_dynamic_links/example/android/build.gradle deleted file mode 100644 index 3759d2af578f..000000000000 --- a/packages/firebase_dynamic_links/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_dynamic_links/example/android/gradle.properties b/packages/firebase_dynamic_links/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_dynamic_links/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_dynamic_links/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_dynamic_links/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_dynamic_links/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_dynamic_links/example/android/settings.gradle b/packages/firebase_dynamic_links/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/firebase_dynamic_links/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_dynamic_links/example/firebase_dynamic_links_example.iml b/packages/firebase_dynamic_links/example/firebase_dynamic_links_example.iml deleted file mode 100644 index e5c837191e06..000000000000 --- a/packages/firebase_dynamic_links/example/firebase_dynamic_links_example.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_dynamic_links/example/firebase_dynamic_links_example_android.iml b/packages/firebase_dynamic_links/example/firebase_dynamic_links_example_android.iml deleted file mode 100644 index b050030a1b87..000000000000 --- a/packages/firebase_dynamic_links/example/firebase_dynamic_links_example_android.iml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_dynamic_links/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6c2de8086bcd..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_dynamic_links/example/ios/Flutter/Debug.xcconfig b/packages/firebase_dynamic_links/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_dynamic_links/example/ios/Flutter/Release.xcconfig b/packages/firebase_dynamic_links/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index ce7d3163f7ac..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,519 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8FE60D1920C0959F00E3A541 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8FE60D1820C0959F00E3A541 /* GoogleService-Info.plist */; }; - 8FF283695FD42FAFAA6F2588 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BEA489D8A0A4C9E6F14F37D /* libPods-Runner.a */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 3BEA489D8A0A4C9E6F14F37D /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8FE60D1820C0959F00E3A541 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 8FE60D1A20C0962300E3A541 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 8FF283695FD42FAFAA6F2588 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - C265487490C4649DB6EB38D8 /* Pods */, - FB89BCA43D68B61E6BC59A86 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 8FE60D1A20C0962300E3A541 /* Runner.entitlements */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 8FE60D1820C0959F00E3A541 /* GoogleService-Info.plist */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - C265487490C4649DB6EB38D8 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - FB89BCA43D68B61E6BC59A86 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3BEA489D8A0A4C9E6F14F37D /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - DFB8FA600F7B599A94289A9E /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 852BEAA0EB8653502C27C0BD /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.SafariKeychain = { - enabled = 0; - }; - }; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 8FE60D1920C0959F00E3A541 /* GoogleService-Info.plist in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 852BEAA0EB8653502C27C0BD /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - DFB8FA600F7B599A94289A9E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseCppDynamicLinksTestApp.dev; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseCppDynamicLinksTestApp.dev; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1263ac84b105..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_dynamic_links/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/firebase_dynamic_links/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner/AppDelegate.h b/packages/firebase_dynamic_links/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_dynamic_links/example/ios/Runner/AppDelegate.m b/packages/firebase_dynamic_links/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_dynamic_links/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_dynamic_links/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_dynamic_links/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index ac0d4c98b0d0..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 479882132969-pn2ancg65o0e7r5ikte1qiciuvdghqf9.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.479882132969-pn2ancg65o0e7r5ikte1qiciuvdghqf9 - ANDROID_CLIENT_ID - 479882132969-32qusitiag53931ck80h121ajhlc5a7e.apps.googleusercontent.com - API_KEY - AIzaSyBECOwLTAN6PU4Aet1b2QLGIb3kRK8Xjew - GCM_SENDER_ID - 479882132969 - PLIST_VERSION - 1 - BUNDLE_ID - com.google.FirebaseCppDynamicLinksTestApp.dev - PROJECT_ID - my-flutter-proj - STORAGE_BUCKET - my-flutter-proj.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:479882132969:ios:36e157824ba4dd3d - DATABASE_URL - https://my-flutter-proj.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Info.plist b/packages/firebase_dynamic_links/example/ios/Runner/Info.plist deleted file mode 100644 index f24bc9d4f80d..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Info.plist +++ /dev/null @@ -1,62 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_dynamic_links_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - Bundle ID - CFBundleURLSchemes - - com.google.FirebaseCppDynamicLinksTestApp.dev - - - - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner/Runner.entitlements b/packages/firebase_dynamic_links/example/ios/Runner/Runner.entitlements deleted file mode 100644 index 0c67376ebacb..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/Runner.entitlements +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packages/firebase_dynamic_links/example/ios/Runner/main.m b/packages/firebase_dynamic_links/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_dynamic_links/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_dynamic_links/example/lib/main.dart b/packages/firebase_dynamic_links/example/lib/main.dart deleted file mode 100644 index 9e915761a9c6..000000000000 --- a/packages/firebase_dynamic_links/example/lib/main.dart +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; -import 'package:flutter/services.dart'; -import 'package:url_launcher/url_launcher.dart'; - -void main() { - runApp(MaterialApp( - title: 'Dynamic Links Example', - routes: { - '/': (BuildContext context) => _MainScreen(), - '/helloworld': (BuildContext context) => _DynamicLinkScreen(), - }, - )); -} - -class _MainScreen extends StatefulWidget { - @override - State createState() => _MainScreenState(); -} - -class _MainScreenState extends State<_MainScreen> { - String _linkMessage; - bool _isCreatingLink = false; - String _testString = - "To test: long press link and then copy and click from a non-browser " - "app. Make sure this isn't being tested on iOS simulator and iOS xcode " - "is properly setup. Look at firebase_dynamic_links/README.md for more " - "details."; - - @override - void initState() { - super.initState(); - initDynamicLinks(); - } - - void initDynamicLinks() async { - final PendingDynamicLinkData data = - await FirebaseDynamicLinks.instance.getInitialLink(); - final Uri deepLink = data?.link; - - if (deepLink != null) { - Navigator.pushNamed(context, deepLink.path); - } - - FirebaseDynamicLinks.instance.onLink( - onSuccess: (PendingDynamicLinkData dynamicLink) async { - final Uri deepLink = dynamicLink?.link; - - if (deepLink != null) { - Navigator.pushNamed(context, deepLink.path); - } - }, onError: (OnLinkErrorException e) async { - print('onLinkError'); - print(e.message); - }); - } - - Future _createDynamicLink(bool short) async { - setState(() { - _isCreatingLink = true; - }); - - final DynamicLinkParameters parameters = DynamicLinkParameters( - uriPrefix: 'https://cx4k7.app.goo.gl', - link: Uri.parse('https://dynamic.link.example/helloworld'), - androidParameters: AndroidParameters( - packageName: 'io.flutter.plugins.firebasedynamiclinksexample', - minimumVersion: 0, - ), - dynamicLinkParametersOptions: DynamicLinkParametersOptions( - shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short, - ), - iosParameters: IosParameters( - bundleId: 'com.google.FirebaseCppDynamicLinksTestApp.dev', - minimumVersion: '0', - ), - ); - - Uri url; - if (short) { - final ShortDynamicLink shortLink = await parameters.buildShortLink(); - url = shortLink.shortUrl; - } else { - url = await parameters.buildUrl(); - } - - setState(() { - _linkMessage = url.toString(); - _isCreatingLink = false; - }); - } - - @override - Widget build(BuildContext context) { - return Material( - child: Scaffold( - appBar: AppBar( - title: const Text('Dynamic Links Example'), - ), - body: Builder(builder: (BuildContext context) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ButtonBar( - alignment: MainAxisAlignment.center, - children: [ - RaisedButton( - onPressed: !_isCreatingLink - ? () => _createDynamicLink(false) - : null, - child: const Text('Get Long Link'), - ), - RaisedButton( - onPressed: !_isCreatingLink - ? () => _createDynamicLink(true) - : null, - child: const Text('Get Short Link'), - ), - ], - ), - InkWell( - child: Text( - _linkMessage ?? '', - style: const TextStyle(color: Colors.blue), - ), - onTap: () async { - if (_linkMessage != null) { - await launch(_linkMessage); - } - }, - onLongPress: () { - Clipboard.setData(ClipboardData(text: _linkMessage)); - Scaffold.of(context).showSnackBar( - const SnackBar(content: Text('Copied Link!')), - ); - }, - ), - Text(_linkMessage == null ? '' : _testString) - ], - ), - ); - }), - ), - ); - } -} - -class _DynamicLinkScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Material( - child: Scaffold( - appBar: AppBar( - title: const Text('Hello World DeepLink'), - ), - body: const Center( - child: Text('Hello, World!'), - ), - ), - ); - } -} diff --git a/packages/firebase_dynamic_links/example/pubspec.yaml b/packages/firebase_dynamic_links/example/pubspec.yaml deleted file mode 100644 index f396651940d9..000000000000 --- a/packages/firebase_dynamic_links/example/pubspec.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: firebase_dynamic_links_example -description: Demonstrates how to use the firebase_dynamic_links plugin. - -dependencies: - flutter: - sdk: flutter - - firebase_dynamic_links: - path: ../ - firebase_core: ^0.4.0 - - url_launcher: ^4.2.0 - -flutter: - uses-material-design: true diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links_android.iml b/packages/firebase_dynamic_links/firebase_dynamic_links_android.iml deleted file mode 100644 index ac5d744d7acc..000000000000 --- a/packages/firebase_dynamic_links/firebase_dynamic_links_android.iml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_dynamic_links/ios/Assets/.gitkeep b/packages/firebase_dynamic_links/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h b/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h deleted file mode 100644 index f905bbbd03e0..000000000000 --- a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseDynamicLinksPlugin : NSObject -@end diff --git a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m b/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m deleted file mode 100644 index 9893a4ad6c02..000000000000 --- a/packages/firebase_dynamic_links/ios/Classes/FirebaseDynamicLinksPlugin.m +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseDynamicLinksPlugin.h" -#import "UserAgent.h" - -#import "Firebase/Firebase.h" - -static FlutterError *getFlutterError(NSError *error) { - return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %d", (int)error.code] - message:error.domain - details:error.localizedDescription]; -} - -static NSMutableDictionary *getDictionaryFromDynamicLink(FIRDynamicLink *dynamicLink) { - if (dynamicLink != nil) { - NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; - dictionary[@"link"] = dynamicLink.url.absoluteString; - - NSMutableDictionary *iosData = [[NSMutableDictionary alloc] init]; - if (dynamicLink.minimumAppVersion) { - iosData[@"minimumVersion"] = dynamicLink.minimumAppVersion; - } - dictionary[@"ios"] = iosData; - return dictionary; - } else { - return nil; - } -} - -static NSMutableDictionary *getDictionaryFromFlutterError(FlutterError *error) { - if (error == nil) { - return nil; - } - - NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; - dictionary[@"code"] = error.code; - dictionary[@"message"] = error.message; - dictionary[@"details"] = error.details; - return dictionary; -} - -@interface FLTFirebaseDynamicLinksPlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@property(nonatomic, retain) FIRDynamicLink *initialLink; -@property(nonatomic, retain) FlutterError *flutterError; -@property(nonatomic) BOOL initiated; -@end - -@implementation FLTFirebaseDynamicLinksPlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_dynamic_links" - binaryMessenger:[registrar messenger]]; - FLTFirebaseDynamicLinksPlugin *instance = - [[FLTFirebaseDynamicLinksPlugin alloc] initWithChannel:channel]; - [registrar addMethodCallDelegate:instance channel:channel]; - [registrar addApplicationDelegate:instance]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)initWithChannel:(FlutterMethodChannel *)channel { - self = [super init]; - if (self) { - _initiated = NO; - _channel = channel; - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"DynamicLinkParameters#buildUrl" isEqualToString:call.method]) { - FIRDynamicLinkComponents *components = [self setupParameters:call.arguments]; - result([components.url absoluteString]); - } else if ([@"DynamicLinkParameters#buildShortLink" isEqualToString:call.method]) { - FIRDynamicLinkComponents *components = [self setupParameters:call.arguments]; - [components shortenWithCompletion:[self createShortLinkCompletion:result]]; - } else if ([@"DynamicLinkParameters#shortenUrl" isEqualToString:call.method]) { - FIRDynamicLinkComponentsOptions *options = [self setupOptions:call.arguments]; - NSURL *url = [NSURL URLWithString:call.arguments[@"url"]]; - [FIRDynamicLinkComponents shortenURL:url - options:options - completion:[self createShortLinkCompletion:result]]; - } else if ([@"FirebaseDynamicLinks#getInitialLink" isEqualToString:call.method]) { - _initiated = YES; - NSMutableDictionary *dict = [self getInitialLink]; - if (dict == nil && self.flutterError) { - result(self.flutterError); - } else { - result(dict); - } - } else { - result(FlutterMethodNotImplemented); - } -} - -- (NSMutableDictionary *)getInitialLink { - return getDictionaryFromDynamicLink(_initialLink); -} - -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)url - options:(NSDictionary *)options { - return [self checkForDynamicLink:url]; -} - -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation { - return [self checkForDynamicLink:url]; -} - -- (BOOL)checkForDynamicLink:(NSURL *)url { - FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url]; - if (dynamicLink) { - if (dynamicLink.url) _initialLink = dynamicLink; - return YES; - } - return NO; -} - -- (BOOL)onLink:(NSUserActivity *)userActivity { - BOOL handled = [[FIRDynamicLinks dynamicLinks] - handleUniversalLink:userActivity.webpageURL - completion:^(FIRDynamicLink *_Nullable dynamicLink, NSError *_Nullable error) { - if (error) { - FlutterError *flutterError = getFlutterError(error); - [self.channel invokeMethod:@"onLinkError" - arguments:getDictionaryFromFlutterError(flutterError)]; - } else { - NSMutableDictionary *dictionary = getDictionaryFromDynamicLink(dynamicLink); - [self.channel invokeMethod:@"onLinkSuccess" arguments:dictionary]; - } - }]; - return handled; -} - -- (BOOL)onInitialLink:(NSUserActivity *)userActivity { - BOOL handled = [[FIRDynamicLinks dynamicLinks] - handleUniversalLink:userActivity.webpageURL - completion:^(FIRDynamicLink *_Nullable dynamicLink, NSError *_Nullable error) { - if (error) { - self.flutterError = getFlutterError(error); - } - self.initialLink = dynamicLink; - }]; - return handled; -} - -- (BOOL)application:(UIApplication *)application - continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *))restorationHandler { - if (_initiated) { - return [self onLink:userActivity]; - } - return [self onInitialLink:userActivity]; -} - -- (FIRDynamicLinkShortenerCompletion)createShortLinkCompletion:(FlutterResult)result { - return ^(NSURL *_Nullable shortURL, NSArray *_Nullable warnings, NSError *_Nullable error) { - if (error) { - result(getFlutterError(error)); - } else { - if (warnings == nil) { - warnings = [NSMutableArray array]; - } - result(@{@"url" : [shortURL absoluteString], @"warnings" : warnings}); - } - }; -} - -- (FIRDynamicLinkComponentsOptions *)setupOptions:(NSDictionary *)arguments { - FIRDynamicLinkComponentsOptions *options; - if (![arguments[@"dynamicLinkParametersOptions"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"dynamicLinkParametersOptions"]; - - options = [FIRDynamicLinkComponentsOptions options]; - - NSNumber *shortDynamicLinkPathLength = params[@"shortDynamicLinkPathLength"]; - if (![shortDynamicLinkPathLength isEqual:[NSNull null]]) { - switch (shortDynamicLinkPathLength.intValue) { - case 0: - options.pathLength = FIRShortDynamicLinkPathLengthUnguessable; - break; - case 1: - options.pathLength = FIRShortDynamicLinkPathLengthShort; - break; - default: - break; - } - } - } - - return options; -} - -- (FIRDynamicLinkComponents *)setupParameters:(NSDictionary *)arguments { - NSURL *link = [NSURL URLWithString:arguments[@"link"]]; - NSString *uriPrefix = arguments[@"uriPrefix"]; - - FIRDynamicLinkComponents *components = [FIRDynamicLinkComponents componentsWithLink:link - domainURIPrefix:uriPrefix]; - - if (![arguments[@"androidParameters"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"androidParameters"]; - - FIRDynamicLinkAndroidParameters *androidParams = - [FIRDynamicLinkAndroidParameters parametersWithPackageName:params[@"packageName"]]; - - NSString *fallbackUrl = params[@"fallbackUrl"]; - NSNumber *minimumVersion = params[@"minimumVersion"]; - - if (![fallbackUrl isEqual:[NSNull null]]) - androidParams.fallbackURL = [NSURL URLWithString:fallbackUrl]; - if (![minimumVersion isEqual:[NSNull null]]) - androidParams.minimumVersion = ((NSNumber *)minimumVersion).integerValue; - - components.androidParameters = androidParams; - } - - if (![arguments[@"dynamicLinkComponentsOptions"] isEqual:[NSNull null]]) { - components.options = [self setupOptions:arguments]; - } - - if (![arguments[@"googleAnalyticsParameters"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"googleAnalyticsParameters"]; - - FIRDynamicLinkGoogleAnalyticsParameters *googleAnalyticsParameters = - [FIRDynamicLinkGoogleAnalyticsParameters parameters]; - - NSString *campaign = params[@"campaign"]; - NSString *content = params[@"content"]; - NSString *medium = params[@"medium"]; - NSString *source = params[@"source"]; - NSString *term = params[@"term"]; - - if (![campaign isEqual:[NSNull null]]) googleAnalyticsParameters.campaign = campaign; - if (![content isEqual:[NSNull null]]) googleAnalyticsParameters.content = content; - if (![medium isEqual:[NSNull null]]) googleAnalyticsParameters.medium = medium; - if (![source isEqual:[NSNull null]]) googleAnalyticsParameters.source = source; - if (![term isEqual:[NSNull null]]) googleAnalyticsParameters.term = term; - - components.analyticsParameters = googleAnalyticsParameters; - } - - if (![arguments[@"iosParameters"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"iosParameters"]; - - FIRDynamicLinkIOSParameters *iosParameters = - [FIRDynamicLinkIOSParameters parametersWithBundleID:params[@"bundleId"]]; - - NSString *appStoreID = params[@"appStoreId"]; - NSString *customScheme = params[@"customScheme"]; - NSString *fallbackURL = params[@"fallbackUrl"]; - NSString *iPadBundleID = params[@"ipadBundleId"]; - NSString *iPadFallbackURL = params[@"ipadFallbackUrl"]; - NSString *minimumAppVersion = params[@"minimumVersion"]; - - if (![appStoreID isEqual:[NSNull null]]) iosParameters.appStoreID = appStoreID; - if (![customScheme isEqual:[NSNull null]]) iosParameters.customScheme = customScheme; - if (![fallbackURL isEqual:[NSNull null]]) - iosParameters.fallbackURL = [NSURL URLWithString:fallbackURL]; - if (![iPadBundleID isEqual:[NSNull null]]) iosParameters.iPadBundleID = iPadBundleID; - if (![iPadFallbackURL isEqual:[NSNull null]]) - iosParameters.iPadFallbackURL = [NSURL URLWithString:iPadFallbackURL]; - if (![minimumAppVersion isEqual:[NSNull null]]) - iosParameters.minimumAppVersion = minimumAppVersion; - - components.iOSParameters = iosParameters; - } - - if (![arguments[@"itunesConnectAnalyticsParameters"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"itunesConnectAnalyticsParameters"]; - - FIRDynamicLinkItunesConnectAnalyticsParameters *itunesConnectAnalyticsParameters = - [FIRDynamicLinkItunesConnectAnalyticsParameters parameters]; - - NSString *affiliateToken = params[@"affiliateToken"]; - NSString *campaignToken = params[@"campaignToken"]; - NSString *providerToken = params[@"providerToken"]; - - if (![affiliateToken isEqual:[NSNull null]]) - itunesConnectAnalyticsParameters.affiliateToken = affiliateToken; - if (![campaignToken isEqual:[NSNull null]]) - itunesConnectAnalyticsParameters.campaignToken = campaignToken; - if (![providerToken isEqual:[NSNull null]]) - itunesConnectAnalyticsParameters.providerToken = providerToken; - - components.iTunesConnectParameters = itunesConnectAnalyticsParameters; - } - - if (![arguments[@"navigationInfoParameters"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"navigationInfoParameters"]; - - FIRDynamicLinkNavigationInfoParameters *navigationInfoParameters = - [FIRDynamicLinkNavigationInfoParameters parameters]; - - NSNumber *forcedRedirectEnabled = params[@"forcedRedirectEnabled"]; - if (![forcedRedirectEnabled isEqual:[NSNull null]]) - navigationInfoParameters.forcedRedirectEnabled = [forcedRedirectEnabled boolValue]; - - components.navigationInfoParameters = navigationInfoParameters; - } - - if (![arguments[@"socialMetaTagParameters"] isEqual:[NSNull null]]) { - NSDictionary *params = arguments[@"socialMetaTagParameters"]; - - FIRDynamicLinkSocialMetaTagParameters *socialMetaTagParameters = - [FIRDynamicLinkSocialMetaTagParameters parameters]; - - NSString *descriptionText = params[@"description"]; - NSString *imageURL = params[@"imageUrl"]; - NSString *title = params[@"title"]; - - if (![descriptionText isEqual:[NSNull null]]) - socialMetaTagParameters.descriptionText = descriptionText; - if (![imageURL isEqual:[NSNull null]]) - socialMetaTagParameters.imageURL = [NSURL URLWithString:imageURL]; - if (![title isEqual:[NSNull null]]) socialMetaTagParameters.title = title; - - components.socialMetaTagParameters = socialMetaTagParameters; - } - - return components; -} - -@end diff --git a/packages/firebase_dynamic_links/ios/firebase_dynamic_links.podspec b/packages/firebase_dynamic_links/ios/firebase_dynamic_links.podspec deleted file mode 100644 index 8d1d18ef1368..000000000000 --- a/packages/firebase_dynamic_links/ios/firebase_dynamic_links.podspec +++ /dev/null @@ -1,33 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_dynamic_links' - s.version = '0.1.0' - s.summary = 'Firebase Dynamic Links plugin for Flutter.' - s.description = <<-DESC -Flutter plugin for Google Dynamic Links for Firebase, an app solution for creating and handling - links across multiple platforms. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_dynamic_links' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase/DynamicLinks' - s.ios.deployment_target = '8.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-dl\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_dynamic_links/lib/firebase_dynamic_links.dart b/packages/firebase_dynamic_links/lib/firebase_dynamic_links.dart deleted file mode 100644 index 5553336f9708..000000000000 --- a/packages/firebase_dynamic_links/lib/firebase_dynamic_links.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_dynamic_links; - -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -part 'src/dynamic_link_parameters.dart'; -part 'src/firebase_dynamic_links.dart'; diff --git a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart b/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart deleted file mode 100644 index 110d9727eb7c..000000000000 --- a/packages/firebase_dynamic_links/lib/src/dynamic_link_parameters.dart +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_dynamic_links; - -/// The class used for Dynamic Link URL generation. -/// -/// Supports creation of short and long Dynamic Link URLs. Short URLs will have -/// a domain and a randomized path. Long URLs will have a domain and a query -/// that contains all of the Dynamic Link parameters. -class DynamicLinkParameters { - DynamicLinkParameters({ - this.androidParameters, - @required this.uriPrefix, - this.dynamicLinkParametersOptions, - this.googleAnalyticsParameters, - this.iosParameters, - this.itunesConnectAnalyticsParameters, - @required this.link, - this.navigationInfoParameters, - this.socialMetaTagParameters, - }) : assert(uriPrefix != null), - assert(link != null); - - /// Android parameters for a generated Dynamic Link URL. - final AndroidParameters androidParameters; - - /// Domain URI Prefix of your App. - // This value must be your assigned domain from the Firebase console. - // (e.g. https://xyz.page.link) - // - // The domain URI prefix must start with a valid HTTPS scheme (https://). - final String uriPrefix; - - /// Defines behavior for generating Dynamic Link URLs. - final DynamicLinkParametersOptions dynamicLinkParametersOptions; - - /// Analytics parameters for a generated Dynamic Link URL. - final GoogleAnalyticsParameters googleAnalyticsParameters; - - /// iOS parameters for a generated Dynamic Link URL. - final IosParameters iosParameters; - - /// iTunes Connect parameters for a generated Dynamic Link URL. - final ItunesConnectAnalyticsParameters itunesConnectAnalyticsParameters; - - /// The link the target app will open. - /// - /// You can specify any URL the app can handle, such as a link to the app’s - /// content, or a URL that initiates some app-specific logic such as crediting - /// the user with a coupon, or displaying a specific welcome screen. - /// This link must be a well-formatted URL, be properly URL-encoded, and use - /// the HTTP or HTTPS scheme. - final Uri link; - - /// Navigation Info parameters for a generated Dynamic Link URL. - final NavigationInfoParameters navigationInfoParameters; - - /// Social Meta Tag parameters for a generated Dynamic Link URL. - final SocialMetaTagParameters socialMetaTagParameters; - - /// Shortens a Dynamic Link URL. - /// - /// This method may be used for shortening a custom URL that was not generated - /// using [DynamicLinkParameters]. - static Future shortenUrl(Uri url, - [DynamicLinkParametersOptions options]) async { - final Map reply = await FirebaseDynamicLinks.channel - .invokeMapMethod( - 'DynamicLinkParameters#shortenUrl', { - 'url': url.toString(), - 'dynamicLinkParametersOptions': options?._data, - }); - return _parseShortLink(reply); - } - - Map get _data => { - 'androidParameters': androidParameters?._data, - 'uriPrefix': uriPrefix, - 'dynamicLinkParametersOptions': dynamicLinkParametersOptions?._data, - 'googleAnalyticsParameters': googleAnalyticsParameters?._data, - 'iosParameters': iosParameters?._data, - 'itunesConnectAnalyticsParameters': - itunesConnectAnalyticsParameters?._data, - 'link': link.toString(), - 'navigationInfoParameters': navigationInfoParameters?._data, - 'socialMetaTagParameters': socialMetaTagParameters?._data, - }; - - /// Generate a long Dynamic Link URL. - Future buildUrl() async { - final String url = await FirebaseDynamicLinks.channel - .invokeMethod('DynamicLinkParameters#buildUrl', _data); - return Uri.parse(url); - } - - /// Generate a short Dynamic Link. - Future buildShortLink() async { - final Map reply = await FirebaseDynamicLinks.channel - .invokeMapMethod( - 'DynamicLinkParameters#buildShortLink', _data); - return _parseShortLink(reply); - } - - static ShortDynamicLink _parseShortLink(Map reply) { - final List warnings = reply['warnings']; - return ShortDynamicLink._(Uri.parse(reply['url']), warnings?.cast()); - } -} - -/// Response from creating a short dynamic link with [DynamicLinkParameters]. -class ShortDynamicLink { - ShortDynamicLink._(this.shortUrl, this.warnings); - - /// Short url value. - final Uri shortUrl; - - /// Information about potential warnings on link creation. - final List warnings; -} - -/// The Dynamic Link Android parameters. -class AndroidParameters { - AndroidParameters( - {this.fallbackUrl, this.minimumVersion, @required this.packageName}) - : assert(packageName != null); - - /// The link to open when the app isn’t installed. - /// - /// Specify this to do something other than install the app from the Play - /// Store when the app isn’t installed, such as open the mobile web version of - /// the content, or display a promotional page for the app. - final Uri fallbackUrl; - - /// The version of the minimum version of your app that can open the link. - /// - /// If the installed app is an older version, the user is taken to the Play - /// Store to upgrade the app. - final int minimumVersion; - - /// The Android app’s package name. - final String packageName; - - Map get _data => { - 'fallbackUrl': fallbackUrl?.toString(), - 'minimumVersion': minimumVersion, - 'packageName': packageName, - }; -} - -/// For specifying length for short Dynamic Links. -enum ShortDynamicLinkPathLength { unguessable, short } - -/// Options class for defining how Dynamic Link URLs are generated. -class DynamicLinkParametersOptions { - DynamicLinkParametersOptions({this.shortDynamicLinkPathLength}); - - /// Specifies the length of the path component of a short Dynamic Link. - final ShortDynamicLinkPathLength shortDynamicLinkPathLength; - - Map get _data => { - 'shortDynamicLinkPathLength': shortDynamicLinkPathLength?.index, - }; -} - -/// The Dynamic Link analytics parameters. -class GoogleAnalyticsParameters { - GoogleAnalyticsParameters({ - @required this.campaign, - this.content, - @required this.medium, - @required this.source, - this.term, - }) : assert(campaign != null), - assert(medium != null), - assert(source != null); - - GoogleAnalyticsParameters.empty() - : campaign = null, - content = null, - medium = null, - source = null, - term = null; - - /// The utm_campaign analytics parameter. - final String campaign; - - /// The utm_content analytics parameter. - final String content; - - /// The utm_medium analytics parameter. - final String medium; - - /// The utm_source analytics parameter. - final String source; - - /// The utm_term analytics parameter. - final String term; - - Map get _data => { - 'campaign': campaign, - 'content': content, - 'medium': medium, - 'source': source, - 'term': term, - }; -} - -/// The Dynamic Link iOS parameters. -class IosParameters { - IosParameters({ - this.appStoreId, - @required this.bundleId, - this.customScheme, - this.fallbackUrl, - this.ipadBundleId, - this.ipadFallbackUrl, - this.minimumVersion, - }) : assert(bundleId != null); - - /// The appStore ID of the iOS app in AppStore. - final String appStoreId; - - /// The bundle ID of the iOS app to use to open the link. - final String bundleId; - - /// The target app’s custom URL scheme. - /// - /// Defined to be something other than the app’s bundle ID. - final String customScheme; - - /// The link to open when the app isn’t installed. - /// - /// Specify this to do something other than install the app from the App Store - /// when the app isn’t installed, such as open the mobile web version of the - /// content, or display a promotional page for the app. - final Uri fallbackUrl; - - /// The bundle ID of the iOS app to use on iPads to open the link. - /// - /// This is only required if there are separate iPhone and iPad applications. - final String ipadBundleId; - - /// The link to open on iPads when the app isn’t installed. - /// - /// Specify this to do something other than install the app from the App Store - /// when the app isn’t installed, such as open the web version of the content, - /// or display a promotional page for the app. - final Uri ipadFallbackUrl; - - /// The the minimum version of your app that can open the link. - /// - /// It is app’s developer responsibility to open AppStore when received link - /// declares higher [minimumVersion] than currently installed. - final String minimumVersion; - - Map get _data => { - 'appStoreId': appStoreId, - 'bundleId': bundleId, - 'customScheme': customScheme, - 'fallbackUrl': fallbackUrl?.toString(), - 'ipadBundleId': ipadBundleId, - 'ipadFallbackUrl': ipadFallbackUrl?.toString(), - 'minimumVersion': minimumVersion, - }; -} - -/// The Dynamic Link iTunes Connect parameters. -class ItunesConnectAnalyticsParameters { - ItunesConnectAnalyticsParameters( - {this.affiliateToken, this.campaignToken, this.providerToken}); - - /// The iTunes Connect affiliate token. - final String affiliateToken; - - /// The iTunes Connect campaign token. - final String campaignToken; - - /// The iTunes Connect provider token. - final String providerToken; - - Map get _data => { - 'affiliateToken': affiliateToken, - 'campaignToken': campaignToken, - 'providerToken': providerToken, - }; -} - -/// Options class for defining navigation behavior of the Dynamic Link. -class NavigationInfoParameters { - NavigationInfoParameters({this.forcedRedirectEnabled}); - - /// Whether forced non-interactive redirect it to be used. - /// - /// Forced non-interactive redirect occurs when link is tapped on mobile - /// device. - /// - /// Default behavior is to disable force redirect and show interstitial page - /// where user tap will initiate navigation to the App (or AppStore if not - /// installed). Disabled force redirect normally improves reliability of the - /// click. - final bool forcedRedirectEnabled; - - Map get _data => { - 'forcedRedirectEnabled': forcedRedirectEnabled, - }; -} - -/// The Dynamic Link Social Meta Tag parameters. -class SocialMetaTagParameters { - SocialMetaTagParameters({this.description, this.imageUrl, this.title}); - - /// The description to use when the Dynamic Link is shared in a social post. - final String description; - - /// The URL to an image related to this link. - final Uri imageUrl; - - /// The title to use when the Dynamic Link is shared in a social post. - final String title; - - Map get _data => { - 'description': description, - 'imageUrl': imageUrl?.toString(), - 'title': title, - }; -} diff --git a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart b/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart deleted file mode 100644 index c247fe82bb28..000000000000 --- a/packages/firebase_dynamic_links/lib/src/firebase_dynamic_links.dart +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_dynamic_links; - -typedef OnLinkSuccessCallback = Future Function( - PendingDynamicLinkData linkData); -typedef OnLinkErrorCallback = Future Function( - OnLinkErrorException error); - -/// Firebase Dynamic Links API. -/// -/// You can get an instance by calling [FirebaseDynamicLinks.instance]. -class FirebaseDynamicLinks { - FirebaseDynamicLinks._(); - - @visibleForTesting - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_dynamic_links'); - - /// Singleton of [FirebaseDynamicLinks]. - static final FirebaseDynamicLinks instance = FirebaseDynamicLinks._(); - - OnLinkSuccessCallback _onLinkSuccess; - OnLinkErrorCallback _onLinkError; - - /// Attempts to retrieve the dynamic link which launched the app. - /// - /// This method always returns a Future. That Future completes to null if - /// there is no pending dynamic link or any call to this method after the - /// the first attempt. - Future getInitialLink() async { - final Map linkData = - await channel.invokeMapMethod( - 'FirebaseDynamicLinks#getInitialLink'); - return getPendingDynamicLinkDataFromMap(linkData); - } - - PendingDynamicLinkData getPendingDynamicLinkDataFromMap( - Map linkData) { - if (linkData == null) return null; - - PendingDynamicLinkDataAndroid androidData; - if (linkData['android'] != null) { - final Map data = linkData['android']; - androidData = PendingDynamicLinkDataAndroid._( - data['clickTimestamp'], - data['minimumVersion'], - ); - } - - PendingDynamicLinkDataIOS iosData; - if (linkData['ios'] != null) { - final Map data = linkData['ios']; - iosData = PendingDynamicLinkDataIOS._(data['minimumVersion']); - } - - return PendingDynamicLinkData._( - Uri.parse(linkData['link']), - androidData, - iosData, - ); - } - - /// Configures onLink listeners: it has two methods for success and failure. - void onLink({ - OnLinkSuccessCallback onSuccess, - OnLinkErrorCallback onError, - }) { - _onLinkSuccess = onSuccess; - _onLinkError = onError; - channel.setMethodCallHandler(_handleMethod); - } - - Future _handleMethod(MethodCall call) async { - switch (call.method) { - case "onLinkSuccess": - final Map data = - call.arguments.cast(); - final PendingDynamicLinkData linkData = - getPendingDynamicLinkDataFromMap(data); - return _onLinkSuccess(linkData); - case "onLinkError": - final Map data = - call.arguments.cast(); - final OnLinkErrorException e = OnLinkErrorException._( - data['code'], data['message'], data['details']); - return _onLinkError(e); - } - } -} - -/// Provides data from received dynamic link. -class PendingDynamicLinkData { - PendingDynamicLinkData._(this.link, this.android, this.ios); - - /// Provides Android specific data from received dynamic link. - /// - /// Can be null if [link] equals null or dynamic link was not received on an - /// Android device. - final PendingDynamicLinkDataAndroid android; - - /// Provides iOS specific data from received dynamic link. - /// - /// Can be null if [link] equals null or dynamic link was not received on an - /// iOS device. - final PendingDynamicLinkDataIOS ios; - - /// Deep link parameter of the dynamic link. - final Uri link; -} - -/// Provides android specific data from received dynamic link. -class PendingDynamicLinkDataAndroid { - PendingDynamicLinkDataAndroid._( - this.clickTimestamp, - this.minimumVersion, - ); - - /// The time the user clicked on the dynamic link. - /// - /// Equals the number of milliseconds that have elapsed since January 1, 1970. - final int clickTimestamp; - - /// The minimum version of your app that can open the link. - /// - /// The minimum Android app version requested to process the dynamic link that - /// can be compared directly with versionCode. - /// - /// If the installed app is an older version, the user is taken to the Play - /// Store to upgrade the app. - final int minimumVersion; -} - -/// Provides iOS specific data from received dynamic link. -class PendingDynamicLinkDataIOS { - PendingDynamicLinkDataIOS._(this.minimumVersion); - - /// The minimum version of your app that can open the link. - /// - /// It is app developer's responsibility to open AppStore when received link - /// declares higher [minimumVersion] than currently installed. - final String minimumVersion; -} - -class OnLinkErrorException { - OnLinkErrorException._(this.code, this.message, this.details); - - final String code; - - final String message; - - final dynamic details; -} diff --git a/packages/firebase_dynamic_links/pubspec.yaml b/packages/firebase_dynamic_links/pubspec.yaml deleted file mode 100644 index 73848496a15b..000000000000 --- a/packages/firebase_dynamic_links/pubspec.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: firebase_dynamic_links -description: Flutter plugin for Google Dynamic Links for Firebase, an app solution for creating - and handling links across multiple platforms. -version: 0.5.0 - -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_dynamic_links - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - url_launcher: ^4.2.0 - firebase_core: ^0.4.0 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebasedynamiclinks - iosPrefix: FLT - pluginClass: FirebaseDynamicLinksPlugin - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_dynamic_links/test/firebase_dynamic_links_test.dart b/packages/firebase_dynamic_links/test/firebase_dynamic_links_test.dart deleted file mode 100644 index e89dfef03df3..000000000000 --- a/packages/firebase_dynamic_links/test/firebase_dynamic_links_test.dart +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/services.dart'; - -import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebaseDynamicLinks', () { - final List log = []; - - setUp(() { - FirebaseDynamicLinks.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - final Map returnUrl = { - 'url': 'google.com', - 'warnings': ['This is only a test link'], - }; - switch (methodCall.method) { - case 'DynamicLinkParameters#buildUrl': - return 'google.com'; - case 'DynamicLinkParameters#buildShortLink': - return returnUrl; - case 'DynamicLinkParameters#shortenUrl': - return returnUrl; - case 'FirebaseDynamicLinks#getInitialLink': - return { - 'link': 'https://google.com', - 'android': { - 'clickTimestamp': 1234567, - 'minimumVersion': 12, - }, - 'ios': { - 'minimumVersion': 'Version 12', - }, - }; - default: - return null; - } - }); - log.clear(); - }); - - test('getInitialLink', () async { - final PendingDynamicLinkData data = - await FirebaseDynamicLinks.instance.getInitialLink(); - - expect(data.link, Uri.parse('https://google.com')); - - expect(data.android.clickTimestamp, 1234567); - expect(data.android.minimumVersion, 12); - - expect(data.ios.minimumVersion, 'Version 12'); - - expect(log, [ - isMethodCall( - 'FirebaseDynamicLinks#getInitialLink', - arguments: null, - ) - ]); - }); - - group('$DynamicLinkParameters', () { - test('shortenUrl', () async { - final Uri url = Uri.parse('google.com'); - final DynamicLinkParametersOptions options = - DynamicLinkParametersOptions( - shortDynamicLinkPathLength: - ShortDynamicLinkPathLength.unguessable); - - await DynamicLinkParameters.shortenUrl(url, options); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#shortenUrl', - arguments: { - 'url': url.toString(), - 'dynamicLinkParametersOptions': { - 'shortDynamicLinkPathLength': - ShortDynamicLinkPathLength.unguessable.index, - }, - }, - ), - ]); - }); - - test('$AndroidParameters', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - androidParameters: AndroidParameters( - fallbackUrl: Uri.parse('test-url'), - minimumVersion: 1, - packageName: 'test-package', - ), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': { - 'fallbackUrl': 'test-url', - 'minimumVersion': 1, - 'packageName': 'test-package', - }, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': { - 'fallbackUrl': 'test-url', - 'minimumVersion': 1, - 'packageName': 'test-package', - }, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - ]); - }); - - test('$DynamicLinkParametersOptions', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - dynamicLinkParametersOptions: DynamicLinkParametersOptions( - shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': { - 'shortDynamicLinkPathLength': - ShortDynamicLinkPathLength.short.index, - }, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': { - 'shortDynamicLinkPathLength': - ShortDynamicLinkPathLength.short.index, - }, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - ]); - }); - - test('$ShortDynamicLinkPathLength', () { - expect(ShortDynamicLinkPathLength.unguessable.index, 0); - expect(ShortDynamicLinkPathLength.short.index, 1); - }); - - test('$GoogleAnalyticsParameters', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - googleAnalyticsParameters: GoogleAnalyticsParameters( - campaign: 'where', - content: 'is', - medium: 'my', - source: 'cat', - term: 'friend', - ), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': { - 'campaign': 'where', - 'content': 'is', - 'medium': 'my', - 'source': 'cat', - 'term': 'friend', - }, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': { - 'campaign': 'where', - 'content': 'is', - 'medium': 'my', - 'source': 'cat', - 'term': 'friend', - }, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - ]); - }); - - test('$IosParameters', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - iosParameters: IosParameters( - appStoreId: 'is', - bundleId: 'this', - customScheme: 'the', - fallbackUrl: Uri.parse('place'), - ipadBundleId: 'to', - ipadFallbackUrl: Uri.parse('find'), - minimumVersion: 'potatoes', - ), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': { - 'appStoreId': 'is', - 'bundleId': 'this', - 'customScheme': 'the', - 'fallbackUrl': 'place', - 'ipadBundleId': 'to', - 'ipadFallbackUrl': 'find', - 'minimumVersion': 'potatoes', - }, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': { - 'appStoreId': 'is', - 'bundleId': 'this', - 'customScheme': 'the', - 'fallbackUrl': 'place', - 'ipadBundleId': 'to', - 'ipadFallbackUrl': 'find', - 'minimumVersion': 'potatoes', - }, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - ]); - }); - - test('$ItunesConnectAnalyticsParameters', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - itunesConnectAnalyticsParameters: ItunesConnectAnalyticsParameters( - affiliateToken: 'hello', - campaignToken: 'mister', - providerToken: 'rose', - ), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': { - 'affiliateToken': 'hello', - 'campaignToken': 'mister', - 'providerToken': 'rose', - }, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': { - 'affiliateToken': 'hello', - 'campaignToken': 'mister', - 'providerToken': 'rose', - }, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': null, - }, - ), - ]); - }); - - test('$NavigationInfoParameters', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - navigationInfoParameters: - NavigationInfoParameters(forcedRedirectEnabled: true), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': { - 'forcedRedirectEnabled': true, - }, - 'socialMetaTagParameters': null, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': { - 'forcedRedirectEnabled': true, - }, - 'socialMetaTagParameters': null, - }, - ), - ]); - }); - - test('$SocialMetaTagParameters', () async { - final DynamicLinkParameters components = DynamicLinkParameters( - uriPrefix: 'https://test-domain/', - link: Uri.parse('test-link.com'), - socialMetaTagParameters: SocialMetaTagParameters( - description: 'describe', - imageUrl: Uri.parse('thisimage'), - title: 'bro', - ), - ); - - await components.buildUrl(); - await components.buildShortLink(); - - expect(log, [ - isMethodCall( - 'DynamicLinkParameters#buildUrl', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': { - 'description': 'describe', - 'imageUrl': 'thisimage', - 'title': 'bro', - }, - }, - ), - isMethodCall( - 'DynamicLinkParameters#buildShortLink', - arguments: { - 'androidParameters': null, - 'uriPrefix': 'https://test-domain/', - 'dynamicLinkParametersOptions': null, - 'googleAnalyticsParameters': null, - 'iosParameters': null, - 'itunesConnectAnalyticsParameters': null, - 'link': 'test-link.com', - 'navigationInfoParameters': null, - 'socialMetaTagParameters': { - 'description': 'describe', - 'imageUrl': 'thisimage', - 'title': 'bro', - }, - }, - ), - ]); - }); - }); - }); -} diff --git a/packages/firebase_in_app_messaging/.gitignore b/packages/firebase_in_app_messaging/.gitignore deleted file mode 100644 index e9dc58d3d6e2..000000000000 --- a/packages/firebase_in_app_messaging/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.dart_tool/ - -.packages -.pub/ - -build/ diff --git a/packages/firebase_in_app_messaging/.metadata b/packages/firebase_in_app_messaging/.metadata deleted file mode 100644 index 330eadcb22d6..000000000000 --- a/packages/firebase_in_app_messaging/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 2e540931f73593e35627592ca4f9a4ca3035ed31 - channel: stable - -project_type: plugin diff --git a/packages/firebase_in_app_messaging/CHANGELOG.md b/packages/firebase_in_app_messaging/CHANGELOG.md deleted file mode 100644 index 12a046c09fbf..000000000000 --- a/packages/firebase_in_app_messaging/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -## 0.0.1+3 - -* Update AGP, gradle and inappmessaging-display versions on Android. - -## 0.0.1+2 - -* Remove dependency `androidx.annotation:annotation:1.0.0`. - -## 0.0.1+1 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.0.1 - -* Initial release. diff --git a/packages/firebase_in_app_messaging/LICENSE b/packages/firebase_in_app_messaging/LICENSE deleted file mode 100644 index 7319cc0d9e04..000000000000 --- a/packages/firebase_in_app_messaging/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright 2018, the Chromium project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/firebase_in_app_messaging/README.md b/packages/firebase_in_app_messaging/README.md deleted file mode 100644 index 9e008fac9220..000000000000 --- a/packages/firebase_in_app_messaging/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# firebase_in_app_messaging plugin - -A Flutter plugin to use the [Firebase In-App Messaging API](https://firebase.google.com/products/in-app-messaging). - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -### Import the firebase_in_app_messaging plugin -To use the firebase_in_app_messaging plugin, follow the [plugin installation instructions](https://pub.dartlang.org/packages/firebase_in_app_messaging#pub-pkg-tab-installing). - -### Android integration - -There are a few extra steps required for the Android integration. Enable the Google services by configuring the Gradle scripts as such. - -1. Add the classpath to the `[project]/android/build.gradle` file. -```gradle -dependencies { - // Example existing classpath - classpath 'com.android.tools.build:gradle:3.3.0' - // Add the google services classpath - classpath 'com.google.gms:google-services:4.3.0' -} -``` - -2. Add the apply plugin to the `[project]/android/app/build.gradle` file. -```gradle -// ADD THIS AT THE BOTTOM -apply plugin: 'com.google.gms.google-services' -``` - -*Note:* If this section is not completed you will get an error like this: -``` -java.lang.IllegalStateException: -Default FirebaseApp is not initialized in this process [package name]. -Make sure to call FirebaseApp.initializeApp(Context) first. -``` - -*Note:* When you are debugging on Android, use a device or AVD with Google Play services. -Otherwise you will not be able to use Firebase In-App Messaging. - -### Use the plugin - -To show In-App Messages in your app, no extra setup is required - just import the plugin and you -are good to go. However, to modify message behavior (as documented [here](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior)), the plugin provides the following methods - - -First off, add the following imports to your Dart code: -```dart -import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; -``` - -#### Programmatic Triggers ([docs](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=android#trigger_in-app_messages_programmatically)) - -To trigger in-app messages programmatically - -```dart -FirebaseInAppMessaging.triggerEvent('eventName'); -``` - -#### Temporarily disable in-app messages ([docs](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=android#temporarily_disable_in-app_messages)) - -If you'd like to suppress message displays for any reason, for example to avoid interrupting a sequence of payment processing screens, you can do that the following - -```dart -FirebaseInAppMessaging.setMessagesSuppressed(true); - - -// To re-enable -FirebaseInAppMessaging.setMessagesSuppressed(false); -``` - -#### Enable opt-out message delivery ([docs](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=android#enable_opt-out_message_delivery)) - -First, follow the step outlined [here](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior#enable_opt-out_message_delivery) for both iOS and Android. Then add the following code in your app: - -```dart -FirebaseInAppMessaging.setAutomaticDataCollectionEnabled(false); -``` - -## Example - -See the [example application](https://github.com/flutter/plugins/tree/master/packages/firebase_in_app_messaging/example) source -for a complete sample app using the Firebase In-App Messaging. - -## Issues and feedback - -Please file [issues](https://github.com/flutter/flutter/issues/new) -to send feedback or report a bug. Thank you! diff --git a/packages/firebase_in_app_messaging/android/.gitignore b/packages/firebase_in_app_messaging/android/.gitignore deleted file mode 100644 index c6cbe562a427..000000000000 --- a/packages/firebase_in_app_messaging/android/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/packages/firebase_in_app_messaging/android/build.gradle b/packages/firebase_in_app_messaging/android/build.gradle deleted file mode 100644 index 280a86f48056..000000000000 --- a/packages/firebase_in_app_messaging/android/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -group 'com.example.firebase_in_app_messaging' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-inappmessaging-display:18.0.2' - } -} diff --git a/packages/firebase_in_app_messaging/android/gradle.properties b/packages/firebase_in_app_messaging/android/gradle.properties deleted file mode 100644 index 2bd6f4fda009..000000000000 --- a/packages/firebase_in_app_messaging/android/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M - diff --git a/packages/firebase_in_app_messaging/android/settings.gradle b/packages/firebase_in_app_messaging/android/settings.gradle deleted file mode 100644 index 727175685e2b..000000000000 --- a/packages/firebase_in_app_messaging/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_in_app_messaging' diff --git a/packages/firebase_in_app_messaging/android/src/main/AndroidManifest.xml b/packages/firebase_in_app_messaging/android/src/main/AndroidManifest.xml deleted file mode 100644 index b6953a13e119..000000000000 --- a/packages/firebase_in_app_messaging/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/packages/firebase_in_app_messaging/android/src/main/java/com/example/firebase_in_app_messaging/FirebaseInAppMessagingPlugin.java b/packages/firebase_in_app_messaging/android/src/main/java/com/example/firebase_in_app_messaging/FirebaseInAppMessagingPlugin.java deleted file mode 100644 index 8a4c6bcfc71e..000000000000 --- a/packages/firebase_in_app_messaging/android/src/main/java/com/example/firebase_in_app_messaging/FirebaseInAppMessagingPlugin.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package com.example.firebase_in_app_messaging; - -import com.google.firebase.inappmessaging.FirebaseInAppMessaging; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; - -/** FirebaseInAppMessagingPlugin */ -public class FirebaseInAppMessagingPlugin implements MethodCallHandler { - private final FirebaseInAppMessaging instance; - - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_in_app_messaging"); - channel.setMethodCallHandler(new FirebaseInAppMessagingPlugin()); - } - - private FirebaseInAppMessagingPlugin() { - instance = FirebaseInAppMessaging.getInstance(); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - switch (call.method) { - case "triggerEvent": - { - String eventName = call.argument("eventName"); - instance.triggerEvent(eventName); - result.success(null); - break; - } - case "setMessagesSuppressed": - { - Boolean suppress = (Boolean) call.arguments; - instance.setMessagesSuppressed(suppress); - result.success(null); - break; - } - case "setAutomaticDataCollectionEnabled": - { - Boolean enabled = (Boolean) call.arguments; - instance.setAutomaticDataCollectionEnabled(enabled); - result.success(null); - break; - } - default: - { - result.notImplemented(); - break; - } - } - } -} diff --git a/packages/firebase_in_app_messaging/example/.gitignore b/packages/firebase_in_app_messaging/example/.gitignore deleted file mode 100644 index ac4a90645ca3..000000000000 --- a/packages/firebase_in_app_messaging/example/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.packages -.pub-cache/ -.pub/ -/build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/firebase_in_app_messaging/example/.metadata b/packages/firebase_in_app_messaging/example/.metadata deleted file mode 100644 index 0fc331292ca8..000000000000 --- a/packages/firebase_in_app_messaging/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 2e540931f73593e35627592ca4f9a4ca3035ed31 - channel: stable - -project_type: app diff --git a/packages/firebase_in_app_messaging/example/README.md b/packages/firebase_in_app_messaging/example/README.md deleted file mode 100644 index 5146fbdf4919..000000000000 --- a/packages/firebase_in_app_messaging/example/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# firebase_in_app_messaging_example - -Demonstrates how to use the firebase_in_app_messaging plugin. - diff --git a/packages/firebase_in_app_messaging/example/android/app/build.gradle b/packages/firebase_in_app_messaging/example/android/app/build.gradle deleted file mode 100644 index ce9e3c1143fb..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "com.example.firebase_in_app_messaging_example" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - multiDexEnabled true - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_in_app_messaging/example/android/app/google-services.json b/packages/firebase_in_app_messaging/example/android/app/google-services.json deleted file mode 100644 index 3e7c1eea26e7..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/google-services.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "project_info": { - "project_number": "417703151161", - "firebase_url": "https://fiamflutter.firebaseio.com", - "project_id": "fiamflutter", - "storage_bucket": "fiamflutter.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:417703151161:android:362d1e29a3978127", - "android_client_info": { - "package_name": "com.example.firebase_in_app_messaging_example" - } - }, - "oauth_client": [ - { - "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBWb90xr1JZGil-JEBULhYeb5w3qM2pYDI" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "417703151161-a2kb2fdjfkd3khbhd2lkf0uvobashf55.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.example.firebaseInappmessagingExample" - } - } - ] - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:417703151161:android:e6d1fd37b00bc472", - "android_client_info": { - "package_name": "com.example.firebase_inappmessaging_example" - } - }, - "oauth_client": [ - { - "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBWb90xr1JZGil-JEBULhYeb5w3qM2pYDI" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "417703151161-a2kb2fdjfkd3khbhd2lkf0uvobashf55.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.example.firebaseInappmessagingExample" - } - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_in_app_messaging/example/android/app/gradle.properties b/packages/firebase_in_app_messaging/example/android/app/gradle.properties deleted file mode 100644 index dbb7bf70d15c..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true diff --git a/packages/firebase_in_app_messaging/example/android/app/src/debug/AndroidManifest.xml b/packages/firebase_in_app_messaging/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 94dd5928d625..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_in_app_messaging/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index d2fa82033723..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/java/com/example/firebase_in_app_messaging_example/MainActivity.java b/packages/firebase_in_app_messaging/example/android/app/src/main/java/com/example/firebase_in_app_messaging_example/MainActivity.java deleted file mode 100644 index 98218250276a..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/src/main/java/com/example/firebase_in_app_messaging_example/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.firebase_in_app_messaging_example; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_in_app_messaging/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/values/styles.xml b/packages/firebase_in_app_messaging/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_in_app_messaging/example/android/app/src/profile/AndroidManifest.xml b/packages/firebase_in_app_messaging/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 94dd5928d625..000000000000 --- a/packages/firebase_in_app_messaging/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/firebase_in_app_messaging/example/android/build.gradle b/packages/firebase_in_app_messaging/example/android/build.gradle deleted file mode 100644 index f373ec6839c9..000000000000 --- a/packages/firebase_in_app_messaging/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - classpath 'com.google.gms:google-services:4.3.0' - - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_in_app_messaging/example/android/gradle.properties b/packages/firebase_in_app_messaging/example/android/gradle.properties deleted file mode 100644 index 2bd6f4fda009..000000000000 --- a/packages/firebase_in_app_messaging/example/android/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M - diff --git a/packages/firebase_in_app_messaging/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_in_app_messaging/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 659814bcc887..000000000000 --- a/packages/firebase_in_app_messaging/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Aug 05 20:16:36 BRT 2019 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/packages/firebase_in_app_messaging/example/android/settings.gradle b/packages/firebase_in_app_messaging/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/firebase_in_app_messaging/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_in_app_messaging/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_in_app_messaging/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6b4c0f78a785..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_in_app_messaging/example/ios/Flutter/Debug.xcconfig b/packages/firebase_in_app_messaging/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_in_app_messaging/example/ios/Flutter/Release.xcconfig b/packages/firebase_in_app_messaging/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 3b7693aef91e..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,600 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9031715A22DD332B00CA8C68 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9031715922DD332B00CA8C68 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - E638726B1F84F369FCA09810 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 914982FDACC51A62D1FAC1F1 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D51D38D6F347D924BF73402 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 4DBCB98EE08F0263FFB39A45 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9031715922DD332B00CA8C68 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 914982FDACC51A62D1FAC1F1 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 9697814F64329B9DFDDD2D22 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - E638726B1F84F369FCA09810 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3273157BD1F69AB58A8F6978 /* Pods */ = { - isa = PBXGroup; - children = ( - 2D51D38D6F347D924BF73402 /* Pods-Runner.debug.xcconfig */, - 4DBCB98EE08F0263FFB39A45 /* Pods-Runner.release.xcconfig */, - 9697814F64329B9DFDDD2D22 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - 9308F32363B77379BD52E16A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 914982FDACC51A62D1FAC1F1 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 3273157BD1F69AB58A8F6978 /* Pods */, - 9308F32363B77379BD52E16A /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 9031715922DD332B00CA8C68 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9FEE87118A15F39DB7049483 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 9CB2B92FB733B57CFCD2086E /* [CP] Embed Pods Frameworks */, - 4E58458F4BA4D6603A0A2A9C /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = TA9VLBVN24; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - 9031715A22DD332B00CA8C68 /* GoogleService-Info.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 4E58458F4BA4D6603A0A2A9C /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - 9CB2B92FB733B57CFCD2086E /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9FEE87118A15F39DB7049483 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = TA9VLBVN24; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseInAppMessagingExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = TA9VLBVN24; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseInAppMessagingExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = TA9VLBVN24; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseInAppMessagingExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 37add4ed8194..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.h b/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.m b/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index 3950f04ab0f9..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_in_app_messaging/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 0ad19e34cfee..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 417703151161-0kmftqj80per9egdcai8c89sefjdptfg.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.417703151161-0kmftqj80per9egdcai8c89sefjdptfg - API_KEY - AIzaSyAirg5nBv4fsGWF82ITldAd04thCp04WQ0 - GCM_SENDER_ID - 417703151161 - PLIST_VERSION - 1 - BUNDLE_ID - com.example.firebaseInAppMessagingExample - PROJECT_ID - fiamflutter - STORAGE_BUCKET - fiamflutter.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:417703151161:ios:2ad9dffe6e82f02c - DATABASE_URL - https://fiamflutter.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Info.plist b/packages/firebase_in_app_messaging/example/ios/Runner/Info.plist deleted file mode 100644 index 9afd5ae7969f..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_in_app_messaging_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/main.m b/packages/firebase_in_app_messaging/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_in_app_messaging/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_in_app_messaging/example/lib/main.dart b/packages/firebase_in_app_messaging/example/lib/main.dart deleted file mode 100644 index 8f187657f95e..000000000000 --- a/packages/firebase_in_app_messaging/example/lib/main.dart +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; -import 'package:flutter/material.dart'; - -void main() => runApp(MyApp()); - -class MyApp extends StatelessWidget { - static FirebaseAnalytics analytics = FirebaseAnalytics(); - static FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('In-App Messaging example'), - ), - body: Builder(builder: (BuildContext context) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AnalyticsEventExample(), - ProgrammaticTriggersExample(fiam), - ], - ), - ); - }), - )); - } -} - -class ProgrammaticTriggersExample extends StatelessWidget { - const ProgrammaticTriggersExample(this.fiam); - - final FirebaseInAppMessaging fiam; - - @override - Widget build(BuildContext context) { - return Card( - child: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - children: [ - Text( - "Programmatic Trigger", - style: TextStyle( - fontStyle: FontStyle.italic, - fontSize: 18, - ), - ), - const SizedBox(height: 8), - const Text("Manually trigger events programmatically "), - const SizedBox(height: 8), - RaisedButton( - onPressed: () { - fiam.triggerEvent('chicken_event'); - Scaffold.of(context).showSnackBar(SnackBar( - content: const Text("Triggering event: chicken_event"))); - }, - color: Colors.blue, - child: Text( - "Programmatic Triggers".toUpperCase(), - style: TextStyle(color: Colors.white), - ), - ) - ], - ), - ), - ); - } -} - -class AnalyticsEventExample extends StatelessWidget { - Future _sendAnalyticsEvent() async { - await MyApp.analytics - .logEvent(name: 'awesome_event', parameters: { - 'int': 42, // not required? - }); - } - - @override - Widget build(BuildContext context) { - return Card( - child: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - children: [ - Text( - "Log an analytics event", - style: TextStyle( - fontStyle: FontStyle.italic, - fontSize: 18, - ), - ), - const SizedBox(height: 8), - const Text("Trigger an analytics event"), - const SizedBox(height: 8), - RaisedButton( - onPressed: () { - _sendAnalyticsEvent(); - Scaffold.of(context).showSnackBar(SnackBar( - content: - const Text("Firing analytics event: awesome_event"))); - }, - color: Colors.blue, - child: Text( - "Log event".toUpperCase(), - style: TextStyle(color: Colors.white), - ), - ), - ], - ), - ), - ); - } -} diff --git a/packages/firebase_in_app_messaging/example/pubspec.yaml b/packages/firebase_in_app_messaging/example/pubspec.yaml deleted file mode 100644 index a2acd35b132f..000000000000 --- a/packages/firebase_in_app_messaging/example/pubspec.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: firebase_in_app_messaging_example -description: Demonstrates how to use the firebase_in_app_messaging plugin. -publish_to: 'none' - -environment: - sdk: ">=2.1.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - cupertino_icons: ^0.1.2 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - - firebase_in_app_messaging: - path: ../ - firebase_core: ^0.4.0+8 - firebase_analytics: ^4.0.2 - -flutter: - uses-material-design: true diff --git a/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging.dart b/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging.dart deleted file mode 100644 index 62953cee0316..000000000000 --- a/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('firebase_in_app_messaging', () { - FirebaseInAppMessaging fiam; - - setUp(() { - fiam = FirebaseInAppMessaging(); - }); - - test('triggerEvent', () { - expect(fiam.triggerEvent('someEvent'), completes); - }); - - test('logging', () { - expect(fiam.setMessagesSuppressed(true), completes); - expect(fiam.setAutomaticDataCollectionEnabled(true), completes); - }); - }); -} diff --git a/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging_test.dart b/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging_test.dart deleted file mode 100644 index cc11eae240e3..000000000000 --- a/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_driver/flutter_driver.dart'; - -void main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_in_app_messaging/ios/.gitignore b/packages/firebase_in_app_messaging/ios/.gitignore deleted file mode 100644 index 710ec6cf1c71..000000000000 --- a/packages/firebase_in_app_messaging/ios/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig diff --git a/packages/firebase_in_app_messaging/ios/Assets/.gitkeep b/packages/firebase_in_app_messaging/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.h b/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.h deleted file mode 100644 index 8a11472c4197..000000000000 --- a/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FirebaseInAppMessagingPlugin : NSObject -@end diff --git a/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.m b/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.m deleted file mode 100644 index 8ae625e4915b..000000000000 --- a/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.m +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseInAppMessagingPlugin.h" - -#import - -@implementation FirebaseInAppMessagingPlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_in_app_messaging" - binaryMessenger:[registrar messenger]]; - FirebaseInAppMessagingPlugin *instance = [[FirebaseInAppMessagingPlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"triggerEvent" isEqualToString:call.method]) { - NSString *eventName = call.arguments[@"eventName"]; - FIRInAppMessaging *fiam = [FIRInAppMessaging inAppMessaging]; - [fiam triggerEvent:eventName]; - result(nil); - } else if ([@"setMessagesSuppressed" isEqualToString:call.method]) { - NSNumber *suppress = [NSNumber numberWithBool:call.arguments]; - FIRInAppMessaging *fiam = [FIRInAppMessaging inAppMessaging]; - fiam.messageDisplaySuppressed = [suppress boolValue]; - result(nil); - } else if ([@"setAutomaticDataCollectionEnabled" isEqualToString:call.method]) { - NSNumber *enabled = [NSNumber numberWithBool:call.arguments]; - FIRInAppMessaging *fiam = [FIRInAppMessaging inAppMessaging]; - fiam.automaticDataCollectionEnabled = [enabled boolValue]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/packages/firebase_in_app_messaging/ios/firebase_in_app_messaging.podspec b/packages/firebase_in_app_messaging/ios/firebase_in_app_messaging.podspec deleted file mode 100644 index f635f4a85656..000000000000 --- a/packages/firebase_in_app_messaging/ios/firebase_in_app_messaging.podspec +++ /dev/null @@ -1,24 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'firebase_in_app_messaging' - s.version = '0.0.1' - s.summary = 'InAppMessaging Plugin for Firebase' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase' - s.dependency 'Firebase/InAppMessagingDisplay' - s.static_framework = true - - s.ios.deployment_target = '8.0' -end - diff --git a/packages/firebase_in_app_messaging/lib/firebase_in_app_messaging.dart b/packages/firebase_in_app_messaging/lib/firebase_in_app_messaging.dart deleted file mode 100644 index e6549888c3ed..000000000000 --- a/packages/firebase_in_app_messaging/lib/firebase_in_app_messaging.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; - -class FirebaseInAppMessaging { - @visibleForTesting - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_in_app_messaging'); - - static FirebaseInAppMessaging _instance = FirebaseInAppMessaging(); - - /// Gets the instance of In-App Messaging for the default Firebase app. - static FirebaseInAppMessaging get instance => _instance; - - /// Triggers an analytics event. - Future triggerEvent(String eventName) async { - await channel.invokeMethod( - 'triggerEvent', {'eventName': eventName}); - } - - /// Enables or disables suppression of message displays. - Future setMessagesSuppressed(bool suppress) async { - if (suppress == null) { - throw ArgumentError.notNull('suppress'); - } - await channel.invokeMethod('setMessagesSuppressed', suppress); - } - - /// Disable data collection for the app. - Future setAutomaticDataCollectionEnabled(bool enabled) async { - if (enabled == null) { - throw ArgumentError.notNull('enabled'); - } - await channel.invokeMethod( - 'setAutomaticDataCollectionEnabled', enabled); - } -} diff --git a/packages/firebase_in_app_messaging/pubspec.yaml b/packages/firebase_in_app_messaging/pubspec.yaml deleted file mode 100644 index e74b6405ad8d..000000000000 --- a/packages/firebase_in_app_messaging/pubspec.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: firebase_in_app_messaging -description: Flutter plugin for Firebase In-App Messaging. -version: 0.0.1+3 -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_in_app_messaging - -environment: - sdk: ">=2.1.0 <3.0.0" - -dependencies: - meta: ^1.1.6 - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - -flutter: - plugin: - androidPackage: com.example.firebase_in_app_messaging - pluginClass: FirebaseInAppMessagingPlugin diff --git a/packages/firebase_in_app_messaging/test/firebase_in_app_messaging_test.dart b/packages/firebase_in_app_messaging/test/firebase_in_app_messaging_test.dart deleted file mode 100644 index d2448c2a9d05..000000000000 --- a/packages/firebase_in_app_messaging/test/firebase_in_app_messaging_test.dart +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebaseInAppMessaging', () { - final List log = []; - - setUp(() { - log.clear(); - FirebaseInAppMessaging.channel - .setMockMethodCallHandler((MethodCall methodcall) async { - log.add(methodcall); - return true; - }); - }); - - test('triggerEvent', () async { - final FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); - await fiam.triggerEvent('someEvent'); - expect(log, [ - isMethodCall('triggerEvent', - arguments: {"eventName": "someEvent"}), - ]); - }); - - test('setMessagesSuppressed', () async { - final FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); - await fiam.setMessagesSuppressed(true); - expect(log, - [isMethodCall('setMessagesSuppressed', arguments: true)]); - - log.clear(); - fiam.setMessagesSuppressed(false); - expect(log, [ - isMethodCall('setMessagesSuppressed', arguments: false), - ]); - }); - - test('setDataCollectionEnabled', () async { - final FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); - await fiam.setAutomaticDataCollectionEnabled(true); - expect(log, [ - isMethodCall('setAutomaticDataCollectionEnabled', arguments: true) - ]); - - log.clear(); - fiam.setAutomaticDataCollectionEnabled(false); - expect(log, [ - isMethodCall('setAutomaticDataCollectionEnabled', arguments: false), - ]); - }); - }); -} diff --git a/packages/firebase_messaging/.gitignore b/packages/firebase_messaging/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_messaging/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_messaging/CHANGELOG.md b/packages/firebase_messaging/CHANGELOG.md deleted file mode 100644 index 76fe5f3c10c0..000000000000 --- a/packages/firebase_messaging/CHANGELOG.md +++ /dev/null @@ -1,262 +0,0 @@ -## 5.1.3 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 5.1.2 - -* Updates to README and example with explanations of differences in data format. - -## 5.1.1 - -* Update README with more detailed integration instructions. - -## 5.1.0 - -* Changed the return type of `subscribeToTopic` and `unsubscribeFromTopic` to - `Future`. - -## 5.0.6 - -* Additional integration tests. - -## 5.0.5 - -* On Android, fix crash when calling `deleteInstanceID` with latest Flutter engine. - -## 5.0.4 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 5.0.3 - -* Update Dart code to conform to current Dart formatter. - -## 5.0.2 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 5.0.1+1 - -* Enable support for `onMessage` on iOS using `shouldEstablishDirectChannel`. - -## 5.0.1 - -* Fix error in the logs on startup if unable to retrieve token on startup on Android. - -## 5.0.0 - -* Update Android dependencies to latest. - -## 4.0.0+4 - -* Remove obsolete `use_frameworks!` instruction. - -## 4.0.0+3 - -* Update iOS configuration documentation. - -## 4.0.0+2 - -* Fix example app's floating action button that stopped working due to a breaking change. - -## 4.0.0+1 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 4.0.0 - -* **Breaking Change** Update message structure for onMessage to match onLaunch and onResume - -## 3.0.1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 3.0.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - - This was originally incorrectly pushed in the `2.2.0` update. - -## 2.2.0+1 - -* **Revert the breaking 2.2.0 update**. 2.2.0 was known to be breaking and - should have incremented the major version number instead of the minor. This - revert is in and of itself breaking for anyone that has already migrated - however. Anyone who has already migrated their app to AndroidX should - immediately update to `3.0.0` instead. That's the correctly versioned new push - of `2.2.0`. - -## 2.2.0 - -* **BAD**. This was a breaking change that was incorrectly published on a minor - version upgrade, should never have happened. Reverted by `2.2.0+1`. - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 2.1.0 - -* Adding support for deleteInstanceID(), autoInitEnabled() and setAutoInitEnabled(). - -## 2.0.3 - -* Removing local cache of getToken() in the dart part of the plugin. Now getToken() calls directly its counterparts in the iOS and Android implementations. This enables obtaining its value without calling configure() or having to wait for a new token refresh. - -## 2.0.2 - -* Use boolean values when checking for notification types on iOS. - -## 2.0.1 - -* Bump Android dependencies to latest. - -## 2.0.0 - -* Updated Android to send Remote Message's title and body to Dart. - -## 1.0.5 - -* Bumped test and mockito versions to pick up Dart 2 support. - -## 1.0.4 - -* Bump Android and Firebase dependency versions. - -## 1.0.3 - -* Updated iOS token hook from 'didRefreshRegistrationToken' to 'didReceiveRegistrationToken' - -## 1.0.2 - -* Updated Gradle tooling to match Android Studio 3.2.2. - -## 1.0.1 - -* Fix for Android where the onLaunch event is not triggered when the Activity is killed by the OS (or if the Don't keep activities toggle is enabled) - -## 1.0.0 - -* Bump to released version - -## 0.2.5 - -* Fixed Dart 2 type error. - -## 0.2.4 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.2.3 - -* Updated package channel name - -## 0.2.2 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.2.1 - -* Fixed Dart 2 type errors. - -## 0.2.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.1.4 - -* Fixed Dart 2 type error in example project. - -## 0.1.3 - -* Enabled use in Swift projects. - -## 0.2.2 - -* Fix for APNS not being correctly registered on iOS when reinstalling application. - -## 0.1.1 - -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.1.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). -* Relaxed GMS dependency to [11.4.0,12.0[ - -## 0.0.8 - -* Added FLT prefix to iOS types -* Change GMS dependency to 11.4.+ - -## 0.0.7 - -In FirebaseMessagingPlugin.m: -* moved logic from 'tokenRefreshNotification' to 'didRefreshRegistrationToken' -* removed 'tokenRefreshNotification' as well as observer registration -* removed 'connectToFcm' method and related calls -* removed unnecessary FIRMessaging disconnect - -## 0.0.6 - -* Change GMS dependency to 11.+ - -## 0.0.5+2 - -* Fixed README example for "click_action" - -## 0.0.5+1 - -* Aligned author name with rest of repo. - -## 0.0.5 - -* Updated to Firebase SDK to always use latest patch version for 11.0.x builds - -## 0.0.4 - -* Updated to Firebase SDK Version 11.0.1 - -## 0.0.3 - -* Updated README.md -* Bumped buildToolsVersion to 25.0.3 - -## 0.0.2+2 - -* Updated README.md - -## 0.0.2+1 - -* Added workaround for https://github.com/flutter/flutter/issues/9694 to README -* Moved code to https://github.com/flutter/plugins - -## 0.0.2 - -* Updated to latest plugin API - -## 0.0.2.2 - -* Downgraded gradle dependency for example app to make `flutter run` happy - -## 0.0.1+1 - -* Updated README with installation instructions -* Added CHANGELOG - -## 0.0.1 - -* Initial Release diff --git a/packages/firebase_messaging/LICENSE b/packages/firebase_messaging/LICENSE deleted file mode 100644 index 000b4618d2bd..000000000000 --- a/packages/firebase_messaging/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_messaging/README.md b/packages/firebase_messaging/README.md deleted file mode 100644 index fced940d7b7f..000000000000 --- a/packages/firebase_messaging/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# Firebase Cloud Messaging for Flutter - -[![pub package](https://img.shields.io/pub/v/firebase_messaging.svg)](https://pub.dartlang.org/packages/firebase_messaging) - -A Flutter plugin to use the [Firebase Cloud Messaging (FCM) API](https://firebase.google.com/docs/cloud-messaging/). - -With this plugin, your Flutter app can receive and process push notifications as well as data messages on Android and iOS. Read Firebase's [About FCM Messages](https://firebase.google.com/docs/cloud-messaging/concept-options) to learn more about the differences between notification messages and data messages. - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage -To use this plugin, add `firebase_messaging` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). - -## Getting Started - -Check out the `example` directory for a sample app using Firebase Cloud Messaging. - -### Android Integration - -To integrate your plugin into the Android part of your app, follow these steps: - -1. Using the [Firebase Console](https://console.firebase.google.com/) add an Android app to your project: Follow the assistant, download the generated `google-services.json` file and place it inside `android/app`. - -2. Add the classpath to the `[project]/android/build.gradle` file. -``` -dependencies { - // Example existing classpath - classpath 'com.android.tools.build:gradle:3.2.1' - // Add the google services classpath - classpath 'com.google.gms:google-services:4.3.0' -} -``` -3. Add the apply plugin to the `[project]/android/app/build.gradle` file. -``` -// ADD THIS AT THE BOTTOM -apply plugin: 'com.google.gms.google-services' -``` - -Note: If this section is not completed you will get an error like this: -``` -java.lang.IllegalStateException: -Default FirebaseApp is not initialized in this process [package name]. -Make sure to call FirebaseApp.initializeApp(Context) first. -``` - -Note: When you are debugging on Android, use a device or AVD with Google Play services. Otherwise you will not be able to authenticate. - -4. (optional, but recommended) If want to be notified in your app (via `onResume` and `onLaunch`, see below) when the user clicks on a notification in the system tray include the following `intent-filter` within the `` tag of your `android/app/src/main/AndroidManifest.xml`: - ```xml - - - - - ``` - - -### iOS Integration - -To integrate your plugin into the iOS part of your app, follow these steps: - -1. Generate the certificates required by Apple for receiving push notifications following [this guide](https://firebase.google.com/docs/cloud-messaging/ios/certs) in the Firebase docs. You can skip the section titled "Create the Provisioning Profile". - -1. Using the [Firebase Console](https://console.firebase.google.com/) add an iOS app to your project: Follow the assistant, download the generated `GoogleService-Info.plist` file, open `ios/Runner.xcworkspace` with Xcode, and within Xcode place the file inside `ios/Runner`. **Don't** follow the steps named "Add Firebase SDK" and "Add initialization code" in the Firebase assistant. - -1. In Xcode, select `Runner` in the Project Navigator. In the Capabilities Tab turn on `Push Notifications` and `Background Modes`, and enable `Background fetch` and `Remote notifications` under `Background Modes`. - -1. Follow the steps in the "[Upload your APNs certificate](https://firebase.google.com/docs/cloud-messaging/ios/client#upload_your_apns_certificate)" section of the Firebase docs. - -### Dart/Flutter Integration - -From your Dart code, you need to import the plugin and instantiate it: - -```dart -import 'package:firebase_messaging/firebase_messaging.dart'; - -final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); -``` - -Next, you should probably request permissions for receiving Push Notifications. For this, call `_firebaseMessaging.requestNotificationPermissions()`. This will bring up a permissions dialog for the user to confirm on iOS. It's a no-op on Android. Last, but not least, register `onMessage`, `onResume`, and `onLaunch` callbacks via `_firebaseMessaging.configure()` to listen for incoming messages (see table below for more information). - -## Receiving Messages - -Messages are sent to your Flutter app via the `onMessage`, `onLaunch`, and `onResume` callbacks that you configured with the plugin during setup. Here is how different message types are delivered on the supported platforms: - -| | App in Foreground | App in Background | App Terminated | -| --------------------------: | ----------------- | ----------------- | -------------- | -| **Notification on Android** | `onMessage` | Notification is delivered to system tray. When the user clicks on it to open app `onResume` fires if `click_action: FLUTTER_NOTIFICATION_CLICK` is set (see below). | Notification is delivered to system tray. When the user clicks on it to open app `onLaunch` fires if `click_action: FLUTTER_NOTIFICATION_CLICK` is set (see below). | -| **Notification on iOS** | `onMessage` | Notification is delivered to system tray. When the user clicks on it to open app `onResume` fires. | Notification is delivered to system tray. When the user clicks on it to open app `onLaunch` fires. | -| **Data Message on Android** | `onMessage` | `onMessage` while app stays in the background. | *not supported by plugin, message is lost* | -| **Data Message on iOS** | `onMessage` | Message is stored by FCM and delivered to app via `onMessage` when the app is brought back to foreground. | Message is stored by FCM and delivered to app via `onMessage` when the app is brought back to foreground. | - -Additional reading: Firebase's [About FCM Messages](https://firebase.google.com/docs/cloud-messaging/concept-options). - -## Notification messages with additional data -It is possible to include additional data in notification messages by adding them to the `"data"`-field of the message. - -On Android, the message contains an additional field `data` containing the data. On iOS, the data is directly appended to the message and the additional `data`-field is omitted. - -To receive the data on both platforms: - -````dart -Future _handleNotification (Map message, bool dialog) async { - var data = message['data'] ?? message; - String expectedAttribute = data['expectedAttribute']; - /// [...] -} -```` - -## Sending Messages -Refer to the [Firebase documentation](https://firebase.google.com/docs/cloud-messaging/) about FCM for all the details about sending messages to your app. When sending a notification message to an Android device, you need to make sure to set the `click_action` property of the message to `FLUTTER_NOTIFICATION_CLICK`. Otherwise the plugin will be unable to deliver the notification to your app when the users clicks on it in the system tray. - -For testing purposes, the simplest way to send a notification is via the [Firebase Console](https://firebase.google.com/docs/cloud-messaging/send-with-console). Make sure to include `click_action: FLUTTER_NOTIFICATION_CLICK` as a "Custom data" key-value-pair (under "Advanced options") when targeting an Android device. The Firebase Console does not support sending data messages. - -Alternatively, a notification or data message can be sent from a terminal: - -```shell -DATA='{"notification": {"body": "this is a body","title": "this is a title"}, "priority": "high", "data": {"click_action": "FLUTTER_NOTIFICATION_CLICK", "id": "1", "status": "done"}, "to": ""}' -curl https://fcm.googleapis.com/fcm/send -H "Content-Type:application/json" -X POST -d "$DATA" -H "Authorization: key=" -``` - -Remove the `notification` property in `DATA` to send a data message. diff --git a/packages/firebase_messaging/android/android.iml b/packages/firebase_messaging/android/android.iml deleted file mode 100644 index c963ea792e12..000000000000 --- a/packages/firebase_messaging/android/android.iml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_messaging/android/build.gradle b/packages/firebase_messaging/android/build.gradle deleted file mode 100644 index b3099b7d582b..000000000000 --- a/packages/firebase_messaging/android/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -def PLUGIN = "firebase_messaging"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebasemessaging' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-messaging:18.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_messaging/android/firebase_messaging.iml b/packages/firebase_messaging/android/firebase_messaging.iml deleted file mode 100644 index 1a79db0c9754..000000000000 --- a/packages/firebase_messaging/android/firebase_messaging.iml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_messaging/android/gradle.properties b/packages/firebase_messaging/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_messaging/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_messaging/android/settings.gradle b/packages/firebase_messaging/android/settings.gradle deleted file mode 100644 index f82964eb43a1..000000000000 --- a/packages/firebase_messaging/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_messaging' diff --git a/packages/firebase_messaging/android/src/main/AndroidManifest.xml b/packages/firebase_messaging/android/src/main/AndroidManifest.xml deleted file mode 100644 index 34e4e6df5d39..000000000000 --- a/packages/firebase_messaging/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java b/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java deleted file mode 100644 index 4ab56e01d299..000000000000 --- a/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemessaging; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.Bundle; -import android.util.Log; -import androidx.annotation.NonNull; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.FirebaseApp; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.InstanceIdResult; -import com.google.firebase.messaging.FirebaseMessaging; -import com.google.firebase.messaging.RemoteMessage; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.NewIntentListener; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** FirebaseMessagingPlugin */ -public class FirebaseMessagingPlugin extends BroadcastReceiver - implements MethodCallHandler, NewIntentListener { - private final Registrar registrar; - private final MethodChannel channel; - - private static final String CLICK_ACTION_VALUE = "FLUTTER_NOTIFICATION_CLICK"; - private static final String TAG = "FirebaseMessagingPlugin"; - - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_messaging"); - final FirebaseMessagingPlugin plugin = new FirebaseMessagingPlugin(registrar, channel); - registrar.addNewIntentListener(plugin); - channel.setMethodCallHandler(plugin); - } - - private FirebaseMessagingPlugin(Registrar registrar, MethodChannel channel) { - this.registrar = registrar; - this.channel = channel; - FirebaseApp.initializeApp(registrar.context()); - - IntentFilter intentFilter = new IntentFilter(); - intentFilter.addAction(FlutterFirebaseMessagingService.ACTION_TOKEN); - intentFilter.addAction(FlutterFirebaseMessagingService.ACTION_REMOTE_MESSAGE); - LocalBroadcastManager manager = LocalBroadcastManager.getInstance(registrar.context()); - manager.registerReceiver(this, intentFilter); - } - - // BroadcastReceiver implementation. - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - - if (action == null) { - return; - } - - if (action.equals(FlutterFirebaseMessagingService.ACTION_TOKEN)) { - String token = intent.getStringExtra(FlutterFirebaseMessagingService.EXTRA_TOKEN); - channel.invokeMethod("onToken", token); - } else if (action.equals(FlutterFirebaseMessagingService.ACTION_REMOTE_MESSAGE)) { - RemoteMessage message = - intent.getParcelableExtra(FlutterFirebaseMessagingService.EXTRA_REMOTE_MESSAGE); - Map content = parseRemoteMessage(message); - channel.invokeMethod("onMessage", content); - } - } - - @NonNull - private Map parseRemoteMessage(RemoteMessage message) { - Map content = new HashMap<>(); - content.put("data", message.getData()); - - RemoteMessage.Notification notification = message.getNotification(); - - Map notificationMap = new HashMap<>(); - - String title = notification != null ? notification.getTitle() : null; - notificationMap.put("title", title); - - String body = notification != null ? notification.getBody() : null; - notificationMap.put("body", body); - - content.put("notification", notificationMap); - return content; - } - - @Override - public void onMethodCall(final MethodCall call, final Result result) { - if ("configure".equals(call.method)) { - FirebaseInstanceId.getInstance() - .getInstanceId() - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - Log.w(TAG, "getToken, error fetching instanceID: ", task.getException()); - return; - } - channel.invokeMethod("onToken", task.getResult().getToken()); - } - }); - if (registrar.activity() != null) { - sendMessageFromIntent("onLaunch", registrar.activity().getIntent()); - } - result.success(null); - } else if ("subscribeToTopic".equals(call.method)) { - String topic = call.arguments(); - FirebaseMessaging.getInstance() - .subscribeToTopic(topic) - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - Exception e = task.getException(); - Log.w(TAG, "subscribeToTopic error", e); - result.error("subscribeToTopic", e.getMessage(), null); - return; - } - result.success(null); - } - }); - } else if ("unsubscribeFromTopic".equals(call.method)) { - String topic = call.arguments(); - FirebaseMessaging.getInstance() - .unsubscribeFromTopic(topic) - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - Exception e = task.getException(); - Log.w(TAG, "unsubscribeFromTopic error", e); - result.error("unsubscribeFromTopic", e.getMessage(), null); - return; - } - result.success(null); - } - }); - } else if ("getToken".equals(call.method)) { - FirebaseInstanceId.getInstance() - .getInstanceId() - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - Log.w(TAG, "getToken, error fetching instanceID: ", task.getException()); - result.success(null); - return; - } - - result.success(task.getResult().getToken()); - } - }); - } else if ("deleteInstanceID".equals(call.method)) { - new Thread( - new Runnable() { - @Override - public void run() { - try { - FirebaseInstanceId.getInstance().deleteInstanceId(); - if (registrar.activity() != null) { - registrar - .activity() - .runOnUiThread( - new Runnable() { - @Override - public void run() { - result.success(true); - } - }); - } - } catch (IOException ex) { - Log.e(TAG, "deleteInstanceID, error:", ex); - if (registrar.activity() != null) { - registrar - .activity() - .runOnUiThread( - new Runnable() { - @Override - public void run() { - result.success(false); - } - }); - } - } - } - }) - .start(); - } else if ("autoInitEnabled".equals(call.method)) { - result.success(FirebaseMessaging.getInstance().isAutoInitEnabled()); - } else if ("setAutoInitEnabled".equals(call.method)) { - Boolean isEnabled = (Boolean) call.arguments(); - FirebaseMessaging.getInstance().setAutoInitEnabled(isEnabled); - result.success(null); - } else { - result.notImplemented(); - } - } - - @Override - public boolean onNewIntent(Intent intent) { - boolean res = sendMessageFromIntent("onResume", intent); - if (res && registrar.activity() != null) { - registrar.activity().setIntent(intent); - } - return res; - } - - /** @return true if intent contained a message to send. */ - private boolean sendMessageFromIntent(String method, Intent intent) { - if (CLICK_ACTION_VALUE.equals(intent.getAction()) - || CLICK_ACTION_VALUE.equals(intent.getStringExtra("click_action"))) { - Map message = new HashMap<>(); - Bundle extras = intent.getExtras(); - - if (extras == null) { - return false; - } - - Map notificationMap = new HashMap<>(); - Map dataMap = new HashMap<>(); - - for (String key : extras.keySet()) { - Object extra = extras.get(key); - if (extra != null) { - dataMap.put(key, extra); - } - } - - message.put("notification", notificationMap); - message.put("data", dataMap); - - channel.invokeMethod(method, message); - return true; - } - return false; - } -} diff --git a/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseAppRegistrar.java b/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index c7b14c89738a..000000000000 --- a/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemessaging; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java b/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java deleted file mode 100644 index 345c0161e192..000000000000 --- a/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemessaging; - -import android.content.Intent; -import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import com.google.firebase.messaging.FirebaseMessagingService; -import com.google.firebase.messaging.RemoteMessage; - -public class FlutterFirebaseMessagingService extends FirebaseMessagingService { - - public static final String ACTION_REMOTE_MESSAGE = - "io.flutter.plugins.firebasemessaging.NOTIFICATION"; - public static final String EXTRA_REMOTE_MESSAGE = "notification"; - - public static final String ACTION_TOKEN = "io.flutter.plugins.firebasemessaging.TOKEN"; - public static final String EXTRA_TOKEN = "token"; - - /** - * Called when message is received. - * - * @param remoteMessage Object representing the message received from Firebase Cloud Messaging. - */ - @Override - public void onMessageReceived(RemoteMessage remoteMessage) { - Intent intent = new Intent(ACTION_REMOTE_MESSAGE); - intent.putExtra(EXTRA_REMOTE_MESSAGE, remoteMessage); - LocalBroadcastManager.getInstance(this).sendBroadcast(intent); - } - - /** - * Called when a new token for the default Firebase project is generated. - * - * @param token The token used for sending messages to this application instance. This token is - * the same as the one retrieved by getInstanceId(). - */ - @Override - public void onNewToken(String token) { - Intent intent = new Intent(ACTION_TOKEN); - intent.putExtra(EXTRA_TOKEN, token); - LocalBroadcastManager.getInstance(this).sendBroadcast(intent); - } -} diff --git a/packages/firebase_messaging/android/user-agent.gradle b/packages/firebase_messaging/android/user-agent.gradle deleted file mode 100644 index 73830fa09152..000000000000 --- a/packages/firebase_messaging/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-fcm" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_messaging/example/README.md b/packages/firebase_messaging/example/README.md deleted file mode 100644 index 4845e56be4ae..000000000000 --- a/packages/firebase_messaging/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_messaging_example - -Demonstrates how to use the firebase_messaging plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_messaging/example/android.iml b/packages/firebase_messaging/example/android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/firebase_messaging/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_messaging/example/android/app/build.gradle b/packages/firebase_messaging/example/android/app/build.gradle deleted file mode 100644 index 6946c388d840..000000000000 --- a/packages/firebase_messaging/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId 'io.flutter.plugins.firebasemessagingexample' - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_messaging/example/android/app/google-services.json b/packages/firebase_messaging/example/android/app/google-services.json deleted file mode 100644 index 625037ce8a98..000000000000 --- a/packages/firebase_messaging/example/android/app/google-services.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "project_info": { - "project_number": "3401408244", - "firebase_url": "https://test-project-cloud-messaging.firebaseio.com", - "project_id": "test-project-cloud-messaging", - "storage_bucket": "test-project-cloud-messaging.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:3401408244:android:5920de3503a2d18c", - "android_client_info": { - "package_name": "com.google.firebase.quickstart.fcm" - } - }, - "oauth_client": [ - { - "client_id": "3401408244-s01tdnd5guf3vrrn4n780j22sm20gob8.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.google.firebase.quickstart.fcm", - "certificate_hash": "a647cb35cdac21e3a26f2b5697c5b789cde3b5a0" - } - }, - { - "client_id": "3401408244-m5m1eph6d37rrp71hj33hcttffmmeat0.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMV3_n5xWH-rzyxsUWbvPPo7-_ZgESSOo" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "3401408244-kpa4vjuab7s8gjut5gjdf3hku8gbdp1c.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebase-messaging" - } - }, - { - "client_id": "3401408244-m5m1eph6d37rrp71hj33hcttffmmeat0.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:3401408244:android:fc026014a0a3ac30", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasemessagingexample" - } - }, - "oauth_client": [ - { - "client_id": "3401408244-m5m1eph6d37rrp71hj33hcttffmmeat0.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyBMV3_n5xWH-rzyxsUWbvPPo7-_ZgESSOo" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} diff --git a/packages/firebase_messaging/example/android/app/gradle.properties b/packages/firebase_messaging/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_messaging/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_messaging/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_messaging/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_messaging/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_messaging/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_messaging/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index adaa7b419adb..000000000000 --- a/packages/firebase_messaging/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_messaging/example/android/app/src/main/java/io/flutter/plugins/.gitignore b/packages/firebase_messaging/example/android/app/src/main/java/io/flutter/plugins/.gitignore deleted file mode 100644 index 9eb4563d2ae1..000000000000 --- a/packages/firebase_messaging/example/android/app/src/main/java/io/flutter/plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -GeneratedPluginRegistrant.java diff --git a/packages/firebase_messaging/example/android/app/src/main/java/io/flutter/plugins/firebasemessagingexample/MainActivity.java b/packages/firebase_messaging/example/android/app/src/main/java/io/flutter/plugins/firebasemessagingexample/MainActivity.java deleted file mode 100644 index dd2923cc9598..000000000000 --- a/packages/firebase_messaging/example/android/app/src/main/java/io/flutter/plugins/firebasemessagingexample/MainActivity.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemessagingexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_messaging/example/android/build.gradle b/packages/firebase_messaging/example/android/build.gradle deleted file mode 100644 index 359119307d55..000000000000 --- a/packages/firebase_messaging/example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_messaging/example/android/gradle.properties b/packages/firebase_messaging/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_messaging/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_messaging/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_messaging/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_messaging/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_messaging/example/android/settings.gradle b/packages/firebase_messaging/example/android/settings.gradle deleted file mode 100644 index 115da6cb4f4d..000000000000 --- a/packages/firebase_messaging/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_messaging/example/example.iml b/packages/firebase_messaging/example/example.iml deleted file mode 100644 index bbf850c6236c..000000000000 --- a/packages/firebase_messaging/example/example.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_messaging/example/firebase_messaging_example.iml b/packages/firebase_messaging/example/firebase_messaging_example.iml deleted file mode 100644 index 9d5dae19540c..000000000000 --- a/packages/firebase_messaging/example/firebase_messaging_example.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_messaging/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_messaging/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6c2de8086bcd..000000000000 --- a/packages/firebase_messaging/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_messaging/example/ios/Flutter/Debug.xcconfig b/packages/firebase_messaging/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index 9803018ca79d..000000000000 --- a/packages/firebase_messaging/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/firebase_messaging/example/ios/Flutter/Release.xcconfig b/packages/firebase_messaging/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index a4a8c604e13d..000000000000 --- a/packages/firebase_messaging/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/firebase_messaging/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_messaging/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 18d6d1e4402a..000000000000 --- a/packages/firebase_messaging/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,500 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 2EF3EFF8E25860E112E91756 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 799CAB03D87EEEE1FF65E7BE /* libPods-Runner.a */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5C5A74FB1EAA74D700FE37CF /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5C5A74FA1EAA74D700FE37CF /* GoogleService-Info.plist */; }; - 5C8223C01EC265DD00E12B15 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C8223BF1EC265DD00E12B15 /* GeneratedPluginRegistrant.m */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5C5A74FA1EAA74D700FE37CF /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 5C8223BE1EC265DD00E12B15 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 5C8223BF1EC265DD00E12B15 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 5CDE2B941EA81E0D006C00D0 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 799CAB03D87EEEE1FF65E7BE /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 2EF3EFF8E25860E112E91756 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 840012C8B5EDBCF56B0E4AC1 /* Pods */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 5C8223BE1EC265DD00E12B15 /* GeneratedPluginRegistrant.h */, - 5C8223BF1EC265DD00E12B15 /* GeneratedPluginRegistrant.m */, - 5CDE2B941EA81E0D006C00D0 /* Runner.entitlements */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 5C5A74FA1EAA74D700FE37CF /* GoogleService-Info.plist */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 799CAB03D87EEEE1FF65E7BE /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - SystemCapabilities = { - com.apple.Push = { - enabled = 1; - }; - }; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5C5A74FB1EAA74D700FE37CF /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 532EA9D341340B1DCD08293D /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 5C8223C01EC265DD00E12B15 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = "io.flutter.plugins.firebase-messaging"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = "io.flutter.plugins.firebase-messaging"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_messaging/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_messaging/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_messaging/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1c9580788197..000000000000 --- a/packages/firebase_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_messaging/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_messaging/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_messaging/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_messaging/example/ios/Runner/.gitignore b/packages/firebase_messaging/example/ios/Runner/.gitignore deleted file mode 100644 index 0cab08d0bdd7..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m diff --git a/packages/firebase_messaging/example/ios/Runner/AppDelegate.h b/packages/firebase_messaging/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_messaging/example/ios/Runner/AppDelegate.m b/packages/firebase_messaging/example/ios/Runner/AppDelegate.m deleted file mode 100644 index a4b51c88eb60..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d22f10b2ab63..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index ebf48f603974..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_messaging/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_messaging/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_messaging/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_messaging/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index aae17f35f51a..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 3401408244-kpa4vjuab7s8gjut5gjdf3hku8gbdp1c.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.3401408244-kpa4vjuab7s8gjut5gjdf3hku8gbdp1c - API_KEY - AIzaSyCwJxWJTafbmE8PNdWEbU5Ciw5z1R5Fl3k - GCM_SENDER_ID - 3401408244 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebase-messaging - PROJECT_ID - test-project-cloud-messaging - STORAGE_BUCKET - test-project-cloud-messaging.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:3401408244:ios:d297dea19b53a7da - DATABASE_URL - https://test-project-cloud-messaging.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_messaging/example/ios/Runner/Info.plist b/packages/firebase_messaging/example/ios/Runner/Info.plist deleted file mode 100644 index ededae49efe7..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - Firebase Cloud Messaging Example - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_messaging_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_messaging/example/ios/Runner/Runner.entitlements b/packages/firebase_messaging/example/ios/Runner/Runner.entitlements deleted file mode 100644 index 903def2af530..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/Runner.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - aps-environment - development - - diff --git a/packages/firebase_messaging/example/ios/Runner/main.m b/packages/firebase_messaging/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/firebase_messaging/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_messaging/example/lib/main.dart b/packages/firebase_messaging/example/lib/main.dart deleted file mode 100644 index 685a3f86f2fa..000000000000 --- a/packages/firebase_messaging/example/lib/main.dart +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; - -final Map _items = {}; -Item _itemForMessage(Map message) { - final dynamic data = message['data'] ?? message; - final String itemId = data['id']; - final Item item = _items.putIfAbsent(itemId, () => Item(itemId: itemId)) - ..status = data['status']; - return item; -} - -class Item { - Item({this.itemId}); - final String itemId; - - StreamController _controller = StreamController.broadcast(); - Stream get onChanged => _controller.stream; - - String _status; - String get status => _status; - set status(String value) { - _status = value; - _controller.add(this); - } - - static final Map> routes = >{}; - Route get route { - final String routeName = '/detail/$itemId'; - return routes.putIfAbsent( - routeName, - () => MaterialPageRoute( - settings: RouteSettings(name: routeName), - builder: (BuildContext context) => DetailPage(itemId), - ), - ); - } -} - -class DetailPage extends StatefulWidget { - DetailPage(this.itemId); - final String itemId; - @override - _DetailPageState createState() => _DetailPageState(); -} - -class _DetailPageState extends State { - Item _item; - StreamSubscription _subscription; - - @override - void initState() { - super.initState(); - _item = _items[widget.itemId]; - _subscription = _item.onChanged.listen((Item item) { - if (!mounted) { - _subscription.cancel(); - } else { - setState(() { - _item = item; - }); - } - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text("Item ${_item.itemId}"), - ), - body: Material( - child: Center(child: Text("Item status: ${_item.status}")), - ), - ); - } -} - -class PushMessagingExample extends StatefulWidget { - @override - _PushMessagingExampleState createState() => _PushMessagingExampleState(); -} - -class _PushMessagingExampleState extends State { - String _homeScreenText = "Waiting for token..."; - bool _topicButtonsDisabled = false; - - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); - final TextEditingController _topicController = - TextEditingController(text: 'topic'); - - Widget _buildDialog(BuildContext context, Item item) { - return AlertDialog( - content: Text("Item ${item.itemId} has been updated"), - actions: [ - FlatButton( - child: const Text('CLOSE'), - onPressed: () { - Navigator.pop(context, false); - }, - ), - FlatButton( - child: const Text('SHOW'), - onPressed: () { - Navigator.pop(context, true); - }, - ), - ], - ); - } - - void _showItemDialog(Map message) { - showDialog( - context: context, - builder: (_) => _buildDialog(context, _itemForMessage(message)), - ).then((bool shouldNavigate) { - if (shouldNavigate == true) { - _navigateToItemDetail(message); - } - }); - } - - void _navigateToItemDetail(Map message) { - final Item item = _itemForMessage(message); - // Clear away dialogs - Navigator.popUntil(context, (Route route) => route is PageRoute); - if (!item.route.isCurrent) { - Navigator.push(context, item.route); - } - } - - @override - void initState() { - super.initState(); - _firebaseMessaging.configure( - onMessage: (Map message) async { - print("onMessage: $message"); - _showItemDialog(message); - }, - onLaunch: (Map message) async { - print("onLaunch: $message"); - _navigateToItemDetail(message); - }, - onResume: (Map message) async { - print("onResume: $message"); - _navigateToItemDetail(message); - }, - ); - _firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings(sound: true, badge: true, alert: true)); - _firebaseMessaging.onIosSettingsRegistered - .listen((IosNotificationSettings settings) { - print("Settings registered: $settings"); - }); - _firebaseMessaging.getToken().then((String token) { - assert(token != null); - setState(() { - _homeScreenText = "Push Messaging token: $token"; - }); - print(_homeScreenText); - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Push Messaging Demo'), - ), - // For testing -- simulate a message being received - floatingActionButton: FloatingActionButton( - onPressed: () => _showItemDialog({ - "data": { - "id": "2", - "status": "out of stock", - }, - }), - tooltip: 'Simulate Message', - child: const Icon(Icons.message), - ), - body: Material( - child: Column( - children: [ - Center( - child: Text(_homeScreenText), - ), - Row(children: [ - Expanded( - child: TextField( - controller: _topicController, - onChanged: (String v) { - setState(() { - _topicButtonsDisabled = v.isEmpty; - }); - }), - ), - FlatButton( - child: const Text("subscribe"), - onPressed: _topicButtonsDisabled - ? null - : () { - _firebaseMessaging - .subscribeToTopic(_topicController.text); - _clearTopicText(); - }, - ), - FlatButton( - child: const Text("unsubscribe"), - onPressed: _topicButtonsDisabled - ? null - : () { - _firebaseMessaging - .unsubscribeFromTopic(_topicController.text); - _clearTopicText(); - }, - ), - ]) - ], - ), - )); - } - - void _clearTopicText() { - setState(() { - _topicController.text = ""; - _topicButtonsDisabled = true; - }); - } -} - -void main() { - runApp( - MaterialApp( - home: PushMessagingExample(), - ), - ); -} diff --git a/packages/firebase_messaging/example/pubspec.yaml b/packages/firebase_messaging/example/pubspec.yaml deleted file mode 100644 index f5b1516d82d6..000000000000 --- a/packages/firebase_messaging/example/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: firebase_messaging_example -description: Demonstrates how to use the firebase_messaging plugin. - -dependencies: - firebase_analytics: any - flutter: - sdk: flutter - firebase_messaging: - path: ../ - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - -flutter: - uses-material-design: true diff --git a/packages/firebase_messaging/example/test_driver/firebase_messaging.dart b/packages/firebase_messaging/example/test_driver/firebase_messaging.dart deleted file mode 100644 index 7ba46b79e733..000000000000 --- a/packages/firebase_messaging/example/test_driver/firebase_messaging.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'dart:async'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_messaging/firebase_messaging.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$FirebaseMessaging', () { - final FirebaseMessaging firebaseMessaging = FirebaseMessaging(); - - test('autoInitEnabled', () async { - await firebaseMessaging.setAutoInitEnabled(false); - expect(await firebaseMessaging.autoInitEnabled(), false); - await firebaseMessaging.setAutoInitEnabled(true); - expect(await firebaseMessaging.autoInitEnabled(), true); - }); - - // TODO(jackson): token retrieval isn't working on test devices yet - test('subscribeToTopic', () async { - await firebaseMessaging.subscribeToTopic('foo'); - }, skip: true); - - // TODO(jackson): token retrieval isn't working on test devices yet - test('unsubscribeFromTopic', () async { - await firebaseMessaging.unsubscribeFromTopic('foo'); - }, skip: true); - - test('deleteInstanceID', () async { - final bool result = await firebaseMessaging.deleteInstanceID(); - expect(result, isTrue); - }); - }); -} diff --git a/packages/firebase_messaging/example/test_driver/firebase_messaging_test.dart b/packages/firebase_messaging/example/test_driver/firebase_messaging_test.dart deleted file mode 100644 index 38fe6c447e05..000000000000 --- a/packages/firebase_messaging/example/test_driver/firebase_messaging_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_messaging/ios/Assets/.gitkeep b/packages/firebase_messaging/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h b/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h deleted file mode 100644 index 492be15a4ea6..000000000000 --- a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseMessagingPlugin : NSObject -@end diff --git a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m b/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m deleted file mode 100644 index 225b86f99599..000000000000 --- a/packages/firebase_messaging/ios/Classes/FirebaseMessagingPlugin.m +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseMessagingPlugin.h" -#import "UserAgent.h" - -#import "Firebase/Firebase.h" - -#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 -@interface FLTFirebaseMessagingPlugin () -@end -#endif - -static FlutterError *getFlutterError(NSError *error) { - if (error == nil) return nil; - return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", error.code] - message:error.domain - details:error.localizedDescription]; -} - -@implementation FLTFirebaseMessagingPlugin { - FlutterMethodChannel *_channel; - NSDictionary *_launchNotification; - BOOL _resumingFromBackground; -} - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_messaging" - binaryMessenger:[registrar messenger]]; - FLTFirebaseMessagingPlugin *instance = - [[FLTFirebaseMessagingPlugin alloc] initWithChannel:channel]; - [registrar addApplicationDelegate:instance]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)initWithChannel:(FlutterMethodChannel *)channel { - self = [super init]; - - if (self) { - _channel = channel; - _resumingFromBackground = NO; - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - [FIRMessaging messaging].delegate = self; - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *method = call.method; - if ([@"requestNotificationPermissions" isEqualToString:method]) { - UIUserNotificationType notificationTypes = 0; - NSDictionary *arguments = call.arguments; - if ([arguments[@"sound"] boolValue]) { - notificationTypes |= UIUserNotificationTypeSound; - } - if ([arguments[@"alert"] boolValue]) { - notificationTypes |= UIUserNotificationTypeAlert; - } - if ([arguments[@"badge"] boolValue]) { - notificationTypes |= UIUserNotificationTypeBadge; - } - UIUserNotificationSettings *settings = - [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; - [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; - - result(nil); - } else if ([@"configure" isEqualToString:method]) { - [FIRMessaging messaging].shouldEstablishDirectChannel = true; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - if (_launchNotification != nil) { - [_channel invokeMethod:@"onLaunch" arguments:_launchNotification]; - } - result(nil); - } else if ([@"subscribeToTopic" isEqualToString:method]) { - NSString *topic = call.arguments; - [[FIRMessaging messaging] subscribeToTopic:topic - completion:^(NSError *error) { - result(getFlutterError(error)); - }]; - } else if ([@"unsubscribeFromTopic" isEqualToString:method]) { - NSString *topic = call.arguments; - [[FIRMessaging messaging] unsubscribeFromTopic:topic - completion:^(NSError *error) { - result(getFlutterError(error)); - }]; - } else if ([@"getToken" isEqualToString:method]) { - [[FIRInstanceID instanceID] - instanceIDWithHandler:^(FIRInstanceIDResult *_Nullable instanceIDResult, - NSError *_Nullable error) { - if (error != nil) { - NSLog(@"getToken, error fetching instanceID: %@", error); - result(nil); - } else { - result(instanceIDResult.token); - } - }]; - } else if ([@"deleteInstanceID" isEqualToString:method]) { - [[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error) { - if (error.code != 0) { - NSLog(@"deleteInstanceID, error: %@", error); - result([NSNumber numberWithBool:NO]); - } else { - [[UIApplication sharedApplication] unregisterForRemoteNotifications]; - result([NSNumber numberWithBool:YES]); - } - }]; - } else if ([@"autoInitEnabled" isEqualToString:method]) { - BOOL value = [[FIRMessaging messaging] isAutoInitEnabled]; - result([NSNumber numberWithBool:value]); - } else if ([@"setAutoInitEnabled" isEqualToString:method]) { - NSNumber *value = call.arguments; - [FIRMessaging messaging].autoInitEnabled = value.boolValue; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 -// Receive data message on iOS 10 devices while app is in the foreground. -- (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage { - [self didReceiveRemoteNotification:remoteMessage.appData]; -} -#endif - -- (void)didReceiveRemoteNotification:(NSDictionary *)userInfo { - if (_resumingFromBackground) { - [_channel invokeMethod:@"onResume" arguments:userInfo]; - } else { - [_channel invokeMethod:@"onMessage" arguments:userInfo]; - } -} - -#pragma mark - AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - if (launchOptions != nil) { - _launchNotification = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]; - } - return YES; -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - _resumingFromBackground = YES; -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - _resumingFromBackground = NO; - // Clears push notifications from the notification center, with the - // side effect of resetting the badge count. We need to clear notifications - // because otherwise the user could tap notifications in the notification - // center while the app is in the foreground, and we wouldn't be able to - // distinguish that case from the case where a message came in and the - // user dismissed the notification center without tapping anything. - // TODO(goderbauer): Revisit this behavior once we provide an API for managing - // the badge number, or if we add support for running Dart in the background. - // Setting badgeNumber to 0 is a no-op (= notifications will not be cleared) - // if it is already 0, - // therefore the next line is setting it to 1 first before clearing it again - // to remove all - // notifications. - application.applicationIconBadgeNumber = 1; - application.applicationIconBadgeNumber = 0; -} - -- (bool)application:(UIApplication *)application - didReceiveRemoteNotification:(NSDictionary *)userInfo - fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - [self didReceiveRemoteNotification:userInfo]; - completionHandler(UIBackgroundFetchResultNoData); - return YES; -} - -- (void)application:(UIApplication *)application - didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { -#ifdef DEBUG - [[FIRMessaging messaging] setAPNSToken:deviceToken type:FIRMessagingAPNSTokenTypeSandbox]; -#else - [[FIRMessaging messaging] setAPNSToken:deviceToken type:FIRMessagingAPNSTokenTypeProd]; -#endif - - [_channel invokeMethod:@"onToken" arguments:[FIRMessaging messaging].FCMToken]; -} - -- (void)application:(UIApplication *)application - didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { - NSDictionary *settingsDictionary = @{ - @"sound" : [NSNumber numberWithBool:notificationSettings.types & UIUserNotificationTypeSound], - @"badge" : [NSNumber numberWithBool:notificationSettings.types & UIUserNotificationTypeBadge], - @"alert" : [NSNumber numberWithBool:notificationSettings.types & UIUserNotificationTypeAlert], - }; - [_channel invokeMethod:@"onIosSettingsRegistered" arguments:settingsDictionary]; -} - -- (void)messaging:(nonnull FIRMessaging *)messaging - didReceiveRegistrationToken:(nonnull NSString *)fcmToken { - [_channel invokeMethod:@"onToken" arguments:fcmToken]; -} - -- (void)messaging:(FIRMessaging *)messaging - didReceiveMessage:(FIRMessagingRemoteMessage *)remoteMessage { - [_channel invokeMethod:@"onMessage" arguments:remoteMessage.appData]; -} - -@end diff --git a/packages/firebase_messaging/ios/firebase_messaging.podspec b/packages/firebase_messaging/ios/firebase_messaging.podspec deleted file mode 100644 index 540efc00a189..000000000000 --- a/packages/firebase_messaging/ios/firebase_messaging.podspec +++ /dev/null @@ -1,33 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_messaging' - s.version = '0.0.1' - s.summary = 'Firebase Cloud Messaging plugin for Flutter.' - s.description = <<-DESC -Firebase Cloud Messaging plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_messaging' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/Messaging' - s.static_framework = true - s.ios.deployment_target = '8.0' - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-fcm\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_messaging/lib/firebase_messaging.dart b/packages/firebase_messaging/lib/firebase_messaging.dart deleted file mode 100644 index f40420c6dbe5..000000000000 --- a/packages/firebase_messaging/lib/firebase_messaging.dart +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:meta/meta.dart'; -import 'package:platform/platform.dart'; - -typedef Future MessageHandler(Map message); - -/// Implementation of the Firebase Cloud Messaging API for Flutter. -/// -/// Your app should call [requestNotificationPermissions] first and then -/// register handlers for incoming messages with [configure]. -class FirebaseMessaging { - factory FirebaseMessaging() => _instance; - - @visibleForTesting - FirebaseMessaging.private(MethodChannel channel, Platform platform) - : _channel = channel, - _platform = platform; - - static final FirebaseMessaging _instance = FirebaseMessaging.private( - const MethodChannel('plugins.flutter.io/firebase_messaging'), - const LocalPlatform()); - - final MethodChannel _channel; - final Platform _platform; - - MessageHandler _onMessage; - MessageHandler _onLaunch; - MessageHandler _onResume; - - /// On iOS, prompts the user for notification permissions the first time - /// it is called. - /// - /// Does nothing on Android. - void requestNotificationPermissions( - [IosNotificationSettings iosSettings = const IosNotificationSettings()]) { - if (!_platform.isIOS) { - return; - } - _channel.invokeMethod( - 'requestNotificationPermissions', iosSettings.toMap()); - } - - final StreamController _iosSettingsStreamController = - StreamController.broadcast(); - - /// Stream that fires when the user changes their notification settings. - /// - /// Only fires on iOS. - Stream get onIosSettingsRegistered { - return _iosSettingsStreamController.stream; - } - - /// Sets up [MessageHandler] for incoming messages. - void configure({ - MessageHandler onMessage, - MessageHandler onLaunch, - MessageHandler onResume, - }) { - _onMessage = onMessage; - _onLaunch = onLaunch; - _onResume = onResume; - _channel.setMethodCallHandler(_handleMethod); - _channel.invokeMethod('configure'); - } - - final StreamController _tokenStreamController = - StreamController.broadcast(); - - /// Fires when a new FCM token is generated. - Stream get onTokenRefresh { - return _tokenStreamController.stream; - } - - /// Returns the FCM token. - Future getToken() async { - return await _channel.invokeMethod('getToken'); - } - - /// Subscribe to topic in background. - /// - /// [topic] must match the following regular expression: - /// "[a-zA-Z0-9-_.~%]{1,900}". - Future subscribeToTopic(String topic) { - return _channel.invokeMethod('subscribeToTopic', topic); - } - - /// Unsubscribe from topic in background. - Future unsubscribeFromTopic(String topic) { - return _channel.invokeMethod('unsubscribeFromTopic', topic); - } - - /// Resets Instance ID and revokes all tokens. In iOS, it also unregisters from remote notifications. - /// - /// A new Instance ID is generated asynchronously if Firebase Cloud Messaging auto-init is enabled. - /// - /// returns true if the operations executed successfully and false if an error ocurred - Future deleteInstanceID() async { - return await _channel.invokeMethod('deleteInstanceID'); - } - - /// Determine whether FCM auto-initialization is enabled or disabled. - Future autoInitEnabled() async { - return await _channel.invokeMethod('autoInitEnabled'); - } - - /// Enable or disable auto-initialization of Firebase Cloud Messaging. - Future setAutoInitEnabled(bool enabled) async { - await _channel.invokeMethod('setAutoInitEnabled', enabled); - } - - Future _handleMethod(MethodCall call) async { - switch (call.method) { - case "onToken": - final String token = call.arguments; - _tokenStreamController.add(token); - return null; - case "onIosSettingsRegistered": - _iosSettingsStreamController.add(IosNotificationSettings._fromMap( - call.arguments.cast())); - return null; - case "onMessage": - return _onMessage(call.arguments.cast()); - case "onLaunch": - return _onLaunch(call.arguments.cast()); - case "onResume": - return _onResume(call.arguments.cast()); - default: - throw UnsupportedError("Unrecognized JSON message"); - } - } -} - -class IosNotificationSettings { - const IosNotificationSettings({ - this.sound = true, - this.alert = true, - this.badge = true, - }); - - IosNotificationSettings._fromMap(Map settings) - : sound = settings['sound'], - alert = settings['alert'], - badge = settings['badge']; - - final bool sound; - final bool alert; - final bool badge; - - @visibleForTesting - Map toMap() { - return {'sound': sound, 'alert': alert, 'badge': badge}; - } - - @override - String toString() => 'PushNotificationSettings ${toMap()}'; -} diff --git a/packages/firebase_messaging/pubspec.yaml b/packages/firebase_messaging/pubspec.yaml deleted file mode 100644 index cdfa9b11d659..000000000000 --- a/packages/firebase_messaging/pubspec.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: firebase_messaging -description: Flutter plugin for Firebase Cloud Messaging, a cross-platform - messaging solution that lets you reliably deliver messages on Android and iOS. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging -version: 5.1.3 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebasemessaging - iosPrefix: FLT - pluginClass: FirebaseMessagingPlugin - -dependencies: - meta: ^1.0.4 - platform: ^2.0.0 - flutter: - sdk: flutter - -dev_dependencies: - test: ^1.3.0 - mockito: ^3.0.0 - flutter_test: - sdk: flutter - firebase_core: ^0.4.0 - flutter_driver: - sdk: flutter - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_messaging/test/firebase_messaging_test.dart b/packages/firebase_messaging/test/firebase_messaging_test.dart deleted file mode 100644 index a4e6d7c04756..000000000000 --- a/packages/firebase_messaging/test/firebase_messaging_test.dart +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:mockito/mockito.dart'; -import 'package:platform/platform.dart'; -import 'package:test/test.dart'; - -void main() { - MockMethodChannel mockChannel; - FirebaseMessaging firebaseMessaging; - - setUp(() { - mockChannel = MockMethodChannel(); - firebaseMessaging = FirebaseMessaging.private( - mockChannel, FakePlatform(operatingSystem: 'ios')); - }); - - test('requestNotificationPermissions on ios with default permissions', () { - firebaseMessaging.requestNotificationPermissions(); - verify(mockChannel.invokeMethod('requestNotificationPermissions', - {'sound': true, 'badge': true, 'alert': true})); - }); - - test('requestNotificationPermissions on ios with custom permissions', () { - firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings(sound: false)); - verify(mockChannel.invokeMethod('requestNotificationPermissions', - {'sound': false, 'badge': true, 'alert': true})); - }); - - test('requestNotificationPermissions on android', () { - firebaseMessaging = FirebaseMessaging.private( - mockChannel, FakePlatform(operatingSystem: 'android')); - - firebaseMessaging.requestNotificationPermissions(); - verifyZeroInteractions(mockChannel); - }); - - test('requestNotificationPermissions on android', () { - firebaseMessaging = FirebaseMessaging.private( - mockChannel, FakePlatform(operatingSystem: 'android')); - - firebaseMessaging.requestNotificationPermissions(); - verifyZeroInteractions(mockChannel); - }); - - test('configure', () { - firebaseMessaging.configure(); - verify(mockChannel.setMethodCallHandler(any)); - verify(mockChannel.invokeMethod('configure')); - }); - - test('incoming token', () async { - firebaseMessaging.configure(); - final dynamic handler = - verify(mockChannel.setMethodCallHandler(captureAny)).captured.single; - final String token1 = 'I am a super secret token'; - final String token2 = 'I am the new token in town'; - Future tokenFromStream = firebaseMessaging.onTokenRefresh.first; - await handler(MethodCall('onToken', token1)); - - expect(await tokenFromStream, token1); - - tokenFromStream = firebaseMessaging.onTokenRefresh.first; - await handler(MethodCall('onToken', token2)); - - expect(await tokenFromStream, token2); - }); - - test('incoming iOS settings', () async { - firebaseMessaging.configure(); - final dynamic handler = - verify(mockChannel.setMethodCallHandler(captureAny)).captured.single; - IosNotificationSettings iosSettings = const IosNotificationSettings(); - - Future iosSettingsFromStream = - firebaseMessaging.onIosSettingsRegistered.first; - await handler(MethodCall('onIosSettingsRegistered', iosSettings.toMap())); - expect((await iosSettingsFromStream).toMap(), iosSettings.toMap()); - - iosSettings = const IosNotificationSettings(sound: false); - iosSettingsFromStream = firebaseMessaging.onIosSettingsRegistered.first; - await handler(MethodCall('onIosSettingsRegistered', iosSettings.toMap())); - expect((await iosSettingsFromStream).toMap(), iosSettings.toMap()); - }); - - test('incoming messages', () async { - final Completer onMessage = Completer(); - final Completer onLaunch = Completer(); - final Completer onResume = Completer(); - - firebaseMessaging.configure(onMessage: (dynamic m) async { - onMessage.complete(m); - }, onLaunch: (dynamic m) async { - onLaunch.complete(m); - }, onResume: (dynamic m) async { - onResume.complete(m); - }); - final dynamic handler = - verify(mockChannel.setMethodCallHandler(captureAny)).captured.single; - - final Map onMessageMessage = {}; - final Map onLaunchMessage = {}; - final Map onResumeMessage = {}; - - await handler(MethodCall('onMessage', onMessageMessage)); - expect(await onMessage.future, onMessageMessage); - expect(onLaunch.isCompleted, isFalse); - expect(onResume.isCompleted, isFalse); - - await handler(MethodCall('onLaunch', onLaunchMessage)); - expect(await onLaunch.future, onLaunchMessage); - expect(onResume.isCompleted, isFalse); - - await handler(MethodCall('onResume', onResumeMessage)); - expect(await onResume.future, onResumeMessage); - }); - - const String myTopic = 'Flutter'; - - test('subscribe to topic', () async { - await firebaseMessaging.subscribeToTopic(myTopic); - verify(mockChannel.invokeMethod('subscribeToTopic', myTopic)); - }); - - test('unsubscribe from topic', () async { - await firebaseMessaging.unsubscribeFromTopic(myTopic); - verify(mockChannel.invokeMethod('unsubscribeFromTopic', myTopic)); - }); - - test('getToken', () { - firebaseMessaging.getToken(); - verify(mockChannel.invokeMethod('getToken')); - }); - - test('deleteInstanceID', () { - firebaseMessaging.deleteInstanceID(); - verify(mockChannel.invokeMethod('deleteInstanceID')); - }); - - test('autoInitEnabled', () { - firebaseMessaging.autoInitEnabled(); - verify(mockChannel.invokeMethod('autoInitEnabled')); - }); - - test('setAutoInitEnabled', () { - // assert that we havent called the method yet - verifyNever(firebaseMessaging.setAutoInitEnabled(true)); - - firebaseMessaging.setAutoInitEnabled(true); - - verify(mockChannel.invokeMethod('setAutoInitEnabled', true)); - - // assert that enabled = false was not yet called - verifyNever(firebaseMessaging.setAutoInitEnabled(false)); - - firebaseMessaging.setAutoInitEnabled(false); - - verify(mockChannel.invokeMethod('setAutoInitEnabled', false)); - }); -} - -class MockMethodChannel extends Mock implements MethodChannel {} diff --git a/packages/firebase_ml_vision/.gitignore b/packages/firebase_ml_vision/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_ml_vision/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_ml_vision/CHANGELOG.md b/packages/firebase_ml_vision/CHANGELOG.md deleted file mode 100644 index b2fe1d37d699..000000000000 --- a/packages/firebase_ml_vision/CHANGELOG.md +++ /dev/null @@ -1,163 +0,0 @@ -## 0.9.2 - -* Add detection of `FaceContour`s when using the `FaceDetector`. See `README.md` for more information. - -## 0.9.1+1 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.9.1 - -* Add support for cloud text recognizer. - -## 0.9.0+3 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.9.0+2 - -* Fix bug causing memory leak with iOS images. - -## 0.9.0+1 - -* Update example app Podfile to match latest Flutter template and support new Xcode build system. - -## 0.9.0 - -* **Breaking Change** Add capability to release resources held by detectors with `close()` method. -You should now call `detector.close()` when a detector will no longer be used. - -## 0.8.0+3 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 0.8.0+2 - -* Fix crash when passing contact info from barcode. - -## 0.8.0+1 - -* Update the sample to use the new ImageStreamListener API introduced in https://github.com/flutter/flutter/pull/32936. - -## 0.8.0 - -* Update Android dependencies to latest. - -## 0.7.0+2 - -* Fix analyzer warnings about `const Rect` in tests. - -## 0.7.0+1 - -* Update README to match latest version. - -## 0.7.0 - -* **Breaking Change** Unified and enhanced on-device and cloud image-labeling API. - `iOS` now requires minimum deployment target of 9.0. Add `platform :ios, '9.0'` in your `Podfile`. - Updated to latest version of `Firebase/MLVision` on `iOS`. Please run `pod update` in directory containing your `iOS` project `Podfile`. - `Label` renamed to `ImageLabel`. - `LabelDetector` renamed to `ImageLabeler`. - Removed `CloudLabelDetector` and replaced it with a cloud `ImageLabeler`. - -## 0.6.0+2 - -* Update README.md -* Fix crash when receiving barcode urls on iOS. - -## 0.6.0+1 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.6.0 - -* **Breaking Change** Removed on-device model dependencies from plugin. - `Android` now requires adding the on-device label detector dependency manually. - `iOS` now requires adding the on-device barcode/face/label/text detector dependencies manually. - See the `README.md` for more details. https://pub.dartlang.org/packages/firebase_ml_vision#-readme-tab- - -## 0.5.1+2 - -* Fixes bug where image file needs to be rotated. - -## 0.5.1+1 - -* Remove categories. - -## 0.5.1 - -* iOS now handles non-planar buffers from `FirebaseVisionImage.fromBytes()`. - -## 0.5.0+1 - -* Fixes `FIRAnalyticsVersionMismatch` compilation error on iOS. Please run `pod update` in directory - containing `Podfile`. - -## 0.5.0 - -* **Breaking Change** Change `Rectangle` to `Rect` in Text/Face/Barcode results. -* **Breaking Change** Change `Point`/`Point` to `Offset` in Text/Face/Barcode results. - -* Fixed bug where there were no corner points for `VisionText` or `Barcode` on iOS. - -## 0.4.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.4.0 - -* **Breaking Change** Removal of base detector class `FirebaseVisionDetector`. -* **Breaking Change** Removal of `TextRecognizer.detectInImage()`. Please use - `TextRecognizer.processImage()`. -* **Breaking Change** Changed `FaceDetector.detectInImage()` to `FaceDetector.processImage()`. - -## 0.3.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.2.1 - -* Add capability to create image from bytes. - -## 0.2.0+2 - -* Fix bug with empty text object. -* Fix bug with crash from passing nil to map. - -## 0.2.0+1 - -Bump Android dependencies to latest. - -## 0.2.0 - -* **Breaking Change** Update TextDetector to TextRecognizer for android mlkit '17.0.0' and -firebase-ios-sdk '5.6.0'. -* Added CloudLabelDetector. - -## 0.1.2 - -* Fix example imports so that publishing will be warning-free. - -## 0.1.1 - -* Set pod version of Firebase/MLVision to avoid breaking changes. - -## 0.1.0 - -* **Breaking Change** Add Barcode, Face, and Label on-device detectors. -* Remove close method. - -## 0.0.2 - -* Bump Android and Firebase dependency versions. - -## 0.0.1 - -* Initial release with text detector. diff --git a/packages/firebase_ml_vision/LICENSE b/packages/firebase_ml_vision/LICENSE deleted file mode 100644 index 8940a4be1b58..000000000000 --- a/packages/firebase_ml_vision/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/firebase_ml_vision/README.md b/packages/firebase_ml_vision/README.md deleted file mode 100644 index be7e6578f3ab..000000000000 --- a/packages/firebase_ml_vision/README.md +++ /dev/null @@ -1,206 +0,0 @@ -# ML Kit Vision for Firebase - -[![pub package](https://img.shields.io/pub/v/firebase_ml_vision.svg)](https://pub.dartlang.org/packages/firebase_ml_vision) - -A Flutter plugin to use the [ML Kit Vision for Firebase API](https://firebase.google.com/docs/ml-kit/). - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -To use this plugin, add `firebase_ml_vision` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). You must also configure Firebase for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#4 for step by step details). - -### Android -If you're using the on-device `ImageLabeler`, include the latest matching [ML Kit: Image Labeling](https://firebase.google.com/support/release-notes/android) dependency in your app-level build.gradle file. - -```xml -android { - dependencies { - // ... - - api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' - } -} -``` - -If you're using the on-device `Face Contour Detection`, include the latest matching [ML Kit: Face Detection Model](https://firebase.google.com/support/release-notes/android) dependency in your app-level build.gradle file. - -``` -android { - dependencies { - // ... - - api 'com.google.firebase:firebase-ml-vision-face-model:17.0.2' - } -} -``` - -If you receive compilation errors, try an earlier version of [ML Kit: Image Labeling](https://firebase.google.com/support/release-notes/android). - -Optional but recommended: If you use the on-device API, configure your app to automatically download the ML model to the device after your app is installed from the Play Store. To do so, add the following declaration to your app's AndroidManifest.xml file: - -```xml - - ... - - - -``` - -### iOS -Versions `0.7.0+` use the latest ML Kit for Firebase version which requires a minimum deployment -target of 9.0. You can add the line `platform :ios, '9.0'` in your iOS project `Podfile`. - -If you're using one of the on-device APIs, include the corresponding ML Kit library model in your -`Podfile`. Then run `pod update` in a terminal within the same directory as your `Podfile`. - -``` -pod 'Firebase/MLVisionBarcodeModel' -pod 'Firebase/MLVisionFaceModel' -pod 'Firebase/MLVisionLabelModel' -pod 'Firebase/MLVisionTextModel' -``` - -## Using an ML Vision Detector - -### 1. Create a `FirebaseVisionImage`. - -Create a `FirebaseVisionImage` object from your image. To create a `FirebaseVisionImage` from an image `File` object: - -```dart -final File imageFile = getImageFile(); -final FirebaseVisionImage visionImage = FirebaseVisionImage.fromFile(imageFile); -``` - -### 2. Create an instance of a detector. - -Get an instance of a `FirebaseVisionDetector`. - -```dart -final BarcodeDetector barcodeDetector = FirebaseVision.instance.barcodeDetector(); -final ImageLabeler cloudLabeler = FirebaseVision.instance.cloudImageLabeler(); -final FaceDetector faceDetector = FirebaseVision.instance.faceDetector(); -final ImageLabeler labeler = FirebaseVision.instance.imageLabeler(); -final TextRecognizer textRecognizer = FirebaseVision.instance.textRecognizer(); -``` - -You can also configure all detectors, except `TextRecognizer`, with desired options. - -```dart -final ImageLabeler labeler = FirebaseVision.instance.imageLabler( - ImageLabelerOptions(confidenceThreshold: 0.75), -); -``` - -### 3. Call `detectInImage()` or `processImage()` with `visionImage`. - -```dart -final List barcodes = await barcodeDetector.detectInImage(visionImage); -final List cloudLabels = await cloudLabeler.processImage(visionImage); -final List faces = await faceDetector.processImage(visionImage); -final List labels = await labeler.processImage(visionImage); -final VisionText visionText = await textRecognizer.processImage(visionImage); -``` - -### 4. Extract data. - -a. Extract barcodes. - -```dart -for (Barcode barcode in barcodes) { - final Rectangle boundingBox = barcode.boundingBox; - final List> cornerPoints = barcode.cornerPoints; - - final String rawValue = barcode.rawValue; - - final BarcodeValueType valueType = barcode.valueType; - - // See API reference for complete list of supported types - switch (valueType) { - case BarcodeValueType.wifi: - final String ssid = barcode.wifi.ssid; - final String password = barcode.wifi.password; - final BarcodeWiFiEncryptionType type = barcode.wifi.encryptionType; - break; - case BarcodeValueType.url: - final String title = barcode.url.title; - final String url = barcode.url.url; - break; - } -} -``` - -b. Extract faces. - -```dart -for (Face face in faces) { - final Rectangle boundingBox = face.boundingBox; - - final double rotY = face.headEulerAngleY; // Head is rotated to the right rotY degrees - final double rotZ = face.headEulerAngleZ; // Head is tilted sideways rotZ degrees - - // If landmark detection was enabled with FaceDetectorOptions (mouth, ears, - // eyes, cheeks, and nose available): - final FaceLandmark leftEar = face.getLandmark(FaceLandmarkType.leftEar); - if (leftEar != null) { - final Point leftEarPos = leftEar.position; - } - - // If classification was enabled with FaceDetectorOptions: - if (face.smilingProbability != null) { - final double smileProb = face.smilingProbability; - } - - // If face tracking was enabled with FaceDetectorOptions: - if (face.trackingId != null) { - final int id = face.trackingId; - } -} -``` - -c. Extract labels. - -```dart -for (ImageLabel label in labels) { - final String text = label.text; - final String entityId = label.entityId; - final double confidence = label.confidence; -} -``` - -d. Extract text. - -```dart -String text = visionText.text; -for (TextBlock block in visionText.blocks) { - final Rect boundingBox = block.boundingBox; - final List cornerPoints = block.cornerPoints; - final String text = block.text; - final List languages = block.recognizedLanguages; - - for (TextLine line in block.lines) { - // Same getters as TextBlock - for (TextElement element in line.elements) { - // Same getters as TextBlock - } - } -} -``` - -### 5. Release resources with `close()`. - -```dart -barcodeDetector.close(); -cloudLabeler.close(); -faceDetector.close(); -labeler.close(); -textRecognizer.close(); -``` - -## Getting Started - -See the `example` directory for a complete sample app using ML Kit Vision for Firebase. diff --git a/packages/firebase_ml_vision/android/build.gradle b/packages/firebase_ml_vision/android/build.gradle deleted file mode 100644 index a484f14df0c7..000000000000 --- a/packages/firebase_ml_vision/android/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -def PLUGIN = "firebase_ml_vision"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebasemlvision' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-ml-vision:20.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - implementation 'androidx.exifinterface:exifinterface:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_ml_vision/android/gradle.properties b/packages/firebase_ml_vision/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_ml_vision/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_ml_vision/android/settings.gradle b/packages/firebase_ml_vision/android/settings.gradle deleted file mode 100644 index 66876748f77c..000000000000 --- a/packages/firebase_ml_vision/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_ml_vision' diff --git a/packages/firebase_ml_vision/android/src/main/AndroidManifest.xml b/packages/firebase_ml_vision/android/src/main/AndroidManifest.xml deleted file mode 100644 index fa9ed7054b9e..000000000000 --- a/packages/firebase_ml_vision/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/BarcodeDetector.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/BarcodeDetector.java deleted file mode 100644 index 899b09cb4653..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/BarcodeDetector.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import android.graphics.Point; -import android.graphics.Rect; -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.firebase.ml.vision.FirebaseVision; -import com.google.firebase.ml.vision.barcode.FirebaseVisionBarcode; -import com.google.firebase.ml.vision.barcode.FirebaseVisionBarcodeDetector; -import com.google.firebase.ml.vision.barcode.FirebaseVisionBarcodeDetectorOptions; -import com.google.firebase.ml.vision.common.FirebaseVisionImage; -import io.flutter.plugin.common.MethodChannel; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -class BarcodeDetector implements Detector { - private final FirebaseVisionBarcodeDetector detector; - - BarcodeDetector(FirebaseVision vision, Map options) { - detector = vision.getVisionBarcodeDetector(parseOptions(options)); - } - - @Override - public void handleDetection(final FirebaseVisionImage image, final MethodChannel.Result result) { - detector - .detectInImage(image) - .addOnSuccessListener( - new OnSuccessListener>() { - @Override - public void onSuccess(List firebaseVisionBarcodes) { - List> barcodes = new ArrayList<>(); - - for (FirebaseVisionBarcode barcode : firebaseVisionBarcodes) { - Map barcodeMap = new HashMap<>(); - - Rect bounds = barcode.getBoundingBox(); - if (bounds != null) { - barcodeMap.put("left", (double) bounds.left); - barcodeMap.put("top", (double) bounds.top); - barcodeMap.put("width", (double) bounds.width()); - barcodeMap.put("height", (double) bounds.height()); - } - - List points = new ArrayList<>(); - if (barcode.getCornerPoints() != null) { - for (Point point : barcode.getCornerPoints()) { - points.add(new double[] {(double) point.x, (double) point.y}); - } - } - barcodeMap.put("points", points); - - barcodeMap.put("rawValue", barcode.getRawValue()); - barcodeMap.put("displayValue", barcode.getDisplayValue()); - barcodeMap.put("format", barcode.getFormat()); - barcodeMap.put("valueType", barcode.getValueType()); - - Map typeValue = new HashMap<>(); - switch (barcode.getValueType()) { - case FirebaseVisionBarcode.TYPE_EMAIL: - FirebaseVisionBarcode.Email email = barcode.getEmail(); - - typeValue.put("type", email.getType()); - typeValue.put("address", email.getAddress()); - typeValue.put("body", email.getBody()); - typeValue.put("subject", email.getSubject()); - - barcodeMap.put("email", typeValue); - break; - case FirebaseVisionBarcode.TYPE_PHONE: - FirebaseVisionBarcode.Phone phone = barcode.getPhone(); - - typeValue.put("number", phone.getNumber()); - typeValue.put("type", phone.getType()); - - barcodeMap.put("phone", typeValue); - break; - case FirebaseVisionBarcode.TYPE_SMS: - FirebaseVisionBarcode.Sms sms = barcode.getSms(); - - typeValue.put("message", sms.getMessage()); - typeValue.put("phoneNumber", sms.getPhoneNumber()); - - barcodeMap.put("sms", typeValue); - break; - case FirebaseVisionBarcode.TYPE_URL: - FirebaseVisionBarcode.UrlBookmark urlBookmark = barcode.getUrl(); - - typeValue.put("title", urlBookmark.getTitle()); - typeValue.put("url", urlBookmark.getUrl()); - - barcodeMap.put("url", typeValue); - break; - case FirebaseVisionBarcode.TYPE_WIFI: - FirebaseVisionBarcode.WiFi wifi = barcode.getWifi(); - - typeValue.put("ssid", wifi.getSsid()); - typeValue.put("password", wifi.getPassword()); - typeValue.put("encryptionType", wifi.getEncryptionType()); - - barcodeMap.put("wifi", typeValue); - break; - case FirebaseVisionBarcode.TYPE_GEO: - FirebaseVisionBarcode.GeoPoint geoPoint = barcode.getGeoPoint(); - - typeValue.put("latitude", geoPoint.getLat()); - typeValue.put("longitude", geoPoint.getLng()); - - barcodeMap.put("geoPoint", typeValue); - break; - case FirebaseVisionBarcode.TYPE_CONTACT_INFO: - FirebaseVisionBarcode.ContactInfo contactInfo = barcode.getContactInfo(); - - List> addresses = new ArrayList<>(); - for (FirebaseVisionBarcode.Address address : contactInfo.getAddresses()) { - Map addressMap = new HashMap<>(); - if (address.getAddressLines() != null) { - addressMap.put("addressLines", Arrays.asList(address.getAddressLines())); - } - addressMap.put("type", address.getType()); - - addresses.add(addressMap); - } - typeValue.put("addresses", addresses); - - List> emails = new ArrayList<>(); - for (FirebaseVisionBarcode.Email contactEmail : contactInfo.getEmails()) { - Map emailMap = new HashMap<>(); - emailMap.put("address", contactEmail.getAddress()); - emailMap.put("type", contactEmail.getType()); - emailMap.put("body", contactEmail.getBody()); - emailMap.put("subject", contactEmail.getSubject()); - - emails.add(emailMap); - } - typeValue.put("emails", emails); - - Map nameMap = new HashMap<>(); - FirebaseVisionBarcode.PersonName name = contactInfo.getName(); - if (name != null) { - nameMap.put("formattedName", name.getFormattedName()); - nameMap.put("first", name.getFirst()); - nameMap.put("last", name.getLast()); - nameMap.put("middle", name.getMiddle()); - nameMap.put("prefix", name.getPrefix()); - nameMap.put("pronunciation", name.getPronunciation()); - nameMap.put("suffix", name.getSuffix()); - } - typeValue.put("name", nameMap); - - List> phones = new ArrayList<>(); - for (FirebaseVisionBarcode.Phone contactPhone : contactInfo.getPhones()) { - Map phoneMap = new HashMap<>(); - phoneMap.put("number", contactPhone.getNumber()); - phoneMap.put("type", contactPhone.getType()); - - phones.add(phoneMap); - } - typeValue.put("phones", phones); - - if (contactInfo.getUrls() != null) { - typeValue.put("urls", Arrays.asList(contactInfo.getUrls())); - } - typeValue.put("jobTitle", contactInfo.getTitle()); - typeValue.put("organization", contactInfo.getOrganization()); - - barcodeMap.put("contactInfo", typeValue); - break; - case FirebaseVisionBarcode.TYPE_CALENDAR_EVENT: - FirebaseVisionBarcode.CalendarEvent calendarEvent = - barcode.getCalendarEvent(); - - typeValue.put("eventDescription", calendarEvent.getDescription()); - typeValue.put("location", calendarEvent.getLocation()); - typeValue.put("organizer", calendarEvent.getOrganizer()); - typeValue.put("status", calendarEvent.getStatus()); - typeValue.put("summary", calendarEvent.getSummary()); - if (calendarEvent.getStart() != null) { - typeValue.put("start", calendarEvent.getStart().getRawValue()); - } - if (calendarEvent.getEnd() != null) { - typeValue.put("end", calendarEvent.getEnd().getRawValue()); - } - - barcodeMap.put("calendarEvent", typeValue); - break; - case FirebaseVisionBarcode.TYPE_DRIVER_LICENSE: - FirebaseVisionBarcode.DriverLicense driverLicense = - barcode.getDriverLicense(); - - typeValue.put("firstName", driverLicense.getFirstName()); - typeValue.put("middleName", driverLicense.getMiddleName()); - typeValue.put("lastName", driverLicense.getLastName()); - typeValue.put("gender", driverLicense.getGender()); - typeValue.put("addressCity", driverLicense.getAddressCity()); - typeValue.put("addressStreet", driverLicense.getAddressStreet()); - typeValue.put("addressState", driverLicense.getAddressState()); - typeValue.put("addressZip", driverLicense.getAddressZip()); - typeValue.put("birthDate", driverLicense.getBirthDate()); - typeValue.put("documentType", driverLicense.getDocumentType()); - typeValue.put("licenseNumber", driverLicense.getLicenseNumber()); - typeValue.put("expiryDate", driverLicense.getExpiryDate()); - typeValue.put("issuingDate", driverLicense.getIssueDate()); - typeValue.put("issuingCountry", driverLicense.getIssuingCountry()); - - barcodeMap.put("driverLicense", typeValue); - break; - } - - barcodes.add(barcodeMap); - } - result.success(barcodes); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception exception) { - result.error("barcodeDetectorError", exception.getLocalizedMessage(), null); - } - }); - } - - private FirebaseVisionBarcodeDetectorOptions parseOptions(Map optionsData) { - Integer barcodeFormats = (Integer) optionsData.get("barcodeFormats"); - return new FirebaseVisionBarcodeDetectorOptions.Builder() - .setBarcodeFormats(barcodeFormats) - .build(); - } - - @Override - public void close() throws IOException { - detector.close(); - } -} diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/Detector.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/Detector.java deleted file mode 100644 index b65efa41f444..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/Detector.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import com.google.firebase.ml.vision.common.FirebaseVisionImage; -import io.flutter.plugin.common.MethodChannel; -import java.io.IOException; - -public interface Detector { - void handleDetection(final FirebaseVisionImage image, final MethodChannel.Result result); - - void close() throws IOException; -} diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FaceDetector.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FaceDetector.java deleted file mode 100644 index 9af31c6973d6..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FaceDetector.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.firebase.ml.vision.FirebaseVision; -import com.google.firebase.ml.vision.common.FirebaseVisionImage; -import com.google.firebase.ml.vision.common.FirebaseVisionPoint; -import com.google.firebase.ml.vision.face.FirebaseVisionFace; -import com.google.firebase.ml.vision.face.FirebaseVisionFaceContour; -import com.google.firebase.ml.vision.face.FirebaseVisionFaceDetector; -import com.google.firebase.ml.vision.face.FirebaseVisionFaceDetectorOptions; -import com.google.firebase.ml.vision.face.FirebaseVisionFaceLandmark; -import io.flutter.plugin.common.MethodChannel; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -class FaceDetector implements Detector { - private final FirebaseVisionFaceDetector detector; - - FaceDetector(FirebaseVision vision, Map options) { - detector = vision.getVisionFaceDetector(parseOptions(options)); - } - - @Override - public void handleDetection(final FirebaseVisionImage image, final MethodChannel.Result result) { - detector - .detectInImage(image) - .addOnSuccessListener( - new OnSuccessListener>() { - @Override - public void onSuccess(List firebaseVisionFaces) { - List> faces = new ArrayList<>(firebaseVisionFaces.size()); - for (FirebaseVisionFace face : firebaseVisionFaces) { - Map faceData = new HashMap<>(); - - faceData.put("left", (double) face.getBoundingBox().left); - faceData.put("top", (double) face.getBoundingBox().top); - faceData.put("width", (double) face.getBoundingBox().width()); - faceData.put("height", (double) face.getBoundingBox().height()); - - faceData.put("headEulerAngleY", face.getHeadEulerAngleY()); - faceData.put("headEulerAngleZ", face.getHeadEulerAngleZ()); - - if (face.getSmilingProbability() != FirebaseVisionFace.UNCOMPUTED_PROBABILITY) { - faceData.put("smilingProbability", face.getSmilingProbability()); - } - - if (face.getLeftEyeOpenProbability() - != FirebaseVisionFace.UNCOMPUTED_PROBABILITY) { - faceData.put("leftEyeOpenProbability", face.getLeftEyeOpenProbability()); - } - - if (face.getRightEyeOpenProbability() - != FirebaseVisionFace.UNCOMPUTED_PROBABILITY) { - faceData.put("rightEyeOpenProbability", face.getRightEyeOpenProbability()); - } - - if (face.getTrackingId() != FirebaseVisionFace.INVALID_ID) { - faceData.put("trackingId", face.getTrackingId()); - } - - faceData.put("landmarks", getLandmarkData(face)); - - faceData.put("contours", getContourData(face)); - - faces.add(faceData); - } - - result.success(faces); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception exception) { - result.error("faceDetectorError", exception.getLocalizedMessage(), null); - } - }); - } - - private Map getLandmarkData(FirebaseVisionFace face) { - Map landmarks = new HashMap<>(); - - landmarks.put("bottomMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.MOUTH_BOTTOM)); - landmarks.put("leftCheek", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_CHEEK)); - landmarks.put("leftEar", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_EAR)); - landmarks.put("leftEye", landmarkPosition(face, FirebaseVisionFaceLandmark.LEFT_EYE)); - landmarks.put("leftMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.MOUTH_LEFT)); - landmarks.put("noseBase", landmarkPosition(face, FirebaseVisionFaceLandmark.NOSE_BASE)); - landmarks.put("rightCheek", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_CHEEK)); - landmarks.put("rightEar", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_EAR)); - landmarks.put("rightEye", landmarkPosition(face, FirebaseVisionFaceLandmark.RIGHT_EYE)); - landmarks.put("rightMouth", landmarkPosition(face, FirebaseVisionFaceLandmark.MOUTH_RIGHT)); - - return landmarks; - } - - private Map> getContourData(FirebaseVisionFace face) { - Map> contours = new HashMap<>(); - - contours.put("allPoints", contourPosition(face, FirebaseVisionFaceContour.ALL_POINTS)); - contours.put("face", contourPosition(face, FirebaseVisionFaceContour.FACE)); - contours.put("leftEye", contourPosition(face, FirebaseVisionFaceContour.LEFT_EYE)); - contours.put( - "leftEyebrowBottom", contourPosition(face, FirebaseVisionFaceContour.LEFT_EYEBROW_BOTTOM)); - contours.put( - "leftEyebrowTop", contourPosition(face, FirebaseVisionFaceContour.LEFT_EYEBROW_TOP)); - contours.put( - "lowerLipBottom", contourPosition(face, FirebaseVisionFaceContour.LOWER_LIP_BOTTOM)); - contours.put("lowerLipTop", contourPosition(face, FirebaseVisionFaceContour.LOWER_LIP_TOP)); - contours.put("noseBottom", contourPosition(face, FirebaseVisionFaceContour.NOSE_BOTTOM)); - contours.put("noseBridge", contourPosition(face, FirebaseVisionFaceContour.NOSE_BRIDGE)); - contours.put("rightEye", contourPosition(face, FirebaseVisionFaceContour.RIGHT_EYE)); - contours.put( - "rightEyebrowBottom", - contourPosition(face, FirebaseVisionFaceContour.RIGHT_EYEBROW_BOTTOM)); - contours.put( - "rightEyebrowTop", contourPosition(face, FirebaseVisionFaceContour.RIGHT_EYEBROW_TOP)); - contours.put( - "upperLipBottom", contourPosition(face, FirebaseVisionFaceContour.UPPER_LIP_BOTTOM)); - contours.put("upperLipTop", contourPosition(face, FirebaseVisionFaceContour.UPPER_LIP_TOP)); - - return contours; - } - - private double[] landmarkPosition(FirebaseVisionFace face, int landmarkInt) { - FirebaseVisionFaceLandmark landmark = face.getLandmark(landmarkInt); - if (landmark != null) { - return new double[] {landmark.getPosition().getX(), landmark.getPosition().getY()}; - } - - return null; - } - - private List contourPosition(FirebaseVisionFace face, int contourInt) { - FirebaseVisionFaceContour contour = face.getContour(contourInt); - if (contour != null) { - List contourPoints = contour.getPoints(); - List result = new ArrayList(); - - for (int i = 0; i < contourPoints.size(); i++) { - result.add(new double[] {contourPoints.get(i).getX(), contourPoints.get(i).getY()}); - } - - return result; - } - - return null; - } - - private FirebaseVisionFaceDetectorOptions parseOptions(Map options) { - int classification = - (boolean) options.get("enableClassification") - ? FirebaseVisionFaceDetectorOptions.ALL_CLASSIFICATIONS - : FirebaseVisionFaceDetectorOptions.NO_CLASSIFICATIONS; - - int landmark = - (boolean) options.get("enableLandmarks") - ? FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS - : FirebaseVisionFaceDetectorOptions.NO_LANDMARKS; - - int contours = - (boolean) options.get("enableContours") - ? FirebaseVisionFaceDetectorOptions.ALL_CONTOURS - : FirebaseVisionFaceDetectorOptions.NO_CONTOURS; - - int mode; - switch ((String) options.get("mode")) { - case "accurate": - mode = FirebaseVisionFaceDetectorOptions.ACCURATE; - break; - case "fast": - mode = FirebaseVisionFaceDetectorOptions.FAST; - break; - default: - throw new IllegalArgumentException("Not a mode:" + options.get("mode")); - } - - FirebaseVisionFaceDetectorOptions.Builder builder = - new FirebaseVisionFaceDetectorOptions.Builder() - .setClassificationMode(classification) - .setLandmarkMode(landmark) - .setContourMode(contours) - .setMinFaceSize((float) ((double) options.get("minFaceSize"))) - .setPerformanceMode(mode); - - if ((boolean) options.get("enableTracking")) { - builder.enableTracking(); - } - - return builder.build(); - } - - @Override - public void close() throws IOException { - detector.close(); - } -} diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FirebaseMlVisionPlugin.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FirebaseMlVisionPlugin.java deleted file mode 100644 index a36cf4f7acb9..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FirebaseMlVisionPlugin.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Matrix; -import android.net.Uri; -import android.util.SparseArray; -import androidx.exifinterface.media.ExifInterface; -import com.google.firebase.ml.vision.FirebaseVision; -import com.google.firebase.ml.vision.common.FirebaseVisionImage; -import com.google.firebase.ml.vision.common.FirebaseVisionImageMetadata; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.io.File; -import java.io.IOException; -import java.util.Map; - -/** FirebaseMlVisionPlugin */ -public class FirebaseMlVisionPlugin implements MethodCallHandler { - private final SparseArray detectors = new SparseArray<>(); - - private Registrar registrar; - - private FirebaseMlVisionPlugin(Registrar registrar) { - this.registrar = registrar; - } - - /** Plugin registration. */ - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_ml_vision"); - channel.setMethodCallHandler(new FirebaseMlVisionPlugin(registrar)); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - switch (call.method) { - case "BarcodeDetector#detectInImage": - case "FaceDetector#processImage": - case "ImageLabeler#processImage": - case "TextRecognizer#processImage": - handleDetection(call, result); - break; - case "BarcodeDetector#close": - case "FaceDetector#close": - case "ImageLabeler#close": - case "TextRecognizer#close": - closeDetector(call, result); - break; - default: - result.notImplemented(); - } - } - - private void handleDetection(MethodCall call, Result result) { - Map options = call.argument("options"); - - FirebaseVisionImage image; - Map imageData = call.arguments(); - try { - image = dataToVisionImage(imageData); - } catch (IOException exception) { - result.error("MLVisionDetectorIOError", exception.getLocalizedMessage(), null); - return; - } - - Detector detector = getDetector(call); - if (detector == null) { - switch (call.method.split("#")[0]) { - case "BarcodeDetector": - detector = new BarcodeDetector(FirebaseVision.getInstance(), options); - break; - case "FaceDetector": - detector = new FaceDetector(FirebaseVision.getInstance(), options); - break; - case "ImageLabeler": - detector = new ImageLabeler(FirebaseVision.getInstance(), options); - break; - case "TextRecognizer": - detector = new TextRecognizer(FirebaseVision.getInstance(), options); - break; - } - - final Integer handle = call.argument("handle"); - addDetector(handle, detector); - } - - detector.handleDetection(image, result); - } - - private void closeDetector(final MethodCall call, final Result result) { - final Detector detector = getDetector(call); - - if (detector == null) { - final Integer handle = call.argument("handle"); - final String message = String.format("Object for handle does not exists: %s", handle); - throw new IllegalArgumentException(message); - } - - try { - detector.close(); - result.success(null); - } catch (IOException e) { - final String code = String.format("%sIOError", detector.getClass().getSimpleName()); - result.error(code, e.getLocalizedMessage(), null); - } finally { - final Integer handle = call.argument("handle"); - detectors.remove(handle); - } - } - - private FirebaseVisionImage dataToVisionImage(Map imageData) throws IOException { - String imageType = (String) imageData.get("type"); - assert imageType != null; - - switch (imageType) { - case "file": - final String imageFilePath = (String) imageData.get("path"); - final int rotation = getImageExifOrientation(imageFilePath); - - if (rotation == 0) { - File file = new File(imageFilePath); - return FirebaseVisionImage.fromFilePath(registrar.context(), Uri.fromFile(file)); - } - - Matrix matrix = new Matrix(); - matrix.postRotate(rotation); - - final Bitmap bitmap = BitmapFactory.decodeFile(imageFilePath); - final Bitmap rotatedBitmap = - Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); - - return FirebaseVisionImage.fromBitmap(rotatedBitmap); - case "bytes": - @SuppressWarnings("unchecked") - Map metadataData = (Map) imageData.get("metadata"); - - FirebaseVisionImageMetadata metadata = - new FirebaseVisionImageMetadata.Builder() - .setWidth((int) (double) metadataData.get("width")) - .setHeight((int) (double) metadataData.get("height")) - .setFormat(FirebaseVisionImageMetadata.IMAGE_FORMAT_NV21) - .setRotation(getRotation((int) metadataData.get("rotation"))) - .build(); - - byte[] bytes = (byte[]) imageData.get("bytes"); - assert bytes != null; - - return FirebaseVisionImage.fromByteArray(bytes, metadata); - default: - throw new IllegalArgumentException(String.format("No image type for: %s", imageType)); - } - } - - private int getImageExifOrientation(String imageFilePath) throws IOException { - ExifInterface exif = new ExifInterface(imageFilePath); - int orientation = - exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); - - switch (orientation) { - case ExifInterface.ORIENTATION_ROTATE_90: - return 90; - case ExifInterface.ORIENTATION_ROTATE_180: - return 180; - case ExifInterface.ORIENTATION_ROTATE_270: - return 270; - default: - return 0; - } - } - - private int getRotation(int rotation) { - switch (rotation) { - case 0: - return FirebaseVisionImageMetadata.ROTATION_0; - case 90: - return FirebaseVisionImageMetadata.ROTATION_90; - case 180: - return FirebaseVisionImageMetadata.ROTATION_180; - case 270: - return FirebaseVisionImageMetadata.ROTATION_270; - default: - throw new IllegalArgumentException(String.format("No rotation for: %d", rotation)); - } - } - - private void addDetector(final int handle, final Detector detector) { - if (detectors.get(handle) != null) { - final String message = String.format("Object for handle already exists: %s", handle); - throw new IllegalArgumentException(message); - } - - detectors.put(handle, detector); - } - - private Detector getDetector(final MethodCall call) { - final Integer handle = call.argument("handle"); - return detectors.get(handle); - } -} diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FlutterFirebaseAppRegistrar.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 14d4accca3dd..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/ImageLabeler.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/ImageLabeler.java deleted file mode 100644 index 99899402c037..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/ImageLabeler.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.firebase.ml.vision.FirebaseVision; -import com.google.firebase.ml.vision.common.FirebaseVisionImage; -import com.google.firebase.ml.vision.label.FirebaseVisionCloudImageLabelerOptions; -import com.google.firebase.ml.vision.label.FirebaseVisionImageLabel; -import com.google.firebase.ml.vision.label.FirebaseVisionImageLabeler; -import com.google.firebase.ml.vision.label.FirebaseVisionOnDeviceImageLabelerOptions; -import io.flutter.plugin.common.MethodChannel; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -class ImageLabeler implements Detector { - private final FirebaseVisionImageLabeler labeler; - - ImageLabeler(FirebaseVision vision, Map options) { - final String modelType = (String) options.get("modelType"); - if (modelType.equals("onDevice")) { - labeler = vision.getOnDeviceImageLabeler(parseOptions(options)); - } else if (modelType.equals("cloud")) { - labeler = vision.getCloudImageLabeler(parseCloudOptions(options)); - } else { - final String message = String.format("No model for type: %s", modelType); - throw new IllegalArgumentException(message); - } - } - - @Override - public void handleDetection(final FirebaseVisionImage image, final MethodChannel.Result result) { - labeler - .processImage(image) - .addOnSuccessListener( - new OnSuccessListener>() { - @Override - public void onSuccess(List firebaseVisionLabels) { - List> labels = new ArrayList<>(firebaseVisionLabels.size()); - for (FirebaseVisionImageLabel label : firebaseVisionLabels) { - Map labelData = new HashMap<>(); - labelData.put("confidence", (double) label.getConfidence()); - labelData.put("entityId", label.getEntityId()); - labelData.put("text", label.getText()); - - labels.add(labelData); - } - - result.success(labels); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("imageLabelerError", e.getLocalizedMessage(), null); - } - }); - } - - private FirebaseVisionOnDeviceImageLabelerOptions parseOptions(Map optionsData) { - float conf = (float) (double) optionsData.get("confidenceThreshold"); - return new FirebaseVisionOnDeviceImageLabelerOptions.Builder() - .setConfidenceThreshold(conf) - .build(); - } - - private FirebaseVisionCloudImageLabelerOptions parseCloudOptions( - Map optionsData) { - float conf = (float) (double) optionsData.get("confidenceThreshold"); - return new FirebaseVisionCloudImageLabelerOptions.Builder() - .setConfidenceThreshold(conf) - .build(); - } - - @Override - public void close() throws IOException { - labeler.close(); - } -} diff --git a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/TextRecognizer.java b/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/TextRecognizer.java deleted file mode 100644 index 29ee31975626..000000000000 --- a/packages/firebase_ml_vision/android/src/main/java/io/flutter/plugins/firebasemlvision/TextRecognizer.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasemlvision; - -import android.graphics.Point; -import android.graphics.Rect; -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.firebase.ml.vision.FirebaseVision; -import com.google.firebase.ml.vision.common.FirebaseVisionImage; -import com.google.firebase.ml.vision.text.FirebaseVisionText; -import com.google.firebase.ml.vision.text.FirebaseVisionTextRecognizer; -import com.google.firebase.ml.vision.text.RecognizedLanguage; -import io.flutter.plugin.common.MethodChannel; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class TextRecognizer implements Detector { - private final FirebaseVisionTextRecognizer recognizer; - - TextRecognizer(FirebaseVision vision, Map options) { - final String modelType = (String) options.get("modelType"); - if (modelType.equals("onDevice")) { - recognizer = vision.getOnDeviceTextRecognizer(); - } else if (modelType.equals("cloud")) { - recognizer = vision.getCloudTextRecognizer(); - } else { - final String message = String.format("No model for type: %s", modelType); - throw new IllegalArgumentException(message); - } - } - - @Override - public void handleDetection(final FirebaseVisionImage image, final MethodChannel.Result result) { - recognizer - .processImage(image) - .addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(FirebaseVisionText firebaseVisionText) { - Map visionTextData = new HashMap<>(); - visionTextData.put("text", firebaseVisionText.getText()); - - List> allBlockData = new ArrayList<>(); - for (FirebaseVisionText.TextBlock block : firebaseVisionText.getTextBlocks()) { - Map blockData = new HashMap<>(); - addData( - blockData, - block.getBoundingBox(), - block.getConfidence(), - block.getCornerPoints(), - block.getRecognizedLanguages(), - block.getText()); - - List> allLineData = new ArrayList<>(); - for (FirebaseVisionText.Line line : block.getLines()) { - Map lineData = new HashMap<>(); - addData( - lineData, - line.getBoundingBox(), - line.getConfidence(), - line.getCornerPoints(), - line.getRecognizedLanguages(), - line.getText()); - - List> allElementData = new ArrayList<>(); - for (FirebaseVisionText.Element element : line.getElements()) { - Map elementData = new HashMap<>(); - addData( - elementData, - element.getBoundingBox(), - element.getConfidence(), - element.getCornerPoints(), - element.getRecognizedLanguages(), - element.getText()); - - allElementData.add(elementData); - } - lineData.put("elements", allElementData); - allLineData.add(lineData); - } - blockData.put("lines", allLineData); - allBlockData.add(blockData); - } - - visionTextData.put("blocks", allBlockData); - result.success(visionTextData); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception exception) { - result.error("textRecognizerError", exception.getLocalizedMessage(), null); - } - }); - } - - private void addData( - Map addTo, - Rect boundingBox, - Float confidence, - Point[] cornerPoints, - List languages, - String text) { - - if (boundingBox != null) { - addTo.put("left", (double) boundingBox.left); - addTo.put("top", (double) boundingBox.top); - addTo.put("width", (double) boundingBox.width()); - addTo.put("height", (double) boundingBox.height()); - } - - addTo.put("confidence", confidence == null ? null : (double) confidence); - - List points = new ArrayList<>(); - if (cornerPoints != null) { - for (Point point : cornerPoints) { - points.add(new double[] {(double) point.x, (double) point.y}); - } - } - addTo.put("points", points); - - List> allLanguageData = new ArrayList<>(); - for (RecognizedLanguage language : languages) { - Map languageData = new HashMap<>(); - languageData.put("languageCode", language.getLanguageCode()); - allLanguageData.add(languageData); - } - addTo.put("recognizedLanguages", allLanguageData); - - addTo.put("text", text); - } - - @Override - public void close() throws IOException { - recognizer.close(); - } -} diff --git a/packages/firebase_ml_vision/android/user-agent.gradle b/packages/firebase_ml_vision/android/user-agent.gradle deleted file mode 100644 index 83d39fc0af02..000000000000 --- a/packages/firebase_ml_vision/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-ml-vis" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_ml_vision/example/.metadata b/packages/firebase_ml_vision/example/.metadata deleted file mode 100644 index 9ce49c5dcc70..000000000000 --- a/packages/firebase_ml_vision/example/.metadata +++ /dev/null @@ -1,8 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: d454629a0646fcbd0f5a8d61998d0ea801d52909 - channel: master diff --git a/packages/firebase_ml_vision/example/README.md b/packages/firebase_ml_vision/example/README.md deleted file mode 100644 index 51e02d473c69..000000000000 --- a/packages/firebase_ml_vision/example/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# firebase_ml_vision_example - -Demonstrates how to use the firebase_ml_vision plugin. - -## Usage - -*Important* If using on-device detectors on `iOS`, see the plugin -[README.md](https://github.com/flutter/plugins/blob/master/packages/firebase_ml_vision/README.md) on including -ML Model pods into the example project. - -This example uses the *image_picker* plugin to get images from the device gallery. If using an iOS -device you will have to configure you project with the correct permissions seen under iOS -configuration [here.](https://pub.dartlang.org/packages/image_picker). - -## Getting Started - -For help getting started with Flutter, view our online -[documentation.](https://flutter.io/) diff --git a/packages/firebase_ml_vision/example/android/app/build.gradle b/packages/firebase_ml_vision/example/android/app/build.gradle deleted file mode 100644 index edd72b27f848..000000000000 --- a/packages/firebase_ml_vision/example/android/app/build.gradle +++ /dev/null @@ -1,59 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebasemlvisionexample" - minSdkVersion 21 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - signingConfig signingConfigs.debug - } - } - - dependencies { - api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' - api 'com.google.firebase:firebase-ml-vision-face-model:17.0.2' - } -} - -flutter { - source '../..' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_ml_vision/example/android/app/google-services.json b/packages/firebase_ml_vision/example/android/app/google-services.json deleted file mode 100644 index 91e7b73c106c..000000000000 --- a/packages/firebase_ml_vision/example/android/app/google-services.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "project_info": { - "project_number": "479882132969", - "firebase_url": "https://my-flutter-proj.firebaseio.com", - "project_id": "my-flutter-proj", - "storage_bucket": "my-flutter-proj.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:479882132969:android:632cdf3fc0a17139", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasedynamiclinksexample" - } - }, - "oauth_client": [ - { - "client_id": "479882132969-32qusitiag53931ck80h121ajhlc5a7e.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebasedynamiclinksexample", - "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "479882132969-pn2ancg65o0e7r5ikte1qiciuvdghqf9.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.google.FirebaseCppDynamicLinksTestApp.dev", - "app_store_id": "1009116743" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:479882132969:android:ae50362b4bc06086", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasemlvisionexample" - } - }, - "oauth_client": [ - { - "client_id": "479882132969-9pp74fkgmtvt47t9rikc1p861v7n85tn.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebasemlvisionexample", - "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "479882132969-pn2ancg65o0e7r5ikte1qiciuvdghqf9.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.google.FirebaseCppDynamicLinksTestApp.dev", - "app_store_id": "1009116743" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:479882132969:android:215a22700e1b466b", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseperformanceexample" - } - }, - "oauth_client": [ - { - "client_id": "479882132969-8h4kiv8m7ho4tvn6uuujsfcrf69unuf7.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseperformanceexample", - "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "479882132969-pn2ancg65o0e7r5ikte1qiciuvdghqf9.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.google.FirebaseCppDynamicLinksTestApp.dev", - "app_store_id": "1009116743" - } - } - ] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_ml_vision/example/android/app/gradle.properties b/packages/firebase_ml_vision/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_ml_vision/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_ml_vision/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_ml_vision/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_ml_vision/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_ml_vision/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_ml_vision/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 2ead36173fb9..000000000000 --- a/packages/firebase_ml_vision/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_ml_vision/example/android/app/src/main/java/io/flutter/plugins/firebasemlvisionexample/MainActivity.java b/packages/firebase_ml_vision/example/android/app/src/main/java/io/flutter/plugins/firebasemlvisionexample/MainActivity.java deleted file mode 100644 index f5bfd378a945..000000000000 --- a/packages/firebase_ml_vision/example/android/app/src/main/java/io/flutter/plugins/firebasemlvisionexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebasemlvisionexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_ml_vision/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_ml_vision/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_ml_vision/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/android/app/src/main/res/values/styles.xml b/packages/firebase_ml_vision/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_ml_vision/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_ml_vision/example/android/build.gradle b/packages/firebase_ml_vision/example/android/build.gradle deleted file mode 100644 index 3759d2af578f..000000000000 --- a/packages/firebase_ml_vision/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_ml_vision/example/android/gradle.properties b/packages/firebase_ml_vision/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_ml_vision/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_ml_vision/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_ml_vision/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2819f022f1fd..000000000000 --- a/packages/firebase_ml_vision/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_ml_vision/example/android/settings.gradle b/packages/firebase_ml_vision/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/firebase_ml_vision/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_ml_vision/example/assets/span_book.jpg b/packages/firebase_ml_vision/example/assets/span_book.jpg deleted file mode 100644 index 2437e1b31b25..000000000000 Binary files a/packages/firebase_ml_vision/example/assets/span_book.jpg and /dev/null differ diff --git a/packages/firebase_ml_vision/example/assets/test_barcode.jpg b/packages/firebase_ml_vision/example/assets/test_barcode.jpg deleted file mode 100644 index 9b00a21a9b5b..000000000000 Binary files a/packages/firebase_ml_vision/example/assets/test_barcode.jpg and /dev/null differ diff --git a/packages/firebase_ml_vision/example/assets/test_contact_barcode.png b/packages/firebase_ml_vision/example/assets/test_contact_barcode.png deleted file mode 100644 index 8bd7e1c900e1..000000000000 Binary files a/packages/firebase_ml_vision/example/assets/test_contact_barcode.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/assets/test_face.jpg b/packages/firebase_ml_vision/example/assets/test_face.jpg deleted file mode 100644 index a384f3c243b6..000000000000 Binary files a/packages/firebase_ml_vision/example/assets/test_face.jpg and /dev/null differ diff --git a/packages/firebase_ml_vision/example/assets/test_text.png b/packages/firebase_ml_vision/example/assets/test_text.png deleted file mode 100644 index 6a316527d9cf..000000000000 Binary files a/packages/firebase_ml_vision/example/assets/test_text.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_ml_vision/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9367d483e44e..000000000000 --- a/packages/firebase_ml_vision/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_ml_vision/example/ios/Flutter/Debug.xcconfig b/packages/firebase_ml_vision/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_ml_vision/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_ml_vision/example/ios/Flutter/Release.xcconfig b/packages/firebase_ml_vision/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_ml_vision/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_ml_vision/example/ios/Podfile b/packages/firebase_ml_vision/example/ios/Podfile deleted file mode 100644 index 5d488a88c6aa..000000000000 --- a/packages/firebase_ml_vision/example/ios/Podfile +++ /dev/null @@ -1,71 +0,0 @@ -# Uncomment this line to define a global platform for your project -platform :ios, '9.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - pods_ary = [] - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) { |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - pods_ary.push({:name => podname, :path => podpath}); - else - puts "Invalid plugin specification: #{line}" - end - } - return pods_ary -end - -target 'Runner' do - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - - # Flutter Pods - generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') - if generated_xcode_build_settings.empty? - puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." - end - generated_xcode_build_settings.map { |p| - if p[:name] == 'FLUTTER_FRAMEWORK_DIR' - symlink = File.join('.symlinks', 'flutter') - File.symlink(File.dirname(p[:path]), symlink) - pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) - end - } - - # Plugin Pods - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.map { |p| - symlink = File.join('.symlinks', 'plugins', p[:name]) - File.symlink(p[:path], symlink) - pod p[:name], :path => File.join(symlink, 'ios') - } -end - -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end - -pod 'Firebase/MLVisionBarcodeModel' -pod 'Firebase/MLVisionFaceModel' -pod 'Firebase/MLVisionLabelModel' -pod 'Firebase/MLVisionTextModel' diff --git a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 826fc6e9146c..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,518 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 8FDA56F920D046020020E776 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8FDA56F820D046020020E776 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - D8D4CC03A45432EE564AF6EC /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 47511359F254D1FA05DF3B06 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 47511359F254D1FA05DF3B06 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8FDA56F820D046020020E776 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - D8D4CC03A45432EE564AF6EC /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 060D02122DE17098607AD6EA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 47511359F254D1FA05DF3B06 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - FC90A70078657ED2825B5943 /* Pods */, - 060D02122DE17098607AD6EA /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 8FDA56F820D046020020E776 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - FC90A70078657ED2825B5943 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 96E46CF45834A6C37B9BB190 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 76593FE57A112D467FCA6E60 /* [CP] Embed Pods Frameworks */, - A29312BDBCEC3EBFF001E62D /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 8FDA56F920D046020020E776 /* GoogleService-Info.plist in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 76593FE57A112D467FCA6E60 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 96E46CF45834A6C37B9BB190 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - A29312BDBCEC3EBFF001E62D /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/GoogleMobileVision/GoogleMVFaceDetectorResources.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/GoogleMobileVision/GoogleMVTextDetectorResources.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMVFaceDetectorResources.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMVTextDetectorResources.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseMlVisionExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseMlVisionExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index ba1a98224109..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_ml_vision/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/firebase_ml_vision/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner/AppDelegate.h b/packages/firebase_ml_vision/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_ml_vision/example/ios/Runner/AppDelegate.m b/packages/firebase_ml_vision/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_ml_vision/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_ml_vision/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_ml_vision/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_ml_vision/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_ml_vision/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 0562b2ee756f..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 479882132969-gjp4e63ogu2h6guttj2ie6t3f10ic7i8.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.479882132969-gjp4e63ogu2h6guttj2ie6t3f10ic7i8 - API_KEY - AIzaSyBECOwLTAN6PU4Aet1b2QLGIb3kRK8Xjew - GCM_SENDER_ID - 479882132969 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebaseMlVisionExample - PROJECT_ID - my-flutter-proj - STORAGE_BUCKET - my-flutter-proj.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:479882132969:ios:249503bd2f4091a3 - DATABASE_URL - https://my-flutter-proj.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_ml_vision/example/ios/Runner/Info.plist b/packages/firebase_ml_vision/example/ios/Runner/Info.plist deleted file mode 100644 index b00979ea6bac..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/Info.plist +++ /dev/null @@ -1,53 +0,0 @@ - - - - - NSCameraUsageDescription - - NSPhotoLibraryUsageDescription - - LSApplicationCategoryType - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_ml_vision_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - NSCameraUsageDescription - Can I use the camera please? - - diff --git a/packages/firebase_ml_vision/example/ios/Runner/main.m b/packages/firebase_ml_vision/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_ml_vision/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_ml_vision/example/lib/camera_preview_scanner.dart b/packages/firebase_ml_vision/example/lib/camera_preview_scanner.dart deleted file mode 100644 index f40e20d6591c..000000000000 --- a/packages/firebase_ml_vision/example/lib/camera_preview_scanner.dart +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:camera/camera.dart'; -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import 'detector_painters.dart'; -import 'scanner_utils.dart'; - -class CameraPreviewScanner extends StatefulWidget { - @override - State createState() => _CameraPreviewScannerState(); -} - -class _CameraPreviewScannerState extends State { - dynamic _scanResults; - CameraController _camera; - Detector _currentDetector = Detector.text; - bool _isDetecting = false; - CameraLensDirection _direction = CameraLensDirection.back; - - final BarcodeDetector _barcodeDetector = - FirebaseVision.instance.barcodeDetector(); - final FaceDetector _faceDetector = FirebaseVision.instance.faceDetector(); - final ImageLabeler _imageLabeler = FirebaseVision.instance.imageLabeler(); - final ImageLabeler _cloudImageLabeler = - FirebaseVision.instance.cloudImageLabeler(); - final TextRecognizer _recognizer = FirebaseVision.instance.textRecognizer(); - final TextRecognizer _cloudRecognizer = - FirebaseVision.instance.cloudTextRecognizer(); - - @override - void initState() { - super.initState(); - _initializeCamera(); - } - - void _initializeCamera() async { - final CameraDescription description = - await ScannerUtils.getCamera(_direction); - - _camera = CameraController( - description, - defaultTargetPlatform == TargetPlatform.iOS - ? ResolutionPreset.low - : ResolutionPreset.medium, - ); - await _camera.initialize(); - - _camera.startImageStream((CameraImage image) { - if (_isDetecting) return; - - _isDetecting = true; - - ScannerUtils.detect( - image: image, - detectInImage: _getDetectionMethod(), - imageRotation: description.sensorOrientation, - ).then( - (dynamic results) { - if (_currentDetector == null) return; - setState(() { - _scanResults = results; - }); - }, - ).whenComplete(() => _isDetecting = false); - }); - } - - Future Function(FirebaseVisionImage image) _getDetectionMethod() { - switch (_currentDetector) { - case Detector.text: - return _recognizer.processImage; - case Detector.cloudText: - return _cloudRecognizer.processImage; - case Detector.barcode: - return _barcodeDetector.detectInImage; - case Detector.label: - return _imageLabeler.processImage; - case Detector.cloudLabel: - return _cloudImageLabeler.processImage; - case Detector.face: - return _faceDetector.processImage; - } - - return null; - } - - Widget _buildResults() { - const Text noResultsText = Text('No results!'); - - if (_scanResults == null || - _camera == null || - !_camera.value.isInitialized) { - return noResultsText; - } - - CustomPainter painter; - - final Size imageSize = Size( - _camera.value.previewSize.height, - _camera.value.previewSize.width, - ); - - switch (_currentDetector) { - case Detector.barcode: - if (_scanResults is! List) return noResultsText; - painter = BarcodeDetectorPainter(imageSize, _scanResults); - break; - case Detector.face: - if (_scanResults is! List) return noResultsText; - painter = FaceDetectorPainter(imageSize, _scanResults); - break; - case Detector.label: - if (_scanResults is! List) return noResultsText; - painter = LabelDetectorPainter(imageSize, _scanResults); - break; - case Detector.cloudLabel: - if (_scanResults is! List) return noResultsText; - painter = LabelDetectorPainter(imageSize, _scanResults); - break; - default: - assert(_currentDetector == Detector.text || - _currentDetector == Detector.cloudText); - if (_scanResults is! VisionText) return noResultsText; - painter = TextDetectorPainter(imageSize, _scanResults); - } - - return CustomPaint( - painter: painter, - ); - } - - Widget _buildImage() { - return Container( - constraints: const BoxConstraints.expand(), - child: _camera == null - ? const Center( - child: Text( - 'Initializing Camera...', - style: TextStyle( - color: Colors.green, - fontSize: 30.0, - ), - ), - ) - : Stack( - fit: StackFit.expand, - children: [ - CameraPreview(_camera), - _buildResults(), - ], - ), - ); - } - - void _toggleCameraDirection() async { - if (_direction == CameraLensDirection.back) { - _direction = CameraLensDirection.front; - } else { - _direction = CameraLensDirection.back; - } - - await _camera.stopImageStream(); - await _camera.dispose(); - - setState(() { - _camera = null; - }); - - _initializeCamera(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('ML Vision Example'), - actions: [ - PopupMenuButton( - onSelected: (Detector result) { - _currentDetector = result; - }, - itemBuilder: (BuildContext context) => >[ - const PopupMenuItem( - child: Text('Detect Barcode'), - value: Detector.barcode, - ), - const PopupMenuItem( - child: Text('Detect Face'), - value: Detector.face, - ), - const PopupMenuItem( - child: Text('Detect Label'), - value: Detector.label, - ), - const PopupMenuItem( - child: Text('Detect Cloud Label'), - value: Detector.cloudLabel, - ), - const PopupMenuItem( - child: Text('Detect Text'), - value: Detector.text, - ), - const PopupMenuItem( - child: Text('Detect Cloud Text'), - value: Detector.cloudText, - ), - ], - ), - ], - ), - body: _buildImage(), - floatingActionButton: FloatingActionButton( - onPressed: _toggleCameraDirection, - child: _direction == CameraLensDirection.back - ? const Icon(Icons.camera_front) - : const Icon(Icons.camera_rear), - ), - ); - } - - @override - void dispose() { - _camera.dispose().then((_) { - _barcodeDetector.close(); - _faceDetector.close(); - _imageLabeler.close(); - _cloudImageLabeler.close(); - _recognizer.close(); - _cloudRecognizer.close(); - }); - - _currentDetector = null; - super.dispose(); - } -} diff --git a/packages/firebase_ml_vision/example/lib/colors.dart b/packages/firebase_ml_vision/example/lib/colors.dart deleted file mode 100644 index 37d92e6d2374..000000000000 --- a/packages/firebase_ml_vision/example/lib/colors.dart +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; - -const Color kShrinePink50 = Color(0xFFFEEAE6); -const Color kShrinePink100 = Color(0xFFFEDBD0); -const Color kShrineFrameBrown = Color(0x8A442C2E); -const Color kShrineScrim = Color(0x73442C2E); diff --git a/packages/firebase_ml_vision/example/lib/detector_painters.dart b/packages/firebase_ml_vision/example/lib/detector_painters.dart deleted file mode 100644 index d8d7316f2509..000000000000 --- a/packages/firebase_ml_vision/example/lib/detector_painters.dart +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:ui' as ui; - -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/material.dart'; - -enum Detector { barcode, face, label, cloudLabel, text, cloudText } - -class BarcodeDetectorPainter extends CustomPainter { - BarcodeDetectorPainter(this.absoluteImageSize, this.barcodeLocations); - - final Size absoluteImageSize; - final List barcodeLocations; - - @override - void paint(Canvas canvas, Size size) { - final double scaleX = size.width / absoluteImageSize.width; - final double scaleY = size.height / absoluteImageSize.height; - - Rect scaleRect(Barcode barcode) { - return Rect.fromLTRB( - barcode.boundingBox.left * scaleX, - barcode.boundingBox.top * scaleY, - barcode.boundingBox.right * scaleX, - barcode.boundingBox.bottom * scaleY, - ); - } - - final Paint paint = Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = 2.0; - - for (Barcode barcode in barcodeLocations) { - paint.color = Colors.green; - canvas.drawRect(scaleRect(barcode), paint); - } - } - - @override - bool shouldRepaint(BarcodeDetectorPainter oldDelegate) { - return oldDelegate.absoluteImageSize != absoluteImageSize || - oldDelegate.barcodeLocations != barcodeLocations; - } -} - -class FaceDetectorPainter extends CustomPainter { - FaceDetectorPainter(this.absoluteImageSize, this.faces); - - final Size absoluteImageSize; - final List faces; - - @override - void paint(Canvas canvas, Size size) { - final double scaleX = size.width / absoluteImageSize.width; - final double scaleY = size.height / absoluteImageSize.height; - - final Paint paint = Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = 2.0 - ..color = Colors.red; - - for (Face face in faces) { - canvas.drawRect( - Rect.fromLTRB( - face.boundingBox.left * scaleX, - face.boundingBox.top * scaleY, - face.boundingBox.right * scaleX, - face.boundingBox.bottom * scaleY, - ), - paint, - ); - } - } - - @override - bool shouldRepaint(FaceDetectorPainter oldDelegate) { - return oldDelegate.absoluteImageSize != absoluteImageSize || - oldDelegate.faces != faces; - } -} - -class LabelDetectorPainter extends CustomPainter { - LabelDetectorPainter(this.absoluteImageSize, this.labels); - - final Size absoluteImageSize; - final List labels; - - @override - void paint(Canvas canvas, Size size) { - final ui.ParagraphBuilder builder = ui.ParagraphBuilder( - ui.ParagraphStyle( - textAlign: TextAlign.left, - fontSize: 23.0, - textDirection: TextDirection.ltr), - ); - - builder.pushStyle(ui.TextStyle(color: Colors.green)); - for (ImageLabel label in labels) { - builder.addText('Label: ${label.text}, ' - 'Confidence: ${label.confidence.toStringAsFixed(2)}\n'); - } - builder.pop(); - - canvas.drawParagraph( - builder.build() - ..layout(ui.ParagraphConstraints( - width: size.width, - )), - const Offset(0.0, 0.0), - ); - } - - @override - bool shouldRepaint(LabelDetectorPainter oldDelegate) { - return oldDelegate.absoluteImageSize != absoluteImageSize || - oldDelegate.labels != labels; - } -} - -// Paints rectangles around all the text in the image. -class TextDetectorPainter extends CustomPainter { - TextDetectorPainter(this.absoluteImageSize, this.visionText); - - final Size absoluteImageSize; - final VisionText visionText; - - @override - void paint(Canvas canvas, Size size) { - final double scaleX = size.width / absoluteImageSize.width; - final double scaleY = size.height / absoluteImageSize.height; - - Rect scaleRect(TextContainer container) { - return Rect.fromLTRB( - container.boundingBox.left * scaleX, - container.boundingBox.top * scaleY, - container.boundingBox.right * scaleX, - container.boundingBox.bottom * scaleY, - ); - } - - final Paint paint = Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = 2.0; - - for (TextBlock block in visionText.blocks) { - for (TextLine line in block.lines) { - for (TextElement element in line.elements) { - paint.color = Colors.green; - canvas.drawRect(scaleRect(element), paint); - } - - paint.color = Colors.yellow; - canvas.drawRect(scaleRect(line), paint); - } - - paint.color = Colors.red; - canvas.drawRect(scaleRect(block), paint); - } - } - - @override - bool shouldRepaint(TextDetectorPainter oldDelegate) { - return oldDelegate.absoluteImageSize != absoluteImageSize || - oldDelegate.visionText != visionText; - } -} diff --git a/packages/firebase_ml_vision/example/lib/main.dart b/packages/firebase_ml_vision/example/lib/main.dart deleted file mode 100644 index c1fe123258b7..000000000000 --- a/packages/firebase_ml_vision/example/lib/main.dart +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; - -import 'camera_preview_scanner.dart'; -import 'material_barcode_scanner.dart'; -import 'picture_scanner.dart'; - -void main() { - runApp( - MaterialApp( - routes: { - '/': (BuildContext context) => _ExampleList(), - '/$PictureScanner': (BuildContext context) => PictureScanner(), - '/$CameraPreviewScanner': (BuildContext context) => - CameraPreviewScanner(), - '/$MaterialBarcodeScanner': (BuildContext context) => - const MaterialBarcodeScanner(), - }, - ), - ); -} - -class _ExampleList extends StatefulWidget { - @override - State createState() => _ExampleListState(); -} - -class _ExampleListState extends State<_ExampleList> { - static final List _exampleWidgetNames = [ - '$PictureScanner', - '$CameraPreviewScanner', - '$MaterialBarcodeScanner', - ]; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Example List'), - ), - body: ListView.builder( - itemCount: _exampleWidgetNames.length, - itemBuilder: (BuildContext context, int index) { - final String widgetName = _exampleWidgetNames[index]; - - return Container( - decoration: BoxDecoration( - border: Border(bottom: BorderSide(color: Colors.grey)), - ), - child: ListTile( - title: Text(widgetName), - onTap: () => Navigator.pushNamed(context, '/$widgetName'), - ), - ); - }, - ), - ); - } -} diff --git a/packages/firebase_ml_vision/example/lib/material_barcode_scanner.dart b/packages/firebase_ml_vision/example/lib/material_barcode_scanner.dart deleted file mode 100644 index 33b5994dd48c..000000000000 --- a/packages/firebase_ml_vision/example/lib/material_barcode_scanner.dart +++ /dev/null @@ -1,763 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:io'; -import 'dart:ui' show lerpDouble; - -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:camera/camera.dart'; -import 'package:flutter/services.dart'; -import 'package:path_provider/path_provider.dart'; - -import 'colors.dart'; -import 'scanner_utils.dart'; - -enum AnimationState { search, barcodeNear, barcodeFound, endSearch } - -class MaterialBarcodeScanner extends StatefulWidget { - const MaterialBarcodeScanner({ - this.validRectangle = const Rectangle(width: 320, height: 144), - this.frameColor = kShrineScrim, - this.traceMultiplier = 1.2, - }); - - final Rectangle validRectangle; - final Color frameColor; - final double traceMultiplier; - - @override - _MaterialBarcodeScannerState createState() => _MaterialBarcodeScannerState(); -} - -class _MaterialBarcodeScannerState extends State - with TickerProviderStateMixin { - CameraController _cameraController; - AnimationController _animationController; - String _scannerHint; - bool _closeWindow = false; - String _barcodePictureFilePath; - Size _previewSize; - AnimationState _currentState = AnimationState.search; - CustomPainter _animationPainter; - int _animationStart = DateTime.now().millisecondsSinceEpoch; - final BarcodeDetector _barcodeDetector = - FirebaseVision.instance.barcodeDetector(); - - @override - void initState() { - super.initState(); - - SystemChrome.setEnabledSystemUIOverlays([]); - SystemChrome.setPreferredOrientations( - [DeviceOrientation.portraitUp], - ); - _initCameraAndScanner(); - _switchAnimationState(AnimationState.search); - } - - void _initCameraAndScanner() { - ScannerUtils.getCamera(CameraLensDirection.back).then( - (CameraDescription camera) async { - await _openCamera(camera); - await _startStreamingImagesToScanner(camera.sensorOrientation); - }, - ); - } - - void _initAnimation(Duration duration) { - setState(() { - _animationPainter = null; - }); - - _animationController?.dispose(); - _animationController = AnimationController(duration: duration, vsync: this); - } - - void _switchAnimationState(AnimationState newState) { - if (newState == AnimationState.search) { - _initAnimation(const Duration(milliseconds: 750)); - - _animationPainter = RectangleOutlinePainter( - animation: RectangleTween( - Rectangle( - width: widget.validRectangle.width, - height: widget.validRectangle.height, - color: Colors.white, - ), - Rectangle( - width: widget.validRectangle.width * widget.traceMultiplier, - height: widget.validRectangle.height * widget.traceMultiplier, - color: Colors.transparent, - ), - ).animate(_animationController), - ); - - _animationController.addStatusListener((AnimationStatus status) { - if (status == AnimationStatus.completed) { - Future.delayed(const Duration(milliseconds: 1600), () { - if (_currentState == AnimationState.search) { - _animationController.forward(from: 0); - } - }); - } - }); - } else if (newState == AnimationState.barcodeNear || - newState == AnimationState.barcodeFound || - newState == AnimationState.endSearch) { - double begin; - if (_currentState == AnimationState.barcodeNear) { - begin = lerpDouble(0.0, 0.5, _animationController.value); - } else if (_currentState == AnimationState.search) { - _initAnimation(const Duration(milliseconds: 500)); - begin = 0.0; - } - - _animationPainter = RectangleTracePainter( - rectangle: Rectangle( - width: widget.validRectangle.width, - height: widget.validRectangle.height, - color: newState == AnimationState.endSearch - ? Colors.transparent - : Colors.white, - ), - animation: Tween( - begin: begin, - end: newState == AnimationState.barcodeNear ? 0.5 : 1.0, - ).animate(_animationController), - ); - - if (newState == AnimationState.barcodeFound) { - _animationController.addStatusListener((AnimationStatus status) { - if (status == AnimationStatus.completed) { - Future.delayed(const Duration(milliseconds: 300), () { - if (_currentState != AnimationState.endSearch) { - _switchAnimationState(AnimationState.endSearch); - setState(() {}); - _showBottomSheet(); - } - }); - } - }); - } - } - - _currentState = newState; - if (newState != AnimationState.endSearch) { - _animationController.forward(from: 0); - _animationStart = DateTime.now().millisecondsSinceEpoch; - } - } - - Future _openCamera(CameraDescription camera) async { - final ResolutionPreset preset = - defaultTargetPlatform == TargetPlatform.android - ? ResolutionPreset.medium - : ResolutionPreset.low; - - _cameraController = CameraController(camera, preset); - await _cameraController.initialize(); - _previewSize = _cameraController.value.previewSize; - setState(() {}); - } - - Future _startStreamingImagesToScanner(int sensorOrientation) async { - bool isDetecting = false; - final MediaQueryData data = MediaQuery.of(context); - - _cameraController.startImageStream((CameraImage image) { - if (isDetecting) { - return; - } - - isDetecting = true; - - ScannerUtils.detect( - image: image, - detectInImage: _barcodeDetector.detectInImage, - imageRotation: sensorOrientation, - ).then( - (dynamic result) { - _handleResult( - barcodes: result, - data: data, - imageSize: Size(image.width.toDouble(), image.height.toDouble()), - ); - }, - ).whenComplete(() => isDetecting = false); - }); - } - - bool get _barcodeNearAnimationInProgress { - return _currentState == AnimationState.barcodeNear && - DateTime.now().millisecondsSinceEpoch - _animationStart < 2500; - } - - void _handleResult({ - @required List barcodes, - @required MediaQueryData data, - @required Size imageSize, - }) { - if (!_cameraController.value.isStreamingImages) { - return; - } - - final EdgeInsets padding = data.padding; - final double maxLogicalHeight = - data.size.height - padding.top - padding.bottom; - - // Width & height are flipped from CameraController.previewSize on iOS - final double imageHeight = defaultTargetPlatform == TargetPlatform.iOS - ? imageSize.height - : imageSize.width; - - final double imageScale = imageHeight / maxLogicalHeight; - final double halfWidth = imageScale * widget.validRectangle.width / 2; - final double halfHeight = imageScale * widget.validRectangle.height / 2; - - final Offset center = imageSize.center(Offset.zero); - final Rect validRect = Rect.fromLTRB( - center.dx - halfWidth, - center.dy - halfHeight, - center.dx + halfWidth, - center.dy + halfHeight, - ); - - for (Barcode barcode in barcodes) { - final Rect intersection = validRect.intersect(barcode.boundingBox); - - final bool doesContain = intersection == barcode.boundingBox; - - if (doesContain) { - _cameraController.stopImageStream().then((_) => _takePicture()); - - if (_currentState != AnimationState.barcodeFound) { - _closeWindow = true; - _scannerHint = 'Loading Information...'; - _switchAnimationState(AnimationState.barcodeFound); - setState(() {}); - } - return; - } else if (barcode.boundingBox.overlaps(validRect)) { - if (_currentState != AnimationState.barcodeNear) { - _scannerHint = 'Move closer to the barcode'; - _switchAnimationState(AnimationState.barcodeNear); - setState(() {}); - } - return; - } - } - - if (_barcodeNearAnimationInProgress) { - return; - } - - if (_currentState != AnimationState.search) { - _scannerHint = null; - _switchAnimationState(AnimationState.search); - setState(() {}); - } - } - - @override - void dispose() { - _currentState = AnimationState.endSearch; - _cameraController?.stopImageStream(); - _cameraController?.dispose(); - _animationController?.dispose(); - _barcodeDetector.close(); - - SystemChrome.setPreferredOrientations([]); - SystemChrome.setEnabledSystemUIOverlays([ - SystemUiOverlay.top, - SystemUiOverlay.bottom, - ]); - - super.dispose(); - } - - Future _takePicture() async { - final Directory extDir = await getApplicationDocumentsDirectory(); - - final String dirPath = '${extDir.path}/Pictures/barcodePics'; - await Directory(dirPath).create(recursive: true); - - final String timestamp = DateTime.now().millisecondsSinceEpoch.toString(); - - final String filePath = '$dirPath/$timestamp.jpg'; - - try { - await _cameraController.takePicture(filePath); - } on CameraException catch (e) { - print(e); - } - - _cameraController.dispose(); - _cameraController = null; - - setState(() { - _barcodePictureFilePath = filePath; - }); - } - - Widget _buildCameraPreview() { - return Container( - color: Colors.black, - child: Transform.scale( - scale: _getImageZoom(MediaQuery.of(context)), - child: Center( - child: AspectRatio( - aspectRatio: _cameraController.value.aspectRatio, - child: CameraPreview(_cameraController), - ), - ), - ), - ); - } - - double _getImageZoom(MediaQueryData data) { - final double logicalWidth = data.size.width; - final double logicalHeight = _previewSize.aspectRatio * logicalWidth; - - final EdgeInsets padding = data.padding; - final double maxLogicalHeight = - data.size.height - padding.top - padding.bottom; - - return maxLogicalHeight / logicalHeight; - } - - void _showBottomSheet() { - showModalBottomSheet( - context: context, - builder: (BuildContext context) { - return Container( - width: double.infinity, - height: 368, - child: Column( - children: [ - Container( - height: 56, - alignment: Alignment.centerLeft, - decoration: BoxDecoration( - border: Border(bottom: const BorderSide(color: Colors.grey)), - ), - child: Padding( - padding: const EdgeInsets.all(16), - child: Text( - '1 result found', - style: Theme.of(context).textTheme.body2, - ), - ), - ), - Expanded( - child: Container( - padding: const EdgeInsets.all(24), - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/span_book.jpg', - fit: BoxFit.cover, - width: 96, - height: 96, - ), - Container( - height: 96, - margin: const EdgeInsets.only(left: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: const EdgeInsets.only(bottom: 4), - child: Text( - 'SPAN Reader', - style: Theme.of(context).textTheme.body2, - ), - ), - Text( - 'Vol. 2', - style: Theme.of(context).textTheme.body2, - ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - margin: - const EdgeInsets.only(bottom: 3), - child: const Text('Material Design'), - ), - const Text('120 pages'), - ], - ), - ), - ], - ), - ) - ], - ), - Container( - margin: const EdgeInsets.only(top: 30), - child: const Text( - 'A Japanese & English accompaniment to the 2016 SPAN ' - 'conference.', - ), - ), - Expanded( - child: Container( - padding: const EdgeInsets.only(bottom: 4), - alignment: Alignment.bottomCenter, - child: ButtonTheme( - minWidth: 312, - height: 48, - child: RaisedButton.icon( - onPressed: () => Navigator.of(context).pop(), - color: kShrinePink100, - label: const Text('ADD TO CART - \$12.99'), - icon: const Icon(Icons.add_shopping_cart), - elevation: 8.0, - shape: const BeveledRectangleBorder( - borderRadius: BorderRadius.all( - Radius.circular(7.0), - ), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ], - ), - ); - }, - ).then((_) => _reset()); - } - - void _reset() { - _initCameraAndScanner(); - setState(() { - _closeWindow = false; - _barcodePictureFilePath = null; - _scannerHint = null; - _switchAnimationState(AnimationState.search); - }); - } - - @override - Widget build(BuildContext context) { - Widget background; - if (_barcodePictureFilePath != null) { - background = Container( - color: Colors.black, - child: Transform.scale( - scale: _getImageZoom(MediaQuery.of(context)), - child: Center( - child: Image.file( - File(_barcodePictureFilePath), - fit: BoxFit.fitWidth, - ), - ), - ), - ); - } else if (_cameraController != null && - _cameraController.value.isInitialized) { - background = _buildCameraPreview(); - } else { - background = Container( - color: Colors.black, - ); - } - - return SafeArea( - child: Scaffold( - body: Stack( - children: [ - background, - Container( - constraints: const BoxConstraints.expand(), - child: CustomPaint( - painter: WindowPainter( - windowSize: Size(widget.validRectangle.width, - widget.validRectangle.height), - outerFrameColor: widget.frameColor, - closeWindow: _closeWindow, - innerFrameColor: _currentState == AnimationState.endSearch - ? Colors.transparent - : kShrineFrameBrown, - ), - ), - ), - Positioned( - left: 0, - right: 0, - top: 0, - child: Container( - height: 56, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: const [Colors.black87, Colors.transparent], - ), - ), - ), - ), - Positioned( - left: 0.0, - bottom: 0.0, - right: 0.0, - height: 56, - child: Container( - color: kShrinePink50, - child: Center( - child: Text( - _scannerHint ?? 'Point your camera at a barcode', - style: Theme.of(context).textTheme.button, - ), - ), - ), - ), - Container( - constraints: const BoxConstraints.expand(), - child: CustomPaint( - painter: _animationPainter, - ), - ), - AppBar( - leading: IconButton( - icon: const Icon(Icons.close, color: Colors.white), - onPressed: () => Navigator.of(context).pop(), - ), - backgroundColor: Colors.transparent, - elevation: 0.0, - actions: [ - IconButton( - icon: const Icon( - Icons.flash_off, - color: Colors.white, - ), - onPressed: () {}, - ), - IconButton( - icon: const Icon( - Icons.help_outline, - color: Colors.white, - ), - onPressed: () {}, - ), - ], - ), - ], - ), - ), - ); - } -} - -class WindowPainter extends CustomPainter { - WindowPainter({ - @required this.windowSize, - this.outerFrameColor = Colors.white54, - this.innerFrameColor = const Color(0xFF442C2E), - this.innerFrameStrokeWidth = 3, - this.closeWindow = false, - }); - - final Size windowSize; - final Color outerFrameColor; - final Color innerFrameColor; - final double innerFrameStrokeWidth; - final bool closeWindow; - - @override - void paint(Canvas canvas, Size size) { - final Offset center = size.center(Offset.zero); - final double windowHalfWidth = windowSize.width / 2; - final double windowHalfHeight = windowSize.height / 2; - - final Rect windowRect = Rect.fromLTRB( - center.dx - windowHalfWidth, - center.dy - windowHalfHeight, - center.dx + windowHalfWidth, - center.dy + windowHalfHeight, - ); - - final Rect left = - Rect.fromLTRB(0, windowRect.top, windowRect.left, windowRect.bottom); - final Rect top = Rect.fromLTRB(0, 0, size.width, windowRect.top); - final Rect right = Rect.fromLTRB( - windowRect.right, - windowRect.top, - size.width, - windowRect.bottom, - ); - final Rect bottom = Rect.fromLTRB( - 0, - windowRect.bottom, - size.width, - size.height, - ); - - canvas.drawRect( - windowRect, - Paint() - ..color = innerFrameColor - ..style = PaintingStyle.stroke - ..strokeWidth = innerFrameStrokeWidth); - - final Paint paint = Paint()..color = outerFrameColor; - canvas.drawRect(left, paint); - canvas.drawRect(top, paint); - canvas.drawRect(right, paint); - canvas.drawRect(bottom, paint); - - if (closeWindow) { - canvas.drawRect(windowRect, paint); - } - } - - @override - bool shouldRepaint(WindowPainter oldDelegate) => - oldDelegate.closeWindow != closeWindow; -} - -class Rectangle { - const Rectangle({this.width, this.height, this.color}); - - final double width; - final double height; - final Color color; - - static Rectangle lerp(Rectangle begin, Rectangle end, double t) { - Color color; - if (t > .5) { - color = Color.lerp(begin.color, end.color, (t - .5) / .25); - } else { - color = begin.color; - } - - return Rectangle( - width: lerpDouble(begin.width, end.width, t), - height: lerpDouble(begin.height, end.height, t), - color: color, - ); - } -} - -class RectangleTween extends Tween { - RectangleTween(Rectangle begin, Rectangle end) - : super(begin: begin, end: end); - - @override - Rectangle lerp(double t) => Rectangle.lerp(begin, end, t); -} - -class RectangleOutlinePainter extends CustomPainter { - RectangleOutlinePainter({ - @required this.animation, - this.strokeWidth = 3, - }) : super(repaint: animation); - - final Animation animation; - final double strokeWidth; - - @override - void paint(Canvas canvas, Size size) { - final Rectangle rectangle = animation.value; - - final Paint paint = Paint() - ..strokeWidth = strokeWidth - ..color = rectangle.color - ..style = PaintingStyle.stroke; - - final Offset center = size.center(Offset.zero); - final double halfWidth = rectangle.width / 2; - final double halfHeight = rectangle.height / 2; - - final Rect rect = Rect.fromLTRB( - center.dx - halfWidth, - center.dy - halfHeight, - center.dx + halfWidth, - center.dy + halfHeight, - ); - - canvas.drawRect(rect, paint); - } - - @override - bool shouldRepaint(RectangleOutlinePainter oldDelegate) => false; -} - -class RectangleTracePainter extends CustomPainter { - RectangleTracePainter({ - @required this.animation, - @required this.rectangle, - this.strokeWidth = 3, - }) : super(repaint: animation); - - final Animation animation; - final Rectangle rectangle; - final double strokeWidth; - - @override - void paint(Canvas canvas, Size size) { - final double value = animation.value; - - final Offset center = size.center(Offset.zero); - final double halfWidth = rectangle.width / 2; - final double halfHeight = rectangle.height / 2; - - final Rect rect = Rect.fromLTRB( - center.dx - halfWidth, - center.dy - halfHeight, - center.dx + halfWidth, - center.dy + halfHeight, - ); - - final Paint paint = Paint() - ..strokeWidth = strokeWidth - ..color = rectangle.color; - - final double halfStrokeWidth = strokeWidth / 2; - - final double heightProportion = (halfStrokeWidth + rect.height) * value; - final double widthProportion = (halfStrokeWidth + rect.width) * value; - - canvas.drawLine( - Offset(rect.right, rect.bottom + halfStrokeWidth), - Offset(rect.right, rect.bottom - heightProportion), - paint, - ); - - canvas.drawLine( - Offset(rect.right + halfStrokeWidth, rect.bottom), - Offset(rect.right - widthProportion, rect.bottom), - paint, - ); - - canvas.drawLine( - Offset(rect.left, rect.top - halfStrokeWidth), - Offset(rect.left, rect.top + heightProportion), - paint, - ); - - canvas.drawLine( - Offset(rect.left - halfStrokeWidth, rect.top), - Offset(rect.left + widthProportion, rect.top), - paint, - ); - } - - @override - bool shouldRepaint(RectangleTracePainter oldDelegate) => false; -} diff --git a/packages/firebase_ml_vision/example/lib/picture_scanner.dart b/packages/firebase_ml_vision/example/lib/picture_scanner.dart deleted file mode 100644 index 182a55a46020..000000000000 --- a/packages/firebase_ml_vision/example/lib/picture_scanner.dart +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:io'; -import 'dart:ui'; - -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/material.dart'; -import 'package:image_picker/image_picker.dart'; - -import 'detector_painters.dart'; - -class PictureScanner extends StatefulWidget { - @override - State createState() => _PictureScannerState(); -} - -class _PictureScannerState extends State { - File _imageFile; - Size _imageSize; - dynamic _scanResults; - Detector _currentDetector = Detector.text; - final BarcodeDetector _barcodeDetector = - FirebaseVision.instance.barcodeDetector(); - final FaceDetector _faceDetector = FirebaseVision.instance.faceDetector(); - final ImageLabeler _imageLabeler = FirebaseVision.instance.imageLabeler(); - final ImageLabeler _cloudImageLabeler = - FirebaseVision.instance.cloudImageLabeler(); - final TextRecognizer _recognizer = FirebaseVision.instance.textRecognizer(); - final TextRecognizer _cloudRecognizer = - FirebaseVision.instance.cloudTextRecognizer(); - - Future _getAndScanImage() async { - setState(() { - _imageFile = null; - _imageSize = null; - }); - - final File imageFile = - await ImagePicker.pickImage(source: ImageSource.gallery); - - if (imageFile != null) { - _getImageSize(imageFile); - _scanImage(imageFile); - } - - setState(() { - _imageFile = imageFile; - }); - } - - Future _getImageSize(File imageFile) async { - final Completer completer = Completer(); - - final Image image = Image.file(imageFile); - image.image.resolve(const ImageConfiguration()).addListener( - ImageStreamListener((ImageInfo info, bool _) { - completer.complete(Size( - info.image.width.toDouble(), - info.image.height.toDouble(), - )); - }), - ); - - final Size imageSize = await completer.future; - setState(() { - _imageSize = imageSize; - }); - } - - Future _scanImage(File imageFile) async { - setState(() { - _scanResults = null; - }); - - final FirebaseVisionImage visionImage = - FirebaseVisionImage.fromFile(imageFile); - - dynamic results; - switch (_currentDetector) { - case Detector.barcode: - results = await _barcodeDetector.detectInImage(visionImage); - break; - case Detector.face: - results = await _faceDetector.processImage(visionImage); - break; - case Detector.label: - results = await _imageLabeler.processImage(visionImage); - break; - case Detector.cloudLabel: - results = await _cloudImageLabeler.processImage(visionImage); - break; - case Detector.text: - results = await _recognizer.processImage(visionImage); - break; - case Detector.cloudText: - results = await _cloudRecognizer.processImage(visionImage); - break; - default: - return; - } - - setState(() { - _scanResults = results; - }); - } - - CustomPaint _buildResults(Size imageSize, dynamic results) { - CustomPainter painter; - - switch (_currentDetector) { - case Detector.barcode: - painter = BarcodeDetectorPainter(_imageSize, results); - break; - case Detector.face: - painter = FaceDetectorPainter(_imageSize, results); - break; - case Detector.label: - painter = LabelDetectorPainter(_imageSize, results); - break; - case Detector.cloudLabel: - painter = LabelDetectorPainter(_imageSize, results); - break; - case Detector.text: - painter = TextDetectorPainter(_imageSize, results); - break; - case Detector.cloudText: - painter = TextDetectorPainter(_imageSize, results); - break; - default: - break; - } - - return CustomPaint( - painter: painter, - ); - } - - Widget _buildImage() { - return Container( - constraints: const BoxConstraints.expand(), - decoration: BoxDecoration( - image: DecorationImage( - image: Image.file(_imageFile).image, - fit: BoxFit.fill, - ), - ), - child: _imageSize == null || _scanResults == null - ? const Center( - child: Text( - 'Scanning...', - style: TextStyle( - color: Colors.green, - fontSize: 30.0, - ), - ), - ) - : _buildResults(_imageSize, _scanResults), - ); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Picture Scanner'), - actions: [ - PopupMenuButton( - onSelected: (Detector result) { - _currentDetector = result; - if (_imageFile != null) _scanImage(_imageFile); - }, - itemBuilder: (BuildContext context) => >[ - const PopupMenuItem( - child: Text('Detect Barcode'), - value: Detector.barcode, - ), - const PopupMenuItem( - child: Text('Detect Face'), - value: Detector.face, - ), - const PopupMenuItem( - child: Text('Detect Label'), - value: Detector.label, - ), - const PopupMenuItem( - child: Text('Detect Cloud Label'), - value: Detector.cloudLabel, - ), - const PopupMenuItem( - child: Text('Detect Text'), - value: Detector.text, - ), - const PopupMenuItem( - child: Text('Detect Cloud Text'), - value: Detector.cloudText, - ), - ], - ), - ], - ), - body: _imageFile == null - ? const Center(child: Text('No image selected.')) - : _buildImage(), - floatingActionButton: FloatingActionButton( - onPressed: _getAndScanImage, - tooltip: 'Pick Image', - child: const Icon(Icons.add_a_photo), - ), - ); - } - - @override - void dispose() { - _barcodeDetector.close(); - _faceDetector.close(); - _imageLabeler.close(); - _cloudImageLabeler.close(); - _recognizer.close(); - _cloudRecognizer.close(); - super.dispose(); - } -} diff --git a/packages/firebase_ml_vision/example/lib/scanner_utils.dart b/packages/firebase_ml_vision/example/lib/scanner_utils.dart deleted file mode 100644 index 6bd156448189..000000000000 --- a/packages/firebase_ml_vision/example/lib/scanner_utils.dart +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:typed_data'; -import 'dart:ui'; - -import 'package:camera/camera.dart'; -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/foundation.dart'; - -class ScannerUtils { - ScannerUtils._(); - - static Future getCamera(CameraLensDirection dir) async { - return await availableCameras().then( - (List cameras) => cameras.firstWhere( - (CameraDescription camera) => camera.lensDirection == dir, - ), - ); - } - - static Future detect({ - @required CameraImage image, - @required Future Function(FirebaseVisionImage image) detectInImage, - @required int imageRotation, - }) async { - return detectInImage( - FirebaseVisionImage.fromBytes( - _concatenatePlanes(image.planes), - _buildMetaData(image, _rotationIntToImageRotation(imageRotation)), - ), - ); - } - - static Uint8List _concatenatePlanes(List planes) { - final WriteBuffer allBytes = WriteBuffer(); - for (Plane plane in planes) { - allBytes.putUint8List(plane.bytes); - } - return allBytes.done().buffer.asUint8List(); - } - - static FirebaseVisionImageMetadata _buildMetaData( - CameraImage image, - ImageRotation rotation, - ) { - return FirebaseVisionImageMetadata( - rawFormat: image.format.raw, - size: Size(image.width.toDouble(), image.height.toDouble()), - rotation: rotation, - planeData: image.planes.map( - (Plane plane) { - return FirebaseVisionImagePlaneMetadata( - bytesPerRow: plane.bytesPerRow, - height: plane.height, - width: plane.width, - ); - }, - ).toList(), - ); - } - - static ImageRotation _rotationIntToImageRotation(int rotation) { - switch (rotation) { - case 0: - return ImageRotation.rotation0; - case 90: - return ImageRotation.rotation90; - case 180: - return ImageRotation.rotation180; - default: - assert(rotation == 270); - return ImageRotation.rotation270; - } - } -} diff --git a/packages/firebase_ml_vision/example/pubspec.yaml b/packages/firebase_ml_vision/example/pubspec.yaml deleted file mode 100644 index f8ecf0e489f2..000000000000 --- a/packages/firebase_ml_vision/example/pubspec.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: firebase_ml_vision_example -description: Demonstrates how to use the firebase_ml_vision plugin. -author: Flutter Team - -dependencies: - flutter: - sdk: flutter - - image_picker: ^0.5.0 - cupertino_icons: ^0.1.2 - firebase_ml_vision: - path: ../ - firebase_core: ^0.4.0 - camera: ^0.5.2+1 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - path: ^1.6.2 - path_provider: ^0.5.0+1 - -flutter: - uses-material-design: true - assets: - - assets/test_face.jpg - - assets/test_barcode.jpg - - assets/test_contact_barcode.png - - assets/test_text.png - - assets/span_book.jpg diff --git a/packages/firebase_ml_vision/example/test_driver/barcode_detector.dart b/packages/firebase_ml_vision/example/test_driver/barcode_detector.dart deleted file mode 100644 index 43cdb0375d80..000000000000 --- a/packages/firebase_ml_vision/example/test_driver/barcode_detector.dart +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of 'firebase_ml_vision.dart'; - -void barcodeDetectorTests() { - group('$BarcodeDetector', () { - final BarcodeDetector detector = FirebaseVision.instance.barcodeDetector(); - - test('detectInImage', () async { - final String tmpFilename = await _loadImage('assets/test_barcode.jpg'); - final FirebaseVisionImage visionImage = - FirebaseVisionImage.fromFilePath(tmpFilename); - - final List barcodes = await detector.detectInImage( - visionImage, - ); - - expect(barcodes.length, 1); - }); - - test('detectInImage contactInfo', () async { - final String tmpFilename = await _loadImage( - 'assets/test_contact_barcode.png', - ); - - final FirebaseVisionImage visionImage = FirebaseVisionImage.fromFilePath( - tmpFilename, - ); - - final BarcodeDetector detector = - FirebaseVision.instance.barcodeDetector(); - final List barcodes = await detector.detectInImage( - visionImage, - ); - - expect(barcodes, hasLength(1)); - final BarcodeContactInfo info = barcodes[0].contactInfo; - - final BarcodePersonName name = info.name; - expect(name.first, 'John'); - expect(name.last, 'Doe'); - expect(name.formattedName, 'John Doe'); - expect(name.middle, anyOf(isNull, isEmpty)); - expect(name.prefix, anyOf(isNull, isEmpty)); - expect(name.pronunciation, anyOf(isNull, isEmpty)); - expect(name.suffix, anyOf(isNull, isEmpty)); - - expect(info.jobTitle, anyOf(isNull, isEmpty)); - expect(info.organization, anyOf(isNull, isEmpty)); - expect(info.urls, ['http://www.example.com']); - expect(info.addresses, anyOf(isNull, isEmpty)); - - expect(info.emails, hasLength(1)); - final BarcodeEmail email = info.emails[0]; - expect(email.address, 'email@example.com'); - expect(email.body, anyOf(isNull, isEmpty)); - expect(email.subject, anyOf(isNull, isEmpty)); - expect(email.type, BarcodeEmailType.unknown); - - expect(info.phones, hasLength(1)); - final BarcodePhone phone = info.phones[0]; - expect(phone.number, '555-555-5555'); - expect(phone.type, BarcodePhoneType.unknown); - }); - - test('close', () { - expect(detector.close(), completes); - }); - }); -} diff --git a/packages/firebase_ml_vision/example/test_driver/face_detector.dart b/packages/firebase_ml_vision/example/test_driver/face_detector.dart deleted file mode 100644 index 666b200e301c..000000000000 --- a/packages/firebase_ml_vision/example/test_driver/face_detector.dart +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of 'firebase_ml_vision.dart'; - -void faceDetectorTests() { - group('$FaceDetector', () { - final FaceDetector detector = FirebaseVision.instance.faceDetector( - FaceDetectorOptions( - enableContours: true, mode: FaceDetectorMode.accurate), - ); - - test('processImage', () async { - final String tmpFilename = await _loadImage('assets/test_face.jpg'); - final FirebaseVisionImage visionImage = - FirebaseVisionImage.fromFilePath(tmpFilename); - - final List faces = await detector.processImage(visionImage); - - expect(faces.length, 1); - expect( - faces[0].getContour(FaceContourType.allPoints).positionsList, - isNotEmpty, - ); - }); - - test('close', () { - expect(detector.close(), completes); - }); - }); -} diff --git a/packages/firebase_ml_vision/example/test_driver/firebase_ml_vision.dart b/packages/firebase_ml_vision/example/test_driver/firebase_ml_vision.dart deleted file mode 100644 index 18ab23047250..000000000000 --- a/packages/firebase_ml_vision/example/test_driver/firebase_ml_vision.dart +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:io'; -import 'dart:typed_data'; - -import 'package:flutter/services.dart'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:path/path.dart' as path; -import 'package:path_provider/path_provider.dart'; - -part 'barcode_detector.dart'; -part 'face_detector.dart'; -part 'image_labeler.dart'; -part 'text_recognizer.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$FirebaseVision', () { - barcodeDetectorTests(); - faceDetectorTests(); - imageLabelerTests(); - textRecognizerTests(); - }); -} - -int nextHandle = 0; - -// Since there is no way to get the full asset filename, this method loads the -// image into a temporary file. -Future _loadImage(String assetFilename) async { - final Directory directory = await getTemporaryDirectory(); - - final String tmpFilename = path.join( - directory.path, - "tmp${nextHandle++}.jpg", - ); - - final ByteData data = await rootBundle.load(assetFilename); - final Uint8List bytes = data.buffer.asUint8List( - data.offsetInBytes, - data.lengthInBytes, - ); - - await File(tmpFilename).writeAsBytes(bytes); - - return tmpFilename; -} diff --git a/packages/firebase_ml_vision/example/test_driver/firebase_ml_vision_test.dart b/packages/firebase_ml_vision/example/test_driver/firebase_ml_vision_test.dart deleted file mode 100644 index b9753054ad5b..000000000000 --- a/packages/firebase_ml_vision/example/test_driver/firebase_ml_vision_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_driver/flutter_driver.dart'; - -void main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_ml_vision/example/test_driver/image_labeler.dart b/packages/firebase_ml_vision/example/test_driver/image_labeler.dart deleted file mode 100644 index fa1655583271..000000000000 --- a/packages/firebase_ml_vision/example/test_driver/image_labeler.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of 'firebase_ml_vision.dart'; - -void imageLabelerTests() { - group('$ImageLabeler', () { - final ImageLabeler labeler = FirebaseVision.instance.imageLabeler(); - - test('processImage', () async { - final String tmpFilename = await _loadImage('assets/test_barcode.jpg'); - final FirebaseVisionImage visionImage = - FirebaseVisionImage.fromFilePath(tmpFilename); - - final List labels = await labeler.processImage(visionImage); - - expect(labels.length, greaterThan(0)); - }); - - test('close', () { - expect(labeler.close(), completes); - }); - }); -} diff --git a/packages/firebase_ml_vision/example/test_driver/text_recognizer.dart b/packages/firebase_ml_vision/example/test_driver/text_recognizer.dart deleted file mode 100644 index 49810f32db50..000000000000 --- a/packages/firebase_ml_vision/example/test_driver/text_recognizer.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of 'firebase_ml_vision.dart'; - -void textRecognizerTests() { - group('$TextRecognizer', () { - final TextRecognizer recognizer = FirebaseVision.instance.textRecognizer(); - - test('processImage', () async { - final String tmpFilename = await _loadImage('assets/test_text.png'); - final FirebaseVisionImage visionImage = - FirebaseVisionImage.fromFilePath(tmpFilename); - - final VisionText text = await recognizer.processImage(visionImage); - - expect(text.text, 'TEXT'); - }); - - test('close', () { - expect(recognizer.close(), completes); - }); - }); -} diff --git a/packages/firebase_ml_vision/ios/Assets/.gitkeep b/packages/firebase_ml_vision/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_ml_vision/ios/Classes/BarcodeDetector.m b/packages/firebase_ml_vision/ios/Classes/BarcodeDetector.m deleted file mode 100644 index 810b2417dfbf..000000000000 --- a/packages/firebase_ml_vision/ios/Classes/BarcodeDetector.m +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseMlVisionPlugin.h" - -@interface BarcodeDetector () -@property FIRVisionBarcodeDetector *detector; -@end - -@implementation BarcodeDetector -- (instancetype)initWithVision:(FIRVision *)vision options:(NSDictionary *)options { - self = [super init]; - if (self) { - _detector = [vision barcodeDetectorWithOptions:[BarcodeDetector parseOptions:options]]; - } - return self; -} - -- (void)handleDetection:(FIRVisionImage *)image result:(FlutterResult)result { - [_detector detectInImage:image - completion:^(NSArray *barcodes, NSError *error) { - if (error) { - [FLTFirebaseMlVisionPlugin handleError:error result:result]; - return; - } else if (!barcodes) { - result(@[]); - return; - } - - NSMutableArray *ret = [NSMutableArray array]; - for (FIRVisionBarcode *barcode in barcodes) { - [ret addObject:visionBarcodeToDictionary(barcode)]; - } - result(ret); - }]; -} - -NSDictionary *visionBarcodeToDictionary(FIRVisionBarcode *barcode) { - __block NSMutableArray *points = [NSMutableArray array]; - - for (NSValue *point in barcode.cornerPoints) { - [points addObject:@[ @(point.CGPointValue.x), @(point.CGPointValue.y) ]]; - } - return @{ - @"rawValue" : barcode.rawValue, - @"displayValue" : barcode.displayValue ? barcode.displayValue : [NSNull null], - @"left" : @(barcode.frame.origin.x), - @"top" : @(barcode.frame.origin.y), - @"width" : @(barcode.frame.size.width), - @"height" : @(barcode.frame.size.height), - @"format" : @(barcode.format), - @"valueType" : @(barcode.valueType), - @"points" : points, - @"wifi" : barcode.wifi ? visionBarcodeWiFiToDictionary(barcode.wifi) : [NSNull null], - @"email" : barcode.email ? visionBarcodeEmailToDictionary(barcode.email) : [NSNull null], - @"phone" : barcode.phone ? visionBarcodePhoneToDictionary(barcode.phone) : [NSNull null], - @"sms" : barcode.sms ? visionBarcodeSMSToDictionary(barcode.sms) : [NSNull null], - @"url" : barcode.URL ? visionBarcodeURLToDictionary(barcode.URL) : [NSNull null], - @"geoPoint" : barcode.geoPoint ? visionBarcodeGeoPointToDictionary(barcode.geoPoint) - : [NSNull null], - @"contactInfo" : barcode.contactInfo ? barcodeContactInfoToDictionary(barcode.contactInfo) - : [NSNull null], - @"calendarEvent" : barcode.calendarEvent ? calendarEventToDictionary(barcode.calendarEvent) - : [NSNull null], - @"driverLicense" : barcode.driverLicense ? driverLicenseToDictionary(barcode.driverLicense) - : [NSNull null], - }; -} - -NSDictionary *visionBarcodeWiFiToDictionary(FIRVisionBarcodeWiFi *wifi) { - return @{ - @"ssid" : wifi.ssid, - @"password" : wifi.password, - @"encryptionType" : @(wifi.type), - }; -} - -NSDictionary *visionBarcodeEmailToDictionary(FIRVisionBarcodeEmail *email) { - return @{ - @"address" : email.address, - @"body" : email.body, - @"subject" : email.subject, - @"type" : @(email.type), - }; -} - -NSDictionary *visionBarcodePhoneToDictionary(FIRVisionBarcodePhone *phone) { - return @{ - @"number" : phone.number, - @"type" : @(phone.type), - }; -} - -NSDictionary *visionBarcodeSMSToDictionary(FIRVisionBarcodeSMS *sms) { - return @{ - @"phoneNumber" : sms.phoneNumber, - @"message" : sms.message, - }; -} - -NSDictionary *visionBarcodeURLToDictionary(FIRVisionBarcodeURLBookmark *url) { - return @{ - @"title" : url.title ? url.title : [NSNull null], - @"url" : url.url ? url.url : [NSNull null], - }; -} - -NSDictionary *visionBarcodeGeoPointToDictionary(FIRVisionBarcodeGeoPoint *geo) { - return @{ - @"longitude" : @(geo.longitude), - @"latitude" : @(geo.latitude), - }; -} - -NSDictionary *barcodeContactInfoToDictionary(FIRVisionBarcodeContactInfo *contact) { - __block NSMutableArray *addresses = [NSMutableArray array]; - [contact.addresses enumerateObjectsUsingBlock:^(FIRVisionBarcodeAddress *_Nonnull address, - NSUInteger idx, BOOL *_Nonnull stop) { - __block NSMutableArray *addressLines = [NSMutableArray array]; - [address.addressLines enumerateObjectsUsingBlock:^(NSString *_Nonnull addressLine, - NSUInteger idx, BOOL *_Nonnull stop) { - [addressLines addObject:addressLine]; - }]; - [addresses addObject:@{ - @"addressLines" : addressLines, - @"type" : @(address.type), - }]; - }]; - - __block NSMutableArray *emails = [NSMutableArray array]; - [contact.emails enumerateObjectsUsingBlock:^(FIRVisionBarcodeEmail *_Nonnull email, - NSUInteger idx, BOOL *_Nonnull stop) { - [emails addObject:@{ - @"address" : email.address ? email.address : [NSNull null], - @"body" : email.body ? email.body : [NSNull null], - @"subject" : email.subject ? email.subject : [NSNull null], - @"type" : @(email.type), - }]; - }]; - - __block NSMutableArray *phones = [NSMutableArray array]; - [contact.phones enumerateObjectsUsingBlock:^(FIRVisionBarcodePhone *_Nonnull phone, - NSUInteger idx, BOOL *_Nonnull stop) { - [phones addObject:@{ - @"number" : phone.number ? phone.number : [NSNull null], - @"type" : @(phone.type), - }]; - }]; - - __block NSMutableArray *urls = [NSMutableArray array]; - [contact.urls - enumerateObjectsUsingBlock:^(NSString *_Nonnull url, NSUInteger idx, BOOL *_Nonnull stop) { - [urls addObject:url]; - }]; - return @{ - @"addresses" : addresses, - @"emails" : emails, - @"phones" : phones, - @"urls" : urls, - @"name" : @{ - @"formattedName" : contact.name.formattedName ? contact.name.formattedName : [NSNull null], - @"first" : contact.name.first ? contact.name.first : [NSNull null], - @"last" : contact.name.last ? contact.name.last : [NSNull null], - @"middle" : contact.name.middle ? contact.name.middle : [NSNull null], - @"prefix" : contact.name.prefix ? contact.name.prefix : [NSNull null], - @"pronunciation" : contact.name.pronounciation ? contact.name.pronounciation : [NSNull null], - @"suffix" : contact.name.suffix ? contact.name.suffix : [NSNull null], - }, - @"jobTitle" : contact.jobTitle ? contact.jobTitle : [NSNull null], - @"organization" : contact.organization ? contact.jobTitle : [NSNull null], - }; -} - -NSDictionary *calendarEventToDictionary(FIRVisionBarcodeCalendarEvent *calendar) { - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; - dateFormatter.dateFormat = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"; - dateFormatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; - return @{ - @"eventDescription" : calendar.eventDescription, - @"location" : calendar.location, - @"organizer" : calendar.organizer, - @"status" : calendar.status, - @"summary" : calendar.summary, - @"start" : [dateFormatter stringFromDate:calendar.start], - @"end" : [dateFormatter stringFromDate:calendar.end], - }; -} - -NSDictionary *driverLicenseToDictionary(FIRVisionBarcodeDriverLicense *license) { - return @{ - @"firstName" : license.firstName, - @"middleName" : license.middleName, - @"lastName" : license.lastName, - @"gender" : license.gender, - @"addressCity" : license.addressCity, - @"addressStreet" : license.addressStreet, - @"addressState" : license.addressState, - @"addressZip" : license.addressZip, - @"birthDate" : license.birthDate, - @"documentType" : license.documentType, - @"licenseNumber" : license.licenseNumber, - @"expiryDate" : license.expiryDate, - @"issuingDate" : license.issuingDate, - @"issuingCountry" : license.issuingCountry, - }; -} - -+ (FIRVisionBarcodeDetectorOptions *)parseOptions:(NSDictionary *)optionsData { - NSNumber *barcodeFormat = optionsData[@"barcodeFormats"]; - return [[FIRVisionBarcodeDetectorOptions alloc] - initWithFormats:(FIRVisionBarcodeFormat)barcodeFormat.intValue]; -} -@end diff --git a/packages/firebase_ml_vision/ios/Classes/FaceDetector.m b/packages/firebase_ml_vision/ios/Classes/FaceDetector.m deleted file mode 100644 index 9d9bed56567f..000000000000 --- a/packages/firebase_ml_vision/ios/Classes/FaceDetector.m +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseMlVisionPlugin.h" - -@interface FaceDetector () -@property FIRVisionFaceDetector *detector; -@end - -@implementation FaceDetector -- (instancetype)initWithVision:(FIRVision *)vision options:(NSDictionary *)options { - self = [super init]; - if (self) { - _detector = [vision faceDetectorWithOptions:[FaceDetector parseOptions:options]]; - } - return self; -} - -- (void)handleDetection:(FIRVisionImage *)image result:(FlutterResult)result { - [_detector - processImage:image - completion:^(NSArray *_Nullable faces, NSError *_Nullable error) { - if (error) { - [FLTFirebaseMlVisionPlugin handleError:error result:result]; - return; - } else if (!faces) { - result(@[]); - return; - } - - NSMutableArray *faceData = [NSMutableArray array]; - for (FIRVisionFace *face in faces) { - id smileProb = face.hasSmilingProbability ? @(face.smilingProbability) : [NSNull null]; - id leftProb = - face.hasLeftEyeOpenProbability ? @(face.leftEyeOpenProbability) : [NSNull null]; - id rightProb = - face.hasRightEyeOpenProbability ? @(face.rightEyeOpenProbability) : [NSNull null]; - - NSDictionary *data = @{ - @"left" : @(face.frame.origin.x), - @"top" : @(face.frame.origin.y), - @"width" : @(face.frame.size.width), - @"height" : @(face.frame.size.height), - @"headEulerAngleY" : face.hasHeadEulerAngleY ? @(face.headEulerAngleY) - : [NSNull null], - @"headEulerAngleZ" : face.hasHeadEulerAngleZ ? @(face.headEulerAngleZ) - : [NSNull null], - @"smilingProbability" : smileProb, - @"leftEyeOpenProbability" : leftProb, - @"rightEyeOpenProbability" : rightProb, - @"trackingId" : face.hasTrackingID ? @(face.trackingID) : [NSNull null], - @"landmarks" : @{ - @"bottomMouth" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeMouthBottom], - @"leftCheek" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeLeftCheek], - @"leftEar" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeLeftEar], - @"leftEye" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeLeftEye], - @"leftMouth" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeMouthLeft], - @"noseBase" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeNoseBase], - @"rightCheek" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeRightCheek], - @"rightEar" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeRightEar], - @"rightEye" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeRightEye], - @"rightMouth" : [FaceDetector getLandmarkPosition:face - landmark:FIRFaceLandmarkTypeMouthRight], - }, - @"contours" : @{ - @"allPoints" : [FaceDetector getContourPoints:face contour:FIRFaceContourTypeAll], - @"face" : [FaceDetector getContourPoints:face contour:FIRFaceContourTypeFace], - @"leftEye" : [FaceDetector getContourPoints:face contour:FIRFaceContourTypeLeftEye], - @"leftEyebrowBottom" : - [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeLeftEyebrowBottom], - @"leftEyebrowTop" : - [FaceDetector getContourPoints:face contour:FIRFaceContourTypeLeftEyebrowTop], - @"lowerLipBottom" : - [FaceDetector getContourPoints:face contour:FIRFaceContourTypeLowerLipBottom], - @"lowerLipTop" : [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeLowerLipTop], - @"noseBottom" : [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeNoseBottom], - @"noseBridge" : [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeNoseBridge], - @"rightEye" : [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeRightEye], - @"rightEyebrowBottom" : - [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeRightEyebrowBottom], - @"rightEyebrowTop" : - [FaceDetector getContourPoints:face contour:FIRFaceContourTypeRightEyebrowTop], - @"upperLipBottom" : - [FaceDetector getContourPoints:face contour:FIRFaceContourTypeUpperLipBottom], - @"upperLipTop" : [FaceDetector getContourPoints:face - contour:FIRFaceContourTypeUpperLipTop], - } - }; - - [faceData addObject:data]; - } - - result(faceData); - }]; -} - -+ (id)getLandmarkPosition:(FIRVisionFace *)face landmark:(FIRFaceLandmarkType)landmarkType { - FIRVisionFaceLandmark *landmark = [face landmarkOfType:landmarkType]; - if (landmark) { - return @[ landmark.position.x, landmark.position.y ]; - } - - return [NSNull null]; -} - -+ (id)getContourPoints:(FIRVisionFace *)face contour:(FIRFaceContourType)contourType { - FIRVisionFaceContour *contour = [face contourOfType:contourType]; - if (contour) { - NSArray *contourPoints = contour.points; - NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:[contourPoints count]]; - for (int i = 0; i < [contourPoints count]; i++) { - FIRVisionPoint *point = [contourPoints objectAtIndex:i]; - [result insertObject:@[ point.x, point.y ] atIndex:i]; - } - return [result copy]; - } - - return [NSNull null]; -} - -+ (FIRVisionFaceDetectorOptions *)parseOptions:(NSDictionary *)optionsData { - FIRVisionFaceDetectorOptions *options = [[FIRVisionFaceDetectorOptions alloc] init]; - - NSNumber *enableClassification = optionsData[@"enableClassification"]; - if (enableClassification.boolValue) { - options.classificationMode = FIRVisionFaceDetectorClassificationModeAll; - } else { - options.classificationMode = FIRVisionFaceDetectorClassificationModeNone; - } - - NSNumber *enableLandmarks = optionsData[@"enableLandmarks"]; - if (enableLandmarks.boolValue) { - options.landmarkMode = FIRVisionFaceDetectorLandmarkModeAll; - } else { - options.landmarkMode = FIRVisionFaceDetectorLandmarkModeNone; - } - - NSNumber *enableContours = optionsData[@"enableContours"]; - if (enableContours.boolValue) { - options.contourMode = FIRVisionFaceDetectorContourModeAll; - } else { - options.contourMode = FIRVisionFaceDetectorContourModeNone; - } - - NSNumber *enableTracking = optionsData[@"enableTracking"]; - options.trackingEnabled = enableTracking.boolValue; - - NSNumber *minFaceSize = optionsData[@"minFaceSize"]; - options.minFaceSize = [minFaceSize doubleValue]; - - NSString *mode = optionsData[@"mode"]; - if ([mode isEqualToString:@"accurate"]) { - options.performanceMode = FIRVisionFaceDetectorPerformanceModeAccurate; - } else if ([mode isEqualToString:@"fast"]) { - options.performanceMode = FIRVisionFaceDetectorPerformanceModeFast; - } - - return options; -} -@end diff --git a/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h b/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h deleted file mode 100644 index 78060e8e1a08..000000000000 --- a/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -#import "Firebase/Firebase.h" - -@interface FLTFirebaseMlVisionPlugin : NSObject -+ (void)handleError:(NSError *)error result:(FlutterResult)result; -@end - -@protocol Detector -@required -- (instancetype)initWithVision:(FIRVision *)vision options:(NSDictionary *)options; -- (void)handleDetection:(FIRVisionImage *)image result:(FlutterResult)result; -@optional -@end - -@interface BarcodeDetector : NSObject -@end - -@interface FaceDetector : NSObject -@end - -@interface ImageLabeler : NSObject -@end - -@interface TextRecognizer : NSObject -@end diff --git a/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.m b/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.m deleted file mode 100644 index d453b7928852..000000000000 --- a/packages/firebase_ml_vision/ios/Classes/FirebaseMlVisionPlugin.m +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseMlVisionPlugin.h" -#import "UserAgent.h" - -static FlutterError *getFlutterError(NSError *error) { - return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %d", (int)error.code] - message:error.domain - details:error.localizedDescription]; -} - -@implementation FLTFirebaseMlVisionPlugin -static NSMutableDictionary> *detectors; - -+ (void)handleError:(NSError *)error result:(FlutterResult)result { - result(getFlutterError(error)); -} - -+ (void)registerWithRegistrar:(NSObject *)registrar { - detectors = [NSMutableDictionary new]; - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_ml_vision" - binaryMessenger:[registrar messenger]]; - FLTFirebaseMlVisionPlugin *instance = [[FLTFirebaseMlVisionPlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"BarcodeDetector#detectInImage" isEqualToString:call.method] || - [@"FaceDetector#processImage" isEqualToString:call.method] || - [@"ImageLabeler#processImage" isEqualToString:call.method] || - [@"TextRecognizer#processImage" isEqualToString:call.method]) { - [self handleDetection:call result:result]; - } else if ([@"BarcodeDetector#close" isEqualToString:call.method] || - [@"FaceDetector#close" isEqualToString:call.method] || - [@"ImageLabeler#close" isEqualToString:call.method] || - [@"TextRecognizer#close" isEqualToString:call.method]) { - NSNumber *handle = call.arguments[@"handle"]; - [detectors removeObjectForKey:handle]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -- (void)handleDetection:(FlutterMethodCall *)call result:(FlutterResult)result { - FIRVisionImage *image = [self dataToVisionImage:call.arguments]; - NSDictionary *options = call.arguments[@"options"]; - - NSNumber *handle = call.arguments[@"handle"]; - id detector = detectors[handle]; - if (!detector) { - if ([call.method hasPrefix:@"BarcodeDetector"]) { - detector = [[BarcodeDetector alloc] initWithVision:[FIRVision vision] options:options]; - } else if ([call.method hasPrefix:@"FaceDetector"]) { - detector = [[FaceDetector alloc] initWithVision:[FIRVision vision] options:options]; - } else if ([call.method hasPrefix:@"ImageLabeler"]) { - detector = [[ImageLabeler alloc] initWithVision:[FIRVision vision] options:options]; - } else if ([call.method hasPrefix:@"TextRecognizer"]) { - detector = [[TextRecognizer alloc] initWithVision:[FIRVision vision] options:options]; - } - - [FLTFirebaseMlVisionPlugin addDetector:handle detector:detector]; - } - - [detectors[handle] handleDetection:image result:result]; -} - -- (FIRVisionImage *)dataToVisionImage:(NSDictionary *)imageData { - NSString *imageType = imageData[@"type"]; - - if ([@"file" isEqualToString:imageType]) { - return [self filePathToVisionImage:imageData[@"path"]]; - } else if ([@"bytes" isEqualToString:imageType]) { - return [self bytesToVisionImage:imageData]; - } else { - NSString *errorReason = [NSString stringWithFormat:@"No image type for: %@", imageType]; - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:errorReason - userInfo:nil]; - } -} - -- (FIRVisionImage *)filePathToVisionImage:(NSString *)filePath { - UIImage *image = [UIImage imageWithContentsOfFile:filePath]; - - if (image.imageOrientation != UIImageOrientationUp) { - CGImageRef imgRef = image.CGImage; - CGRect bounds = CGRectMake(0, 0, CGImageGetWidth(imgRef), CGImageGetHeight(imgRef)); - UIGraphicsBeginImageContext(bounds.size); - CGContextDrawImage(UIGraphicsGetCurrentContext(), bounds, imgRef); - UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - image = newImage; - } - - return [[FIRVisionImage alloc] initWithImage:image]; -} - -- (FIRVisionImage *)bytesToVisionImage:(NSDictionary *)imageData { - FlutterStandardTypedData *byteData = imageData[@"bytes"]; - NSData *imageBytes = byteData.data; - - NSDictionary *metadata = imageData[@"metadata"]; - NSArray *planeData = metadata[@"planeData"]; - size_t planeCount = planeData.count; - - NSNumber *width = metadata[@"width"]; - NSNumber *height = metadata[@"height"]; - - NSNumber *rawFormat = metadata[@"rawFormat"]; - FourCharCode format = FOUR_CHAR_CODE(rawFormat.unsignedIntValue); - - CVPixelBufferRef pxBuffer = NULL; - if (planeCount == 0) { - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"Can't create image buffer with 0 planes." - userInfo:nil]; - } else if (planeCount == 1) { - NSDictionary *plane = planeData[0]; - NSNumber *bytesPerRow = plane[@"bytesPerRow"]; - - pxBuffer = [self bytesToPixelBuffer:width.unsignedLongValue - height:height.unsignedLongValue - format:format - baseAddress:(void *)imageBytes.bytes - bytesPerRow:bytesPerRow.unsignedLongValue]; - } else { - pxBuffer = [self planarBytesToPixelBuffer:width.unsignedLongValue - height:height.unsignedLongValue - format:format - baseAddress:(void *)imageBytes.bytes - dataSize:imageBytes.length - planeCount:planeCount - planeData:planeData]; - } - - return [self pixelBufferToVisionImage:pxBuffer]; -} - -- (CVPixelBufferRef)bytesToPixelBuffer:(size_t)width - height:(size_t)height - format:(FourCharCode)format - baseAddress:(void *)baseAddress - bytesPerRow:(size_t)bytesPerRow { - CVPixelBufferRef pxBuffer = NULL; - CVPixelBufferCreateWithBytes(kCFAllocatorDefault, width, height, format, baseAddress, bytesPerRow, - NULL, NULL, NULL, &pxBuffer); - return pxBuffer; -} - -- (CVPixelBufferRef)planarBytesToPixelBuffer:(size_t)width - height:(size_t)height - format:(FourCharCode)format - baseAddress:(void *)baseAddress - dataSize:(size_t)dataSize - planeCount:(size_t)planeCount - planeData:(NSArray *)planeData { - size_t widths[planeCount]; - size_t heights[planeCount]; - size_t bytesPerRows[planeCount]; - - void *baseAddresses[planeCount]; - baseAddresses[0] = baseAddress; - - size_t lastAddressIndex = 0; // Used to get base address for each plane - for (int i = 0; i < planeCount; i++) { - NSDictionary *plane = planeData[i]; - - NSNumber *width = plane[@"width"]; - NSNumber *height = plane[@"height"]; - NSNumber *bytesPerRow = plane[@"bytesPerRow"]; - - widths[i] = width.unsignedLongValue; - heights[i] = height.unsignedLongValue; - bytesPerRows[i] = bytesPerRow.unsignedLongValue; - - if (i > 0) { - size_t addressIndex = lastAddressIndex + heights[i - 1] * bytesPerRows[i - 1]; - baseAddresses[i] = baseAddress + addressIndex; - lastAddressIndex = addressIndex; - } - } - - CVPixelBufferRef pxBuffer = NULL; - CVPixelBufferCreateWithPlanarBytes(kCFAllocatorDefault, width, height, format, NULL, dataSize, - planeCount, baseAddresses, widths, heights, bytesPerRows, NULL, - NULL, NULL, &pxBuffer); - - return pxBuffer; -} - -- (FIRVisionImage *)pixelBufferToVisionImage:(CVPixelBufferRef)pixelBufferRef { - CIImage *ciImage = [CIImage imageWithCVPixelBuffer:pixelBufferRef]; - - CIContext *temporaryContext = [CIContext contextWithOptions:nil]; - CGImageRef videoImage = - [temporaryContext createCGImage:ciImage - fromRect:CGRectMake(0, 0, CVPixelBufferGetWidth(pixelBufferRef), - CVPixelBufferGetHeight(pixelBufferRef))]; - - UIImage *uiImage = [UIImage imageWithCGImage:videoImage]; - CVPixelBufferRelease(pixelBufferRef); - CGImageRelease(videoImage); - return [[FIRVisionImage alloc] initWithImage:uiImage]; -} - -+ (void)addDetector:(NSNumber *)handle detector:(id)detector { - if (detectors[handle]) { - NSString *reason = - [[NSString alloc] initWithFormat:@"Object for handle already exists: %d", handle.intValue]; - @throw [[NSException alloc] initWithName:NSInvalidArgumentException reason:reason userInfo:nil]; - } - - detectors[handle] = detector; -} -@end diff --git a/packages/firebase_ml_vision/ios/Classes/ImageLabeler.m b/packages/firebase_ml_vision/ios/Classes/ImageLabeler.m deleted file mode 100644 index 6cb8341597bc..000000000000 --- a/packages/firebase_ml_vision/ios/Classes/ImageLabeler.m +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseMlVisionPlugin.h" - -@interface ImageLabeler () -@property FIRVisionImageLabeler *labeler; -@end - -@implementation ImageLabeler -- (instancetype)initWithVision:(FIRVision *)vision options:(NSDictionary *)options { - self = [super init]; - if (self) { - if ([@"onDevice" isEqualToString:options[@"modelType"]]) { - _labeler = [vision onDeviceImageLabelerWithOptions:[ImageLabeler parseOptions:options]]; - } else if ([@"cloud" isEqualToString:options[@"modelType"]]) { - _labeler = [vision cloudImageLabelerWithOptions:[ImageLabeler parseCloudOptions:options]]; - } else { - NSString *reason = - [NSString stringWithFormat:@"Invalid model type: %@", options[@"modelType"]]; - @throw [[NSException alloc] initWithName:NSInvalidArgumentException - reason:reason - userInfo:nil]; - } - } - return self; -} - -- (void)handleDetection:(FIRVisionImage *)image result:(FlutterResult)result { - [_labeler - processImage:image - completion:^(NSArray *_Nullable labels, NSError *_Nullable error) { - if (error) { - [FLTFirebaseMlVisionPlugin handleError:error result:result]; - return; - } else if (!labels) { - result(@[]); - } - - NSMutableArray *labelData = [NSMutableArray array]; - for (FIRVisionImageLabel *label in labels) { - NSDictionary *data = @{ - @"confidence" : label.confidence, - @"entityID" : label.entityID, - @"text" : label.text, - }; - [labelData addObject:data]; - } - - result(labelData); - }]; -} - -+ (FIRVisionOnDeviceImageLabelerOptions *)parseOptions:(NSDictionary *)optionsData { - NSNumber *conf = optionsData[@"confidenceThreshold"]; - - FIRVisionOnDeviceImageLabelerOptions *options = [FIRVisionOnDeviceImageLabelerOptions new]; - options.confidenceThreshold = [conf floatValue]; - - return options; -} - -+ (FIRVisionCloudImageLabelerOptions *)parseCloudOptions:(NSDictionary *)optionsData { - NSNumber *conf = optionsData[@"confidenceThreshold"]; - - FIRVisionCloudImageLabelerOptions *options = [FIRVisionCloudImageLabelerOptions new]; - options.confidenceThreshold = [conf floatValue]; - - return options; -} -@end diff --git a/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m b/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m deleted file mode 100644 index a6f401b9ca39..000000000000 --- a/packages/firebase_ml_vision/ios/Classes/TextRecognizer.m +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseMlVisionPlugin.h" - -@interface TextRecognizer () -@property FIRVisionTextRecognizer *recognizer; -@end - -@implementation TextRecognizer -- (instancetype)initWithVision:(FIRVision *)vision options:(NSDictionary *)options { - self = [super init]; - if (self) { - if ([@"onDevice" isEqualToString:options[@"modelType"]]) { - _recognizer = [vision onDeviceTextRecognizer]; - } else if ([@"cloud" isEqualToString:options[@"modelType"]]) { - _recognizer = [vision cloudTextRecognizer]; - } else { - NSString *reason = - [NSString stringWithFormat:@"Invalid model type: %@", options[@"modelType"]]; - @throw [[NSException alloc] initWithName:NSInvalidArgumentException - reason:reason - userInfo:nil]; - } - } - return self; -} - -- (void)handleDetection:(FIRVisionImage *)image result:(FlutterResult)result { - [_recognizer processImage:image - completion:^(FIRVisionText *_Nullable visionText, NSError *_Nullable error) { - if (error) { - [FLTFirebaseMlVisionPlugin handleError:error result:result]; - return; - } else if (!visionText) { - result(@{@"text" : @"", @"blocks" : @[]}); - return; - } - - NSMutableDictionary *visionTextData = [NSMutableDictionary dictionary]; - visionTextData[@"text"] = visionText.text; - - NSMutableArray *allBlockData = [NSMutableArray array]; - for (FIRVisionTextBlock *block in visionText.blocks) { - NSMutableDictionary *blockData = [NSMutableDictionary dictionary]; - - [self addData:blockData - confidence:block.confidence - cornerPoints:block.cornerPoints - frame:block.frame - languages:block.recognizedLanguages - text:block.text]; - - NSMutableArray *allLineData = [NSMutableArray array]; - for (FIRVisionTextLine *line in block.lines) { - NSMutableDictionary *lineData = [NSMutableDictionary dictionary]; - - [self addData:lineData - confidence:line.confidence - cornerPoints:line.cornerPoints - frame:line.frame - languages:line.recognizedLanguages - text:line.text]; - - NSMutableArray *allElementData = [NSMutableArray array]; - for (FIRVisionTextElement *element in line.elements) { - NSMutableDictionary *elementData = [NSMutableDictionary dictionary]; - - [self addData:elementData - confidence:element.confidence - cornerPoints:element.cornerPoints - frame:element.frame - languages:element.recognizedLanguages - text:element.text]; - - [allElementData addObject:elementData]; - } - - lineData[@"elements"] = allElementData; - [allLineData addObject:lineData]; - } - - blockData[@"lines"] = allLineData; - [allBlockData addObject:blockData]; - } - - visionTextData[@"blocks"] = allBlockData; - result(visionTextData); - }]; -} - -- (void)addData:(NSMutableDictionary *)addTo - confidence:(NSNumber *)confidence - cornerPoints:(NSArray *)cornerPoints - frame:(CGRect)frame - languages:(NSArray *)languages - text:(NSString *)text { - __block NSMutableArray *points = [NSMutableArray array]; - - for (NSValue *point in cornerPoints) { - [points addObject:@[ @(point.CGPointValue.x), @(point.CGPointValue.y) ]]; - } - - __block NSMutableArray *allLanguageData = [NSMutableArray array]; - for (FIRVisionTextRecognizedLanguage *language in languages) { - [allLanguageData addObject:@{ - @"languageCode" : language.languageCode ? language.languageCode : [NSNull null] - }]; - } - - [addTo addEntriesFromDictionary:@{ - @"confidence" : confidence ? confidence : [NSNull null], - @"points" : points, - @"left" : @(frame.origin.x), - @"top" : @(frame.origin.y), - @"width" : @(frame.size.width), - @"height" : @(frame.size.height), - @"recognizedLanguages" : allLanguageData, - @"text" : text, - }]; -} -@end diff --git a/packages/firebase_ml_vision/ios/firebase_ml_vision.podspec b/packages/firebase_ml_vision/ios/firebase_ml_vision.podspec deleted file mode 100644 index eb497c1db866..000000000000 --- a/packages/firebase_ml_vision/ios/firebase_ml_vision.podspec +++ /dev/null @@ -1,34 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_ml_vision' - s.version = '0.1.1' - s.summary = 'Flutter plugin for Google ML Vision for Firebase.' - s.description = <<-DESC -An SDK that brings Google's machine learning expertise to Android and iOS apps in a powerful yet - easy-to-use package. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_ml_vision' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/MLVision' - s.ios.deployment_target = '9.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-ml-vis\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_ml_vision/lib/firebase_ml_vision.dart b/packages/firebase_ml_vision/lib/firebase_ml_vision.dart deleted file mode 100644 index 7e90b95b4a44..000000000000 --- a/packages/firebase_ml_vision/lib/firebase_ml_vision.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_ml_vision; - -import 'dart:async'; -import 'dart:io'; -import 'dart:typed_data'; -import 'dart:ui'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; - -part 'src/barcode_detector.dart'; -part 'src/face_detector.dart'; -part 'src/firebase_vision.dart'; -part 'src/image_labeler.dart'; -part 'src/text_recognizer.dart'; diff --git a/packages/firebase_ml_vision/lib/src/barcode_detector.dart b/packages/firebase_ml_vision/lib/src/barcode_detector.dart deleted file mode 100644 index d7e3eb76b212..000000000000 --- a/packages/firebase_ml_vision/lib/src/barcode_detector.dart +++ /dev/null @@ -1,661 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_ml_vision; - -/// Enumeration of supported barcode content value types for [Barcode.valueType]. -/// -/// Note that the built-in parsers only recognize a few popular value -/// structures. For your specific use case, you may want to implement your own -/// parsing logic. -enum BarcodeValueType { - /// Unknown Barcode value types. - unknown, - - /// Barcode value type for contact info. - contactInfo, - - /// Barcode value type for email addresses. - email, - - /// Barcode value type for ISBNs. - isbn, - - /// Barcode value type for phone numbers. - phone, - - /// Barcode value type for product codes. - product, - - /// Barcode value type for SMS details. - sms, - - /// Barcode value type for plain text. - text, - - /// Barcode value type for URLs/bookmarks. - url, - - /// Barcode value type for Wi-Fi access point details. - wifi, - - /// Barcode value type for geographic coordinates. - geographicCoordinates, - - /// Barcode value type for calendar events. - calendarEvent, - - /// Barcode value type for driver's license data. - driverLicense, -} - -/// The type of email for [BarcodeEmail.type]. -enum BarcodeEmailType { - /// Unknown email type. - unknown, - - /// Barcode work email type. - work, - - /// Barcode home email type. - home, -} - -/// The type of phone number for [BarcodePhone.type]. -enum BarcodePhoneType { - /// Unknown phone type. - unknown, - - /// Barcode work phone type. - work, - - /// Barcode home phone type. - home, - - /// Barcode fax phone type. - fax, - - /// Barcode mobile phone type. - mobile, -} - -/// Wifi encryption type constants for [BarcodeWiFi.encryptionType]. -enum BarcodeWiFiEncryptionType { - /// Barcode unknown Wi-Fi encryption type. - unknown, - - /// Barcode open Wi-Fi encryption type. - open, - - /// Barcode WPA Wi-Fi encryption type. - wpa, - - /// Barcode WEP Wi-Fi encryption type. - wep, -} - -/// Address type constants for [BarcodeAddress.type] -enum BarcodeAddressType { - /// Barcode unknown address type. - unknown, - - /// Barcode work address type. - work, - - /// Barcode home address type. - home, -} - -/// Class containing supported barcode format constants for [BarcodeDetector]. -/// -/// Passed to [BarcodeDetectorOptions] to set which formats the detector should -/// detect. -/// -/// Also, represents possible values for [Barcode.format]. -class BarcodeFormat { - const BarcodeFormat._(this.value); - - /// Barcode format constant representing the union of all supported formats. - static const BarcodeFormat all = BarcodeFormat._(0xFFFF); - - /// Barcode format unknown to the current SDK. - static const BarcodeFormat unknown = BarcodeFormat._(0); - - /// Barcode format constant for Code 128. - static const BarcodeFormat code128 = BarcodeFormat._(0x0001); - - /// Barcode format constant for Code 39. - static const BarcodeFormat code39 = BarcodeFormat._(0x0002); - - /// Barcode format constant for Code 93. - static const BarcodeFormat code93 = BarcodeFormat._(0x0004); - - /// Barcode format constant for CodaBar. - static const BarcodeFormat codabar = BarcodeFormat._(0x0008); - - /// Barcode format constant for Data Matrix. - static const BarcodeFormat dataMatrix = BarcodeFormat._(0x0010); - - /// Barcode format constant for EAN-13. - static const BarcodeFormat ean13 = BarcodeFormat._(0x0020); - - /// Barcode format constant for EAN-8. - static const BarcodeFormat ean8 = BarcodeFormat._(0x0040); - - /// Barcode format constant for ITF (Interleaved Two-of-Five). - static const BarcodeFormat itf = BarcodeFormat._(0x0080); - - /// Barcode format constant for QR Code. - static const BarcodeFormat qrCode = BarcodeFormat._(0x0100); - - /// Barcode format constant for UPC-A. - static const BarcodeFormat upca = BarcodeFormat._(0x0200); - - /// Barcode format constant for UPC-E. - static const BarcodeFormat upce = BarcodeFormat._(0x0400); - - /// Barcode format constant for PDF-417. - static const BarcodeFormat pdf417 = BarcodeFormat._(0x0800); - - /// Barcode format constant for AZTEC. - static const BarcodeFormat aztec = BarcodeFormat._(0x1000); - - /// Raw BarcodeFormat value. - final int value; - - BarcodeFormat operator |(BarcodeFormat other) => - BarcodeFormat._(value | other.value); -} - -/// Detector for performing barcode scanning on an input image. -/// -/// A barcode detector is created via -/// `barcodeDetector([BarcodeDetectorOptions options])` in [FirebaseVision]: -/// -/// ```dart -/// final FirebaseVisionImage image = -/// FirebaseVisionImage.fromFilePath('path/to/file'); -/// -/// final BarcodeDetector barcodeDetector = -/// FirebaseVision.instance.barcodeDetector(); -/// -/// final List barcodes = await barcodeDetector.detectInImage(image); -/// ``` -class BarcodeDetector { - BarcodeDetector._(this.options, this._handle) : assert(options != null); - - /// The options for configuring this detector. - final BarcodeDetectorOptions options; - final int _handle; - bool _hasBeenOpened = false; - bool _isClosed = false; - - /// Detects barcodes in the input image. - Future> detectInImage(FirebaseVisionImage visionImage) async { - assert(!_isClosed); - - _hasBeenOpened = true; - final List reply = - await FirebaseVision.channel.invokeListMethod( - 'BarcodeDetector#detectInImage', - { - 'handle': _handle, - 'options': { - 'barcodeFormats': options.barcodeFormats.value, - }, - }..addAll(visionImage._serialize()), - ); - - final List barcodes = []; - reply.forEach((dynamic barcode) { - barcodes.add(Barcode._(barcode)); - }); - - return barcodes; - } - - /// Release resources used by this detector. - Future close() { - if (!_hasBeenOpened) _isClosed = true; - if (_isClosed) return Future.value(null); - - _isClosed = true; - return FirebaseVision.channel.invokeMethod( - 'BarcodeDetector#close', - {'handle': _handle}, - ); - } -} - -/// Immutable options to configure [BarcodeDetector]. -/// -/// Sets which barcode formats the detector will detect. Defaults to -/// [BarcodeFormat.all]. -/// -/// Example usage: -/// ```dart -/// final BarcodeDetectorOptions options = -/// BarcodeDetectorOptions(barcodeFormats: BarcodeFormat.aztec | BarcodeFormat.ean8); -/// ``` -class BarcodeDetectorOptions { - const BarcodeDetectorOptions({this.barcodeFormats = BarcodeFormat.all}); - - final BarcodeFormat barcodeFormats; -} - -// TODO(bparrishMines): Normalize default string values. Some values return null on iOS while Android returns empty string. -/// Represents a single recognized barcode and its value. -class Barcode { - Barcode._(Map _data) - : boundingBox = _data['left'] != null - ? Rect.fromLTWH( - _data['left'], - _data['top'], - _data['width'], - _data['height'], - ) - : null, - rawValue = _data['rawValue'], - displayValue = _data['displayValue'], - format = BarcodeFormat._(_data['format']), - _cornerPoints = _data['points'] == null - ? null - : _data['points'] - .map((dynamic item) => Offset( - item[0], - item[1], - )) - .toList(), - valueType = BarcodeValueType.values[_data['valueType']], - email = _data['email'] == null ? null : BarcodeEmail._(_data['email']), - phone = _data['phone'] == null ? null : BarcodePhone._(_data['phone']), - sms = _data['sms'] == null ? null : BarcodeSMS._(_data['sms']), - url = _data['url'] == null ? null : BarcodeURLBookmark._(_data['url']), - wifi = _data['wifi'] == null ? null : BarcodeWiFi._(_data['wifi']), - geoPoint = _data['geoPoint'] == null - ? null - : BarcodeGeoPoint._(_data['geoPoint']), - contactInfo = _data['contactInfo'] == null - ? null - : BarcodeContactInfo._(_data['contactInfo']), - calendarEvent = _data['calendarEvent'] == null - ? null - : BarcodeCalendarEvent._(_data['calendarEvent']), - driverLicense = _data['driverLicense'] == null - ? null - : BarcodeDriverLicense._(_data['driverLicense']); - - final List _cornerPoints; - - /// The bounding rectangle of the detected barcode. - /// - /// Could be null if the bounding rectangle can not be determined. - final Rect boundingBox; - - /// Barcode value as it was encoded in the barcode. - /// - /// Structured values are not parsed, for example: 'MEBKM:TITLE:Google;URL://www.google.com;;'. - /// - /// Null if nothing found. - final String rawValue; - - /// Barcode value in a user-friendly format. - /// - /// May omit some of the information encoded in the barcode. - /// For example, if rawValue is 'MEBKM:TITLE:Google;URL://www.google.com;;', - /// the displayValue might be '//www.google.com'. - /// If valueType = [BarcodeValueType.text], this field will be equal to rawValue. - /// - /// This value may be multiline, for example, when line breaks are encoded into the original TEXT barcode value. - /// May include the supplement value. - /// - /// Null if nothing found. - final String displayValue; - - /// The barcode format, for example [BarcodeFormat.ean13]. - final BarcodeFormat format; - - /// The four corner points in clockwise direction starting with top-left. - /// - /// Due to the possible perspective distortions, this is not necessarily a rectangle. - List get cornerPoints => List.from(_cornerPoints); - - /// The format type of the barcode value. - /// - /// For example, [BarcodeValueType.text], [BarcodeValueType.product], [BarcodeValueType.url], etc. - /// - /// If the value structure cannot be parsed, [BarcodeValueType.text] will be returned. - /// If the recognized structure type is not defined in your current version of SDK, [BarcodeValueType.unknown] will be returned. - /// - /// Note that the built-in parsers only recognize a few popular value structures. - /// For your specific use case, you might want to directly consume rawValue - /// and implement your own parsing logic. - final BarcodeValueType valueType; - - /// Parsed email details. (set iff [valueType] is [BarcodeValueType.email]). - final BarcodeEmail email; - - /// Parsed phone details. (set iff [valueType] is [BarcodeValueType.phone]). - final BarcodePhone phone; - - /// Parsed SMS details. (set iff [valueType] is [BarcodeValueType.sms]). - final BarcodeSMS sms; - - /// Parsed URL bookmark details. (set iff [valueType] is [BarcodeValueType.url]). - final BarcodeURLBookmark url; - - /// Parsed WiFi AP details. (set iff [valueType] is [BarcodeValueType.wifi]). - final BarcodeWiFi wifi; - - /// Parsed geo coordinates. (set iff [valueType] is [BarcodeValueType.geographicCoordinates]). - final BarcodeGeoPoint geoPoint; - - /// Parsed contact details. (set iff [valueType] is [BarcodeValueType.contactInfo]). - final BarcodeContactInfo contactInfo; - - /// Parsed calendar event details. (set iff [valueType] is [BarcodeValueType.calendarEvent]). - final BarcodeCalendarEvent calendarEvent; - - /// Parsed driver's license details. (set iff [valueType] is [BarcodeValueType.driverLicense]). - final BarcodeDriverLicense driverLicense; -} - -/// An email message from a 'MAILTO:' or similar QRCode type. -class BarcodeEmail { - BarcodeEmail._(Map data) - : type = BarcodeEmailType.values[data['type']], - address = data['address'], - body = data['body'], - subject = data['subject']; - - /// The email's address. - final String address; - - /// The email's body. - final String body; - - /// The email's subject. - final String subject; - - /// The type of the email. - final BarcodeEmailType type; -} - -/// Phone number info. -class BarcodePhone { - BarcodePhone._(Map data) - : number = data['number'], - type = BarcodePhoneType.values[data['type']]; - - /// Phone number. - final String number; - - /// Type of the phone number. - /// - /// See also [BarcodePhoneType] - final BarcodePhoneType type; -} - -/// An sms message from an 'SMS:' or similar QRCode type. -class BarcodeSMS { - BarcodeSMS._(Map data) - : message = data['message'], - phoneNumber = data['phoneNumber']; - - /// An SMS message body. - final String message; - - /// An SMS message phone number. - final String phoneNumber; -} - -/// A URL and title from a 'MEBKM:' or similar QRCode type. -class BarcodeURLBookmark { - BarcodeURLBookmark._(Map data) - : title = data['title'], - url = data['url']; - - /// A URL bookmark title. - final String title; - - /// A URL bookmark url. - final String url; -} - -/// A wifi network parameters from a 'WIFI:' or similar QRCode type. -class BarcodeWiFi { - BarcodeWiFi._(Map data) - : ssid = data['ssid'], - password = data['password'], - encryptionType = - BarcodeWiFiEncryptionType.values[data['encryptionType']]; - - /// A Wi-Fi access point SSID. - final String ssid; - - /// A Wi-Fi access point password. - final String password; - - /// The encryption type of the WIFI - /// - /// See all [BarcodeWiFiEncryptionType] - final BarcodeWiFiEncryptionType encryptionType; -} - -/// GPS coordinates from a 'GEO:' or similar QRCode type. -class BarcodeGeoPoint { - BarcodeGeoPoint._(Map data) - : latitude = data['latitude'], - longitude = data['longitude']; - - /// A location latitude. - final double latitude; - - /// A location longitude. - final double longitude; -} - -/// A person's or organization's business card. -class BarcodeContactInfo { - BarcodeContactInfo._(Map data) - : addresses = data['addresses'] == null - ? null - : List.unmodifiable(data['addresses'] - .map((dynamic item) => BarcodeAddress._(item))), - emails = data['emails'] == null - ? null - : List.unmodifiable(data['emails'] - .map((dynamic item) => BarcodeEmail._(item))), - name = data['name'] == null ? null : BarcodePersonName._(data['name']), - phones = data['phones'] == null - ? null - : List.unmodifiable(data['phones'] - .map((dynamic item) => BarcodePhone._(item))), - urls = data['urls'] == null - ? null - : List.unmodifiable( - data['urls'].map((dynamic item) { - final String s = item; - return s; - })), - jobTitle = data['jobTitle'], - organization = data['organization']; - - /// Contact person's addresses. - /// - /// Could be an empty list if nothing found. - final List addresses; - - /// Contact person's emails. - /// - /// Could be an empty list if nothing found. - final List emails; - - /// Contact person's name. - final BarcodePersonName name; - - /// Contact person's phones. - /// - /// Could be an empty list if nothing found. - final List phones; - - /// Contact urls associated with this person. - final List urls; - - /// Contact person's title. - final String jobTitle; - - /// Contact person's organization. - final String organization; -} - -/// An address. -class BarcodeAddress { - BarcodeAddress._(Map data) - : addressLines = List.unmodifiable( - data['addressLines'].map((dynamic item) { - final String s = item; - return s; - })), - type = BarcodeAddressType.values[data['type']]; - - /// Formatted address, multiple lines when appropriate. - /// - /// This field always contains at least one line. - final List addressLines; - - /// Type of the address. - /// - /// See also [BarcodeAddressType] - final BarcodeAddressType type; -} - -/// A person's name, both formatted version and individual name components. -class BarcodePersonName { - BarcodePersonName._(Map data) - : formattedName = data['formattedName'], - first = data['first'], - last = data['last'], - middle = data['middle'], - prefix = data['prefix'], - pronunciation = data['pronunciation'], - suffix = data['suffix']; - - /// The properly formatted name. - final String formattedName; - - /// First name - final String first; - - /// Last name - final String last; - - /// Middle name - final String middle; - - /// Prefix of the name - final String prefix; - - /// Designates a text string to be set as the kana name in the phonebook. Used for Japanese contacts. - final String pronunciation; - - /// Suffix of the person's name - final String suffix; -} - -/// DateTime data type used in calendar events. -class BarcodeCalendarEvent { - BarcodeCalendarEvent._(Map data) - : eventDescription = data['eventDescription'], - location = data['location'], - organizer = data['organizer'], - status = data['status'], - summary = data['summary'], - start = DateTime.parse(data['start']), - end = DateTime.parse(data['end']); - - /// The description of the calendar event. - final String eventDescription; - - /// The location of the calendar event. - final String location; - - /// The organizer of the calendar event. - final String organizer; - - /// The status of the calendar event. - final String status; - - /// The summary of the calendar event. - final String summary; - - /// The start date time of the calendar event. - final DateTime start; - - /// The end date time of the calendar event. - final DateTime end; -} - -/// A driver license or ID card. -class BarcodeDriverLicense { - BarcodeDriverLicense._(Map data) - : firstName = data['firstName'], - middleName = data['middleName'], - lastName = data['lastName'], - gender = data['gender'], - addressCity = data['addressCity'], - addressState = data['addressState'], - addressStreet = data['addressStreet'], - addressZip = data['addressZip'], - birthDate = data['birthDate'], - documentType = data['documentType'], - licenseNumber = data['licenseNumber'], - expiryDate = data['expiryDate'], - issuingDate = data['issuingDate'], - issuingCountry = data['issuingCountry']; - - /// Holder's first name. - final String firstName; - - /// Holder's middle name. - final String middleName; - - /// Holder's last name. - final String lastName; - - /// Holder's gender. 1 - male, 2 - female. - final String gender; - - /// City of holder's address. - final String addressCity; - - /// State of holder's address. - final String addressState; - - /// Holder's street address. - final String addressStreet; - - /// Zip code of holder's address. - final String addressZip; - - /// Birth date of the holder. - final String birthDate; - - /// "DL" for driver licenses, "ID" for ID cards. - final String documentType; - - /// Driver license ID number. - final String licenseNumber; - - /// Expiry date of the license. - final String expiryDate; - - /// Issue date of the license. - /// - /// The date format depends on the issuing country. MMDDYYYY for the US, YYYYMMDD for Canada. - final String issuingDate; - - /// Country in which DL/ID was issued. US = "USA", Canada = "CAN". - final String issuingCountry; -} diff --git a/packages/firebase_ml_vision/lib/src/face_detector.dart b/packages/firebase_ml_vision/lib/src/face_detector.dart deleted file mode 100644 index aa4d0d76f560..000000000000 --- a/packages/firebase_ml_vision/lib/src/face_detector.dart +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_ml_vision; - -/// Option for controlling additional trade-offs in performing face detection. -/// -/// Accurate tends to detect more faces and may be more precise in determining -/// values such as position, at the cost of speed. -enum FaceDetectorMode { accurate, fast } - -/// Available face landmarks detected by [FaceDetector]. -enum FaceLandmarkType { - bottomMouth, - leftCheek, - leftEar, - leftEye, - leftMouth, - noseBase, - rightCheek, - rightEar, - rightEye, - rightMouth, -} - -/// Available face contour types detected by [FaceDetector]. -enum FaceContourType { - allPoints, - face, - leftEye, - leftEyebrowBottom, - leftEyebrowTop, - lowerLipBottom, - lowerLipTop, - noseBottom, - noseBridge, - rightEye, - rightEyebrowBottom, - rightEyebrowTop, - upperLipBottom, - upperLipTop -} - -/// Detector for detecting faces in an input image. -/// -/// A face detector is created via -/// `faceDetector([FaceDetectorOptions options])` in [FirebaseVision]: -/// -/// ```dart -/// final FirebaseVisionImage image = -/// FirebaseVisionImage.fromFilePath('path/to/file'); -/// -/// final FaceDetector faceDetector = FirebaseVision.instance.faceDetector(); -/// -/// final List faces = await faceDetector.processImage(image); -/// ``` -class FaceDetector { - FaceDetector._(this.options, this._handle) : assert(options != null); - - /// The options for the face detector. - final FaceDetectorOptions options; - final int _handle; - bool _hasBeenOpened = false; - bool _isClosed = false; - - /// Detects faces in the input image. - Future> processImage(FirebaseVisionImage visionImage) async { - assert(!_isClosed); - - _hasBeenOpened = true; - final List reply = - await FirebaseVision.channel.invokeListMethod( - 'FaceDetector#processImage', - { - 'handle': _handle, - 'options': { - 'enableClassification': options.enableClassification, - 'enableLandmarks': options.enableLandmarks, - 'enableContours': options.enableContours, - 'enableTracking': options.enableTracking, - 'minFaceSize': options.minFaceSize, - 'mode': _enumToString(options.mode), - }, - }..addAll(visionImage._serialize()), - ); - - final List faces = []; - for (dynamic data in reply) { - faces.add(Face._(data)); - } - - return faces; - } - - /// Release resources used by this detector. - Future close() { - if (!_hasBeenOpened) _isClosed = true; - if (_isClosed) return Future.value(null); - - _isClosed = true; - return FirebaseVision.channel.invokeMethod( - 'FaceDetector#close', - {'handle': _handle}, - ); - } -} - -/// Immutable options for configuring features of [FaceDetector]. -/// -/// Used to configure features such as classification, face tracking, speed, -/// etc. -class FaceDetectorOptions { - /// Constructor for [FaceDetectorOptions]. - /// - /// The parameter minFaceValue must be between 0.0 and 1.0, inclusive. - const FaceDetectorOptions({ - this.enableClassification = false, - this.enableLandmarks = false, - this.enableContours = false, - this.enableTracking = false, - this.minFaceSize = 0.1, - this.mode = FaceDetectorMode.fast, - }) : assert(minFaceSize >= 0.0), - assert(minFaceSize <= 1.0); - - /// Whether to run additional classifiers for characterizing attributes. - /// - /// E.g. "smiling" and "eyes open". - final bool enableClassification; - - /// Whether to detect [FaceLandmark]s. - final bool enableLandmarks; - - /// Whether to detect [FaceContour]s. - final bool enableContours; - - /// Whether to enable face tracking. - /// - /// If enabled, the detector will maintain a consistent ID for each face when - /// processing consecutive frames. - final bool enableTracking; - - /// The smallest desired face size. - /// - /// Expressed as a proportion of the width of the head to the image width. - /// - /// Must be a value between 0.0 and 1.0. - final double minFaceSize; - - /// Option for controlling additional accuracy / speed trade-offs. - final FaceDetectorMode mode; -} - -/// Represents a face detected by [FaceDetector]. -class Face { - Face._(dynamic data) - : boundingBox = Rect.fromLTWH( - data['left'], - data['top'], - data['width'], - data['height'], - ), - headEulerAngleY = data['headEulerAngleY'], - headEulerAngleZ = data['headEulerAngleZ'], - leftEyeOpenProbability = data['leftEyeOpenProbability'], - rightEyeOpenProbability = data['rightEyeOpenProbability'], - smilingProbability = data['smilingProbability'], - trackingId = data['trackingId'], - _landmarks = Map.fromIterables( - FaceLandmarkType.values, - FaceLandmarkType.values.map((FaceLandmarkType type) { - final List pos = data['landmarks'][_enumToString(type)]; - return (pos == null) - ? null - : FaceLandmark._( - type, - Offset(pos[0], pos[1]), - ); - })), - _contours = Map.fromIterables( - FaceContourType.values, - FaceContourType.values.map((FaceContourType type) { - /// added empty map to pass the tests - final List arr = - (data['contours'] ?? {})[_enumToString(type)]; - return (arr == null) - ? null - : FaceContour._( - type, - arr - .map((dynamic pos) => Offset(pos[0], pos[1])) - .toList(), - ); - })); - - final Map _landmarks; - final Map _contours; - - /// The axis-aligned bounding rectangle of the detected face. - /// - /// The point (0, 0) is defined as the upper-left corner of the image. - final Rect boundingBox; - - /// The rotation of the face about the vertical axis of the image. - /// - /// Represented in degrees. - /// - /// A face with a positive Euler Y angle is turned to the camera's right and - /// to its left. - /// - /// The Euler Y angle is guaranteed only when using the "accurate" mode - /// setting of the face detector (as opposed to the "fast" mode setting, which - /// takes some shortcuts to make detection faster). - final double headEulerAngleY; - - /// The rotation of the face about the axis pointing out of the image. - /// - /// Represented in degrees. - /// - /// A face with a positive Euler Z angle is rotated counter-clockwise relative - /// to the camera. - /// - /// ML Kit always reports the Euler Z angle of a detected face. - final double headEulerAngleZ; - - /// Probability that the face's left eye is open. - /// - /// A value between 0.0 and 1.0 inclusive, or null if probability was not - /// computed. - final double leftEyeOpenProbability; - - /// Probability that the face's right eye is open. - /// - /// A value between 0.0 and 1.0 inclusive, or null if probability was not - /// computed. - final double rightEyeOpenProbability; - - /// Probability that the face is smiling. - /// - /// A value between 0.0 and 1.0 inclusive, or null if probability was not - /// computed. - final double smilingProbability; - - /// The tracking ID if the tracking is enabled. - /// - /// Null if tracking was not enabled. - final int trackingId; - - /// Gets the landmark based on the provided [FaceLandmarkType]. - /// - /// Null if landmark was not detected. - FaceLandmark getLandmark(FaceLandmarkType landmark) => _landmarks[landmark]; - - /// Gets the contour based on the provided [FaceContourType]. - /// - /// Null if contour was not detected. - FaceContour getContour(FaceContourType contour) => _contours[contour]; -} - -/// Represent a face landmark. -/// -/// A landmark is a point on a detected face, such as an eye, nose, or mouth. -class FaceLandmark { - FaceLandmark._(this.type, this.position); - - /// The [FaceLandmarkType] of this landmark. - final FaceLandmarkType type; - - /// Gets a 2D point for landmark position. - /// - /// The point (0, 0) is defined as the upper-left corner of the image. - final Offset position; -} - -/// Represent a face contour. -/// -/// Contours of facial features. -class FaceContour { - FaceContour._(this.type, this.positionsList); - - /// The [FaceContourType] of this contour. - final FaceContourType type; - - /// Gets a 2D point [List] for contour positions. - /// - /// The point (0, 0) is defined as the upper-left corner of the image. - final List positionsList; -} diff --git a/packages/firebase_ml_vision/lib/src/firebase_vision.dart b/packages/firebase_ml_vision/lib/src/firebase_vision.dart deleted file mode 100644 index d0f593cff8f8..000000000000 --- a/packages/firebase_ml_vision/lib/src/firebase_vision.dart +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_ml_vision; - -enum _ImageType { file, bytes } - -/// Indicates the image rotation. -/// -/// Rotation is counter-clockwise. -enum ImageRotation { rotation0, rotation90, rotation180, rotation270 } - -/// Indicates whether a model is ran on device or in the cloud. -enum ModelType { onDevice, cloud } - -/// The Firebase machine learning vision API. -/// -/// You can get an instance by calling [FirebaseVision.instance] and then get -/// a detector from the instance: -/// -/// ```dart -/// TextRecognizer textRecognizer = FirebaseVision.instance.textRecognizer(); -/// ``` -class FirebaseVision { - FirebaseVision._(); - - @visibleForTesting - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_ml_vision'); - - @visibleForTesting - static int nextHandle = 0; - - /// Singleton of [FirebaseVision]. - /// - /// Use this get an instance of a detector: - /// - /// ```dart - /// TextRecognizer textRecognizer = FirebaseVision.instance.textRecognizer(); - /// ``` - static final FirebaseVision instance = FirebaseVision._(); - - /// Creates an instance of [BarcodeDetector]. - BarcodeDetector barcodeDetector([BarcodeDetectorOptions options]) { - return BarcodeDetector._( - options ?? const BarcodeDetectorOptions(), - nextHandle++, - ); - } - - /// Creates an instance of [FaceDetector]. - FaceDetector faceDetector([FaceDetectorOptions options]) { - return FaceDetector._( - options ?? const FaceDetectorOptions(), - nextHandle++, - ); - } - - /// Creates an on device instance of [ImageLabeler]. - ImageLabeler imageLabeler([ImageLabelerOptions options]) { - return ImageLabeler._( - options: options ?? const ImageLabelerOptions(), - modelType: ModelType.onDevice, - handle: nextHandle++, - ); - } - - /// Creates an instance of [TextRecognizer]. - TextRecognizer textRecognizer() { - return TextRecognizer._( - modelType: ModelType.onDevice, - handle: nextHandle++, - ); - } - - /// Creates a cloud instance of [ImageLabeler]. - ImageLabeler cloudImageLabeler([CloudImageLabelerOptions options]) { - return ImageLabeler._( - options: options ?? const CloudImageLabelerOptions(), - modelType: ModelType.cloud, - handle: nextHandle++, - ); - } - - /// Creates a cloud instance of [TextRecognizer]. - TextRecognizer cloudTextRecognizer() { - return TextRecognizer._( - modelType: ModelType.cloud, - handle: nextHandle++, - ); - } -} - -/// Represents an image object used for both on-device and cloud API detectors. -/// -/// Create an instance by calling one of the factory constructors. -class FirebaseVisionImage { - FirebaseVisionImage._({ - @required _ImageType type, - FirebaseVisionImageMetadata metadata, - File imageFile, - Uint8List bytes, - }) : _imageFile = imageFile, - _metadata = metadata, - _bytes = bytes, - _type = type; - - /// Construct a [FirebaseVisionImage] from a file. - factory FirebaseVisionImage.fromFile(File imageFile) { - assert(imageFile != null); - return FirebaseVisionImage._( - type: _ImageType.file, - imageFile: imageFile, - ); - } - - /// Construct a [FirebaseVisionImage] from a file path. - factory FirebaseVisionImage.fromFilePath(String imagePath) { - assert(imagePath != null); - return FirebaseVisionImage._( - type: _ImageType.file, - imageFile: File(imagePath), - ); - } - - /// Construct a [FirebaseVisionImage] from a list of bytes. - /// - /// On Android, expects `android.graphics.ImageFormat.NV21` format. Note: - /// Concatenating the planes of `android.graphics.ImageFormat.YUV_420_888` - /// into a single plane, converts it to `android.graphics.ImageFormat.NV21`. - /// - /// On iOS, expects `kCVPixelFormatType_32BGRA` format. However, this should - /// work with most formats from `kCVPixelFormatType_*`. - factory FirebaseVisionImage.fromBytes( - Uint8List bytes, - FirebaseVisionImageMetadata metadata, - ) { - assert(bytes != null); - assert(metadata != null); - return FirebaseVisionImage._( - type: _ImageType.bytes, - bytes: bytes, - metadata: metadata, - ); - } - - final Uint8List _bytes; - final File _imageFile; - final FirebaseVisionImageMetadata _metadata; - final _ImageType _type; - - Map _serialize() => { - 'type': _enumToString(_type), - 'bytes': _bytes, - 'path': _imageFile?.path, - 'metadata': _type == _ImageType.bytes ? _metadata._serialize() : null, - }; -} - -/// Plane attributes to create the image buffer on iOS. -/// -/// When using iOS, [bytesPerRow], [height], and [width] throw [AssertionError] -/// if `null`. -class FirebaseVisionImagePlaneMetadata { - FirebaseVisionImagePlaneMetadata({ - @required this.bytesPerRow, - @required this.height, - @required this.width, - }) : assert(defaultTargetPlatform == TargetPlatform.iOS - ? bytesPerRow != null - : true), - assert(defaultTargetPlatform == TargetPlatform.iOS - ? height != null - : true), - assert( - defaultTargetPlatform == TargetPlatform.iOS ? width != null : true); - - /// The row stride for this color plane, in bytes. - final int bytesPerRow; - - /// Height of the pixel buffer on iOS. - final int height; - - /// Width of the pixel buffer on iOS. - final int width; - - Map _serialize() => { - 'bytesPerRow': bytesPerRow, - 'height': height, - 'width': width, - }; -} - -/// Image metadata used by [FirebaseVision] detectors. -/// -/// [rotation] defaults to [ImageRotation.rotation0]. Currently only rotates on -/// Android. -/// -/// When using iOS, [rawFormat] and [planeData] throw [AssertionError] if -/// `null`. -class FirebaseVisionImageMetadata { - FirebaseVisionImageMetadata({ - @required this.size, - @required this.rawFormat, - @required this.planeData, - this.rotation = ImageRotation.rotation0, - }) : assert(size != null), - assert(defaultTargetPlatform == TargetPlatform.iOS - ? rawFormat != null - : true), - assert(defaultTargetPlatform == TargetPlatform.iOS - ? planeData != null - : true), - assert(defaultTargetPlatform == TargetPlatform.iOS - ? planeData.isNotEmpty - : true); - - /// Size of the image in pixels. - final Size size; - - /// Rotation of the image for Android. - /// - /// Not currently used on iOS. - final ImageRotation rotation; - - /// Raw version of the format from the iOS platform. - /// - /// Since iOS can use any planar format, this format will be used to create - /// the image buffer on iOS. - /// - /// On iOS, this is a `FourCharCode` constant from Pixel Format Identifiers. - /// See https://developer.apple.com/documentation/corevideo/1563591-pixel_format_identifiers?language=objc - /// - /// Not used on Android. - final dynamic rawFormat; - - /// The plane attributes to create the image buffer on iOS. - /// - /// Not used on Android. - final List planeData; - - int _imageRotationToInt(ImageRotation rotation) { - switch (rotation) { - case ImageRotation.rotation90: - return 90; - case ImageRotation.rotation180: - return 180; - case ImageRotation.rotation270: - return 270; - default: - assert(rotation == ImageRotation.rotation0); - return 0; - } - } - - Map _serialize() => { - 'width': size.width, - 'height': size.height, - 'rotation': _imageRotationToInt(rotation), - 'rawFormat': rawFormat, - 'planeData': planeData - .map((FirebaseVisionImagePlaneMetadata plane) => plane._serialize()) - .toList(), - }; -} - -String _enumToString(dynamic enumValue) { - final String enumString = enumValue.toString(); - return enumString.substring(enumString.indexOf('.') + 1); -} diff --git a/packages/firebase_ml_vision/lib/src/image_labeler.dart b/packages/firebase_ml_vision/lib/src/image_labeler.dart deleted file mode 100644 index f644676bc6bd..000000000000 --- a/packages/firebase_ml_vision/lib/src/image_labeler.dart +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_ml_vision; - -/// Used for finding [ImageLabel]s in a supplied image. -/// -/// When you use the API, you get a list of the entities that were recognized: -/// people, things, places, activities, and so on. Each label found comes with a -/// score that indicates the confidence the ML model has in its relevance. With -/// this information, you can perform tasks such as automatic metadata -/// generation and content moderation. -/// -/// A image labeler is created via -/// `imageLabeler([ImageLabelerOptions options])` or -/// `cloudImageLabeler([CloudImageLabelerOptions options])` in [FirebaseVision]: -/// -/// ```dart -/// final FirebaseVisionImage image = -/// FirebaseVisionImage.fromFilePath('path/to/file'); -/// -/// final ImageLabeler imageLabeler = -/// FirebaseVision.instance.imageLabeler(options); -/// -/// final List labels = await imageLabeler.processImage(image); -/// ``` -class ImageLabeler { - ImageLabeler._({ - @required dynamic options, - @required this.modelType, - @required int handle, - }) : _options = options, - _handle = handle, - assert(options != null), - assert(modelType != null); - - /// Indicates whether this labeler is ran on device or in the cloud. - final ModelType modelType; - - // Should be of type ImageLabelerOptions or CloudImageLabelerOptions. - final dynamic _options; - final int _handle; - bool _hasBeenOpened = false; - bool _isClosed = false; - - /// Finds entities in the input image. - Future> processImage(FirebaseVisionImage visionImage) async { - assert(!_isClosed); - - _hasBeenOpened = true; - final List reply = - await FirebaseVision.channel.invokeListMethod( - 'ImageLabeler#processImage', - { - 'handle': _handle, - 'options': { - 'modelType': _enumToString(modelType), - 'confidenceThreshold': _options.confidenceThreshold, - }, - }..addAll(visionImage._serialize()), - ); - - final List labels = []; - for (dynamic data in reply) { - labels.add(ImageLabel._(data)); - } - - return labels; - } - - /// Release resources used by this labeler. - Future close() { - if (!_hasBeenOpened) _isClosed = true; - if (_isClosed) return Future.value(null); - - _isClosed = true; - return FirebaseVision.channel.invokeMethod( - 'ImageLabeler#close', - {'handle': _handle}, - ); - } -} - -/// Options for on device image labeler. -/// -/// Confidence threshold could be provided for the label detection. For example, -/// if the confidence threshold is set to 0.7, only labels with -/// confidence >= 0.7 would be returned. The default threshold is 0.5. -class ImageLabelerOptions { - /// Constructor for [ImageLabelerOptions]. - /// - /// Confidence threshold could be provided for the label detection. - /// For example, if the confidence threshold is set to 0.7, only labels with - /// confidence >= 0.7 would be returned. The default threshold is 0.5. - const ImageLabelerOptions({this.confidenceThreshold = 0.5}) - : assert(confidenceThreshold >= 0.0), - assert(confidenceThreshold <= 1.0); - - /// The minimum confidence threshold of labels to be detected. - /// - /// Required to be in range [0.0, 1.0]. - final double confidenceThreshold; -} - -/// Options for cloud image labeler. -/// -/// Confidence threshold could be provided for the label detection. For example, -/// if the confidence threshold is set to 0.7, only labels with -/// confidence >= 0.7 would be returned. The default threshold is 0.5. -class CloudImageLabelerOptions { - /// Constructor for [CloudImageLabelerOptions]. - /// - /// Confidence threshold could be provided for the label detection. - /// For example, if the confidence threshold is set to 0.7, only labels with - /// confidence >= 0.7 would be returned. The default threshold is 0.5. - const CloudImageLabelerOptions({this.confidenceThreshold = 0.5}) - : assert(confidenceThreshold >= 0.0), - assert(confidenceThreshold <= 1.0); - - /// The minimum confidence threshold of labels to be detected. - /// - /// Required to be in range [0.0, 1.0]. - final double confidenceThreshold; -} - -/// Represents an entity label detected by [ImageLabeler] and [CloudImageLabeler]. -class ImageLabel { - ImageLabel._(dynamic data) - : confidence = data['confidence'], - entityId = data['entityId'], - text = data['text']; - - /// The overall confidence of the result. Range [0.0, 1.0]. - final double confidence; - - /// The opaque entity ID. - /// - /// IDs are available in Google Knowledge Graph Search API - /// https://developers.google.com/knowledge-graph/ - final String entityId; - - /// A detected label from the given image. - /// - /// The label returned here is in English only. The end developer should use - /// [entityId] to retrieve unique id. - final String text; -} diff --git a/packages/firebase_ml_vision/lib/src/text_recognizer.dart b/packages/firebase_ml_vision/lib/src/text_recognizer.dart deleted file mode 100644 index 98936f66a906..000000000000 --- a/packages/firebase_ml_vision/lib/src/text_recognizer.dart +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_ml_vision; - -/// Detector for performing optical character recognition(OCR) on an input image. -/// -/// A text recognizer is created via `textRecognizer()` in [FirebaseVision]: -/// -/// ```dart -/// final FirebaseVisionImage image = -/// FirebaseVisionImage.fromFilePath('path/to/file'); -/// -/// final TextRecognizer textRecognizer = -/// FirebaseVision.instance.textRecognizer(); -/// -/// final List recognizedText = -/// await textRecognizer.processImage(image); -/// ``` -class TextRecognizer { - TextRecognizer._({ - @required this.modelType, - @required int handle, - }) : _handle = handle, - assert(modelType != null); - - final ModelType modelType; - - final int _handle; - bool _hasBeenOpened = false; - bool _isClosed = false; - - /// Detects [VisionText] from a [FirebaseVisionImage]. - Future processImage(FirebaseVisionImage visionImage) async { - assert(!_isClosed); - - _hasBeenOpened = true; - final Map reply = - await FirebaseVision.channel.invokeMapMethod( - 'TextRecognizer#processImage', - { - 'handle': _handle, - 'options': { - 'modelType': _enumToString(modelType), - }, - }..addAll(visionImage._serialize()), - ); - - return VisionText._(reply); - } - - /// Release resources used by this recognizer. - Future close() { - if (!_hasBeenOpened) _isClosed = true; - if (_isClosed) return Future.value(null); - - _isClosed = true; - return FirebaseVision.channel.invokeMethod( - 'TextRecognizer#close', - {'handle': _handle}, - ); - } -} - -/// Recognized text in an image. -class VisionText { - VisionText._(Map data) - : text = data['text'], - blocks = List.unmodifiable(data['blocks'] - .map((dynamic block) => TextBlock._(block))); - - /// String representation of the recognized text. - final String text; - - /// All recognized text broken down into individual blocks/paragraphs. - final List blocks; -} - -/// Detected language from text recognition. -class RecognizedLanguage { - RecognizedLanguage._(dynamic data) : languageCode = data['languageCode']; - - /// The BCP-47 language code, such as, en-US or sr-Latn. For more information, - /// see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - final String languageCode; -} - -/// Abstract class representing dimensions of recognized text in an image. -abstract class TextContainer { - TextContainer._(Map data) - : boundingBox = data['left'] != null - ? Rect.fromLTWH( - data['left'], - data['top'], - data['width'], - data['height'], - ) - : null, - confidence = data['confidence'], - cornerPoints = List.unmodifiable( - data['points'].map((dynamic point) => Offset( - point[0], - point[1], - ))), - recognizedLanguages = List.unmodifiable( - data['recognizedLanguages'].map( - (dynamic language) => RecognizedLanguage._(language))), - text = data['text']; - - /// Axis-aligned bounding rectangle of the detected text. - /// - /// The point (0, 0) is defined as the upper-left corner of the image. - /// - /// Could be null even if text is found. - final Rect boundingBox; - - /// The confidence of the recognized text block. - /// - /// The value is null for all text recognizers except for cloud text - /// recognizers. - final double confidence; - - /// The four corner points in clockwise direction starting with top-left. - /// - /// Due to the possible perspective distortions, this is not necessarily a - /// rectangle. Parts of the region could be outside of the image. - /// - /// Could be empty even if text is found. - final List cornerPoints; - - /// All detected languages from recognized text. - /// - /// On-device text recognizers only detect Latin-based languages, while cloud - /// text recognizers can detect multiple languages. If no languages are - /// recognized, the list is empty. - final List recognizedLanguages; - - /// The recognized text as a string. - /// - /// Returned in reading order for the language. For Latin, this is top to - /// bottom within a Block, and left-to-right within a Line. - final String text; -} - -/// A block of text (think of it as a paragraph) as deemed by the OCR engine. -class TextBlock extends TextContainer { - TextBlock._(Map block) - : lines = List.unmodifiable( - block['lines'].map((dynamic line) => TextLine._(line))), - super._(block); - - /// The contents of the text block, broken down into individual lines. - final List lines; -} - -/// Represents a line of text. -class TextLine extends TextContainer { - TextLine._(Map line) - : elements = List.unmodifiable(line['elements'] - .map((dynamic element) => TextElement._(element))), - super._(line); - - /// The contents of this line, broken down into individual elements. - final List elements; -} - -/// Roughly equivalent to a space-separated "word." -/// -/// The API separates elements into words in most Latin languages, but could -/// separate by characters in others. -/// -/// If a word is split between two lines by a hyphen, each part is encoded as a -/// separate element. -class TextElement extends TextContainer { - TextElement._(Map element) : super._(element); -} diff --git a/packages/firebase_ml_vision/pubspec.yaml b/packages/firebase_ml_vision/pubspec.yaml deleted file mode 100644 index 05bdfe95d299..000000000000 --- a/packages/firebase_ml_vision/pubspec.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: firebase_ml_vision -description: Flutter plugin for Firebase machine learning vision services. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_ml_vision -version: 0.9.2 - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - image_picker: ^0.5.0 - flutter_test: - sdk: flutter - firebase_core: ^0.4.0 - flutter_driver: - sdk: flutter - test: any - path: ^1.6.2 - path_provider: ^0.5.0+1 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebasemlvision - iosPrefix: FLT - pluginClass: FirebaseMlVisionPlugin - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_ml_vision/test/firebase_ml_vision_test.dart b/packages/firebase_ml_vision/test/firebase_ml_vision_test.dart deleted file mode 100644 index 59dea115f83f..000000000000 --- a/packages/firebase_ml_vision/test/firebase_ml_vision_test.dart +++ /dev/null @@ -1,1294 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:typed_data'; -import 'dart:ui'; - -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebaseVision', () { - final List log = []; - dynamic returnValue; - - setUp(() { - FirebaseVision.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - - switch (methodCall.method) { - case 'BarcodeDetector#detectInImage': - return returnValue; - case 'FaceDetector#processImage': - return returnValue; - case 'TextRecognizer#processImage': - return returnValue; - default: - return null; - } - }); - log.clear(); - FirebaseVision.nextHandle = 0; - }); - - group('$FirebaseVisionImageMetadata', () { - final TextRecognizer recognizer = - FirebaseVision.instance.textRecognizer(); - - setUp(() { - returnValue = { - 'text': '', - 'blocks': [], - }; - }); - - test('default serialization', () async { - final FirebaseVisionImageMetadata metadata = - FirebaseVisionImageMetadata( - rawFormat: 35, - size: const Size(1.0, 1.0), - planeData: [ - FirebaseVisionImagePlaneMetadata( - bytesPerRow: 1000, - height: 480, - width: 480, - ), - ], - ); - final FirebaseVisionImage image = - FirebaseVisionImage.fromBytes(Uint8List(0), metadata); - await recognizer.processImage(image); - - expect(log, [ - isMethodCall( - 'TextRecognizer#processImage', - arguments: { - 'handle': 0, - 'type': 'bytes', - 'path': null, - 'bytes': Uint8List(0), - 'metadata': { - 'width': 1.0, - 'height': 1.0, - 'rotation': 0, - 'rawFormat': 35, - 'planeData': [ - { - 'bytesPerRow': 1000, - 'height': 480, - 'width': 480, - }, - ], - }, - 'options': { - 'modelType': 'onDevice', - }, - }, - ), - ]); - }); - }); - - group('$BarcodeDetector', () { - BarcodeDetector detector; - FirebaseVisionImage image; - List returnBarcodes; - - setUp(() { - detector = FirebaseVision.instance.barcodeDetector(); - image = FirebaseVisionImage.fromFilePath('empty'); - returnBarcodes = [ - { - 'rawValue': 'hello:raw', - 'displayValue': 'hello:display', - 'format': 0, - 'left': 1.0, - 'top': 2.0, - 'width': 3.0, - 'height': 4.0, - 'points': [ - [5.0, 6.0], - [7.0, 8.0], - ], - }, - ]; - }); - - test('detectInImage unknown', () async { - returnBarcodes[0]['valueType'] = BarcodeValueType.unknown.index; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - expect(log, [ - isMethodCall( - 'BarcodeDetector#detectInImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'barcodeFormats': 0xFFFF, - }, - }, - ), - ]); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.unknown); - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(barcode.boundingBox, Rect.fromLTWH(1.0, 2.0, 3.0, 4.0)); - expect(barcode.rawValue, 'hello:raw'); - expect(barcode.displayValue, 'hello:display'); - expect(barcode.cornerPoints, const [ - Offset(5.0, 6.0), - Offset(7.0, 8.0), - ]); - }); - - test('detectInImage email', () async { - final Map email = { - 'address': 'a', - 'body': 'b', - 'subject': 's', - 'type': BarcodeEmailType.home.index, - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.email.index; - returnBarcodes[0]['email'] = email; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.email); - expect(barcode.email.address, 'a'); - expect(barcode.email.body, 'b'); - expect(barcode.email.subject, 's'); - expect(barcode.email.type, BarcodeEmailType.home); - }); - - test('detectInImage phone', () async { - final Map phone = { - 'number': '000', - 'type': BarcodePhoneType.fax.index, - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.phone.index; - returnBarcodes[0]['phone'] = phone; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.phone); - expect(barcode.phone.number, '000'); - expect(barcode.phone.type, BarcodePhoneType.fax); - }); - - test('detectInImage sms', () async { - final Map sms = { - 'phoneNumber': '000', - 'message': 'm' - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.sms.index; - returnBarcodes[0]['sms'] = sms; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.sms); - expect(barcode.sms.phoneNumber, '000'); - expect(barcode.sms.message, 'm'); - }); - - test('detectInImage url', () async { - final Map url = { - 'title': 't', - 'url': 'u' - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.url.index; - returnBarcodes[0]['url'] = url; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.url); - expect(barcode.url.title, 't'); - expect(barcode.url.url, 'u'); - }); - - test('detectInImage wifi', () async { - final Map wifi = { - 'ssid': 's', - 'password': 'p', - 'encryptionType': BarcodeWiFiEncryptionType.wep.index, - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.wifi.index; - returnBarcodes[0]['wifi'] = wifi; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.wifi); - expect(barcode.wifi.ssid, 's'); - expect(barcode.wifi.password, 'p'); - expect(barcode.wifi.encryptionType, BarcodeWiFiEncryptionType.wep); - }); - - test('detectInImage geoPoint', () async { - final Map geoPoint = { - 'latitude': 0.2, - 'longitude': 0.3, - }; - - returnBarcodes[0]['valueType'] = - BarcodeValueType.geographicCoordinates.index; - returnBarcodes[0]['geoPoint'] = geoPoint; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.geographicCoordinates); - expect(barcode.geoPoint.latitude, 0.2); - expect(barcode.geoPoint.longitude, 0.3); - }); - - test('detectInImage contactInfo', () async { - final Map contact = { - 'addresses': [ - { - 'addressLines': ['al'], - 'type': BarcodeAddressType.work.index, - } - ], - 'emails': [ - { - 'type': BarcodeEmailType.home.index, - 'address': 'a', - 'body': 'b', - 'subject': 's' - }, - ], - 'name': { - 'formattedName': 'fn', - 'first': 'f', - 'last': 'l', - 'middle': 'm', - 'prefix': 'p', - 'pronunciation': 'pn', - 'suffix': 's', - }, - 'phones': [ - { - 'number': '012', - 'type': BarcodePhoneType.mobile.index, - } - ], - 'urls': ['url'], - 'jobTitle': 'j', - 'organization': 'o' - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.contactInfo.index; - returnBarcodes[0]['contactInfo'] = contact; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.contactInfo); - expect(barcode.contactInfo.addresses[0].type, BarcodeAddressType.work); - expect(barcode.contactInfo.addresses[0].addressLines[0], 'al'); - expect(barcode.contactInfo.emails[0].type, BarcodeEmailType.home); - expect(barcode.contactInfo.emails[0].address, 'a'); - expect(barcode.contactInfo.emails[0].body, 'b'); - expect(barcode.contactInfo.emails[0].subject, 's'); - expect(barcode.contactInfo.name.first, 'f'); - expect(barcode.contactInfo.name.last, 'l'); - expect(barcode.contactInfo.name.middle, 'm'); - expect(barcode.contactInfo.name.formattedName, 'fn'); - expect(barcode.contactInfo.name.prefix, 'p'); - expect(barcode.contactInfo.name.suffix, 's'); - expect(barcode.contactInfo.name.pronunciation, 'pn'); - expect(barcode.contactInfo.phones[0].type, BarcodePhoneType.mobile); - expect(barcode.contactInfo.phones[0].number, '012'); - expect(barcode.contactInfo.urls[0], 'url'); - expect(barcode.contactInfo.jobTitle, 'j'); - expect(barcode.contactInfo.organization, 'o'); - }); - - test('detectInImage calendarEvent', () async { - final Map calendar = { - 'eventDescription': 'e', - 'location': 'l', - 'organizer': 'o', - 'status': 'st', - 'summary': 'sm', - 'start': '2017-07-04 12:34:56.123', - 'end': '2018-08-05 01:23:45.456', - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.calendarEvent.index; - returnBarcodes[0]['calendarEvent'] = calendar; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.calendarEvent); - expect(barcode.calendarEvent.eventDescription, 'e'); - expect(barcode.calendarEvent.location, 'l'); - expect(barcode.calendarEvent.organizer, 'o'); - expect(barcode.calendarEvent.status, 'st'); - expect(barcode.calendarEvent.summary, 'sm'); - expect( - barcode.calendarEvent.start, DateTime(2017, 7, 4, 12, 34, 56, 123)); - expect(barcode.calendarEvent.end, DateTime(2018, 8, 5, 1, 23, 45, 456)); - }); - - test('detectInImage driversLicense', () async { - final Map driver = { - 'firstName': 'fn', - 'middleName': 'mn', - 'lastName': 'ln', - 'gender': 'g', - 'addressCity': 'ac', - 'addressState': 'a', - 'addressStreet': 'st', - 'addressZip': 'az', - 'birthDate': 'bd', - 'documentType': 'dt', - 'licenseNumber': 'l', - 'expiryDate': 'ed', - 'issuingDate': 'id', - 'issuingCountry': 'ic' - }; - - returnBarcodes[0]['valueType'] = BarcodeValueType.driverLicense.index; - returnBarcodes[0]['driverLicense'] = driver; - returnValue = returnBarcodes; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.valueType, BarcodeValueType.driverLicense); - expect(barcode.driverLicense.firstName, 'fn'); - expect(barcode.driverLicense.middleName, 'mn'); - expect(barcode.driverLicense.lastName, 'ln'); - expect(barcode.driverLicense.gender, 'g'); - expect(barcode.driverLicense.addressCity, 'ac'); - expect(barcode.driverLicense.addressState, 'a'); - expect(barcode.driverLicense.addressStreet, 'st'); - expect(barcode.driverLicense.addressZip, 'az'); - expect(barcode.driverLicense.birthDate, 'bd'); - expect(barcode.driverLicense.documentType, 'dt'); - expect(barcode.driverLicense.licenseNumber, 'l'); - expect(barcode.driverLicense.expiryDate, 'ed'); - expect(barcode.driverLicense.issuingDate, 'id'); - expect(barcode.driverLicense.issuingCountry, 'ic'); - }); - - test('detectInImage no blocks', () async { - returnValue = []; - - final List blocks = await detector.detectInImage(image); - expect(blocks, isEmpty); - }); - - test('detectInImage no bounding box', () async { - returnValue = [ - { - 'rawValue': 'potato:raw', - 'displayValue': 'potato:display', - 'valueType': 0, - 'format': 0, - 'points': [ - [17.0, 18.0], - [19.0, 20.0], - ], - }, - ]; - - final List barcodes = await detector.detectInImage(image); - - final Barcode barcode = barcodes[0]; - expect(barcode.boundingBox, null); - expect(barcode.rawValue, 'potato:raw'); - expect(barcode.displayValue, 'potato:display'); - expect(barcode.cornerPoints, const [ - Offset(17.0, 18.0), - Offset(19.0, 20.0), - ]); - }); - - test('enums match device APIs', () { - expect(BarcodeValueType.values.length, 13); - expect(BarcodeValueType.unknown.index, 0); - expect(BarcodeValueType.contactInfo.index, 1); - expect(BarcodeValueType.email.index, 2); - expect(BarcodeValueType.isbn.index, 3); - expect(BarcodeValueType.phone.index, 4); - expect(BarcodeValueType.product.index, 5); - expect(BarcodeValueType.sms.index, 6); - expect(BarcodeValueType.text.index, 7); - expect(BarcodeValueType.url.index, 8); - expect(BarcodeValueType.wifi.index, 9); - expect(BarcodeValueType.geographicCoordinates.index, 10); - expect(BarcodeValueType.calendarEvent.index, 11); - expect(BarcodeValueType.driverLicense.index, 12); - - expect(BarcodeEmailType.values.length, 3); - expect(BarcodeEmailType.unknown.index, 0); - expect(BarcodeEmailType.work.index, 1); - expect(BarcodeEmailType.home.index, 2); - - expect(BarcodePhoneType.values.length, 5); - expect(BarcodePhoneType.unknown.index, 0); - expect(BarcodePhoneType.work.index, 1); - expect(BarcodePhoneType.home.index, 2); - expect(BarcodePhoneType.fax.index, 3); - expect(BarcodePhoneType.mobile.index, 4); - - expect(BarcodeWiFiEncryptionType.values.length, 4); - expect(BarcodeWiFiEncryptionType.unknown.index, 0); - expect(BarcodeWiFiEncryptionType.open.index, 1); - expect(BarcodeWiFiEncryptionType.wpa.index, 2); - expect(BarcodeWiFiEncryptionType.wep.index, 3); - - expect(BarcodeAddressType.values.length, 3); - expect(BarcodeAddressType.unknown.index, 0); - expect(BarcodeAddressType.work.index, 1); - expect(BarcodeAddressType.home.index, 2); - }); - - group('$BarcodeDetectorOptions', () { - test('barcodeFormats', () async { - // The constructor for `BarcodeDetectorOptions` can't be `const` - // without triggering a `CONST_EVAL_TYPE_BOOL_INT` error. - // ignore: prefer_const_constructors - final BarcodeDetectorOptions options = BarcodeDetectorOptions( - barcodeFormats: BarcodeFormat.code128 | - BarcodeFormat.dataMatrix | - BarcodeFormat.ean8, - ); - - final BarcodeDetector detector = - FirebaseVision.instance.barcodeDetector(options); - await detector.detectInImage(image); - - expect( - log[0].arguments['options']['barcodeFormats'], - 0x0001 | 0x0010 | 0x0040, - ); - }); - }); - }); - - group('$FaceDetector', () { - List testFaces; - - setUp(() { - testFaces = [ - { - 'left': 0.0, - 'top': 1.0, - 'width': 2.0, - 'height': 3.0, - 'headEulerAngleY': 4.0, - 'headEulerAngleZ': 5.0, - 'leftEyeOpenProbability': 0.4, - 'rightEyeOpenProbability': 0.5, - 'smilingProbability': 0.2, - 'trackingId': 8, - 'landmarks': { - 'bottomMouth': [0.1, 1.1], - 'leftCheek': [2.1, 3.1], - 'leftEar': [4.1, 5.1], - 'leftEye': [6.1, 7.1], - 'leftMouth': [8.1, 9.1], - 'noseBase': [10.1, 11.1], - 'rightCheek': [12.1, 13.1], - 'rightEar': [14.1, 15.1], - 'rightEye': [16.1, 17.1], - 'rightMouth': [18.1, 19.1], - }, - 'contours': { - 'allPoints': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'face': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'leftEye': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'leftEyebrowBottom': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'leftEyebrowTop': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'lowerLipBottom': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'lowerLipTop': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'noseBottom': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'noseBridge': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'rightEye': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'rightEyebrowBottom': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'rightEyebrowTop': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'upperLipBottom': [ - [1.1, 2.2], - [3.3, 4.4], - ], - 'upperLipTop': [ - [1.1, 2.2], - [3.3, 4.4], - ], - }, - }, - ]; - }); - - test('processImage', () async { - returnValue = testFaces; - - final FaceDetector detector = FirebaseVision.instance.faceDetector( - const FaceDetectorOptions( - enableClassification: true, - enableLandmarks: true, - enableTracking: false, - enableContours: true, - minFaceSize: 0.5, - mode: FaceDetectorMode.accurate, - ), - ); - - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - final List faces = await detector.processImage(image); - - expect(log, [ - isMethodCall( - 'FaceDetector#processImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'enableClassification': true, - 'enableLandmarks': true, - 'enableContours': true, - 'enableTracking': false, - 'minFaceSize': 0.5, - 'mode': 'accurate', - }, - }, - ), - ]); - - final Face face = faces[0]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(face.boundingBox, Rect.fromLTWH(0.0, 1.0, 2.0, 3.0)); - expect(face.headEulerAngleY, 4.0); - expect(face.headEulerAngleZ, 5.0); - expect(face.leftEyeOpenProbability, 0.4); - expect(face.rightEyeOpenProbability, 0.5); - expect(face.smilingProbability, 0.2); - expect(face.trackingId, 8); - - for (FaceLandmarkType type in FaceLandmarkType.values) { - expect(face.getLandmark(type).type, type); - } - - Offset p(FaceLandmarkType type) { - return face.getLandmark(type).position; - } - - expect(p(FaceLandmarkType.bottomMouth), const Offset(0.1, 1.1)); - expect(p(FaceLandmarkType.leftCheek), const Offset(2.1, 3.1)); - expect(p(FaceLandmarkType.leftEar), const Offset(4.1, 5.1)); - expect(p(FaceLandmarkType.leftEye), const Offset(6.1, 7.1)); - expect(p(FaceLandmarkType.leftMouth), const Offset(8.1, 9.1)); - expect(p(FaceLandmarkType.noseBase), const Offset(10.1, 11.1)); - expect(p(FaceLandmarkType.rightCheek), const Offset(12.1, 13.1)); - expect(p(FaceLandmarkType.rightEar), const Offset(14.1, 15.1)); - expect(p(FaceLandmarkType.rightEye), const Offset(16.1, 17.1)); - expect(p(FaceLandmarkType.rightMouth), const Offset(18.1, 19.1)); - - List c(FaceContourType type) { - return face.getContour(type).positionsList; - } - - expect( - c(FaceContourType.allPoints), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.face), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.leftEye), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.leftEyebrowBottom), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.leftEyebrowTop), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.lowerLipBottom), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.lowerLipTop), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.noseBottom), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.noseBridge), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.rightEye), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.rightEyebrowBottom), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.rightEyebrowTop), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.upperLipBottom), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - expect( - c(FaceContourType.upperLipTop), - containsAllInOrder( - [const Offset(1.1, 2.2), const Offset(3.3, 4.4)]), - ); - }); - - test('processImage with null landmark', () async { - testFaces[0]['landmarks']['bottomMouth'] = null; - returnValue = testFaces; - - final FaceDetector detector = FirebaseVision.instance.faceDetector( - const FaceDetectorOptions(), - ); - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - final List faces = await detector.processImage(image); - - expect(faces[0].getLandmark(FaceLandmarkType.bottomMouth), isNull); - }); - - test('processImage no faces', () async { - returnValue = []; - - final FaceDetector detector = FirebaseVision.instance.faceDetector( - const FaceDetectorOptions(), - ); - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - final List faces = await detector.processImage(image); - expect(faces, isEmpty); - }); - }); - - group('$TextRecognizer', () { - TextRecognizer recognizer; - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - setUp(() { - recognizer = FirebaseVision.instance.textRecognizer(); - final List elements = [ - { - 'text': 'hello', - 'left': 1.0, - 'top': 2.0, - 'width': 3.0, - 'height': 4.0, - 'points': [ - [5.0, 6.0], - [7.0, 8.0], - ], - 'recognizedLanguages': [ - { - 'languageCode': 'ab', - }, - { - 'languageCode': 'cd', - } - ], - 'confidence': 0.1, - }, - { - 'text': 'my', - 'left': 4.0, - 'top': 3.0, - 'width': 2.0, - 'height': 1.0, - 'points': [ - [6.0, 5.0], - [8.0, 7.0], - ], - 'recognizedLanguages': [], - 'confidence': 0.2, - }, - ]; - - final List lines = [ - { - 'text': 'friend', - 'left': 5.0, - 'top': 6.0, - 'width': 7.0, - 'height': 8.0, - 'points': [ - [9.0, 10.0], - [11.0, 12.0], - ], - 'recognizedLanguages': [ - { - 'languageCode': 'ef', - }, - { - 'languageCode': 'gh', - } - ], - 'elements': elements, - 'confidence': 0.3, - }, - { - 'text': 'how', - 'left': 8.0, - 'top': 7.0, - 'width': 4.0, - 'height': 5.0, - 'points': [ - [10.0, 9.0], - [12.0, 11.0], - ], - 'recognizedLanguages': [], - 'elements': [], - 'confidence': 0.4, - }, - ]; - - final List blocks = [ - { - 'text': 'friend', - 'left': 13.0, - 'top': 14.0, - 'width': 15.0, - 'height': 16.0, - 'points': [ - [17.0, 18.0], - [19.0, 20.0], - ], - 'recognizedLanguages': [ - { - 'languageCode': 'ij', - }, - { - 'languageCode': 'kl', - } - ], - 'lines': lines, - 'confidence': 0.5, - }, - { - 'text': 'hello', - 'left': 14.0, - 'top': 13.0, - 'width': 16.0, - 'height': 15.0, - 'points': [ - [18.0, 17.0], - [20.0, 19.0], - ], - 'recognizedLanguages': [], - 'lines': [], - 'confidence': 0.6, - }, - ]; - - final dynamic visionText = { - 'text': 'testext', - 'blocks': blocks, - }; - - returnValue = visionText; - }); - - group('$TextBlock', () { - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - expect(text.blocks, hasLength(2)); - - TextBlock block = text.blocks[0]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(block.boundingBox, Rect.fromLTWH(13.0, 14.0, 15.0, 16.0)); - expect(block.text, 'friend'); - expect(block.cornerPoints, const [ - Offset(17.0, 18.0), - Offset(19.0, 20.0), - ]); - expect(block.recognizedLanguages, hasLength(2)); - expect(block.recognizedLanguages[0].languageCode, 'ij'); - expect(block.recognizedLanguages[1].languageCode, 'kl'); - expect(block.confidence, 0.5); - - block = text.blocks[1]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(block.boundingBox, Rect.fromLTWH(14.0, 13.0, 16.0, 15.0)); - expect(block.text, 'hello'); - expect(block.cornerPoints, const [ - Offset(18.0, 17.0), - Offset(20.0, 19.0), - ]); - expect(block.confidence, 0.6); - }); - }); - - group('$TextLine', () { - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - TextLine line = text.blocks[0].lines[0]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(line.boundingBox, Rect.fromLTWH(5, 6, 7, 8)); - expect(line.text, 'friend'); - expect(line.cornerPoints, const [ - Offset(9.0, 10.0), - Offset(11.0, 12.0), - ]); - expect(line.recognizedLanguages, hasLength(2)); - expect(line.recognizedLanguages[0].languageCode, 'ef'); - expect(line.recognizedLanguages[1].languageCode, 'gh'); - expect(line.confidence, 0.3); - - line = text.blocks[0].lines[1]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(line.boundingBox, Rect.fromLTWH(8.0, 7.0, 4.0, 5.0)); - expect(line.text, 'how'); - expect(line.cornerPoints, const [ - Offset(10.0, 9.0), - Offset(12.0, 11.0), - ]); - expect(line.confidence, 0.4); - }); - }); - - group('$TextElement', () { - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - TextElement element = text.blocks[0].lines[0].elements[0]; - // ignore: prefer_const_constructors - expect(element.boundingBox, Rect.fromLTWH(1.0, 2.0, 3.0, 4.0)); - expect(element.text, 'hello'); - expect(element.cornerPoints, const [ - Offset(5.0, 6.0), - Offset(7.0, 8.0), - ]); - expect(element.recognizedLanguages, hasLength(2)); - expect(element.recognizedLanguages[0].languageCode, 'ab'); - expect(element.recognizedLanguages[1].languageCode, 'cd'); - expect(element.confidence, 0.1); - - element = text.blocks[0].lines[0].elements[1]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(element.boundingBox, Rect.fromLTWH(4.0, 3.0, 2.0, 1.0)); - expect(element.text, 'my'); - expect(element.cornerPoints, const [ - Offset(6.0, 5.0), - Offset(8.0, 7.0), - ]); - expect(element.confidence, 0.2); - }); - }); - - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - expect(text.text, 'testext'); - expect(log, [ - isMethodCall( - 'TextRecognizer#processImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'modelType': 'onDevice', - }, - }, - ), - ]); - }); - - test('processImage no bounding box', () async { - returnValue = { - 'blocks': [ - { - 'text': '', - 'points': [], - 'recognizedLanguages': [], - 'lines': [], - }, - ], - }; - - final VisionText text = await recognizer.processImage(image); - - final TextBlock block = text.blocks[0]; - expect(block.boundingBox, null); - }); - }); - - group('Cloud $TextRecognizer', () { - TextRecognizer recognizer; - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - setUp(() { - recognizer = FirebaseVision.instance.cloudTextRecognizer(); - final List elements = [ - { - 'text': 'hello', - 'left': 1.0, - 'top': 2.0, - 'width': 3.0, - 'height': 4.0, - 'points': [ - [5.0, 6.0], - [7.0, 8.0], - ], - 'recognizedLanguages': [ - { - 'languageCode': 'ab', - }, - { - 'languageCode': 'cd', - } - ], - 'confidence': 0.1, - }, - { - 'text': 'my', - 'left': 4.0, - 'top': 3.0, - 'width': 2.0, - 'height': 1.0, - 'points': [ - [6.0, 5.0], - [8.0, 7.0], - ], - 'recognizedLanguages': [], - 'confidence': 0.2, - }, - ]; - - final List lines = [ - { - 'text': 'friend', - 'left': 5.0, - 'top': 6.0, - 'width': 7.0, - 'height': 8.0, - 'points': [ - [9.0, 10.0], - [11.0, 12.0], - ], - 'recognizedLanguages': [ - { - 'languageCode': 'ef', - }, - { - 'languageCode': 'gh', - } - ], - 'elements': elements, - 'confidence': 0.3, - }, - { - 'text': 'how', - 'left': 8.0, - 'top': 7.0, - 'width': 4.0, - 'height': 5.0, - 'points': [ - [10.0, 9.0], - [12.0, 11.0], - ], - 'recognizedLanguages': [], - 'elements': [], - 'confidence': 0.4, - }, - ]; - - final List blocks = [ - { - 'text': 'friend', - 'left': 13.0, - 'top': 14.0, - 'width': 15.0, - 'height': 16.0, - 'points': [ - [17.0, 18.0], - [19.0, 20.0], - ], - 'recognizedLanguages': [ - { - 'languageCode': 'ij', - }, - { - 'languageCode': 'kl', - } - ], - 'lines': lines, - 'confidence': 0.5, - }, - { - 'text': 'hello', - 'left': 14.0, - 'top': 13.0, - 'width': 16.0, - 'height': 15.0, - 'points': [ - [18.0, 17.0], - [20.0, 19.0], - ], - 'recognizedLanguages': [], - 'lines': [], - 'confidence': 0.6, - }, - ]; - - final dynamic visionText = { - 'text': 'testext', - 'blocks': blocks, - }; - - returnValue = visionText; - }); - - group('$TextBlock', () { - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - expect(text.blocks, hasLength(2)); - - TextBlock block = text.blocks[0]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(block.boundingBox, Rect.fromLTWH(13.0, 14.0, 15.0, 16.0)); - expect(block.text, 'friend'); - expect(block.cornerPoints, const [ - Offset(17.0, 18.0), - Offset(19.0, 20.0), - ]); - expect(block.recognizedLanguages, hasLength(2)); - expect(block.recognizedLanguages[0].languageCode, 'ij'); - expect(block.recognizedLanguages[1].languageCode, 'kl'); - expect(block.confidence, 0.5); - - block = text.blocks[1]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(block.boundingBox, Rect.fromLTWH(14.0, 13.0, 16.0, 15.0)); - expect(block.text, 'hello'); - expect(block.cornerPoints, const [ - Offset(18.0, 17.0), - Offset(20.0, 19.0), - ]); - expect(block.confidence, 0.6); - }); - }); - - group('$TextLine', () { - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - TextLine line = text.blocks[0].lines[0]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(line.boundingBox, Rect.fromLTWH(5, 6, 7, 8)); - expect(line.text, 'friend'); - expect(line.cornerPoints, const [ - Offset(9.0, 10.0), - Offset(11.0, 12.0), - ]); - expect(line.recognizedLanguages, hasLength(2)); - expect(line.recognizedLanguages[0].languageCode, 'ef'); - expect(line.recognizedLanguages[1].languageCode, 'gh'); - expect(line.confidence, 0.3); - - line = text.blocks[0].lines[1]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(line.boundingBox, Rect.fromLTWH(8.0, 7.0, 4.0, 5.0)); - expect(line.text, 'how'); - expect(line.cornerPoints, const [ - Offset(10.0, 9.0), - Offset(12.0, 11.0), - ]); - expect(line.confidence, 0.4); - }); - }); - - group('$TextElement', () { - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - TextElement element = text.blocks[0].lines[0].elements[0]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(element.boundingBox, Rect.fromLTWH(1.0, 2.0, 3.0, 4.0)); - expect(element.text, 'hello'); - expect(element.cornerPoints, const [ - Offset(5.0, 6.0), - Offset(7.0, 8.0), - ]); - expect(element.recognizedLanguages, hasLength(2)); - expect(element.recognizedLanguages[0].languageCode, 'ab'); - expect(element.recognizedLanguages[1].languageCode, 'cd'); - expect(element.confidence, 0.1); - - element = text.blocks[0].lines[0].elements[1]; - // TODO(jackson): Use const Rect when available in minimum Flutter SDK - // ignore: prefer_const_constructors - expect(element.boundingBox, Rect.fromLTWH(4.0, 3.0, 2.0, 1.0)); - expect(element.text, 'my'); - expect(element.cornerPoints, const [ - Offset(6.0, 5.0), - Offset(8.0, 7.0), - ]); - expect(element.confidence, 0.2); - }); - }); - - test('processImage', () async { - final VisionText text = await recognizer.processImage(image); - - expect(text.text, 'testext'); - expect(log, [ - isMethodCall( - 'TextRecognizer#processImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'modelType': 'cloud', - }, - }, - ), - ]); - }); - - test('processImage no bounding box', () async { - returnValue = { - 'blocks': [ - { - 'text': '', - 'points': [], - 'recognizedLanguages': [], - 'lines': [], - }, - ], - }; - - final VisionText text = await recognizer.processImage(image); - - final TextBlock block = text.blocks[0]; - expect(block.boundingBox, null); - }); - }); - }); -} diff --git a/packages/firebase_ml_vision/test/image_labeler_test.dart b/packages/firebase_ml_vision/test/image_labeler_test.dart deleted file mode 100644 index a95cca264235..000000000000 --- a/packages/firebase_ml_vision/test/image_labeler_test.dart +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:firebase_ml_vision/firebase_ml_vision.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebaseVision', () { - final List log = []; - dynamic returnValue; - - setUp(() { - FirebaseVision.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - - switch (methodCall.method) { - case 'ImageLabeler#processImage': - return returnValue; - default: - return null; - } - }); - log.clear(); - FirebaseVision.nextHandle = 0; - }); - - group('$ImageLabeler', () { - test('processImage', () async { - final List labelData = [ - { - 'confidence': 0.6, - 'entityId': 'hello', - 'text': 'friend', - }, - { - 'confidence': 0.8, - 'entityId': 'hi', - 'text': 'brother', - }, - ]; - - returnValue = labelData; - - final ImageLabeler detector = FirebaseVision.instance.imageLabeler( - const ImageLabelerOptions(confidenceThreshold: 0.2), - ); - - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - final List labels = await detector.processImage(image); - - expect(log, [ - isMethodCall( - 'ImageLabeler#processImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'modelType': 'onDevice', - 'confidenceThreshold': 0.2, - }, - }, - ), - ]); - - expect(labels[0].confidence, 0.6); - expect(labels[0].entityId, 'hello'); - expect(labels[0].text, 'friend'); - - expect(labels[1].confidence, 0.8); - expect(labels[1].entityId, 'hi'); - expect(labels[1].text, 'brother'); - }); - - test('processImage no blocks', () async { - returnValue = []; - - final ImageLabeler detector = FirebaseVision.instance.imageLabeler( - const ImageLabelerOptions(), - ); - final FirebaseVisionImage image = - FirebaseVisionImage.fromFilePath('empty'); - - final List labels = await detector.processImage(image); - - expect(log, [ - isMethodCall( - 'ImageLabeler#processImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'modelType': 'onDevice', - 'confidenceThreshold': 0.5, - }, - }, - ), - ]); - - expect(labels, isEmpty); - }); - }); - - group('Cloud $ImageLabeler', () { - test('processImage', () async { - final List labelData = [ - { - 'confidence': 0.6, - 'entityId': '/m/0', - 'text': 'banana', - }, - { - 'confidence': 0.8, - 'entityId': '/m/1', - 'text': 'apple', - }, - ]; - - returnValue = labelData; - - final ImageLabeler labeler = FirebaseVision.instance.cloudImageLabeler( - const CloudImageLabelerOptions(confidenceThreshold: 0.6), - ); - - final FirebaseVisionImage image = FirebaseVisionImage.fromFilePath( - 'empty', - ); - - final List labels = await labeler.processImage(image); - - expect(log, [ - isMethodCall( - 'ImageLabeler#processImage', - arguments: { - 'handle': 0, - 'type': 'file', - 'path': 'empty', - 'bytes': null, - 'metadata': null, - 'options': { - 'modelType': 'cloud', - 'confidenceThreshold': 0.6, - }, - }, - ), - ]); - - expect(labels[0].confidence, 0.6); - expect(labels[0].entityId, '/m/0'); - expect(labels[0].text, 'banana'); - - expect(labels[1].confidence, 0.8); - expect(labels[1].entityId, '/m/1'); - expect(labels[1].text, 'apple'); - }); - }); - }); -} diff --git a/packages/firebase_performance/.gitignore b/packages/firebase_performance/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_performance/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_performance/CHANGELOG.md b/packages/firebase_performance/CHANGELOG.md deleted file mode 100644 index 64e95feed5a8..000000000000 --- a/packages/firebase_performance/CHANGELOG.md +++ /dev/null @@ -1,94 +0,0 @@ -## 0.3.0+4 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.3.0+3 - -* Fix bug that caused `invokeMethod` to fail with Dart code obfuscation - -## 0.3.0+2 - -* Fix bug preventing this plugin from working with hot restart. - -## 0.3.0+1 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.3.0 - -* **Breaking Change** Removed `Trace.incrementCounter`. Please use `Trace.incrementMetric`. -* Assertion errors are no longer thrown for incorrect input for `Trace`s and `HttpMetric`s. -* You can now get entire list of attributes from `Trace` and `HttpMetric` with `getAttributes()`. -* Added access to `Trace` value `name`. -* Added access to `HttpMetric` values `url` and `HttpMethod`. - -## 0.2.0 - -* Update Android dependencies to latest. - -## 0.1.1 - -* Deprecate `Trace.incrementCounter` and add `Trace.incrementMetric`. -* Additional integration testing. - -## 0.1.0+4 - -* Remove deprecated methods for iOS. -* Fix bug where `Trace` attributes were not set correctly. - -## 0.1.0+3 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.1.0+2 - -* Fixed bug where `Traces` and `HttpMetrics` weren't being passed to Firebase on iOS. - -## 0.1.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.1.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.0.8+1 - -* Bump Android dependencies to latest. - -## 0.0.8 - -* Set http version to be compatible with flutter_test. - -## 0.0.7 - -* Added missing http package dependency. - -## 0.0.6 - -* Bump Android and Firebase dependency versions. - -## 0.0.5 - -Added comments explaining the time it takes to see performance results. - -## 0.0.4 - -* Formatted code, updated comments, and removed unnecessary files. - -## 0.0.3 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.0.2 - -* Added HttpMetric for monitoring for specific network requests. - -## 0.0.1 - -* Initial Release. diff --git a/packages/firebase_performance/LICENSE b/packages/firebase_performance/LICENSE deleted file mode 100644 index 8940a4be1b58..000000000000 --- a/packages/firebase_performance/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/firebase_performance/README.md b/packages/firebase_performance/README.md deleted file mode 100644 index 8dc69662364e..000000000000 --- a/packages/firebase_performance/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Google Performance Monitoring for Firebase - -[![pub package](https://img.shields.io/pub/v/firebase_performance.svg)](https://pub.dartlang.org/packages/firebase_performance) - -A Flutter plugin to use the [Google Performance Monitoring for Firebase API](https://firebase.google.com/docs/perf-mon/). - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -To use this plugin, add `firebase_performance` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). You must also configure firebase performance monitoring for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#4 for step by step details). - -You can confirm that Performance Monitoring results appear in the [Firebase console.](https://console.firebase.google.com/) Results should appear within 12 hours. - -## Define a Custom Trace - -A custom trace is a report of performance data associated with some of the code in your app. To learn more about custom traces, see the [Performance Monitoring overview](https://firebase.google.com/docs/perf-mon/#how_does_it_work). - -```dart -final Trace myTrace = FirebasePerformance.instance.newTrace("test_trace"); -myTrace.start(); - -final Item item = cache.fetch("item"); -if (item != null) { - myTrace.incrementMetric("item_cache_hit", 1); -} else { - myTrace.incrementMetric("item_cache_miss", 1); -} - -myTrace.stop(); -``` - -## Add monitoring for specific network requests - -Performance Monitoring collects network requests automatically. Although this includes most network requests for your app, some might not be reported. To include specific network requests in Performance Monitoring, add the following code to your app: - -```dart -class _MetricHttpClient extends BaseClient { - _MetricHttpClient(this._inner); - - final Client _inner; - - @override - Future send(BaseRequest request) async { - final HttpMetric metric = FirebasePerformance.instance - .newHttpMetric(request.url.toString(), HttpMethod.Get); - - await metric.start(); - - StreamedResponse response; - try { - response = await _inner.send(request); - metric - ..responsePayloadSize = response.contentLength - ..responseContentType = response.headers['Content-Type'] - ..requestPayloadSize = request.contentLength - ..httpResponseCode = response.statusCode; - } finally { - await metric.stop(); - } - - return response; - } -} - -class _MyAppState extends State { -. -. -. - Future testHttpMetric() async { - final _MetricHttpClient metricHttpClient = _MetricHttpClient(Client()); - - final Request request = - Request("SEND", Uri.parse("https://www.google.com")); - - metricHttpClient.send(request); - } -. -. -. -} -``` - -## Getting Started - -See the `example` directory for a complete sample app using Google Performance Monitoring for Firebase. diff --git a/packages/firebase_performance/android/build.gradle b/packages/firebase_performance/android/build.gradle deleted file mode 100644 index 82b655b7136b..000000000000 --- a/packages/firebase_performance/android/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -def PLUGIN = "firebase_performance"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebaseperformance' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-perf:17.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_performance/android/gradle.properties b/packages/firebase_performance/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_performance/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_performance/android/settings.gradle b/packages/firebase_performance/android/settings.gradle deleted file mode 100644 index 50c3a2d77af8..000000000000 --- a/packages/firebase_performance/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_performance' diff --git a/packages/firebase_performance/android/src/main/AndroidManifest.xml b/packages/firebase_performance/android/src/main/AndroidManifest.xml deleted file mode 100644 index 2d19cbfdc23e..000000000000 --- a/packages/firebase_performance/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FirebasePerformancePlugin.java b/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FirebasePerformancePlugin.java deleted file mode 100644 index 53cbaae72737..000000000000 --- a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FirebasePerformancePlugin.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseperformance; - -import android.util.SparseArray; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.PluginRegistry.Registrar; - -/** FirebasePerformancePlugin */ -public class FirebasePerformancePlugin implements MethodChannel.MethodCallHandler { - private static final String CHANNEL_NAME = "plugins.flutter.io/firebase_performance"; - - private static final SparseArray handlers = new SparseArray<>(); - - public static void registerWith(Registrar registrar) { - final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL_NAME); - channel.setMethodCallHandler(new FirebasePerformancePlugin()); - } - - @Override - public void onMethodCall(MethodCall call, MethodChannel.Result result) { - if (call.method.equals("FirebasePerformance#instance")) { - handlers.clear(); - FlutterFirebasePerformance.getInstance(call, result); - } else { - final MethodChannel.MethodCallHandler handler = getHandler(call); - - if (handler != null) { - handler.onMethodCall(call, result); - } else { - result.notImplemented(); - } - } - } - - static void addHandler(final int handle, final MethodChannel.MethodCallHandler handler) { - if (handlers.get(handle) != null) { - final String message = String.format("Object for handle already exists: %s", handle); - throw new IllegalArgumentException(message); - } - - handlers.put(handle, handler); - } - - static void removeHandler(final int handle) { - handlers.remove(handle); - } - - private static MethodChannel.MethodCallHandler getHandler(final MethodCall call) { - final Integer handle = call.argument("handle"); - - if (handle == null) return null; - return handlers.get(handle); - } -} diff --git a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterFirebaseAppRegistrar.java b/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 37bf5a31dea6..000000000000 --- a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseperformance; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterFirebasePerformance.java b/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterFirebasePerformance.java deleted file mode 100644 index ce04044a1ea8..000000000000 --- a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterFirebasePerformance.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseperformance; - -import com.google.firebase.perf.FirebasePerformance; -import com.google.firebase.perf.metrics.HttpMetric; -import com.google.firebase.perf.metrics.Trace; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; - -public class FlutterFirebasePerformance implements MethodChannel.MethodCallHandler { - private static String parseHttpMethod(String httpMethod) { - switch (httpMethod) { - case "HttpMethod.Connect": - return FirebasePerformance.HttpMethod.CONNECT; - case "HttpMethod.Delete": - return FirebasePerformance.HttpMethod.DELETE; - case "HttpMethod.Get": - return FirebasePerformance.HttpMethod.GET; - case "HttpMethod.Head": - return FirebasePerformance.HttpMethod.HEAD; - case "HttpMethod.Options": - return FirebasePerformance.HttpMethod.OPTIONS; - case "HttpMethod.Patch": - return FirebasePerformance.HttpMethod.PATCH; - case "HttpMethod.Post": - return FirebasePerformance.HttpMethod.POST; - case "HttpMethod.Put": - return FirebasePerformance.HttpMethod.PUT; - case "HttpMethod.Trace": - return FirebasePerformance.HttpMethod.TRACE; - default: - throw new IllegalArgumentException(String.format("No HttpMethod for: %s", httpMethod)); - } - } - - private final FirebasePerformance performance; - - @SuppressWarnings("ConstantConditions") - static void getInstance(MethodCall call, MethodChannel.Result result) { - final Integer handle = call.argument("handle"); - FirebasePerformancePlugin.addHandler(handle, new FlutterFirebasePerformance()); - result.success(null); - } - - private FlutterFirebasePerformance() { - this.performance = FirebasePerformance.getInstance(); - } - - @Override - public void onMethodCall(MethodCall call, MethodChannel.Result result) { - switch (call.method) { - case "FirebasePerformance#isPerformanceCollectionEnabled": - isPerformanceCollectionEnabled(result); - break; - case "FirebasePerformance#setPerformanceCollectionEnabled": - setPerformanceCollectionEnabled(call, result); - break; - case "FirebasePerformance#newTrace": - newTrace(call, result); - break; - case "FirebasePerformance#newHttpMetric": - newHttpMetric(call, result); - break; - default: - result.notImplemented(); - } - } - - private void isPerformanceCollectionEnabled(MethodChannel.Result result) { - result.success(performance.isPerformanceCollectionEnabled()); - } - - @SuppressWarnings("ConstantConditions") - private void setPerformanceCollectionEnabled(MethodCall call, MethodChannel.Result result) { - final Boolean enable = call.argument("enable"); - performance.setPerformanceCollectionEnabled(enable); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void newTrace(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - final Trace trace = performance.newTrace(name); - - final Integer handle = call.argument("traceHandle"); - FirebasePerformancePlugin.addHandler(handle, new FlutterTrace(trace)); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void newHttpMetric(MethodCall call, MethodChannel.Result result) { - final String url = call.argument("url"); - final String httpMethod = call.argument("httpMethod"); - - final HttpMetric metric = performance.newHttpMetric(url, parseHttpMethod(httpMethod)); - - final Integer handle = call.argument("httpMetricHandle"); - FirebasePerformancePlugin.addHandler(handle, new FlutterHttpMetric(metric)); - - result.success(null); - } -} diff --git a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterHttpMetric.java b/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterHttpMetric.java deleted file mode 100644 index 2e2f2e6e4ed3..000000000000 --- a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterHttpMetric.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseperformance; - -import com.google.firebase.perf.metrics.HttpMetric; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; - -public class FlutterHttpMetric implements MethodChannel.MethodCallHandler { - private final HttpMetric httpMetric; - - FlutterHttpMetric(final HttpMetric metric) { - this.httpMetric = metric; - } - - @Override - public void onMethodCall(MethodCall call, MethodChannel.Result result) { - switch (call.method) { - case "HttpMetric#start": - start(result); - break; - case "HttpMetric#stop": - stop(call, result); - break; - case "HttpMetric#httpResponseCode": - setHttpResponseCode(call, result); - break; - case "HttpMetric#requestPayloadSize": - setRequestPayloadSize(call, result); - break; - case "HttpMetric#responseContentType": - setResponseContentType(call, result); - break; - case "HttpMetric#responsePayloadSize": - setResponsePayloadSize(call, result); - break; - case "PerformanceAttributes#putAttribute": - putAttribute(call, result); - break; - case "PerformanceAttributes#removeAttribute": - removeAttribute(call, result); - break; - case "PerformanceAttributes#getAttributes": - getAttributes(result); - break; - default: - result.notImplemented(); - } - } - - private void start(MethodChannel.Result result) { - httpMetric.start(); - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void stop(MethodCall call, MethodChannel.Result result) { - httpMetric.stop(); - - final Integer handle = call.argument("handle"); - FirebasePerformancePlugin.removeHandler(handle); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void setHttpResponseCode(MethodCall call, MethodChannel.Result result) { - final Integer httpResponseCode = call.argument("httpResponseCode"); - httpMetric.setHttpResponseCode(httpResponseCode); - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void setRequestPayloadSize(MethodCall call, MethodChannel.Result result) { - final Number payloadSize = call.argument("requestPayloadSize"); - httpMetric.setRequestPayloadSize(payloadSize.longValue()); - result.success(null); - } - - private void setResponseContentType(MethodCall call, MethodChannel.Result result) { - final String contentType = call.argument("responseContentType"); - httpMetric.setResponseContentType(contentType); - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void setResponsePayloadSize(MethodCall call, MethodChannel.Result result) { - final Number payloadSize = call.argument("responsePayloadSize"); - httpMetric.setResponsePayloadSize(payloadSize.longValue()); - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void putAttribute(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - final String value = call.argument("value"); - - httpMetric.putAttribute(name, value); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void removeAttribute(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - httpMetric.removeAttribute(name); - - result.success(null); - } - - private void getAttributes(MethodChannel.Result result) { - result.success(httpMetric.getAttributes()); - } -} diff --git a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterTrace.java b/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterTrace.java deleted file mode 100644 index 0bcb54f34834..000000000000 --- a/packages/firebase_performance/android/src/main/java/io/flutter/plugins/firebaseperformance/FlutterTrace.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebaseperformance; - -import com.google.firebase.perf.metrics.Trace; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; - -public class FlutterTrace implements MethodChannel.MethodCallHandler { - private final Trace trace; - - FlutterTrace(final Trace trace) { - this.trace = trace; - } - - @Override - public void onMethodCall(MethodCall call, MethodChannel.Result result) { - switch (call.method) { - case "Trace#start": - start(result); - break; - case "Trace#stop": - stop(call, result); - break; - case "Trace#setMetric": - setMetric(call, result); - break; - case "Trace#incrementMetric": - incrementMetric(call, result); - break; - case "Trace#getMetric": - getMetric(call, result); - break; - case "PerformanceAttributes#putAttribute": - putAttribute(call, result); - break; - case "PerformanceAttributes#removeAttribute": - removeAttribute(call, result); - break; - case "PerformanceAttributes#getAttributes": - getAttributes(result); - break; - default: - result.notImplemented(); - } - } - - private void start(MethodChannel.Result result) { - trace.start(); - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void stop(MethodCall call, MethodChannel.Result result) { - trace.stop(); - - final Integer handle = call.argument("handle"); - FirebasePerformancePlugin.removeHandler(handle); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void setMetric(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - final Number value = call.argument("value"); - trace.putMetric(name, value.longValue()); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void incrementMetric(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - final Number value = call.argument("value"); - trace.incrementMetric(name, value.longValue()); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void getMetric(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - - result.success(trace.getLongMetric(name)); - } - - @SuppressWarnings("ConstantConditions") - private void putAttribute(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - final String value = call.argument("value"); - - trace.putAttribute(name, value); - - result.success(null); - } - - @SuppressWarnings("ConstantConditions") - private void removeAttribute(MethodCall call, MethodChannel.Result result) { - final String name = call.argument("name"); - trace.removeAttribute(name); - - result.success(null); - } - - private void getAttributes(MethodChannel.Result result) { - result.success(trace.getAttributes()); - } -} diff --git a/packages/firebase_performance/android/user-agent.gradle b/packages/firebase_performance/android/user-agent.gradle deleted file mode 100644 index 9ad33e05b6ed..000000000000 --- a/packages/firebase_performance/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-perf" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_performance/example/.metadata b/packages/firebase_performance/example/.metadata deleted file mode 100644 index 866a061a7a7f..000000000000 --- a/packages/firebase_performance/example/.metadata +++ /dev/null @@ -1,8 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: f408bb06f9361793ca85493c38d809ee1e2f7e30 - channel: master diff --git a/packages/firebase_performance/example/README.md b/packages/firebase_performance/example/README.md deleted file mode 100644 index cb4342d67998..000000000000 --- a/packages/firebase_performance/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_performance_example - -Demonstrates how to use the firebase_performance plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](https://flutter.io/). diff --git a/packages/firebase_performance/example/android/app/build.gradle b/packages/firebase_performance/example/android/app/build.gradle deleted file mode 100644 index 994afa5ec9d8..000000000000 --- a/packages/firebase_performance/example/android/app/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebaseperformanceexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { -} - -apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/packages/firebase_performance/example/android/app/google-services.json b/packages/firebase_performance/example/android/app/google-services.json deleted file mode 100644 index 007c845bee36..000000000000 --- a/packages/firebase_performance/example/android/app/google-services.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "project_info": { - "project_number": "479882132969", - "firebase_url": "https://my-flutter-proj.firebaseio.com", - "project_id": "my-flutter-proj", - "storage_bucket": "my-flutter-proj.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:479882132969:android:215a22700e1b466b", - "android_client_info": { - "package_name": "io.flutter.plugins.firebaseperformanceexample" - } - }, - "oauth_client": [ - { - "client_id": "479882132969-8h4kiv8m7ho4tvn6uuujsfcrf69unuf7.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebaseperformanceexample", - "certificate_hash": "e733b7a303250b63e06de6f7c9767c517d69cfa0" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCrZz9T0Pg0rDnpxfNuPBrOxGhXskfebXs" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "479882132969-3nf0of470m8do5qa83e8tiivv7e1thq1.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "io.flutter.plugins.firebasePerfExample" - } - }, - { - "client_id": "479882132969-0d20fkjtr1p8evfomfkf3vmi50uajml2.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_performance/example/android/app/gradle.properties b/packages/firebase_performance/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_performance/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_performance/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_performance/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_performance/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_performance/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_performance/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 1e529d80ab04..000000000000 --- a/packages/firebase_performance/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/firebase_performance/example/android/app/src/main/java/io/flutter/plugins/firebaseperformanceexample/MainActivity.java b/packages/firebase_performance/example/android/app/src/main/java/io/flutter/plugins/firebaseperformanceexample/MainActivity.java deleted file mode 100644 index 945f06506be7..000000000000 --- a/packages/firebase_performance/example/android/app/src/main/java/io/flutter/plugins/firebaseperformanceexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebaseperformanceexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_performance/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_performance/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_performance/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_performance/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_performance/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_performance/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_performance/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_performance/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_performance/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_performance/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_performance/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_performance/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_performance/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_performance/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_performance/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_performance/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_performance/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_performance/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_performance/example/android/app/src/main/res/values/styles.xml b/packages/firebase_performance/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_performance/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_performance/example/android/build.gradle b/packages/firebase_performance/example/android/build.gradle deleted file mode 100644 index 695de848ec30..000000000000 --- a/packages/firebase_performance/example/android/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - mavenLocal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_performance/example/android/gradle.properties b/packages/firebase_performance/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_performance/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_performance/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_performance/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2819f022f1fd..000000000000 --- a/packages/firebase_performance/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_performance/example/android/settings.gradle b/packages/firebase_performance/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/firebase_performance/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_performance/example/firebase_performance_example.iml b/packages/firebase_performance/example/firebase_performance_example.iml deleted file mode 100644 index e5c837191e06..000000000000 --- a/packages/firebase_performance/example/firebase_performance_example.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_performance/example/firebase_performance_example_android.iml b/packages/firebase_performance/example/firebase_performance_example_android.iml deleted file mode 100644 index b050030a1b87..000000000000 --- a/packages/firebase_performance/example/firebase_performance_example_android.iml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_performance/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_performance/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6c2de8086bcd..000000000000 --- a/packages/firebase_performance/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_performance/example/ios/Flutter/Debug.xcconfig b/packages/firebase_performance/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_performance/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_performance/example/ios/Flutter/Release.xcconfig b/packages/firebase_performance/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_performance/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_performance/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_performance/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 36e9fe7d7e2d..000000000000 --- a/packages/firebase_performance/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,501 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4F30D5F713FAE573DBE831BD /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AADA30890C75F448DA1E1040 /* libPods-Runner.a */; }; - 8FF7AD1520880821009B43A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8FF7AD1420880820009B43A2 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8FF7AD1420880820009B43A2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AADA30890C75F448DA1E1040 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 4F30D5F713FAE573DBE831BD /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 556632B50846818D9A90AA4B /* Frameworks */ = { - isa = PBXGroup; - children = ( - AADA30890C75F448DA1E1040 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - DE7EB5CF2B4FC4A8BCD09CC6 /* Pods */, - 556632B50846818D9A90AA4B /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 8FF7AD1420880820009B43A2 /* GoogleService-Info.plist */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - DE7EB5CF2B4FC4A8BCD09CC6 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 92CA2C06BD2DACC2EF38987C /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - EEF842937EAC4019A711CBB3 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 8FF7AD1520880821009B43A2 /* GoogleService-Info.plist in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 92CA2C06BD2DACC2EF38987C /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - EEF842937EAC4019A711CBB3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebasePerformanceExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 1; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebasePerformanceExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_performance/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_performance/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_performance/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_performance/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_performance/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1263ac84b105..000000000000 --- a/packages/firebase_performance/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_performance/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_performance/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_performance/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_performance/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/firebase_performance/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/firebase_performance/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/firebase_performance/example/ios/Runner/AppDelegate.h b/packages/firebase_performance/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_performance/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_performance/example/ios/Runner/AppDelegate.m b/packages/firebase_performance/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_performance/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_performance/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_performance/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_performance/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_performance/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_performance/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_performance/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_performance/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_performance/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_performance/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 2064ea6415c8..000000000000 --- a/packages/firebase_performance/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 479882132969-sbr97a40ji0hqujs9ksm2lrm1mfhdum3.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.479882132969-sbr97a40ji0hqujs9ksm2lrm1mfhdum3 - API_KEY - AIzaSyBECOwLTAN6PU4Aet1b2QLGIb3kRK8Xjew - GCM_SENDER_ID - 479882132969 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebasePerformanceExample - PROJECT_ID - my-flutter-proj - STORAGE_BUCKET - my-flutter-proj.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:479882132969:ios:0f2b615ff954f3ae - DATABASE_URL - https://my-flutter-proj.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_performance/example/ios/Runner/Info.plist b/packages/firebase_performance/example/ios/Runner/Info.plist deleted file mode 100644 index 930df5baa66b..000000000000 --- a/packages/firebase_performance/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_performance_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_performance/example/ios/Runner/main.m b/packages/firebase_performance/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_performance/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_performance/example/lib/main.dart b/packages/firebase_performance/example/lib/main.dart deleted file mode 100644 index e947cd5bfd65..000000000000 --- a/packages/firebase_performance/example/lib/main.dart +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:http/http.dart'; -import 'package:flutter/material.dart'; - -import 'package:firebase_performance/firebase_performance.dart'; - -void main() => runApp(MyApp()); - -class MyApp extends StatefulWidget { - @override - _MyAppState createState() => _MyAppState(); -} - -class _MetricHttpClient extends BaseClient { - _MetricHttpClient(this._inner); - - final Client _inner; - - @override - Future send(BaseRequest request) async { - final HttpMetric metric = FirebasePerformance.instance - .newHttpMetric(request.url.toString(), HttpMethod.Get); - - await metric.start(); - - StreamedResponse response; - try { - response = await _inner.send(request); - metric - ..responsePayloadSize = response.contentLength - ..responseContentType = response.headers['Content-Type'] - ..requestPayloadSize = request.contentLength - ..httpResponseCode = response.statusCode; - } finally { - await metric.stop(); - } - - return response; - } -} - -class _MyAppState extends State { - FirebasePerformance _performance = FirebasePerformance.instance; - bool _isPerformanceCollectionEnabled = false; - String _performanceCollectionMessage = - 'Unknown status of performance collection.'; - bool _traceHasRan = false; - bool _httpMetricHasRan = false; - - @override - void initState() { - super.initState(); - _togglePerformanceCollection(); - } - - Future _togglePerformanceCollection() async { - await _performance - .setPerformanceCollectionEnabled(!_isPerformanceCollectionEnabled); - - final bool isEnabled = await _performance.isPerformanceCollectionEnabled(); - setState(() { - _isPerformanceCollectionEnabled = isEnabled; - _performanceCollectionMessage = _isPerformanceCollectionEnabled - ? 'Performance collection is enabled.' - : 'Performance collection is disabled.'; - }); - } - - Future _testTrace() async { - setState(() { - _traceHasRan = false; - }); - - final Trace trace = _performance.newTrace("test"); - trace.incrementMetric("metric1", 16); - trace.putAttribute("favorite_color", "blue"); - - await trace.start(); - - int sum = 0; - for (int i = 0; i < 10000000; i++) { - sum += i; - } - print(sum); - - await trace.stop(); - - setState(() { - _traceHasRan = true; - }); - } - - Future _testHttpMetric() async { - setState(() { - _httpMetricHasRan = false; - }); - - final _MetricHttpClient metricHttpClient = _MetricHttpClient(Client()); - - final Request request = Request( - "SEND", - Uri.parse("https://www.google.com"), - ); - - metricHttpClient.send(request); - - setState(() { - _httpMetricHasRan = true; - }); - } - - @override - Widget build(BuildContext context) { - final TextStyle textStyle = - const TextStyle(color: Colors.lightGreenAccent, fontSize: 25.0); - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Firebase Performance Example'), - ), - body: Center( - child: Column( - children: [ - Text(_performanceCollectionMessage), - RaisedButton( - onPressed: _togglePerformanceCollection, - child: const Text('Toggle Data Collection'), - ), - RaisedButton( - onPressed: _testTrace, - child: const Text('Run Trace'), - ), - Text( - _traceHasRan ? 'Trace Ran!' : '', - style: textStyle, - ), - RaisedButton( - onPressed: _testHttpMetric, - child: const Text('Run HttpMetric'), - ), - Text( - _httpMetricHasRan ? 'HttpMetric Ran!' : '', - style: textStyle, - ), - ], - ), - ), - ), - ); - } -} diff --git a/packages/firebase_performance/example/pubspec.yaml b/packages/firebase_performance/example/pubspec.yaml deleted file mode 100644 index f5a91e28453a..000000000000 --- a/packages/firebase_performance/example/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: firebase_performance_example -description: Demonstrates how to use the firebase_performance plugin. -author: Flutter Team - -dependencies: - http: ^0.12.0 - flutter: - sdk: flutter - firebase_performance: - path: ../ - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - -flutter: - uses-material-design: true diff --git a/packages/firebase_performance/example/test_driver/firebase_performance.dart b/packages/firebase_performance/example/test_driver/firebase_performance.dart deleted file mode 100644 index 7ae6381bfb53..000000000000 --- a/packages/firebase_performance/example/test_driver/firebase_performance.dart +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_performance/firebase_performance.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('firebase_performance', () { - final FirebasePerformance performance = FirebasePerformance.instance; - - group('$FirebasePerformance', () { - test('setPerformanceCollectionEnabled', () { - performance.setPerformanceCollectionEnabled(true); - expect( - performance.isPerformanceCollectionEnabled(), - completion(isTrue), - ); - - performance.setPerformanceCollectionEnabled(false); - expect( - performance.isPerformanceCollectionEnabled(), - completion(isFalse), - ); - }); - }); - - group('$HttpMethod', () { - test('test all values', () { - for (HttpMethod method in HttpMethod.values) { - final HttpMetric testMetric = performance.newHttpMetric( - 'https://www.google.com/', - method, - ); - testMetric.start(); - testMetric.stop(); - } - }); - }); - - group('$Trace', () { - Trace testTrace; - - setUpAll(() { - performance.setPerformanceCollectionEnabled(true); - }); - - setUp(() { - testTrace = performance.newTrace('test-trace'); - }); - - tearDown(() { - testTrace.stop(); - testTrace = null; - }); - - test('incrementMetric', () { - testTrace.start(); - - testTrace.incrementMetric('metric', 14); - expectLater(testTrace.getMetric('metric'), completion(14)); - - testTrace.incrementMetric('metric', 45); - expect(testTrace.getMetric('metric'), completion(59)); - }); - - test('setMetric', () { - testTrace.start(); - - testTrace.setMetric('metric2', 37); - expect(testTrace.getMetric('metric2'), completion(37)); - }); - - test('putAttribute', () { - testTrace.putAttribute('apple', 'sauce'); - testTrace.putAttribute('banana', 'pie'); - - expect( - testTrace.getAttributes(), - completion({'apple': 'sauce', 'banana': 'pie'}), - ); - }); - - test('removeAttribute', () { - testTrace.putAttribute('sponge', 'bob'); - testTrace.putAttribute('patrick', 'star'); - testTrace.removeAttribute('sponge'); - - expect( - testTrace.getAttributes(), - completion({'patrick': 'star'}), - ); - }); - - test('getAttributes', () { - testTrace.putAttribute('yugi', 'oh'); - - expect( - testTrace.getAttributes(), - completion({'yugi': 'oh'}), - ); - - testTrace.start(); - testTrace.stop(); - expect( - testTrace.getAttributes(), - completion({'yugi': 'oh'}), - ); - }); - }); - - group('$HttpMetric', () { - HttpMetric testMetric; - - setUpAll(() { - performance.setPerformanceCollectionEnabled(true); - }); - - setUp(() { - testMetric = performance.newHttpMetric( - 'https://www.google.com/', - HttpMethod.Delete, - ); - }); - - test('putAttribute', () { - testMetric.putAttribute('apple', 'sauce'); - testMetric.putAttribute('banana', 'pie'); - - expect( - testMetric.getAttributes(), - completion({'apple': 'sauce', 'banana': 'pie'}), - ); - }); - - test('removeAttribute', () { - testMetric.putAttribute('sponge', 'bob'); - testMetric.putAttribute('patrick', 'star'); - testMetric.removeAttribute('sponge'); - - expect( - testMetric.getAttributes(), - completion({'patrick': 'star'}), - ); - }); - - test('getAttributes', () { - testMetric.putAttribute('yugi', 'oh'); - - expect( - testMetric.getAttributes(), - completion({'yugi': 'oh'}), - ); - - testMetric.start(); - testMetric.stop(); - expect( - testMetric.getAttributes(), - completion({'yugi': 'oh'}), - ); - }); - - test('http setters shouldn\'t cause a crash', () async { - testMetric.start(); - - testMetric.httpResponseCode = 443; - testMetric.requestPayloadSize = 56734; - testMetric.responseContentType = '1984'; - testMetric.responsePayloadSize = 4949; - - await pumpEventQueue(); - }); - }); - }); -} diff --git a/packages/firebase_performance/example/test_driver/firebase_performance_test.dart b/packages/firebase_performance/example/test_driver/firebase_performance_test.dart deleted file mode 100644 index b9753054ad5b..000000000000 --- a/packages/firebase_performance/example/test_driver/firebase_performance_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_driver/flutter_driver.dart'; - -void main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_performance/firebase_performance_android.iml b/packages/firebase_performance/firebase_performance_android.iml deleted file mode 100644 index ac5d744d7acc..000000000000 --- a/packages/firebase_performance/firebase_performance_android.iml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_performance/ios/Assets/.gitkeep b/packages/firebase_performance/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_performance/ios/Classes/FLTFirebasePerformance.m b/packages/firebase_performance/ios/Classes/FLTFirebasePerformance.m deleted file mode 100644 index 81cf29c06559..000000000000 --- a/packages/firebase_performance/ios/Classes/FLTFirebasePerformance.m +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebasePerformancePlugin+Internal.h" - -@interface FLTFirebasePerformance () -@property FIRPerformance *performance; -@end - -@implementation FLTFirebasePerformance -+ (instancetype _Nonnull)sharedInstance { - static FLTFirebasePerformance *sharedInstance = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[FLTFirebasePerformance alloc] init]; - sharedInstance.performance = [FIRPerformance sharedInstance]; - }); - return sharedInstance; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"FirebasePerformance#isPerformanceCollectionEnabled" isEqualToString:call.method]) { - [self isPerformanceCollectionEnabled:result]; - } else if ([@"FirebasePerformance#setPerformanceCollectionEnabled" isEqualToString:call.method]) { - [self setPerformanceCollectionEnabled:call result:result]; - } else if ([@"FirebasePerformance#newTrace" isEqualToString:call.method]) { - [self newTrace:call result:result]; - } else if ([@"FirebasePerformance#newHttpMetric" isEqualToString:call.method]) { - [self newHttpMetric:call result:result]; - } else { - result(FlutterMethodNotImplemented); - } -} - -- (void)isPerformanceCollectionEnabled:(FlutterResult)result { - result(@([_performance isDataCollectionEnabled])); -} - -- (void)setPerformanceCollectionEnabled:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *enable = call.arguments[@"enable"]; - [_performance setDataCollectionEnabled:[enable boolValue]]; - result(nil); -} - -- (void)newTrace:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - FIRTrace *trace = [_performance traceWithName:name]; - FLTTrace *handler = [[FLTTrace alloc] initWithTrace:trace]; - - NSNumber *handle = call.arguments[@"traceHandle"]; - [FLTFirebasePerformancePlugin addMethodHandler:handle methodHandler:handler]; - - result(nil); -} - -- (void)newHttpMetric:(FlutterMethodCall *)call result:(FlutterResult)result { - FIRHTTPMethod method = [FLTFirebasePerformance parseHttpMethod:call.arguments[@"httpMethod"]]; - NSURL *url = [NSURL URLWithString:call.arguments[@"url"]]; - - FIRHTTPMetric *metric = [[FIRHTTPMetric alloc] initWithURL:url HTTPMethod:method]; - FLTHttpMetric *handler = [[FLTHttpMetric alloc] initWithHTTPMetric:metric]; - - NSNumber *handle = call.arguments[@"httpMetricHandle"]; - [FLTFirebasePerformancePlugin addMethodHandler:handle methodHandler:handler]; - - result(nil); -} - -+ (FIRHTTPMethod)parseHttpMethod:(NSString *)method { - if ([@"HttpMethod.Connect" isEqualToString:method]) { - return FIRHTTPMethodCONNECT; - } else if ([@"HttpMethod.Delete" isEqualToString:method]) { - return FIRHTTPMethodDELETE; - } else if ([@"HttpMethod.Get" isEqualToString:method]) { - return FIRHTTPMethodGET; - } else if ([@"HttpMethod.Head" isEqualToString:method]) { - return FIRHTTPMethodHEAD; - } else if ([@"HttpMethod.Options" isEqualToString:method]) { - return FIRHTTPMethodOPTIONS; - } else if ([@"HttpMethod.Patch" isEqualToString:method]) { - return FIRHTTPMethodPATCH; - } else if ([@"HttpMethod.Post" isEqualToString:method]) { - return FIRHTTPMethodPOST; - } else if ([@"HttpMethod.Put" isEqualToString:method]) { - return FIRHTTPMethodPUT; - } else if ([@"HttpMethod.Trace" isEqualToString:method]) { - return FIRHTTPMethodTRACE; - } - - NSString *reason = [NSString stringWithFormat:@"Invalid HttpMethod: %@", method]; - @throw [[NSException alloc] initWithName:NSInvalidArgumentException reason:reason userInfo:nil]; -} -@end diff --git a/packages/firebase_performance/ios/Classes/FLTHttpMetric.m b/packages/firebase_performance/ios/Classes/FLTHttpMetric.m deleted file mode 100644 index 3a12f3400613..000000000000 --- a/packages/firebase_performance/ios/Classes/FLTHttpMetric.m +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebasePerformancePlugin+Internal.h" - -@interface FLTHttpMetric () -@property FIRHTTPMetric *metric; -@end - -@implementation FLTHttpMetric -- (instancetype _Nonnull)initWithHTTPMetric:(FIRHTTPMetric *)metric { - self = [self init]; - if (self) { - _metric = metric; - } - - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"HttpMetric#start" isEqualToString:call.method]) { - [self start:result]; - } else if ([@"HttpMetric#stop" isEqualToString:call.method]) { - [self stop:call result:result]; - } else if ([@"HttpMetric#httpResponseCode" isEqualToString:call.method]) { - [self setHttpResponseCode:call result:result]; - } else if ([@"HttpMetric#requestPayloadSize" isEqualToString:call.method]) { - [self requestPayloadSize:call result:result]; - } else if ([@"HttpMetric#responseContentType" isEqualToString:call.method]) { - [self responseContentType:call result:result]; - } else if ([@"HttpMetric#responsePayloadSize" isEqualToString:call.method]) { - [self responsePayloadSize:call result:result]; - } else if ([@"PerformanceAttributes#putAttribute" isEqualToString:call.method]) { - [self putAttribute:call result:result]; - } else if ([@"PerformanceAttributes#removeAttribute" isEqualToString:call.method]) { - [self removeAttribute:call result:result]; - } else if ([@"PerformanceAttributes#getAttributes" isEqualToString:call.method]) { - [self getAttributes:result]; - } else { - result(FlutterMethodNotImplemented); - } -} - -- (void)start:(FlutterResult)result { - [_metric start]; - result(nil); -} - -- (void)stop:(FlutterMethodCall *)call result:(FlutterResult)result { - [_metric stop]; - - NSNumber *handle = call.arguments[@"handle"]; - [FLTFirebasePerformancePlugin removeMethodHandler:handle]; - - result(nil); -} - -- (void)setHttpResponseCode:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *responseCode = call.arguments[@"httpResponseCode"]; - - if (![responseCode isEqual:[NSNull null]]) _metric.responseCode = [responseCode integerValue]; - result(nil); -} - -- (void)requestPayloadSize:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *requestPayloadSize = call.arguments[@"requestPayloadSize"]; - - if (![requestPayloadSize isEqual:[NSNull null]]) { - _metric.requestPayloadSize = [requestPayloadSize longValue]; - } - result(nil); -} - -- (void)responseContentType:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *responseContentType = call.arguments[@"responseContentType"]; - - if (![responseContentType isEqual:[NSNull null]]) { - _metric.responseContentType = responseContentType; - } - result(nil); -} - -- (void)responsePayloadSize:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *responsePayloadSize = call.arguments[@"responsePayloadSize"]; - - if (![responsePayloadSize isEqual:[NSNull null]]) { - _metric.responsePayloadSize = [responsePayloadSize longValue]; - } - result(nil); -} - -- (void)putAttribute:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - NSString *value = call.arguments[@"value"]; - - [_metric setValue:value forAttribute:name]; - result(nil); -} - -- (void)removeAttribute:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - - [_metric removeAttribute:name]; - result(nil); -} - -- (void)getAttributes:(FlutterResult)result { - result([_metric attributes]); -} -@end diff --git a/packages/firebase_performance/ios/Classes/FLTTrace.m b/packages/firebase_performance/ios/Classes/FLTTrace.m deleted file mode 100644 index 3ce6af5fc3ef..000000000000 --- a/packages/firebase_performance/ios/Classes/FLTTrace.m +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebasePerformancePlugin+Internal.h" - -@interface FLTTrace () -@property FIRTrace *trace; -@end - -@implementation FLTTrace -- (instancetype _Nonnull)initWithTrace:(FIRTrace *)trace { - self = [self init]; - if (self) { - _trace = trace; - } - - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"Trace#start" isEqualToString:call.method]) { - [self start:result]; - } else if ([@"Trace#stop" isEqualToString:call.method]) { - [self stop:call result:result]; - } else if ([@"Trace#setMetric" isEqualToString:call.method]) { - [self setMetric:call result:result]; - } else if ([@"Trace#incrementMetric" isEqualToString:call.method]) { - [self incrementMetric:call result:result]; - } else if ([@"Trace#getMetric" isEqualToString:call.method]) { - [self getMetric:call result:result]; - } else if ([@"PerformanceAttributes#putAttribute" isEqualToString:call.method]) { - [self putAttribute:call result:result]; - } else if ([@"PerformanceAttributes#removeAttribute" isEqualToString:call.method]) { - [self removeAttribute:call result:result]; - } else if ([@"PerformanceAttributes#getAttributes" isEqualToString:call.method]) { - [self getAttributes:result]; - } else { - result(FlutterMethodNotImplemented); - } -} - -- (void)start:(FlutterResult)result { - [_trace start]; - result(nil); -} - -- (void)stop:(FlutterMethodCall *)call result:(FlutterResult)result { - [_trace stop]; - - NSNumber *handle = call.arguments[@"handle"]; - [FLTFirebasePerformancePlugin removeMethodHandler:handle]; - - result(nil); -} - -- (void)setMetric:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - NSNumber *value = call.arguments[@"value"]; - - [_trace setIntValue:value.longValue forMetric:name]; - result(nil); -} - -- (void)incrementMetric:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - NSNumber *value = call.arguments[@"value"]; - - [_trace incrementMetric:name byInt:value.longValue]; - result(nil); -} - -- (void)getMetric:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - - int64_t metric = [_trace valueForIntMetric:name]; - result(@(metric)); -} - -- (void)putAttribute:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - NSString *value = call.arguments[@"value"]; - - [_trace setValue:value forAttribute:name]; - result(nil); -} - -- (void)removeAttribute:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *name = call.arguments[@"name"]; - - [_trace removeAttribute:name]; - result(nil); -} - -- (void)getAttributes:(FlutterResult)result { - result([_trace attributes]); -} -@end diff --git a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin+Internal.h b/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin+Internal.h deleted file mode 100644 index f0adca5b905b..000000000000 --- a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin+Internal.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebasePerformancePlugin.h" - -@protocol MethodCallHandler -@required -- (void)handleMethodCall:(FlutterMethodCall *_Nonnull)call result:(FlutterResult _Nonnull)result; -@end - -@interface FLTFirebasePerformancePlugin (Internal) -+ (void)addMethodHandler:(NSNumber *_Nonnull)handle - methodHandler:(id _Nonnull)handler; -+ (void)removeMethodHandler:(NSNumber *_Nonnull)handle; -@end - -@interface FLTFirebasePerformance : NSObject -+ (instancetype _Nonnull)sharedInstance; -@end - -@interface FLTTrace : NSObject -- (instancetype _Nonnull)initWithTrace:(FIRTrace *_Nonnull)trace; -@end - -@interface FLTHttpMetric : NSObject -- (instancetype _Nonnull)initWithHTTPMetric:(FIRHTTPMetric *_Nonnull)metric; -@end diff --git a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h b/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h deleted file mode 100644 index f5258a1c561d..000000000000 --- a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface FLTFirebasePerformancePlugin : NSObject -@end diff --git a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.m b/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.m deleted file mode 100644 index 51000f3b5153..000000000000 --- a/packages/firebase_performance/ios/Classes/FirebasePerformancePlugin.m +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebasePerformancePlugin+Internal.h" -#import "UserAgent.h" - -@implementation FLTFirebasePerformancePlugin -static NSMutableDictionary> *methodHandlers; - -+ (void)registerWithRegistrar:(NSObject *)registrar { - methodHandlers = [NSMutableDictionary new]; - - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_performance" - binaryMessenger:[registrar messenger]]; - - FLTFirebasePerformancePlugin *instance = [FLTFirebasePerformancePlugin new]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"FirebasePerformance#instance" isEqualToString:call.method]) { - [methodHandlers removeAllObjects]; - - NSNumber *handle = call.arguments[@"handle"]; - FLTFirebasePerformance *performance = [FLTFirebasePerformance sharedInstance]; - - [FLTFirebasePerformancePlugin addMethodHandler:handle methodHandler:performance]; - result(nil); - } else { - NSNumber *handle = call.arguments[@"handle"]; - - if (![handle isEqual:[NSNull null]]) { - [methodHandlers[handle] handleMethodCall:call result:result]; - } else { - result(FlutterMethodNotImplemented); - } - } -} - -+ (void)addMethodHandler:(NSNumber *)handle methodHandler:(id)handler { - if (methodHandlers[handle]) { - NSString *reason = - [[NSString alloc] initWithFormat:@"Object for handle already exists: %d", handle.intValue]; - @throw [[NSException alloc] initWithName:NSInvalidArgumentException reason:reason userInfo:nil]; - } - - methodHandlers[handle] = handler; -} - -+ (void)removeMethodHandler:(NSNumber *)handle { - [methodHandlers removeObjectForKey:handle]; -} -@end diff --git a/packages/firebase_performance/ios/firebase_performance.podspec b/packages/firebase_performance/ios/firebase_performance.podspec deleted file mode 100644 index 0759c43b20ee..000000000000 --- a/packages/firebase_performance/ios/firebase_performance.podspec +++ /dev/null @@ -1,33 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_performance' - s.version = '0.0.1' - s.summary = 'Firebase Performance plugin for Flutter.' - s.description = <<-DESC -Firebase Performance plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_performance' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Firebase/Core' - s.dependency 'Firebase/Performance' - s.ios.deployment_target = '8.0' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-perf\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_performance/lib/firebase_performance.dart b/packages/firebase_performance/lib/firebase_performance.dart deleted file mode 100644 index a4574ab47dd1..000000000000 --- a/packages/firebase_performance/lib/firebase_performance.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_performance; - -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:flutter/foundation.dart'; - -part 'src/firebase_performance.dart'; -part 'src/http_metric.dart'; -part 'src/performance_attributes.dart'; -part 'src/trace.dart'; diff --git a/packages/firebase_performance/lib/src/firebase_performance.dart b/packages/firebase_performance/lib/src/firebase_performance.dart deleted file mode 100644 index c0d15573c96a..000000000000 --- a/packages/firebase_performance/lib/src/firebase_performance.dart +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_performance; - -/// Valid HttpMethods for manual network APIs. -enum HttpMethod { Connect, Delete, Get, Head, Options, Patch, Post, Put, Trace } - -/// The Firebase Performance API. -/// -/// You can get an instance by calling [FirebasePerformance.instance]. -class FirebasePerformance { - FirebasePerformance._(this._handle) { - channel.invokeMethod( - 'FirebasePerformance#instance', - {'handle': _handle}, - ); - } - - static int _nextHandle = 0; - - final int _handle; - - @visibleForTesting - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_performance'); - - /// Singleton of [FirebasePerformance]. - static final FirebasePerformance instance = - FirebasePerformance._(_nextHandle++); - - /// Determines whether performance monitoring is enabled or disabled. - /// - /// True if performance monitoring is enabled and false if performance - /// monitoring is disabled. This is for dynamic enable/disable state. This - /// does not reflect whether instrumentation is enabled/disabled. - Future isPerformanceCollectionEnabled() { - return channel.invokeMethod( - 'FirebasePerformance#isPerformanceCollectionEnabled', - {'handle': _handle}, - ); - } - - /// Enables or disables performance monitoring. - /// - /// This setting is persisted and applied on future invocations of your - /// application. By default, performance monitoring is enabled. - Future setPerformanceCollectionEnabled(bool enable) { - return channel.invokeMethod( - 'FirebasePerformance#setPerformanceCollectionEnabled', - {'handle': _handle, 'enable': enable}, - ); - } - - /// Creates a [Trace] object with given [name]. - /// - /// The [name] requires no leading or trailing whitespace, no leading - /// underscore _ character, and max length of [Trace.maxTraceNameLength] - /// characters. - Trace newTrace(String name) { - final int handle = _nextHandle++; - - FirebasePerformance.channel.invokeMethod( - 'FirebasePerformance#newTrace', - {'handle': _handle, 'traceHandle': handle, 'name': name}, - ); - - return Trace._(handle, name); - } - - /// Creates [HttpMetric] for collecting performance for one request/response. - HttpMetric newHttpMetric(String url, HttpMethod httpMethod) { - final int handle = _nextHandle++; - - FirebasePerformance.channel.invokeMethod( - 'FirebasePerformance#newHttpMetric', - { - 'handle': _handle, - 'httpMetricHandle': handle, - 'url': url, - 'httpMethod': httpMethod.toString(), - }, - ); - - return HttpMetric._(handle, url, httpMethod); - } - - /// Creates a [Trace] object with given [name] and starts the trace. - /// - /// The [name] requires no leading or trailing whitespace, no leading - /// underscore _ character, max length of [Trace.maxTraceNameLength] - /// characters. - static Future startTrace(String name) async { - final Trace trace = instance.newTrace(name); - await trace.start(); - return trace; - } -} diff --git a/packages/firebase_performance/lib/src/http_metric.dart b/packages/firebase_performance/lib/src/http_metric.dart deleted file mode 100644 index 2586a1455cc5..000000000000 --- a/packages/firebase_performance/lib/src/http_metric.dart +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_performance; - -/// Metric used to collect data for network requests/responses. -/// -/// It is possible to have more than one [HttpMetric] running at a time. -/// Attributes can also be added to help measure performance related events. A -/// [HttpMetric] also measures the time between calling `start()` and `stop()`. -/// -/// Data collected is automatically sent to the associated Firebase console -/// after stop() is called. -/// -/// You can confirm that Performance Monitoring results appear in the Firebase -/// console. Results should appear within 12 hours. -/// -/// It is highly recommended that one always calls `start()` and `stop()` on -/// each created [HttpMetric] to avoid leaking on the platform side. -class HttpMetric extends PerformanceAttributes { - HttpMetric._(this._handle, this.url, this.httpMethod); - - final String url; - final HttpMethod httpMethod; - - @override - bool _hasStarted = false; - - @override - bool _hasStopped = false; - - int _httpResponseCode; - int _requestPayloadSize; - String _responseContentType; - int _responsePayloadSize; - - @override - final int _handle; - - /// HttpResponse code of the request. - int get httpResponseCode => _httpResponseCode; - - /// Size of the request payload. - int get requestPayloadSize => _requestPayloadSize; - - /// Content type of the response such as text/html, application/json, etc... - String get responseContentType => _responseContentType; - - /// Size of the response payload. - int get responsePayloadSize => _responsePayloadSize; - - /// HttpResponse code of the request. - /// - /// If the [HttpMetric] has already been stopped, returns immediately without - /// taking action. - set httpResponseCode(int httpResponseCode) { - if (_hasStopped) return; - - _httpResponseCode = httpResponseCode; - FirebasePerformance.channel.invokeMethod( - 'HttpMetric#httpResponseCode', - { - 'handle': _handle, - 'httpResponseCode': httpResponseCode, - }, - ); - } - - /// Size of the request payload. - /// - /// If the [HttpMetric] has already been stopped, returns immediately without - /// taking action. - set requestPayloadSize(int requestPayloadSize) { - if (_hasStopped) return; - - _requestPayloadSize = requestPayloadSize; - FirebasePerformance.channel.invokeMethod( - 'HttpMetric#requestPayloadSize', - { - 'handle': _handle, - 'requestPayloadSize': requestPayloadSize, - }, - ); - } - - /// Content type of the response such as text/html, application/json, etc... - /// - /// If the [HttpMetric] has already been stopped, returns immediately without - /// taking action. - set responseContentType(String responseContentType) { - if (_hasStopped) return; - - _responseContentType = responseContentType; - FirebasePerformance.channel.invokeMethod( - 'HttpMetric#responseContentType', - { - 'handle': _handle, - 'responseContentType': responseContentType, - }, - ); - } - - /// Size of the response payload. - /// - /// If the [HttpMetric] has already been stopped, returns immediately without - /// taking action. - set responsePayloadSize(int responsePayloadSize) { - if (_hasStopped) return; - - _responsePayloadSize = responsePayloadSize; - FirebasePerformance.channel.invokeMethod( - 'HttpMetric#responsePayloadSize', - { - 'handle': _handle, - 'responsePayloadSize': responsePayloadSize, - }, - ); - } - - /// Starts this [HttpMetric]. - /// - /// Can only be called once. - /// - /// Using `await` with this method is only necessary when accurate timing - /// is relevant. - Future start() { - if (_hasStopped) return Future.value(null); - - _hasStarted = true; - return FirebasePerformance.channel.invokeMethod( - 'HttpMetric#start', - {'handle': _handle}, - ); - } - - /// Stops this [HttpMetric]. - /// - /// Can only be called once and only after start(), Data collected is - /// automatically sent to the associate Firebase console after stop() is - /// called. You can confirm that Performance Monitoring results appear in the - /// Firebase console. Results should appear within 12 hours. - /// - /// Not necessary to use `await` with this method. - Future stop() { - if (_hasStopped) return Future.value(null); - - _hasStopped = true; - return FirebasePerformance.channel.invokeMethod( - 'HttpMetric#stop', - {'handle': _handle}, - ); - } -} diff --git a/packages/firebase_performance/lib/src/performance_attributes.dart b/packages/firebase_performance/lib/src/performance_attributes.dart deleted file mode 100644 index 96a77a009f57..000000000000 --- a/packages/firebase_performance/lib/src/performance_attributes.dart +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_performance; - -/// Abstract class that allows adding/removing attributes to an object. -abstract class PerformanceAttributes { - /// Maximum allowed length of a key passed to [putAttribute]. - static const int maxAttributeKeyLength = 40; - - /// Maximum allowed length of a value passed to [putAttribute]. - static const int maxAttributeValueLength = 100; - - /// Maximum allowed number of attributes that can be added. - static const int maxCustomAttributes = 5; - - final Map _attributes = {}; - - bool get _hasStarted; - bool get _hasStopped; - - int get _handle; - - /// Sets a String [value] for the specified attribute with [name]. - /// - /// Updates the value of the attribute if the attribute already exists. - /// The maximum number of attributes that can be added are - /// [maxCustomAttributes]. An attempt to add more than [maxCustomAttributes] - /// to this object will return without adding the attribute. - /// - /// Name of the attribute has max length of [maxAttributeKeyLength] - /// characters. Value of the attribute has max length of - /// [maxAttributeValueLength] characters. If the name has a length greater - /// than [maxAttributeKeyLength] or the value has a length greater than - /// [maxAttributeValueLength], this method will return without adding - /// anything. - /// - /// If this object has been stopped, this method returns without adding the - /// attribute. - Future putAttribute(String name, String value) { - if (_hasStopped || - name.length > maxAttributeKeyLength || - value.length > maxAttributeValueLength || - _attributes.length == maxCustomAttributes) { - return Future.value(null); - } - - _attributes[name] = value; - return FirebasePerformance.channel.invokeMethod( - 'PerformanceAttributes#putAttribute', - { - 'handle': _handle, - 'name': name, - 'value': value, - }, - ); - } - - /// Removes an already added attribute. - /// - /// If this object has been stopped, this method returns without removing the - /// attribute. - Future removeAttribute(String name) { - if (_hasStopped) return Future.value(null); - - _attributes.remove(name); - return FirebasePerformance.channel.invokeMethod( - 'PerformanceAttributes#removeAttribute', - {'handle': _handle, 'name': name}, - ); - } - - /// Returns the value of an attribute. - /// - /// Returns `null` if an attribute with this [name] has not been added. - String getAttribute(String name) => _attributes[name]; - - /// All attributes added. - Future> getAttributes() { - if (_hasStopped) { - return Future>.value( - Map.unmodifiable(_attributes), - ); - } - - return FirebasePerformance.channel.invokeMapMethod( - 'PerformanceAttributes#getAttributes', - {'handle': _handle}, - ); - } -} diff --git a/packages/firebase_performance/lib/src/trace.dart b/packages/firebase_performance/lib/src/trace.dart deleted file mode 100644 index 873a138c7392..000000000000 --- a/packages/firebase_performance/lib/src/trace.dart +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_performance; - -/// [Trace] allows you to set the beginning and end of a custom trace in your app. -/// -/// A trace is a report of performance data associated with some of the -/// code in your app. You can have multiple custom traces, and it is -/// possible to have more than one custom trace running at a time. Each custom -/// trace can have multiple metrics and attributes added to help measure -/// performance related events. A trace also measures the time between calling -/// `start()` and `stop()`. -/// -/// Data collected is automatically sent to the associated Firebase console -/// after stop() is called. -/// -/// You can confirm that Performance Monitoring results appear in the Firebase -/// console. Results should appear within 12 hours. -/// -/// It is highly recommended that one always calls `start()` and `stop()` on -/// each created [Trace] to not avoid leaking on the platform side. -class Trace extends PerformanceAttributes { - Trace._(this._handle, this.name); - - /// Maximum allowed length of the name of a [Trace]. - static const int maxTraceNameLength = 100; - - final Map _metrics = {}; - - @override - bool _hasStarted = false; - - @override - bool _hasStopped = false; - - @override - final int _handle; - - /// Name representing this [Trace] on the Firebase Console. - final String name; - - /// Starts this [Trace]. - /// - /// Can only be called once. - /// - /// Using `await` with this method is only necessary when accurate timing - /// is relevant. - Future start() { - if (_hasStopped) return Future.value(null); - - _hasStarted = true; - return FirebasePerformance.channel.invokeMethod( - 'Trace#start', - {'handle': _handle}, - ); - } - - /// Stops this [Trace]. - /// - /// Can only be called once and only after start() Data collected is - /// automatically sent to the associated Firebase console after stop() is - /// called. You can confirm that Performance Monitoring results appear in the - /// Firebase console. Results should appear within 12 hours. - /// - /// Not necessary to use `await` with this method. - Future stop() { - if (_hasStopped) return Future.value(null); - - _hasStopped = true; - return FirebasePerformance.channel.invokeMethod( - 'Trace#stop', - {'handle': _handle}, - ); - } - - /// Increments the metric with the given [name]. - /// - /// If the metric does not exist, a new one will be created. If the [Trace] has - /// not been started or has already been stopped, returns immediately without - /// taking action. - Future incrementMetric(String name, int value) { - if (!_hasStarted || _hasStopped) { - return Future.value(null); - } - - _metrics.putIfAbsent(name, () => 0); - _metrics[name] += value; - return FirebasePerformance.channel.invokeMethod( - 'Trace#incrementMetric', - {'handle': _handle, 'name': name, 'value': value}, - ); - } - - /// Sets the [value] of the metric with the given [name]. - /// - /// If a metric with the given name doesn't exist, a new one will be created. - /// If the [Trace] has not been started or has already been stopped, returns - /// immediately without taking action. - Future setMetric(String name, int value) { - if (!_hasStarted || _hasStopped) return Future.value(null); - - _metrics[name] = value; - return FirebasePerformance.channel.invokeMethod( - 'Trace#setMetric', - {'handle': _handle, 'name': name, 'value': value}, - ); - } - - /// Gets the value of the metric with the given [name]. - /// - /// If a metric with the given name doesn't exist, it is NOT created and a 0 - /// is returned. - Future getMetric(String name) { - if (_hasStopped) return Future.value(_metrics[name] ?? 0); - - return FirebasePerformance.channel.invokeMethod( - 'Trace#getMetric', - {'handle': _handle, 'name': name}, - ); - } -} diff --git a/packages/firebase_performance/pubspec.yaml b/packages/firebase_performance/pubspec.yaml deleted file mode 100644 index f864e84745b7..000000000000 --- a/packages/firebase_performance/pubspec.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: firebase_performance -description: Flutter plugin for Google Performance Monitoring for Firebase, an app - measurement solution that monitors traces and HTTP/S network requests on Android and - iOS. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_performance -version: 0.3.0+4 - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - http: ^0.12.0 - flutter_test: - sdk: flutter - firebase_core: ^0.4.0 - flutter_driver: - sdk: flutter - test: any - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebaseperformance - iosPrefix: FLT - pluginClass: FirebasePerformancePlugin - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.4 <2.0.0" diff --git a/packages/firebase_performance/test/firebase_performance_test.dart b/packages/firebase_performance/test/firebase_performance_test.dart deleted file mode 100644 index 70549a0501e4..000000000000 --- a/packages/firebase_performance/test/firebase_performance_test.dart +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/services.dart'; - -import 'package:firebase_performance/firebase_performance.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('$FirebasePerformance', () { - final List performanceLog = []; - - FirebasePerformance performance; - int firebasePerformanceHandle; - - int nextHandle = 0; - - bool isPerformanceCollectionEnabledResult; - - setUpAll(() { - FirebasePerformance.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - performanceLog.add(methodCall); - switch (methodCall.method) { - case 'FirebasePerformance#isPerformanceCollectionEnabled': - return isPerformanceCollectionEnabledResult; - default: - return null; - } - }); - }); - - setUp(() { - performanceLog.clear(); - }); - - test('instance', () { - firebasePerformanceHandle = nextHandle++; - performance = FirebasePerformance.instance; - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#instance', - arguments: {'handle': firebasePerformanceHandle}, - ), - ]); - }); - - test('isPerformanceCollectionEnabled', () async { - isPerformanceCollectionEnabledResult = true; - final bool enabled = await performance.isPerformanceCollectionEnabled(); - expect(enabled, isTrue); - - isPerformanceCollectionEnabledResult = false; - final bool disabled = await performance.isPerformanceCollectionEnabled(); - expect(disabled, isFalse); - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#isPerformanceCollectionEnabled', - arguments: {'handle': firebasePerformanceHandle}, - ), - isMethodCall( - 'FirebasePerformance#isPerformanceCollectionEnabled', - arguments: {'handle': firebasePerformanceHandle}, - ), - ]); - }); - - test('setPerformanceCollectionEnabled', () { - performance.setPerformanceCollectionEnabled(true); - performance.setPerformanceCollectionEnabled(false); - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#setPerformanceCollectionEnabled', - arguments: { - 'handle': firebasePerformanceHandle, - 'enable': true, - }, - ), - isMethodCall( - 'FirebasePerformance#setPerformanceCollectionEnabled', - arguments: { - 'handle': firebasePerformanceHandle, - 'enable': false, - }, - ), - ]); - }); - - test('newTrace', () { - performance.newTrace('test-trace'); - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#newTrace', - arguments: { - 'handle': firebasePerformanceHandle, - 'traceHandle': nextHandle++, - 'name': 'test-trace', - }, - ), - ]); - }); - - test('newHttpMetric', () { - performance.newHttpMetric('https://google.com', HttpMethod.Connect); - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#newHttpMetric', - arguments: { - 'handle': firebasePerformanceHandle, - 'httpMetricHandle': nextHandle++, - 'url': 'https://google.com', - 'httpMethod': HttpMethod.Connect.toString(), - }, - ), - ]); - }); - - test('startTrace', () { - final int currentHandle = nextHandle++; - FirebasePerformance.startTrace('test-start-trace'); - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#newTrace', - arguments: { - 'handle': firebasePerformanceHandle, - 'traceHandle': currentHandle, - 'name': 'test-start-trace', - }, - ), - isMethodCall( - 'Trace#start', - arguments: {'handle': currentHandle}, - ), - ]); - }); - - test('$HttpMethod', () { - performance.newHttpMetric('https://google.com', HttpMethod.Delete); - - expect(performanceLog, [ - isMethodCall( - 'FirebasePerformance#newHttpMetric', - arguments: { - 'handle': firebasePerformanceHandle, - 'httpMetricHandle': nextHandle++, - 'url': 'https://google.com', - 'httpMethod': HttpMethod.Delete.toString(), - }, - ), - ]); - }); - - group('$Trace', () { - final List traceLog = []; - - Trace testTrace; - int currentTestTraceHandle; - - setUpAll(() { - FirebasePerformance.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - traceLog.add(methodCall); - switch (methodCall.method) { - case 'FirebasePerformance#isPerformanceCollectionEnabled': - return isPerformanceCollectionEnabledResult; - default: - return null; - } - }); - }); - - setUp(() { - testTrace = performance.newTrace('test'); - currentTestTraceHandle = nextHandle++; - - traceLog.clear(); - }); - - test('start', () { - testTrace.start(); - - expect(traceLog, [ - isMethodCall( - 'Trace#start', - arguments: {'handle': currentTestTraceHandle}, - ), - ]); - }); - - test('stop', () { - testTrace.start(); - traceLog.clear(); - - testTrace.stop(); - - expect(traceLog, [ - isMethodCall( - 'Trace#stop', - arguments: {'handle': currentTestTraceHandle}, - ), - ]); - }); - - test('incrementMetric', () { - testTrace.start(); - traceLog.clear(); - - testTrace.incrementMetric('metric1', 3); - - expect(traceLog, [ - isMethodCall( - 'Trace#incrementMetric', - arguments: { - 'handle': currentTestTraceHandle, - 'name': 'metric1', - 'value': 3, - }, - ), - ]); - }); - - test('setMetric', () { - testTrace.start(); - traceLog.clear(); - - testTrace.setMetric('metric3', 5); - - expect(traceLog, [ - isMethodCall( - 'Trace#setMetric', - arguments: { - 'handle': currentTestTraceHandle, - 'name': 'metric3', - 'value': 5, - }, - ), - ]); - }); - - test('getMetric', () { - testTrace.getMetric('metric4'); - - expect(traceLog, [ - isMethodCall( - 'Trace#getMetric', - arguments: { - 'handle': currentTestTraceHandle, - 'name': 'metric4', - }, - ), - ]); - }); - - test('invokeMethod not called if trace hasn\'t started', () { - testTrace.incrementMetric('any', 211); - testTrace.setMetric('what', 23); - - expect(traceLog, isEmpty); - }); - - test('invokeMethod not called if trace has stopped', () { - testTrace.start(); - testTrace.stop(); - traceLog.clear(); - - testTrace.start(); - testTrace.stop(); - testTrace.incrementMetric('any', 211); - testTrace.setMetric('what', 23); - testTrace.getMetric('efser'); - - expect(traceLog, isEmpty); - }); - }); - - group('$HttpMetric', () { - final List httpMetricLog = []; - - HttpMetric testMetric; - int currentTestMetricHandle; - - setUpAll(() { - FirebasePerformance.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - httpMetricLog.add(methodCall); - switch (methodCall.method) { - case 'FirebasePerformance#isPerformanceCollectionEnabled': - return isPerformanceCollectionEnabledResult; - default: - return null; - } - }); - }); - - setUp(() { - testMetric = performance.newHttpMetric( - 'https://google.com', - HttpMethod.Get, - ); - currentTestMetricHandle = nextHandle++; - - httpMetricLog.clear(); - }); - - test('start', () { - testMetric.start(); - - expect(httpMetricLog, [ - isMethodCall( - 'HttpMetric#start', - arguments: {'handle': currentTestMetricHandle}, - ), - ]); - }); - - test('stop', () { - testMetric.start(); - httpMetricLog.clear(); - - testMetric.stop(); - - expect(httpMetricLog, [ - isMethodCall( - 'HttpMetric#stop', - arguments: {'handle': currentTestMetricHandle}, - ), - ]); - }); - - test('httpResponseCode', () { - testMetric.httpResponseCode = 45; - - expect(httpMetricLog, [ - isMethodCall( - 'HttpMetric#httpResponseCode', - arguments: { - 'handle': currentTestMetricHandle, - 'httpResponseCode': 45, - }, - ), - ]); - }); - - test('requestPayloadSize', () { - testMetric.requestPayloadSize = 436; - - expect(httpMetricLog, [ - isMethodCall( - 'HttpMetric#requestPayloadSize', - arguments: { - 'handle': currentTestMetricHandle, - 'requestPayloadSize': 436, - }, - ), - ]); - }); - - test('responseContentType', () { - testMetric.responseContentType = 'hi'; - - expect(httpMetricLog, [ - isMethodCall( - 'HttpMetric#responseContentType', - arguments: { - 'handle': currentTestMetricHandle, - 'responseContentType': 'hi', - }, - ), - ]); - }); - - test('responsePayloadSize', () { - testMetric.responsePayloadSize = 12; - - expect(httpMetricLog, [ - isMethodCall( - 'HttpMetric#responsePayloadSize', - arguments: { - 'handle': currentTestMetricHandle, - 'responsePayloadSize': 12, - }, - ), - ]); - }); - - test('invokeMethod not called if httpMetric has stopped', () { - testMetric.start(); - testMetric.stop(); - httpMetricLog.clear(); - - testMetric.start(); - testMetric.stop(); - testMetric.httpResponseCode = 12; - testMetric.requestPayloadSize = 23; - testMetric.responseContentType = 'potato'; - testMetric.responsePayloadSize = 123; - - expect(httpMetricLog, isEmpty); - }); - }); - - group('$PerformanceAttributes', () { - final List attributeLog = []; - - Trace attributeTrace; - int currentTraceHandle; - - setUpAll(() { - FirebasePerformance.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - attributeLog.add(methodCall); - switch (methodCall.method) { - case 'PerformanceAttributes#getAttributes': - return { - 'a1': 'hello', - 'a2': 'friend', - }; - default: - return null; - } - }); - }); - - setUp(() { - attributeTrace = performance.newTrace('trace'); - currentTraceHandle = nextHandle++; - - attributeLog.clear(); - }); - - test('putAttribute', () { - attributeTrace.putAttribute('attr1', 'apple'); - - expect(attributeLog, [ - isMethodCall( - 'PerformanceAttributes#putAttribute', - arguments: { - 'handle': currentTraceHandle, - 'name': 'attr1', - 'value': 'apple', - }, - ), - ]); - }); - - test('removeAttribute', () { - attributeTrace.removeAttribute('attr14'); - - expect(attributeLog, [ - isMethodCall( - 'PerformanceAttributes#removeAttribute', - arguments: { - 'handle': currentTraceHandle, - 'name': 'attr14', - }, - ), - ]); - }); - - test('getAttributes', () async { - final Map result = await attributeTrace.getAttributes(); - - expect(attributeLog, [ - isMethodCall( - 'PerformanceAttributes#getAttributes', - arguments: {'handle': currentTraceHandle}, - ), - ]); - - expect(result, {'a1': 'hello', 'a2': 'friend'}); - }); - - test('invokeMethod not called if trace has stopped', () { - attributeTrace.start(); - attributeTrace.stop(); - attributeLog.clear(); - - attributeTrace.putAttribute('tonto', 'orale'); - attributeTrace.removeAttribute('ewfo'); - attributeTrace.getAttributes(); - - expect(attributeLog, isEmpty); - }); - }); - }); -} diff --git a/packages/firebase_remote_config/.gitignore b/packages/firebase_remote_config/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_remote_config/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_remote_config/CHANGELOG.md b/packages/firebase_remote_config/CHANGELOG.md deleted file mode 100644 index bdc6d78948a5..000000000000 --- a/packages/firebase_remote_config/CHANGELOG.md +++ /dev/null @@ -1,81 +0,0 @@ -## 0.2.0+5 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 0.2.0+4 - -* Fixed a bug where `RemoteConfigValue` could incorrectly report a remote `source` for default values. -* Added an integration test for the fixed behavior of `source`. -* Removed a test that made integration test flaky. - -## 0.2.0+3 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 0.2.0+2 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 0.2.0+1 - -* Minor internal code cleanup in Java implementation. - -## 0.2.0 - -* Update Android dependencies to latest. - -## 0.1.0+3 - -* Initial integration tests. - -## 0.1.0+2 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 0.1.0+1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 0.1.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 0.0.6+1 - -* Bump Android dependencies to latest. - -## 0.0.6 - -* Allowed extending the RemoteConfig class. - -## 0.0.5 - -* Bump Android and Firebase dependency versions. - -## 0.0.4 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.0.3 - -* Added missing await in setDefaults. -* Fixed example code in README. - -## 0.0.2 - -* Update iOS plugin so that it returns fetch status - as a String instead of an int. -* Bump Android library version to 15.+. The Android plugins for - FlutterFire need to all be on the same version. Updating - Remote Config to match other FlutterFire plugins. - -## 0.0.1 - -* Implement Firebase Remote Config. diff --git a/packages/firebase_remote_config/LICENSE b/packages/firebase_remote_config/LICENSE deleted file mode 100644 index dd2a7aca4242..000000000000 --- a/packages/firebase_remote_config/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright 2018, the Chromium project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_remote_config/README.md b/packages/firebase_remote_config/README.md deleted file mode 100644 index 07f0c223d90b..000000000000 --- a/packages/firebase_remote_config/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# firebase_remote_config plugin - -A Flutter plugin to use the [Firebase Remote Config API](https://firebase.google.com/products/remote-config/). - -[![pub package](https://img.shields.io/pub/v/firebase_remote_config.svg)](https://pub.dartlang.org/packages/firebase_remote_config) - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -### Import the firebase_remote_config plugin -To use the firebase_remote_config plugin, follow the [plugin installation instructions](https://pub.dartlang.org/packages/firebase_remote_config#pub-pkg-tab-installing). - -### Android integration - -Enable the Google services by configuring the Gradle scripts as such. - -1. Add the classpath to the `[project]/android/build.gradle` file. -```gradle -dependencies { - // Example existing classpath - classpath 'com.android.tools.build:gradle:3.2.1' - // Add the google services classpath - classpath 'com.google.gms:google-services:4.3.0' -} -``` - -2. Add the apply plugin to the `[project]/android/app/build.gradle` file. -```gradle -// ADD THIS AT THE BOTTOM -apply plugin: 'com.google.gms.google-services' -``` - -*Note:* If this section is not completed you will get an error like this: -``` -java.lang.IllegalStateException: -Default FirebaseApp is not initialized in this process [package name]. -Make sure to call FirebaseApp.initializeApp(Context) first. -``` - -*Note:* When you are debugging on android, use a device or AVD with Google Play services. -Otherwise you will not be able to use Firebase Remote Config. - -### Use the plugin - -Add the following imports to your Dart code: -```dart -import 'package:firebase_remote_config/firebase_remote_config.dart'; -``` - -Initialize `RemoteConfig`: -```dart -final RemoteConfig remoteConfig = await RemoteConfig.instance; -``` - -You can now use the Firebase `remoteConfig` to fetch remote configurations in your Dart code, e.g. -```dart -final defaults = {'welcome': 'default welcome'}; -await remoteConfig.setDefaults(defaults); - -await remoteConfig.fetch(expiration: const Duration(hours: 5)); -await remoteConfig.activateFetched(); -print('welcome message: ' + remoteConfig.getString('welcome')); -``` - -## Example - -See the [example application](https://github.com/flutter/plugins/tree/master/packages/firebase_remote_config/example) source -for a complete sample app using the Firebase Remote Config. - -## Issues and feedback - -Please file [issues](https://github.com/flutter/flutter/issues/new) -to send feedback or report a bug. Thank you! diff --git a/packages/firebase_remote_config/android/build.gradle b/packages/firebase_remote_config/android/build.gradle deleted file mode 100644 index b4eb1e6158d7..000000000000 --- a/packages/firebase_remote_config/android/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -def PLUGIN = "firebase_remote_config"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebase.firebaseremoteconfig' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-config:16.4.1' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_remote_config/android/gradle.properties b/packages/firebase_remote_config/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_remote_config/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_remote_config/android/settings.gradle b/packages/firebase_remote_config/android/settings.gradle deleted file mode 100644 index 1ab71539c02f..000000000000 --- a/packages/firebase_remote_config/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_remote_config' diff --git a/packages/firebase_remote_config/android/src/main/AndroidManifest.xml b/packages/firebase_remote_config/android/src/main/AndroidManifest.xml deleted file mode 100644 index 4cc4c7d7c467..000000000000 --- a/packages/firebase_remote_config/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_remote_config/android/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfig/FirebaseRemoteConfigPlugin.java b/packages/firebase_remote_config/android/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfig/FirebaseRemoteConfigPlugin.java deleted file mode 100644 index d07a9ad1d57a..000000000000 --- a/packages/firebase_remote_config/android/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfig/FirebaseRemoteConfigPlugin.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.firebaseremoteconfig; - -import android.content.Context; -import android.content.SharedPreferences; -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.remoteconfig.FirebaseRemoteConfig; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigFetchThrottledException; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigInfo; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** FirebaseRemoteConfigPlugin */ -public class FirebaseRemoteConfigPlugin implements MethodCallHandler { - - public static final String TAG = "FirebaseRemoteConfigPlugin"; - public static final String PREFS_NAME = - "io.flutter.plugins.firebase.firebaseremoteconfig.FirebaseRemoteConfigPlugin"; - public static final String DEFAULT_PREF_KEY = "default_keys"; - - private static SharedPreferences sharedPreferences; - - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_remote_config"); - channel.setMethodCallHandler(new FirebaseRemoteConfigPlugin()); - sharedPreferences = registrar.context().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); - } - - @Override - public void onMethodCall(MethodCall call, final Result result) { - switch (call.method) { - case "RemoteConfig#instance": - { - FirebaseRemoteConfigInfo firebaseRemoteConfigInfo = - FirebaseRemoteConfig.getInstance().getInfo(); - - Map properties = new HashMap<>(); - properties.put("lastFetchTime", firebaseRemoteConfigInfo.getFetchTimeMillis()); - properties.put( - "lastFetchStatus", mapLastFetchStatus(firebaseRemoteConfigInfo.getLastFetchStatus())); - properties.put( - "inDebugMode", firebaseRemoteConfigInfo.getConfigSettings().isDeveloperModeEnabled()); - properties.put("parameters", getConfigParameters()); - result.success(properties); - break; - } - case "RemoteConfig#setConfigSettings": - { - boolean debugMode = call.argument("debugMode"); - final FirebaseRemoteConfig firebaseRemoteConfig = FirebaseRemoteConfig.getInstance(); - FirebaseRemoteConfigSettings settings = - new FirebaseRemoteConfigSettings.Builder().setDeveloperModeEnabled(debugMode).build(); - firebaseRemoteConfig.setConfigSettings(settings); - result.success(null); - break; - } - case "RemoteConfig#fetch": - { - long expiration = ((Number) call.argument("expiration")).longValue(); - final FirebaseRemoteConfig firebaseRemoteConfig = FirebaseRemoteConfig.getInstance(); - firebaseRemoteConfig - .fetch(expiration) - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - FirebaseRemoteConfigInfo firebaseRemoteConfigInfo = - firebaseRemoteConfig.getInfo(); - Map properties = new HashMap<>(); - properties.put( - "lastFetchTime", firebaseRemoteConfigInfo.getFetchTimeMillis()); - properties.put( - "lastFetchStatus", - mapLastFetchStatus(firebaseRemoteConfigInfo.getLastFetchStatus())); - if (!task.isSuccessful()) { - final Exception exception = task.getException(); - - if (exception instanceof FirebaseRemoteConfigFetchThrottledException) { - properties.put( - "fetchThrottledEnd", - ((FirebaseRemoteConfigFetchThrottledException) exception) - .getThrottleEndTimeMillis()); - String errorMessage = - "Fetch has been throttled. See the error's " - + "FETCH_THROTTLED_END field for throttle end time."; - result.error("fetchFailedThrottled", errorMessage, properties); - } else { - String errorMessage = - "Unable to complete fetch. Reason is unknown " - + "but this could be due to lack of connectivity."; - result.error("fetchFailed", errorMessage, properties); - } - } else { - result.success(properties); - } - } - }); - break; - } - case "RemoteConfig#activate": - { - boolean newConfig = FirebaseRemoteConfig.getInstance().activateFetched(); - Map properties = new HashMap<>(); - properties.put("parameters", getConfigParameters()); - properties.put("newConfig", newConfig); - result.success(properties); - break; - } - case "RemoteConfig#setDefaults": - { - Map defaults = call.argument("defaults"); - FirebaseRemoteConfig.getInstance().setDefaults(defaults); - SharedPreferences.Editor editor = sharedPreferences.edit(); - editor.putStringSet(DEFAULT_PREF_KEY, defaults.keySet()).apply(); - result.success(null); - break; - } - default: - { - result.notImplemented(); - break; - } - } - } - - private Map getConfigParameters() { - FirebaseRemoteConfig firebaseRemoteConfig = FirebaseRemoteConfig.getInstance(); - Map parameterMap = new HashMap<>(); - Set keys = firebaseRemoteConfig.getKeysByPrefix(""); - for (String key : keys) { - FirebaseRemoteConfigValue remoteConfigValue = firebaseRemoteConfig.getValue(key); - parameterMap.put(key, createRemoteConfigValueMap(remoteConfigValue)); - } - // Add default parameters if missing since `getKeysByPrefix` does not return default keys. - Set defaultKeys = - sharedPreferences.getStringSet(DEFAULT_PREF_KEY, new HashSet()); - for (String defaultKey : defaultKeys) { - if (!parameterMap.containsKey(defaultKey)) { - FirebaseRemoteConfigValue remoteConfigValue = firebaseRemoteConfig.getValue(defaultKey); - parameterMap.put(defaultKey, createRemoteConfigValueMap(remoteConfigValue)); - } - } - return parameterMap; - } - - private Map createRemoteConfigValueMap( - FirebaseRemoteConfigValue remoteConfigValue) { - Map valueMap = new HashMap<>(); - valueMap.put("value", remoteConfigValue.asByteArray()); - valueMap.put("source", mapValueSource(remoteConfigValue.getSource())); - return valueMap; - } - - private String mapLastFetchStatus(int status) { - switch (status) { - case FirebaseRemoteConfig.LAST_FETCH_STATUS_SUCCESS: - return "success"; - case FirebaseRemoteConfig.LAST_FETCH_STATUS_FAILURE: - return "failure"; - case FirebaseRemoteConfig.LAST_FETCH_STATUS_THROTTLED: - return "throttled"; - case FirebaseRemoteConfig.LAST_FETCH_STATUS_NO_FETCH_YET: - return "noFetchYet"; - default: - return "failure"; - } - } - - private String mapValueSource(int source) { - switch (source) { - case FirebaseRemoteConfig.VALUE_SOURCE_STATIC: - return "static"; - case FirebaseRemoteConfig.VALUE_SOURCE_DEFAULT: - return "default"; - case FirebaseRemoteConfig.VALUE_SOURCE_REMOTE: - return "remote"; - default: - return "static"; - } - } -} diff --git a/packages/firebase_remote_config/android/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfig/FlutterFirebaseAppRegistrar.java b/packages/firebase_remote_config/android/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfig/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index 6be694a853be..000000000000 --- a/packages/firebase_remote_config/android/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfig/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.firebaseremoteconfig; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_remote_config/android/user-agent.gradle b/packages/firebase_remote_config/android/user-agent.gradle deleted file mode 100644 index 3454bf0b3a48..000000000000 --- a/packages/firebase_remote_config/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-rc" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_remote_config/example/.metadata b/packages/firebase_remote_config/example/.metadata deleted file mode 100644 index bdd1083db148..000000000000 --- a/packages/firebase_remote_config/example/.metadata +++ /dev/null @@ -1,8 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 538ba522eeeffb8a754ecb12b77eddac3452ed74 - channel: master diff --git a/packages/firebase_remote_config/example/README.md b/packages/firebase_remote_config/example/README.md deleted file mode 100644 index 5890edf8f25b..000000000000 --- a/packages/firebase_remote_config/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_remote_config_example - -Demonstrates how to use the firebase_remote_config plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_remote_config/example/android.iml b/packages/firebase_remote_config/example/android.iml deleted file mode 100644 index 462b903e05b6..000000000000 --- a/packages/firebase_remote_config/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/example/android/app/build.gradle b/packages/firebase_remote_config/example/android/app/build.gradle deleted file mode 100644 index 0912407d96fa..000000000000 --- a/packages/firebase_remote_config/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "io.flutter.plugins.firebase.firebaseremoteconfigexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/packages/firebase_remote_config/example/android/app/google-services.json b/packages/firebase_remote_config/example/android/app/google-services.json deleted file mode 100644 index 5de4fcc09915..000000000000 --- a/packages/firebase_remote_config/example/android/app/google-services.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "project_info": { - "project_number": "297855924061", - "firebase_url": "https://flutterfire-cd2f7.firebaseio.com", - "project_id": "flutterfire-cd2f7", - "storage_bucket": "flutterfire-cd2f7.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:669871c998cc21bd", - "android_client_info": { - "package_name": "com.yourcompany.firebaseauth.example" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-r1u58cnh4p6l1ghpkteil46erlkfll62.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.yourcompany.firebaseauth.example", - "certificate_hash": "c3adef7e7773e40e777d5c236dbba7461cbea5f0" - } - }, - { - "client_id": "297855924061-col4in4uubarifm60nbq8id01ec3ss4c.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.yourcompany.firebaseauth.example", - "certificate_hash": "8a4e194f5bfc3fb1075e7daae8dcddd526fde207" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "297855924061-1skfqv2sc9avlclefi3q2l229t98dpda.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.yourcompany.firestoreExample" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:92efa9a0df6f077f", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase_storage_example" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:db912bec12847bd9", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase_database_example" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-fbg7lp8bvtbibn2edns7d5fc3k0fhsa3.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebase_database_example", - "certificate_hash": "c3adef7e7773e40e777d5c236dbba7461cbea5f0" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "297855924061-1skfqv2sc9avlclefi3q2l229t98dpda.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.yourcompany.firestoreExample" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:236f9daea101f77e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-n8i063j2dib6goh5or4lrctg6sccpevi.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "io.flutter.plugins.firebase.firestoreexample", - "certificate_hash": "a8fc78a37cd4f0471580936de67a2cb2ae4657c7" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 2, - "other_platform_oauth_client": [ - { - "client_id": "297855924061-1skfqv2sc9avlclefi3q2l229t98dpda.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.yourcompany.firestoreExample" - } - }, - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ] - }, - "ads_service": { - "status": 2 - } - } - }, - { - "client_info": { - "mobilesdk_app_id": "1:297855924061:android:6ef94ae486218531", - "android_client_info": { - "package_name": "io.flutter.plugins.firebase.firebaseremoteconfigexample" - } - }, - "oauth_client": [ - { - "client_id": "297855924061-f68m5v860ms5faiotn5mv9f50cmpacdq.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyD_shO5mfO9lhy2TVWhfo1VUmARKlG4suk" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/packages/firebase_remote_config/example/android/app/gradle.properties b/packages/firebase_remote_config/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_remote_config/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_remote_config/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_remote_config/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_remote_config/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_remote_config/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_remote_config/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index fe4292fe0322..000000000000 --- a/packages/firebase_remote_config/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/example/android/app/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfigexample/MainActivity.java b/packages/firebase_remote_config/example/android/app/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfigexample/MainActivity.java deleted file mode 100644 index ef048c74f4df..000000000000 --- a/packages/firebase_remote_config/example/android/app/src/main/java/io/flutter/plugins/firebase/firebaseremoteconfigexample/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.flutter.plugins.firebase.firebaseremoteconfigexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_remote_config/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f88420..000000000000 --- a/packages/firebase_remote_config/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391482be..000000000000 Binary files a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_remote_config/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/android/app/src/main/res/values/styles.xml b/packages/firebase_remote_config/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417cfbe..000000000000 --- a/packages/firebase_remote_config/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/firebase_remote_config/example/android/build.gradle b/packages/firebase_remote_config/example/android/build.gradle deleted file mode 100644 index 359119307d55..000000000000 --- a/packages/firebase_remote_config/example/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_remote_config/example/android/gradle.properties b/packages/firebase_remote_config/example/android/gradle.properties deleted file mode 100644 index 8bd86f680510..000000000000 --- a/packages/firebase_remote_config/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_remote_config/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_remote_config/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2819f022f1fd..000000000000 --- a/packages/firebase_remote_config/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_remote_config/example/android/settings.gradle b/packages/firebase_remote_config/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb18f6..000000000000 --- a/packages/firebase_remote_config/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_remote_config/example/firebase_remote_config_example.iml b/packages/firebase_remote_config/example/firebase_remote_config_example.iml deleted file mode 100644 index 4881df8aeff2..000000000000 --- a/packages/firebase_remote_config/example/firebase_remote_config_example.iml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_remote_config/example/firebase_remote_config_example_android.iml b/packages/firebase_remote_config/example/firebase_remote_config_example_android.iml deleted file mode 100644 index 0ca70ed93eaf..000000000000 --- a/packages/firebase_remote_config/example/firebase_remote_config_example_android.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_remote_config/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6c2de8086bcd..000000000000 --- a/packages/firebase_remote_config/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_remote_config/example/ios/Flutter/Debug.xcconfig b/packages/firebase_remote_config/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/firebase_remote_config/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_remote_config/example/ios/Flutter/Release.xcconfig b/packages/firebase_remote_config/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/firebase_remote_config/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/firebase_remote_config/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_remote_config/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 1d083180dd16..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,493 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D6D2766E14E657030745966 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9305D2E097F7C3459489ECC /* libPods-Runner.a */; }; - 32F83A89202CD0EF00F9ABDD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 32F83A88202CD0EF00F9ABDD /* GoogleService-Info.plist */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 32F83A88202CD0EF00F9ABDD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A9305D2E097F7C3459489ECC /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - 2D6D2766E14E657030745966 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 23DAF82DF3F4525BB2F90DDE /* Frameworks */ = { - isa = PBXGroup; - children = ( - A9305D2E097F7C3459489ECC /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - DC0A69E1FF6565F85D3F7801 /* Pods */, - 23DAF82DF3F4525BB2F90DDE /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 32F83A88202CD0EF00F9ABDD /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - DC0A69E1FF6565F85D3F7801 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 8F3B99257FEBEE68D8CDFD61 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 5CC7800A6771FA590AF8C939 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 32F83A89202CD0EF00F9ABDD /* GoogleService-Info.plist in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 5CC7800A6771FA590AF8C939 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 8F3B99257FEBEE68D8CDFD61 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.firebaseRemoteConfigExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebase.firebaseRemoteConfigExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_remote_config/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_remote_config/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16ed0f..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/firebase_remote_config/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_remote_config/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 1263ac84b105..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_remote_config/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_remote_config/example/ios/Runner/AppDelegate.h b/packages/firebase_remote_config/example/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bbf9cf4..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_remote_config/example/ios/Runner/AppDelegate.m b/packages/firebase_remote_config/example/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e90be12..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d22f10b2ab63..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_remote_config/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_remote_config/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_remote_config/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_remote_config/example/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index ac1700e202bf..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 297855924061-g2np3o504qtqpuip8ud0f884j8kfp9jf.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.297855924061-g2np3o504qtqpuip8ud0f884j8kfp9jf - API_KEY - AIzaSyBq6mcufFXfyqr79uELCiqM_O_1-G72PVU - GCM_SENDER_ID - 297855924061 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebase.firebaseRemoteConfigExample - PROJECT_ID - flutterfire-cd2f7 - STORAGE_BUCKET - flutterfire-cd2f7.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:297855924061:ios:ea6d07263d05c514 - DATABASE_URL - https://flutterfire-cd2f7.firebaseio.com - - \ No newline at end of file diff --git a/packages/firebase_remote_config/example/ios/Runner/Info.plist b/packages/firebase_remote_config/example/ios/Runner/Info.plist deleted file mode 100644 index 60e6abcf802c..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_remote_config_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_remote_config/example/ios/Runner/main.m b/packages/firebase_remote_config/example/ios/Runner/main.m deleted file mode 100644 index dff6597e4513..000000000000 --- a/packages/firebase_remote_config/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_remote_config/example/lib/main.dart b/packages/firebase_remote_config/example/lib/main.dart deleted file mode 100644 index 8db737372086..000000000000 --- a/packages/firebase_remote_config/example/lib/main.dart +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:firebase_remote_config/firebase_remote_config.dart'; -import 'package:flutter/material.dart'; - -void main() { - runApp(MaterialApp( - title: 'Remote Config Example', - home: FutureBuilder( - future: setupRemoteConfig(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - return snapshot.hasData - ? WelcomeWidget(remoteConfig: snapshot.data) - : Container(); - }, - ))); -} - -class WelcomeWidget extends AnimatedWidget { - WelcomeWidget({this.remoteConfig}) : super(listenable: remoteConfig); - - final RemoteConfig remoteConfig; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Remote Config Example'), - ), - body: Center(child: Text('Welcome ${remoteConfig.getString('welcome')}')), - floatingActionButton: FloatingActionButton( - child: const Icon(Icons.refresh), - onPressed: () async { - try { - // Using default duration to force fetching from remote server. - await remoteConfig.fetch(expiration: const Duration(seconds: 0)); - await remoteConfig.activateFetched(); - } on FetchThrottledException catch (exception) { - // Fetch throttled. - print(exception); - } catch (exception) { - print( - 'Unable to fetch remote config. Cached or default values will be ' - 'used'); - } - }), - ); - } -} - -Future setupRemoteConfig() async { - final RemoteConfig remoteConfig = await RemoteConfig.instance; - // Enable developer mode to relax fetch throttling - remoteConfig.setConfigSettings(RemoteConfigSettings(debugMode: true)); - remoteConfig.setDefaults({ - 'welcome': 'default welcome', - 'hello': 'default hello', - }); - return remoteConfig; -} diff --git a/packages/firebase_remote_config/example/pubspec.yaml b/packages/firebase_remote_config/example/pubspec.yaml deleted file mode 100644 index 06c9b5bea711..000000000000 --- a/packages/firebase_remote_config/example/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: firebase_remote_config_example -description: Demonstrates how to use the firebase_remote_config plugin. - -dependencies: - flutter: - sdk: flutter - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.0 - firebase_remote_config: - path: ../ - firebase_core: ^0.4.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any diff --git a/packages/firebase_remote_config/example/test_driver/firebase_remote_config.dart b/packages/firebase_remote_config/example/test_driver/firebase_remote_config.dart deleted file mode 100644 index 2514b2a08a1d..000000000000 --- a/packages/firebase_remote_config/example/test_driver/firebase_remote_config.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'dart:async'; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_remote_config/firebase_remote_config.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$RemoteConfig', () { - RemoteConfig remoteConfig; - - setUp(() async { - remoteConfig = await RemoteConfig.instance; - await remoteConfig - .setConfigSettings(RemoteConfigSettings(debugMode: true)); - await remoteConfig.setDefaults({ - 'welcome': 'default welcome', - 'hello': 'default hello', - }); - }); - - test('fetch', () async { - final DateTime lastFetchTime = remoteConfig.lastFetchTime; - expect(lastFetchTime.isBefore(DateTime.now()), true); - await remoteConfig.fetch(expiration: const Duration(seconds: 0)); - expect(remoteConfig.lastFetchStatus, LastFetchStatus.success); - await remoteConfig.activateFetched(); - - expect(remoteConfig.getString('welcome'), 'Earth, welcome! Hello!'); - expect(remoteConfig.getString('hello'), 'default hello'); - expect(remoteConfig.getInt('nonexisting'), 0); - - expect(remoteConfig.getValue('welcome').source, ValueSource.valueRemote); - expect(remoteConfig.getValue('hello').source, ValueSource.valueDefault); - expect( - remoteConfig.getValue('nonexisting').source, - ValueSource.valueStatic, - ); - }); - }); -} diff --git a/packages/firebase_remote_config/example/test_driver/firebase_remote_config_test.dart b/packages/firebase_remote_config/example/test_driver/firebase_remote_config_test.dart deleted file mode 100644 index 38fe6c447e05..000000000000 --- a/packages/firebase_remote_config/example/test_driver/firebase_remote_config_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_remote_config/firebase_remote_config_android.iml b/packages/firebase_remote_config/firebase_remote_config_android.iml deleted file mode 100644 index 0ebb6c9fe763..000000000000 --- a/packages/firebase_remote_config/firebase_remote_config_android.iml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_remote_config/ios/Assets/.gitkeep b/packages/firebase_remote_config/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h b/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h deleted file mode 100644 index eb3cd9767481..000000000000 --- a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FirebaseRemoteConfigPlugin : NSObject -@end diff --git a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m b/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m deleted file mode 100644 index 844e11d811b8..000000000000 --- a/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseRemoteConfigPlugin.h" -#import "UserAgent.h" - -#import - -@interface FirebaseRemoteConfigPlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@end - -@implementation FirebaseRemoteConfigPlugin - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_remote_config" - binaryMessenger:[registrar messenger]]; - FirebaseRemoteConfigPlugin *instance = [[FirebaseRemoteConfigPlugin alloc] init]; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([@"RemoteConfig#instance" isEqualToString:call.method]) { - FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; - FIRRemoteConfigSettings *firRemoteConfigSettings = [remoteConfig configSettings]; - NSMutableDictionary *resultDict = [[NSMutableDictionary alloc] init]; - - resultDict[@"lastFetchTime"] = [[NSNumber alloc] - initWithLong:(long)[[remoteConfig lastFetchTime] timeIntervalSince1970] * 1000]; - resultDict[@"lastFetchStatus"] = - [self mapLastFetchStatus:(FIRRemoteConfigFetchStatus)[remoteConfig lastFetchStatus]]; - resultDict[@"inDebugMode"] = - [[NSNumber alloc] initWithBool:[firRemoteConfigSettings isDeveloperModeEnabled]]; - - resultDict[@"parameters"] = [self getConfigParameters]; - - result(resultDict); - } else if ([@"RemoteConfig#setConfigSettings" isEqualToString:call.method]) { - FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; - bool debugMode = (bool)call.arguments[@"debugMode"]; - FIRRemoteConfigSettings *remoteConfigSettings = - [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:debugMode]; - [remoteConfig setConfigSettings:remoteConfigSettings]; - result(nil); - } else if ([@"RemoteConfig#fetch" isEqualToString:call.method]) { - FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; - long expiration = (long)call.arguments[@"expiration"]; - - [remoteConfig - fetchWithExpirationDuration:expiration - completionHandler:^(FIRRemoteConfigFetchStatus status, NSError *error) { - NSNumber *lastFetchTime = [[NSNumber alloc] - initWithLong:(long)[[remoteConfig lastFetchTime] timeIntervalSince1970] * - 1000]; - NSString *lastFetchStatus = - [self mapLastFetchStatus:(FIRRemoteConfigFetchStatus)[remoteConfig - lastFetchStatus]]; - NSMutableDictionary *resultDict = [[NSMutableDictionary alloc] init]; - resultDict[@"lastFetchTime"] = lastFetchTime; - resultDict[@"lastFetchStatus"] = lastFetchStatus; - - if (status != FIRRemoteConfigFetchStatusSuccess) { - FlutterError *flutterError; - if (status == FIRRemoteConfigFetchStatusThrottled) { - int mills = - [[error.userInfo - valueForKey:FIRRemoteConfigThrottledEndTimeInSecondsKey] intValue] * - 1000; - resultDict[@"fetchThrottledEnd"] = [[NSNumber alloc] initWithInt:mills]; - NSString *errorMessage = - @"Fetch has been throttled. See the error's fetchThrottledEnd " - "field for throttle end time."; - flutterError = [FlutterError errorWithCode:@"fetchFailedThrottled" - message:errorMessage - details:resultDict]; - } else { - NSString *errorMessage = @"Unable to complete fetch. Reason is unknown " - "but this could be due to lack of connectivity."; - flutterError = [FlutterError errorWithCode:@"fetchFailed" - message:errorMessage - details:resultDict]; - } - result(flutterError); - } else { - result(resultDict); - } - }]; - } else if ([@"RemoteConfig#activate" isEqualToString:call.method]) { - BOOL newConfig = [[FIRRemoteConfig remoteConfig] activateFetched]; - NSDictionary *parameters = [self getConfigParameters]; - NSMutableDictionary *resultDict = [[NSMutableDictionary alloc] init]; - resultDict[@"newConfig"] = [NSNumber numberWithBool:newConfig]; - resultDict[@"parameters"] = parameters; - result(resultDict); - } else if ([@"RemoteConfig#setDefaults" isEqualToString:call.method]) { - FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; - NSDictionary *defaults = call.arguments[@"defaults"]; - [remoteConfig setDefaults:defaults]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -- (NSMutableDictionary *)createRemoteConfigValueDict:(FIRRemoteConfigValue *)remoteConfigValue { - NSMutableDictionary *valueDict = [[NSMutableDictionary alloc] init]; - valueDict[@"value"] = [FlutterStandardTypedData typedDataWithBytes:[remoteConfigValue dataValue]]; - valueDict[@"source"] = [self mapValueSource:[remoteConfigValue source]]; - return valueDict; -} - -- (NSDictionary *)getConfigParameters { - FIRRemoteConfig *remoteConfig = [FIRRemoteConfig remoteConfig]; - NSMutableDictionary *parameterDict = [[NSMutableDictionary alloc] init]; - NSSet *keySet = [remoteConfig keysWithPrefix:@""]; - for (NSString *key in keySet) { - parameterDict[key] = [self createRemoteConfigValueDict:[remoteConfig configValueForKey:key]]; - } - // Add default parameters if missing since `keysWithPrefix` does not return default keys. - NSArray *defaultKeys = [remoteConfig allKeysFromSource:FIRRemoteConfigSourceDefault - namespace:FIRNamespaceGoogleMobilePlatform]; - for (NSString *key in defaultKeys) { - if ([parameterDict valueForKey:key] == nil) { - parameterDict[key] = [self createRemoteConfigValueDict:[remoteConfig configValueForKey:key]]; - } - } - return parameterDict; -} - -- (NSString *)mapLastFetchStatus:(FIRRemoteConfigFetchStatus)status { - if (status == FIRRemoteConfigFetchStatusSuccess) { - return @"success"; - } else if (status == FIRRemoteConfigFetchStatusFailure) { - return @"failure"; - } else if (status == FIRRemoteConfigFetchStatusThrottled) { - return @"throttled"; - } else if (status == FIRRemoteConfigFetchStatusNoFetchYet) { - return @"noFetchYet"; - } else { - return @"failure"; - } -} - -- (NSString *)mapValueSource:(FIRRemoteConfigSource)source { - if (source == FIRRemoteConfigSourceStatic) { - return @"static"; - } else if (source == FIRRemoteConfigSourceDefault) { - return @"default"; - } else if (source == FIRRemoteConfigSourceRemote) { - return @"remote"; - } else { - return @"static"; - } -} - -@end diff --git a/packages/firebase_remote_config/ios/firebase_remote_config.podspec b/packages/firebase_remote_config/ios/firebase_remote_config.podspec deleted file mode 100644 index 3e9a83bd0826..000000000000 --- a/packages/firebase_remote_config/ios/firebase_remote_config.podspec +++ /dev/null @@ -1,33 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_remote_config' - s.version = '0.0.1' - s.summary = 'Firebase Remote Config plugin for Flutter' - s.description = <<-DESC -Firebase Remote Config plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_remote_config' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/RemoteConfig' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-rc\\"" >> Classes/UserAgent.h - CMD -end - diff --git a/packages/firebase_remote_config/lib/firebase_remote_config.dart b/packages/firebase_remote_config/lib/firebase_remote_config.dart deleted file mode 100644 index 641e6efbe102..000000000000 --- a/packages/firebase_remote_config/lib/firebase_remote_config.dart +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_remote_config; - -import 'dart:async'; -import 'dart:convert'; - -import 'package:flutter/services.dart'; -import 'package:flutter/foundation.dart'; - -part 'src/remote_config.dart'; -part 'src/remote_config_settings.dart'; -part 'src/remote_config_value.dart'; -part 'src/remote_config_fetch_throttled_exception.dart'; -part 'src/remote_config_last_fetch_status.dart'; diff --git a/packages/firebase_remote_config/lib/src/remote_config.dart b/packages/firebase_remote_config/lib/src/remote_config.dart deleted file mode 100644 index ea8362eac265..000000000000 --- a/packages/firebase_remote_config/lib/src/remote_config.dart +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_remote_config; - -/// The entry point for accessing Remote Config. -/// -/// You can get an instance by calling [RemoteConfig.instance]. Note -/// [RemoteConfig.instance] is async. -class RemoteConfig extends ChangeNotifier { - @visibleForTesting - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_remote_config'); - - static const String defaultValueForString = ''; - static const int defaultValueForInt = 0; - static const double defaultValueForDouble = 0.0; - static const bool defaultValueForBool = false; - - Map _parameters; - - DateTime _lastFetchTime; - LastFetchStatus _lastFetchStatus; - RemoteConfigSettings _remoteConfigSettings; - - DateTime get lastFetchTime => _lastFetchTime; - LastFetchStatus get lastFetchStatus => _lastFetchStatus; - RemoteConfigSettings get remoteConfigSettings => _remoteConfigSettings; - - static Completer _instanceCompleter = Completer(); - - /// Gets the instance of RemoteConfig for the default Firebase app. - static Future get instance async { - if (!_instanceCompleter.isCompleted) { - _getRemoteConfigInstance(); - } - return _instanceCompleter.future; - } - - static void _getRemoteConfigInstance() async { - final Map properties = - await channel.invokeMapMethod('RemoteConfig#instance'); - - final RemoteConfig instance = RemoteConfig(); - - instance._lastFetchTime = - DateTime.fromMillisecondsSinceEpoch(properties['lastFetchTime']); - instance._lastFetchStatus = - _parseLastFetchStatus(properties['lastFetchStatus']); - final RemoteConfigSettings remoteConfigSettings = - RemoteConfigSettings(debugMode: properties['inDebugMode']); - instance._remoteConfigSettings = remoteConfigSettings; - instance._parameters = - _parseRemoteConfigParameters(parameters: properties['parameters']); - _instanceCompleter.complete(instance); - } - - static Map _parseRemoteConfigParameters( - {Map parameters}) { - final Map parsedParameters = - {}; - parameters.forEach((dynamic key, dynamic value) { - final ValueSource valueSource = _parseValueSource(value['source']); - final RemoteConfigValue remoteConfigValue = - RemoteConfigValue._(value['value']?.cast(), valueSource); - parsedParameters[key] = remoteConfigValue; - }); - return parsedParameters; - } - - static ValueSource _parseValueSource(String sourceStr) { - switch (sourceStr) { - case 'static': - return ValueSource.valueStatic; - case 'default': - return ValueSource.valueDefault; - case 'remote': - return ValueSource.valueRemote; - default: - return null; - } - } - - static LastFetchStatus _parseLastFetchStatus(String statusStr) { - switch (statusStr) { - case 'success': - return LastFetchStatus.success; - case 'failure': - return LastFetchStatus.failure; - case 'throttled': - return LastFetchStatus.throttled; - case 'noFetchYet': - return LastFetchStatus.noFetchYet; - default: - return LastFetchStatus.failure; - } - } - - /// Set the configuration settings for this [RemoteConfig] instance. - /// - /// This can be used for enabling developer mode. - Future setConfigSettings( - RemoteConfigSettings remoteConfigSettings) async { - await channel - .invokeMethod('RemoteConfig#setConfigSettings', { - 'debugMode': remoteConfigSettings.debugMode, - }); - _remoteConfigSettings = remoteConfigSettings; - } - - /// Fetches parameter values for your app. - /// - /// Parameter values may be from Default Config (local cache) or Remote - /// Config if enough time has elapsed since parameter values were last - /// fetched from the server. The default expiration time is 12 hours. - /// Expiration must be defined in seconds. - Future fetch({Duration expiration = const Duration(hours: 12)}) async { - try { - final Map properties = await channel - .invokeMapMethod('RemoteConfig#fetch', - {'expiration': expiration.inSeconds}); - _lastFetchTime = - DateTime.fromMillisecondsSinceEpoch(properties['lastFetchTime']); - _lastFetchStatus = _parseLastFetchStatus(properties['lastFetchStatus']); - } on PlatformException catch (e) { - _lastFetchTime = - DateTime.fromMillisecondsSinceEpoch(e.details['lastFetchTime']); - _lastFetchStatus = _parseLastFetchStatus(e.details['lastFetchStatus']); - if (e.code == 'fetchFailedThrottled') { - final int fetchThrottleEnd = e.details['fetchThrottledEnd']; - throw FetchThrottledException._(endTimeInMills: fetchThrottleEnd); - } else { - throw Exception('Unable to fetch remote config'); - } - } - } - - /// Activates the fetched config, makes fetched key-values take effect. - /// - /// The returned Future completes true if the fetched config is different - /// from the currently activated config, it contains false otherwise. - Future activateFetched() async { - final Map properties = - await channel.invokeMapMethod('RemoteConfig#activate'); - final Map rawParameters = properties['parameters']; - final bool newConfig = properties['newConfig']; - final Map fetchedParameters = - _parseRemoteConfigParameters(parameters: rawParameters); - _parameters = fetchedParameters; - notifyListeners(); - return newConfig; - } - - /// Sets the default config. - /// - /// Default config parameters should be set then when changes are needed the - /// parameters should be updated in the Firebase console. - Future setDefaults(Map defaults) async { - assert(defaults != null); - // Make defaults available even if fetch fails. - defaults.forEach((String key, dynamic value) { - if (!_parameters.containsKey(key)) { - final RemoteConfigValue remoteConfigValue = RemoteConfigValue._( - const Utf8Codec().encode(value.toString()), - ValueSource.valueDefault, - ); - _parameters[key] = remoteConfigValue; - } - }); - await channel.invokeMethod( - 'RemoteConfig#setDefaults', {'defaults': defaults}); - } - - /// Gets the value corresponding to the [key] as a String. - /// - /// If there is no parameter with corresponding [key] then the default - /// String value is returned. - String getString(String key) { - if (_parameters.containsKey(key)) { - return _parameters[key].asString(); - } else { - return defaultValueForString; - } - } - - /// Gets the value corresponding to the [key] as an int. - /// - /// If there is no parameter with corresponding [key] then the default - /// int value is returned. - int getInt(String key) { - if (_parameters.containsKey(key)) { - return _parameters[key].asInt(); - } else { - return defaultValueForInt; - } - } - - /// Gets the value corresponding to the [key] as a double. - /// - /// If there is no parameter with corresponding [key] then the default double - /// value is returned. - double getDouble(String key) { - if (_parameters.containsKey(key)) { - return _parameters[key].asDouble(); - } else { - return defaultValueForDouble; - } - } - - /// Gets the value corresponding to the [key] as a bool. - /// - /// If there is no parameter with corresponding [key] then the default bool - /// value is returned. - bool getBool(String key) { - if (_parameters.containsKey(key)) { - return _parameters[key].asBool(); - } else { - return defaultValueForBool; - } - } - - /// Gets the [RemoteConfigValue] corresponding to the [key]. - /// - /// If there is no parameter with corresponding key then a [RemoteConfigValue] - /// with a null value and static source is returned. - RemoteConfigValue getValue(String key) { - if (_parameters.containsKey(key)) { - return _parameters[key]; - } else { - return RemoteConfigValue._(null, ValueSource.valueStatic); - } - } - - /// Gets all [RemoteConfigValue]. - /// - /// This includes all remote and default values - Map getAll() { - return Map.unmodifiable(_parameters); - } -} diff --git a/packages/firebase_remote_config/lib/src/remote_config_fetch_throttled_exception.dart b/packages/firebase_remote_config/lib/src/remote_config_fetch_throttled_exception.dart deleted file mode 100644 index 7e8f28cd1eba..000000000000 --- a/packages/firebase_remote_config/lib/src/remote_config_fetch_throttled_exception.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_remote_config; - -/// Exception thrown when the fetch() operation cannot be completed successfully, due to throttling. -class FetchThrottledException implements Exception { - FetchThrottledException._({int endTimeInMills}) { - _throttleEnd = DateTime.fromMillisecondsSinceEpoch(endTimeInMills); - } - - DateTime _throttleEnd; - - DateTime get throttleEnd => _throttleEnd; - - @override - String toString() { - final Duration duration = _throttleEnd.difference(DateTime.now()); - return '''FetchThrottledException -Fetching throttled, try again in ${duration.inMilliseconds} milliseconds'''; - } -} diff --git a/packages/firebase_remote_config/lib/src/remote_config_last_fetch_status.dart b/packages/firebase_remote_config/lib/src/remote_config_last_fetch_status.dart deleted file mode 100644 index ad82f9a3d876..000000000000 --- a/packages/firebase_remote_config/lib/src/remote_config_last_fetch_status.dart +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_remote_config; - -/// LastFetchStatus defines the possible status values of the last fetch. -enum LastFetchStatus { success, failure, throttled, noFetchYet } diff --git a/packages/firebase_remote_config/lib/src/remote_config_settings.dart b/packages/firebase_remote_config/lib/src/remote_config_settings.dart deleted file mode 100644 index 38ace7611ddb..000000000000 --- a/packages/firebase_remote_config/lib/src/remote_config_settings.dart +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_remote_config; - -/// RemoteConfigSettings can be used to configure how Remote Config operates. -class RemoteConfigSettings { - RemoteConfigSettings({this.debugMode = false}); - - /// Enable or disable developer mode for Remote Config. - /// - /// When set to true developer mode is enabled, when set to false developer - /// mode is disabled. When developer mode is enabled fetch throttling is - /// relaxed to allow many more fetch calls per hour to the remote server than - /// the 5 per hour that is enforced when developer mode is disabled. - final bool debugMode; -} diff --git a/packages/firebase_remote_config/lib/src/remote_config_value.dart b/packages/firebase_remote_config/lib/src/remote_config_value.dart deleted file mode 100644 index ddf93a5df189..000000000000 --- a/packages/firebase_remote_config/lib/src/remote_config_value.dart +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_remote_config; - -/// ValueSource defines the possible sources of a config parameter value. -enum ValueSource { valueStatic, valueDefault, valueRemote } - -/// RemoteConfigValue encapsulates the value and source of a Remote Config -/// parameter. -class RemoteConfigValue { - RemoteConfigValue._(this._value, this.source) : assert(source != null); - - List _value; - - /// Indicates at which source this value came from. - final ValueSource source; - - /// Decode value to string. - String asString() { - return _value != null - ? const Utf8Codec().decode(_value) - : RemoteConfig.defaultValueForString; - } - - /// Decode value to int. - int asInt() { - if (_value != null) { - final String strValue = const Utf8Codec().decode(_value); - final int intValue = - int.tryParse(strValue) ?? RemoteConfig.defaultValueForInt; - return intValue; - } else { - return RemoteConfig.defaultValueForInt; - } - } - - /// Decode value to double. - double asDouble() { - if (_value != null) { - final String strValue = const Utf8Codec().decode(_value); - final double doubleValue = - double.tryParse(strValue) ?? RemoteConfig.defaultValueForDouble; - return doubleValue; - } else { - return RemoteConfig.defaultValueForDouble; - } - } - - /// Decode value to bool. - bool asBool() { - if (_value != null) { - final String strValue = const Utf8Codec().decode(_value); - return strValue.toLowerCase() == 'true'; - } else { - return RemoteConfig.defaultValueForBool; - } - } -} diff --git a/packages/firebase_remote_config/pubspec.yaml b/packages/firebase_remote_config/pubspec.yaml deleted file mode 100644 index 5875219ecc3d..000000000000 --- a/packages/firebase_remote_config/pubspec.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: firebase_remote_config -description: Flutter plugin for Firebase Remote Config. Update your application look and feel and behaviour without - re-releasing. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_remote_config -version: 0.2.0+5 - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - firebase_core: ^0.4.0 - flutter_driver: - sdk: flutter - test: any - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.firebaseremoteconfig - pluginClass: FirebaseRemoteConfigPlugin - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_remote_config/test/firebase_remote_config_test.dart b/packages/firebase_remote_config/test/firebase_remote_config_test.dart deleted file mode 100644 index b86f067a6c1a..000000000000 --- a/packages/firebase_remote_config/test/firebase_remote_config_test.dart +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:firebase_remote_config/firebase_remote_config.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - final int lastFetchTime = 1520618753782; - Map getDefaultInstance() { - return { - 'lastFetchTime': lastFetchTime, - 'lastFetchStatus': 'success', - 'inDebugMode': true, - 'parameters': { - 'param1': { - 'source': 'static', - 'value': [118, 97, 108, 49], // UTF-8 encoded 'val1' - }, - }, - }; - } - - group('$RemoteConfig', () { - final List log = []; - - setUp(() async { - RemoteConfig.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'RemoteConfig#instance': - return getDefaultInstance(); - default: - return true; - } - }); - }); - - test('instance', () async { - final RemoteConfig remoteConfig = await RemoteConfig.instance; - expect( - log, - [ - isMethodCall('RemoteConfig#instance', arguments: null), - ], - ); - expect(remoteConfig.remoteConfigSettings.debugMode, true); - expect(remoteConfig.lastFetchTime, - DateTime.fromMillisecondsSinceEpoch(lastFetchTime)); - expect(remoteConfig.lastFetchStatus, LastFetchStatus.values[0]); - }); - - test('doubleInstance', () async { - final List> futures = >[ - RemoteConfig.instance, - RemoteConfig.instance, - ]; - Future.wait(futures).then((List remoteConfigs) { - // Check that both returned Remote Config instances are the same. - expect(remoteConfigs[0], remoteConfigs[1]); - }); - }); - }); - - group('$RemoteConfig', () { - final List log = []; - - final int lastFetchTime = 1520618753782; - RemoteConfig remoteConfig; - - setUp(() async { - RemoteConfig.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'RemoteConfig#setDefaults': - return null; - case 'RemoteConfig#fetch': - return { - 'lastFetchTime': lastFetchTime, - 'lastFetchStatus': 'success', - }; - case 'RemoteConfig#instance': - return getDefaultInstance(); - case 'RemoteConfig#activate': - return { - 'parameters': { - 'param1': { - 'source': 'remote', - 'value': [118, 97, 108, 49], // UTF-8 encoded 'val1' - }, - 'param2': { - 'source': 'remote', - 'value': [49, 50, 51, 52, 53], // UTF-8 encoded '12345' - }, - 'param3': { - 'source': 'default', - 'value': [51, 46, 49, 52], // UTF-8 encoded '3.14' - }, - 'param4': { - 'source': 'remote', - 'value': [116, 114, 117, 101], // UTF-8 encoded 'true' - }, - 'param5': { - 'source': 'default', - 'value': [ - 102, - 97, - 108, - 115, - 101 - ], // UTF-8 encoded 'false' - }, - 'param6': {'source': 'default', 'value': null} - }, - 'newConfig': true, - }; - case 'RemoteConfig#setConfigSettings': - return null; - default: - return true; - } - }); - remoteConfig = await RemoteConfig.instance; - log.clear(); - }); - - test('setDefaults', () async { - await remoteConfig.setDefaults({ - 'foo': 'bar', - }); - expect(log, [ - isMethodCall( - 'RemoteConfig#setDefaults', - arguments: { - 'defaults': { - 'foo': 'bar', - }, - }, - ), - ]); - }); - - test('fetch', () async { - await remoteConfig.fetch(expiration: const Duration(hours: 1)); - expect( - log, - [ - isMethodCall( - 'RemoteConfig#fetch', - arguments: { - 'expiration': 3600, - }, - ), - ], - ); - }); - - test('activate', () async { - final bool newConfig = await remoteConfig.activateFetched(); - expect( - log, - [ - isMethodCall( - 'RemoteConfig#activate', - arguments: null, - ), - ], - ); - expect(newConfig, true); - expect(remoteConfig.getString('param1'), 'val1'); - expect(remoteConfig.getInt('param2'), 12345); - expect(remoteConfig.getDouble('param3'), 3.14); - expect(remoteConfig.getBool('param4'), true); - expect(remoteConfig.getBool('param5'), false); - expect(remoteConfig.getInt('param6'), 0); - - remoteConfig.getAll().forEach((String key, RemoteConfigValue value) { - switch (key) { - case 'param1': - expect(value.asString(), 'val1'); - break; - case 'param2': - expect(value.asInt(), 12345); - break; - case 'param3': - expect(value.asDouble(), 3.14); - break; - case 'param4': - expect(value.asBool(), true); - break; - case 'param5': - expect(value.asBool(), false); - break; - case 'param6': - expect(value.asInt(), 0); - break; - default: - } - }); - - final Map resultAllSources = remoteConfig - .getAll() - .map((String key, RemoteConfigValue value) => - MapEntry(key, value.source)); - expect(resultAllSources, { - 'param1': ValueSource.valueRemote, - 'param2': ValueSource.valueRemote, - 'param3': ValueSource.valueDefault, - 'param4': ValueSource.valueRemote, - 'param5': ValueSource.valueDefault, - 'param6': ValueSource.valueDefault, - }); - }); - - test('setConfigSettings', () async { - expect(remoteConfig.remoteConfigSettings.debugMode, true); - final RemoteConfigSettings remoteConfigSettings = - RemoteConfigSettings(debugMode: false); - await remoteConfig.setConfigSettings(remoteConfigSettings); - expect( - log, - [ - isMethodCall( - 'RemoteConfig#setConfigSettings', - arguments: { - 'debugMode': false, - }, - ), - ], - ); - expect(remoteConfig.remoteConfigSettings.debugMode, false); - }); - }); -} diff --git a/packages/firebase_storage/.gitignore b/packages/firebase_storage/.gitignore deleted file mode 100644 index 46385dab97b6..000000000000 --- a/packages/firebase_storage/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ios/Classes/UserAgent.h diff --git a/packages/firebase_storage/CHANGELOG.md b/packages/firebase_storage/CHANGELOG.md deleted file mode 100644 index 86b8003b2fea..000000000000 --- a/packages/firebase_storage/CHANGELOG.md +++ /dev/null @@ -1,244 +0,0 @@ -## 3.0.5 -* Removed automatic print statements for `StorageTaskEvent`'s. - If you want to see the event status in your logs now, you will have to use the following: - `storageReference.put{File/Data}(..).events.listen((event) => print('EVENT ${event.type}'));` -* Updated `README.md` to explain the above. - -## 3.0.4 - -* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. - -## 3.0.3 - -* Fix inconsistency of `getPath`, on Android the path returned started with a `/` but on iOS it did not -* Fix content-type auto-detection on Android - -## 3.0.2 - -* Automatically use version from pubspec.yaml when reporting usage to Firebase. - -## 3.0.1 - -* Add missing template type parameter to `invokeMethod` calls. -* Bump minimum Flutter version to 1.5.0. -* Replace invokeMethod with invokeMapMethod wherever necessary. - -## 3.0.0 - -* Update Android dependencies to latest. - -## 2.1.1+2 - -* On iOS, use `putFile` instead of `putData` appropriately to detect `Content-Type`. - -## 2.1.1+1 - -* On iOS, gracefully handle the case of uploading a nonexistent file without crashing. - -## 2.1.1 - -* Added integration tests. - -## 2.1.0+1 - -* Reverting error.code casting/formatting to what it was until version 2.0.1. - -## 2.1.0 - -* Added support for getReferenceFromUrl. - -## 2.0.1+2 - -* Log messages about automatic configuration of the default app are now less confusing. - -## 2.0.1+1 - -* Remove categories. - -## 2.0.1 - -* Log a more detailed warning at build time about the previous AndroidX - migration. - -## 2.0.0 - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - - This was originally incorrectly pushed in the `1.1.0` update. - -## 1.1.0+1 - -* **Revert the breaking 1.1.0 update**. 1.1.0 was known to be breaking and - should have incremented the major version number instead of the minor. This - revert is in and of itself breaking for anyone that has already migrated - however. Anyone who has already migrated their app to AndroidX should - immediately update to `2.0.0` instead. That's the correctly versioned new push - of `1.1.0`. - -## 1.1.0 - -* **BAD**. This was a breaking change that was incorrectly published on a minor - version upgrade, should never have happened. Reverted by 1.1.0+1. - -* **Breaking change**. Migrate from the deprecated original Android Support - Library to AndroidX. This shouldn't result in any functional changes, but it - requires any Android apps using this plugin to [also - migrate](https://developer.android.com/jetpack/androidx/migrate) if they're - using the original support library. - -## 1.0.4 - -* Bump Android dependencies to latest. - -## 1.0.3 - -* Added monitoring of StorageUploadTask via `events` stream. -* Added support for StorageUploadTask functions: `pause`, `resume`, `cancel`. -* Set http version to be compatible with flutter_test. - -## 1.0.2 - -* Added missing http package dependency. - -## 1.0.1 - -* Bump Android and Firebase dependency versions. - -## 1.0.0 - -* **Breaking change**. Make StorageUploadTask implementation classes private. -* Bump to released version - -## 0.3.7 - -* Updated Gradle tooling to match Android Studio 3.1.2. - -## 0.3.6 - -* Added support for custom metadata. - -## 0.3.5 - -* Updated iOS implementation to reflect Firebase API changes. - -## 0.3.4 - -* Added timeout properties to FirebaseStorage. - -## 0.3.3 - -* Added support for initialization with a custom Firebase app. - -## 0.3.2 - -* Added support for StorageReference `writeToFile`. - -## 0.3.1 - -* Added support for StorageReference functions: `getParent`, `getRoot`, `getStorage`, `getName`, `getPath`, `getBucket`. - -## 0.3.0 - -* **Breaking change**. Changed StorageUploadTask to abstract, removed the 'file' field, and made 'path' and 'metadata' - private. Added two subclasses: StorageFileUploadTask and StorageDataUploadTask. -* Deprecated the `put` function and added `putFile` and `putData` to upload files and bytes respectively. - -## 0.2.6 - -* Added support for updateMetadata. - -## 0.2.5 - -* Added StorageMetadata class, support for getMetadata, and support for uploading file with metadata. - -## 0.2.4 - -* Updated Google Play Services dependencies to version 15.0.0. - -## 0.2.3 - -* Updated package channel name and made channel visible for testing - -## 0.2.2 - -* Simplified podspec for Cocoapods 1.5.0, avoiding link issues in app archives. - -## 0.2.1 - -* Added support for getDownloadUrl. - -## 0.2.0 - -* **Breaking change**. Set SDK constraints to match the Flutter beta release. - -## 0.1.5 - -* Fix Dart 2 type errors. - -## 0.1.4 - -* Enabled use in Swift projects. - -## 0.1.3 - -* Added StorageReference `path` getter to retrieve the path component for the storage node. - -## 0.1.2 - -* Added StorageReference delete function to remove files from Firebase. - -## 0.1.1 - -* Simplified and upgraded Android project template to Android SDK 27. -* Updated package description. - -## 0.1.0 - -* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin - 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in - order to use this version of the plugin. Instructions can be found - [here](https://github.com/flutter/flutter/wiki/Updating-Flutter-projects-to-Gradle-4.1-and-Android-Studio-Gradle-plugin-3.0.1). -* Relaxed GMS dependency to [11.4.0,12.0[ - -## 0.0.8 - -* Added FLT prefix to iOS types -* Change GMS dependency to 11.4.+ - -## 0.0.7 - -* Change GMS dependency to 11.+ - -## 0.0.6 - -* Added StorageReference getData function to download files into memory. - -## 0.0.5+1 - -* Aligned author name with rest of repo. - -## 0.0.5 - -* Updated to Firebase SDK to always use latest patch version for 11.0.x builds -* Fix crash when encountering upload failure - -## 0.0.4 - -* Updated to Firebase SDK Version 11.0.1 - -## 0.0.3 - -* Suppress unchecked warnings - -## 0.0.2 - -* Bumped buildToolsVersion to 25.0.3 -* Updated README - -## 0.0.1 - -* Initial Release diff --git a/packages/firebase_storage/LICENSE b/packages/firebase_storage/LICENSE deleted file mode 100755 index 000b4618d2bd..000000000000 --- a/packages/firebase_storage/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/firebase_storage/README.md b/packages/firebase_storage/README.md deleted file mode 100755 index 70aea955cd52..000000000000 --- a/packages/firebase_storage/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Firebase Cloud Storage for Flutter - -[![pub package](https://img.shields.io/pub/v/firebase_storage.svg)](https://pub.dartlang.org/packages/firebase_storage) - -A Flutter plugin to use the [Firebase Cloud Storage API](https://firebase.google.com/products/storage/). - -For Flutter plugins for other Firebase products, see [FlutterFire.md](https://github.com/flutter/plugins/blob/master/FlutterFire.md). - -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/flutter/flutter/issues) and [Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome! - -## Usage - -To use this plugin, add `firebase_storage` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). - -### Logging - -If you wish to see status events for your upload tasks in your logs, you should listen to the `StorageUploadTask.events` stream. -This could look like the following if you are using `StorageReference.putData`: - -```dart -final StorageReference storageReference = FirebaseStorage().ref().child(path); - -final StorageUploadTask uploadTask = storageReference.putData(data); - -final StreamSubscription streamSubscription = uploadTask.events.listen((event) { - // You can use this to notify yourself or your user in any kind of way. - // For example: you could use the uploadTask.events stream in a StreamBuilder instead - // to show your user what the current status is. In that case, you would not need to cancel any - // subscription as StreamBuilder handles this automatically. - - // Here, every StorageTaskEvent concerning the upload is printed to the logs. - print('EVENT ${event.type}'); -}); - -// Cancel your subscription when done. -await uploadTask.onComplete; -streamSubscription.cancel(); -``` - -## Getting Started - -See the `example` directory for a complete sample app using Firebase Cloud Storage. diff --git a/packages/firebase_storage/android/build.gradle b/packages/firebase_storage/android/build.gradle deleted file mode 100755 index 63ff9a1c681a..000000000000 --- a/packages/firebase_storage/android/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def PLUGIN = "firebase_storage"; -def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; -gradle.buildFinished { buildResult -> - if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { - println ' *********************************************************' - println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' - println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' - println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' - println ' *********************************************************' - rootProject.ext.set(ANDROIDX_WARNING, true); - } -} - -group 'io.flutter.plugins.firebase.storage' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -allprojects { - gradle.projectsEvaluated { - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - } - } -} - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 28 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } - dependencies { - api 'com.google.firebase:firebase-storage:17.0.0' - implementation 'com.google.firebase:firebase-common:16.1.0' - implementation 'androidx.annotation:annotation:1.0.0' - } -} - -apply from: file("./user-agent.gradle") diff --git a/packages/firebase_storage/android/gradle.properties b/packages/firebase_storage/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_storage/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_storage/android/settings.gradle b/packages/firebase_storage/android/settings.gradle deleted file mode 100755 index f0aec4453e6d..000000000000 --- a/packages/firebase_storage/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'firebase_storage' diff --git a/packages/firebase_storage/android/src/main/AndroidManifest.xml b/packages/firebase_storage/android/src/main/AndroidManifest.xml deleted file mode 100755 index 0e72a41f0472..000000000000 --- a/packages/firebase_storage/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/packages/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java b/packages/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java deleted file mode 100755 index 406956da7608..000000000000 --- a/packages/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.storage; - -import android.net.Uri; -import android.util.SparseArray; -import android.webkit.MimeTypeMap; -import androidx.annotation.NonNull; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.OnSuccessListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.FirebaseApp; -import com.google.firebase.storage.FileDownloadTask; -import com.google.firebase.storage.FirebaseStorage; -import com.google.firebase.storage.OnPausedListener; -import com.google.firebase.storage.OnProgressListener; -import com.google.firebase.storage.StorageException; -import com.google.firebase.storage.StorageMetadata; -import com.google.firebase.storage.StorageReference; -import com.google.firebase.storage.UploadTask; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.PluginRegistry.Registrar; -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -/** FirebaseStoragePlugin */ -public class FirebaseStoragePlugin implements MethodCallHandler { - private FirebaseStorage firebaseStorage; - private final MethodChannel channel; - - private int nextUploadHandle = 0; - private final SparseArray uploadTasks = new SparseArray<>(); - - public static void registerWith(Registrar registrar) { - final MethodChannel channel = - new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_storage"); - channel.setMethodCallHandler(new FirebaseStoragePlugin(channel, registrar)); - } - - private FirebaseStoragePlugin(MethodChannel channel, Registrar registrar) { - this.channel = channel; - FirebaseApp.initializeApp(registrar.context()); - } - - @Override - public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result) { - String app = call.argument("app"); - String storageBucket = call.argument("bucket"); - if (app == null && storageBucket == null) { - firebaseStorage = FirebaseStorage.getInstance(); - } else if (storageBucket == null) { - firebaseStorage = FirebaseStorage.getInstance(FirebaseApp.getInstance(app)); - } else if (app == null) { - firebaseStorage = FirebaseStorage.getInstance(storageBucket); - } else { - firebaseStorage = FirebaseStorage.getInstance(FirebaseApp.getInstance(app), storageBucket); - } - - switch (call.method) { - case "FirebaseStorage#getMaxDownloadRetryTime": - result.success(firebaseStorage.getMaxDownloadRetryTimeMillis()); - break; - case "FirebaseStorage#getMaxUploadRetryTime": - result.success(firebaseStorage.getMaxUploadRetryTimeMillis()); - break; - case "FirebaseStorage#getMaxOperationRetryTime": - result.success(firebaseStorage.getMaxOperationRetryTimeMillis()); - break; - case "FirebaseStorage#setMaxDownloadRetryTime": - setMaxDownloadRetryTimeMillis(call, result); - break; - case "FirebaseStorage#setMaxUploadRetryTime": - setMaxUploadRetryTimeMillis(call, result); - break; - case "FirebaseStorage#setMaxOperationRetryTime": - setMaxOperationTimeMillis(call, result); - break; - case "FirebaseStorage#getReferenceFromUrl": - getReferenceFromUrl(call, result); - break; - case "StorageReference#putFile": - putFile(call, result); - break; - case "StorageReference#putData": - putData(call, result); - break; - case "StorageReference#getData": - getData(call, result); - break; - case "StorageReference#delete": - delete(call, result); - break; - case "StorageReference#getBucket": - getBucket(call, result); - break; - case "StorageReference#getName": - getName(call, result); - break; - case "StorageReference#getPath": - getPath(call, result); - break; - case "StorageReference#getDownloadUrl": - getDownloadUrl(call, result); - break; - case "StorageReference#getMetadata": - getMetadata(call, result); - break; - case "StorageReference#updateMetadata": - updateMetadata(call, result); - break; - case "StorageReference#writeToFile": - writeToFile(call, result); - break; - case "UploadTask#pause": - pauseUploadTask(call, result); - break; - case "UploadTask#resume": - resumeUploadTask(call, result); - break; - case "UploadTask#cancel": - cancelUploadTask(call, result); - break; - default: - result.notImplemented(); - break; - } - } - - private void setMaxDownloadRetryTimeMillis(MethodCall call, Result result) { - Number time = call.argument("time"); - firebaseStorage.setMaxDownloadRetryTimeMillis(time.longValue()); - result.success(null); - } - - private void setMaxUploadRetryTimeMillis(MethodCall call, Result result) { - Number time = call.argument("time"); - firebaseStorage.setMaxUploadRetryTimeMillis(time.longValue()); - result.success(null); - } - - private void setMaxOperationTimeMillis(MethodCall call, Result result) { - Number time = call.argument("time"); - firebaseStorage.setMaxOperationRetryTimeMillis(time.longValue()); - result.success(null); - } - - private void getReferenceFromUrl(MethodCall call, Result result) { - String fullUrl = call.argument("fullUrl"); - StorageReference ref = firebaseStorage.getReferenceFromUrl(fullUrl); - result.success(ref != null ? ref.getPath() : null); - } - - private void getMetadata(MethodCall call, final Result result) { - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - ref.getMetadata() - .addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(StorageMetadata storageMetadata) { - result.success(buildMapFromMetadata(storageMetadata)); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("metadata_error", e.getMessage(), null); - } - }); - } - - private void updateMetadata(MethodCall call, final Result result) { - String path = call.argument("path"); - Map metadata = call.argument("metadata"); - StorageReference ref = firebaseStorage.getReference().child(path); - ref.updateMetadata(buildMetadataFromMap(metadata)) - .addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(StorageMetadata storageMetadata) { - result.success(buildMapFromMetadata(storageMetadata)); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("metadata_error", e.getMessage(), null); - } - }); - } - - private void getBucket(MethodCall call, final Result result) { - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - result.success(ref.getBucket()); - } - - private void getName(MethodCall call, final Result result) { - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - result.success(ref.getName()); - } - - private void getPath(MethodCall call, final Result result) { - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - result.success(ref.getPath()); - } - - private void getDownloadUrl(MethodCall call, final Result result) { - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - ref.getDownloadUrl() - .addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(Uri uri) { - result.success(uri.toString()); - } - }) - .addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("download_error", e.getMessage(), null); - } - }); - } - - private void delete(MethodCall call, final Result result) { - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - final Task deleteTask = ref.delete(); - deleteTask.addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(Void aVoid) { - result.success(null); - } - }); - deleteTask.addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("deletion_error", e.getMessage(), null); - } - }); - } - - private void putFile(MethodCall call, Result result) { - String filename = call.argument("filename"); - String path = call.argument("path"); - File file = new File(filename); - final Uri fileUri = Uri.fromFile(file); - Map metadata = call.argument("metadata"); - metadata = ensureMimeType(metadata, fileUri); - - StorageReference ref = firebaseStorage.getReference().child(path); - final UploadTask uploadTask = ref.putFile(fileUri, buildMetadataFromMap(metadata)); - final int handle = addUploadListeners(uploadTask); - result.success(handle); - } - - private void putData(MethodCall call, Result result) { - byte[] bytes = call.argument("data"); - String path = call.argument("path"); - Map metadata = call.argument("metadata"); - StorageReference ref = firebaseStorage.getReference().child(path); - UploadTask uploadTask; - if (metadata == null) { - uploadTask = ref.putBytes(bytes); - } else { - uploadTask = ref.putBytes(bytes, buildMetadataFromMap(metadata)); - } - final int handle = addUploadListeners(uploadTask); - result.success(handle); - } - - private StorageMetadata buildMetadataFromMap(Map map) { - StorageMetadata.Builder builder = new StorageMetadata.Builder(); - builder.setCacheControl((String) map.get("cacheControl")); - builder.setContentEncoding((String) map.get("contentEncoding")); - builder.setContentDisposition((String) map.get("contentDisposition")); - builder.setContentLanguage((String) map.get("contentLanguage")); - builder.setContentType((String) map.get("contentType")); - - @SuppressWarnings("unchecked") - Map customMetadata = (Map) map.get("customMetadata"); - if (customMetadata != null) { - for (String key : customMetadata.keySet()) { - builder.setCustomMetadata(key, customMetadata.get(key)); - } - } - return builder.build(); - } - - private Map buildMapFromMetadata(StorageMetadata storageMetadata) { - Map map = new HashMap<>(); - map.put("name", storageMetadata.getName()); - map.put("bucket", storageMetadata.getBucket()); - map.put("generation", storageMetadata.getGeneration()); - map.put("metadataGeneration", storageMetadata.getMetadataGeneration()); - map.put("path", storageMetadata.getPath()); - map.put("sizeBytes", storageMetadata.getSizeBytes()); - map.put("creationTimeMillis", storageMetadata.getCreationTimeMillis()); - map.put("updatedTimeMillis", storageMetadata.getUpdatedTimeMillis()); - map.put("md5Hash", storageMetadata.getMd5Hash()); - map.put("cacheControl", storageMetadata.getCacheControl()); - map.put("contentDisposition", storageMetadata.getContentDisposition()); - map.put("contentEncoding", storageMetadata.getContentEncoding()); - map.put("contentLanguage", storageMetadata.getContentLanguage()); - map.put("contentType", storageMetadata.getContentType()); - - Map customMetadata = new HashMap<>(); - for (String key : storageMetadata.getCustomMetadataKeys()) { - customMetadata.put(key, storageMetadata.getCustomMetadata(key)); - } - map.put("customMetadata", customMetadata); - return map; - } - - private void getData(MethodCall call, final Result result) { - Integer maxSize = call.argument("maxSize"); - String path = call.argument("path"); - StorageReference ref = firebaseStorage.getReference().child(path); - Task downloadTask = ref.getBytes(maxSize); - downloadTask.addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(byte[] bytes) { - result.success(bytes); - } - }); - downloadTask.addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("download_error", e.getMessage(), null); - } - }); - } - - private void writeToFile(MethodCall call, final Result result) { - String path = call.argument("path"); - String filePath = call.argument("filePath"); - File file = new File(filePath); - StorageReference ref = firebaseStorage.getReference().child(path); - FileDownloadTask downloadTask = ref.getFile(file); - downloadTask.addOnSuccessListener( - new OnSuccessListener() { - @Override - public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) { - result.success(taskSnapshot.getTotalByteCount()); - } - }); - downloadTask.addOnFailureListener( - new OnFailureListener() { - @Override - public void onFailure(@NonNull Exception e) { - result.error("download_error", e.getMessage(), null); - } - }); - } - - private void pauseUploadTask(MethodCall call, final Result result) { - int handle = call.argument("handle"); - UploadTask task = uploadTasks.get(handle); - if (task != null) { - task.pause(); - result.success(null); - } else { - result.error("pause_error", "task == null", null); - } - } - - private void cancelUploadTask(MethodCall call, final Result result) { - int handle = call.argument("handle"); - UploadTask task = uploadTasks.get(handle); - if (task != null) { - task.cancel(); - result.success(null); - } else { - result.error("cancel_error", "task == null", null); - } - } - - private void resumeUploadTask(MethodCall call, @NonNull final Result result) { - int handle = call.argument("handle"); - UploadTask task = uploadTasks.get(handle); - if (task != null) { - task.resume(); - result.success(null); - } else { - result.error("resume_error", "task == null", null); - } - } - - private int addUploadListeners(final UploadTask uploadTask) { - final int handle = ++nextUploadHandle; - uploadTask - .addOnProgressListener( - new OnProgressListener() { - @Override - public void onProgress(UploadTask.TaskSnapshot snapshot) { - invokeStorageTaskEvent(handle, StorageTaskEventType.progress, snapshot, null); - } - }) - .addOnPausedListener( - new OnPausedListener() { - @Override - public void onPaused(UploadTask.TaskSnapshot snapshot) { - invokeStorageTaskEvent(handle, StorageTaskEventType.pause, snapshot, null); - } - }) - .addOnCompleteListener( - new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - invokeStorageTaskEvent( - handle, - StorageTaskEventType.failure, - uploadTask.getSnapshot(), - (StorageException) task.getException()); - } else { - invokeStorageTaskEvent( - handle, StorageTaskEventType.success, task.getResult(), null); - } - uploadTasks.remove(handle); - } - }); - uploadTasks.put(handle, uploadTask); - return handle; - } - - private enum StorageTaskEventType { - resume, - progress, - pause, - success, - failure - } - - private void invokeStorageTaskEvent( - int handle, - StorageTaskEventType type, - UploadTask.TaskSnapshot snapshot, - StorageException error) { - channel.invokeMethod("StorageTaskEvent", buildMapFromTaskEvent(handle, type, snapshot, error)); - } - - private Map buildMapFromTaskEvent( - int handle, - StorageTaskEventType type, - UploadTask.TaskSnapshot snapshot, - StorageException error) { - Map map = new HashMap<>(); - map.put("handle", handle); - map.put("type", type.ordinal()); - map.put("snapshot", buildMapFromTaskSnapshot(snapshot, error)); - return map; - } - - private Map buildMapFromTaskSnapshot( - UploadTask.TaskSnapshot snapshot, StorageException error) { - Map map = new HashMap<>(); - map.put("bytesTransferred", snapshot.getBytesTransferred()); - map.put("totalByteCount", snapshot.getTotalByteCount()); - if (snapshot.getUploadSessionUri() != null) { - map.put("uploadSessionUri", snapshot.getUploadSessionUri().toString()); - } - if (error != null) { - map.put("error", error.getErrorCode()); - } - if (snapshot.getMetadata() != null) { - map.put("storageMetadata", buildMapFromMetadata(snapshot.getMetadata())); - } - return map; - } - - private Map ensureMimeType(Map metadata, Uri file) { - if (metadata == null) { - metadata = new HashMap<>(); - } - - if (metadata.get("contentType") == null) { - metadata.put("contentType", getMimeType(file)); - } - - return metadata; - } - - private static String getMimeType(Uri file) { - String type = null; - String extension = MimeTypeMap.getFileExtensionFromUrl(file.toString()); - if (extension != null) { - type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - } - return type; - } -} diff --git a/packages/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseAppRegistrar.java b/packages/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseAppRegistrar.java deleted file mode 100644 index a3b58d0fbe2f..000000000000 --- a/packages/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseAppRegistrar.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebase.storage; - -import com.google.firebase.components.Component; -import com.google.firebase.components.ComponentRegistrar; -import com.google.firebase.platforminfo.LibraryVersionComponent; -import java.util.Collections; -import java.util.List; - -public class FlutterFirebaseAppRegistrar implements ComponentRegistrar { - @Override - public List> getComponents() { - return Collections.>singletonList( - LibraryVersionComponent.create(BuildConfig.LIBRARY_NAME, BuildConfig.LIBRARY_VERSION)); - } -} diff --git a/packages/firebase_storage/android/user-agent.gradle b/packages/firebase_storage/android/user-agent.gradle deleted file mode 100644 index 0311d5695937..000000000000 --- a/packages/firebase_storage/android/user-agent.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import java.util.regex.Matcher -import java.util.regex.Pattern - -String libraryVersionName = "UNKNOWN" -String libraryName = "flutter-fire-gcs" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") -} - -android { - defaultConfig { - // BuildConfig.VERSION_NAME - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersionName}\"" - // BuildConfig.LIBRARY_NAME - buildConfigField 'String', 'LIBRARY_NAME', "\"${libraryName}\"" - } -} diff --git a/packages/firebase_storage/example/README.md b/packages/firebase_storage/example/README.md deleted file mode 100755 index 8ed83b61da22..000000000000 --- a/packages/firebase_storage/example/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# firebase_storage_example - -Demonstrates how to use the firebase_storage plugin. - -## Getting Started - -For help getting started with Flutter, view our online -[documentation](http://flutter.io/). diff --git a/packages/firebase_storage/example/android.iml b/packages/firebase_storage/example/android.iml deleted file mode 100755 index 462b903e05b6..000000000000 --- a/packages/firebase_storage/example/android.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/firebase_storage/example/android/app/build.gradle b/packages/firebase_storage/example/android/app/build.gradle deleted file mode 100755 index e40ea979a675..000000000000 --- a/packages/firebase_storage/example/android/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId 'io.flutter.plugins.firebasestorageexample' - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} - -apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_storage/example/android/app/google-services.json b/packages/firebase_storage/example/android/app/google-services.json deleted file mode 100755 index 52dd25ca3f63..000000000000 --- a/packages/firebase_storage/example/android/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "159623150305", - "firebase_url": "https://flutter-firebase-plugins.firebaseio.com", - "project_id": "flutter-firebase-plugins", - "storage_bucket": "flutter-firebase-plugins.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:ef48439a0cc0263d", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasestorageexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} diff --git a/packages/firebase_storage/example/android/app/gradle.properties b/packages/firebase_storage/example/android/app/gradle.properties deleted file mode 100644 index 5465fec0ecad..000000000000 --- a/packages/firebase_storage/example/android/app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/packages/firebase_storage/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_storage/example/android/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9a4163a4f5ee..000000000000 --- a/packages/firebase_storage/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/packages/firebase_storage/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_storage/example/android/app/src/main/AndroidManifest.xml deleted file mode 100755 index c2ce4f809e56..000000000000 --- a/packages/firebase_storage/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/firebase_storage/example/android/app/src/main/java/io/flutter/plugins/firebasestorageexample/MainActivity.java b/packages/firebase_storage/example/android/app/src/main/java/io/flutter/plugins/firebasestorageexample/MainActivity.java deleted file mode 100644 index 4fa7818db065..000000000000 --- a/packages/firebase_storage/example/android/app/src/main/java/io/flutter/plugins/firebasestorageexample/MainActivity.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package io.flutter.plugins.firebasestorageexample; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/packages/firebase_storage/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_storage/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index db77bb4b7b09..000000000000 Binary files a/packages/firebase_storage/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_storage/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_storage/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index 17987b79bb8a..000000000000 Binary files a/packages/firebase_storage/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_storage/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_storage/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 09d4391482be..000000000000 Binary files a/packages/firebase_storage/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_storage/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_storage/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index d5f1c8d34e7a..000000000000 Binary files a/packages/firebase_storage/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_storage/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_storage/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 4d6372eebdb2..000000000000 Binary files a/packages/firebase_storage/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/firebase_storage/example/android/build.gradle b/packages/firebase_storage/example/android/build.gradle deleted file mode 100755 index 695de848ec30..000000000000 --- a/packages/firebase_storage/example/android/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - mavenLocal() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.google.gms:google-services:4.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenLocal() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/packages/firebase_storage/example/android/gradle.properties b/packages/firebase_storage/example/android/gradle.properties deleted file mode 100755 index 8bd86f680510..000000000000 --- a/packages/firebase_storage/example/android/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M diff --git a/packages/firebase_storage/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_storage/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 019065d1d650..000000000000 --- a/packages/firebase_storage/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/packages/firebase_storage/example/android/settings.gradle b/packages/firebase_storage/example/android/settings.gradle deleted file mode 100755 index 115da6cb4f4d..000000000000 --- a/packages/firebase_storage/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withInputStream { stream -> plugins.load(stream) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/packages/firebase_storage/example/firebase_storage_example.iml b/packages/firebase_storage/example/firebase_storage_example.iml deleted file mode 100755 index 1ae40a0f7f54..000000000000 --- a/packages/firebase_storage/example/firebase_storage_example.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100755 index 6c2de8086bcd..000000000000 --- a/packages/firebase_storage/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 8.0 - - diff --git a/packages/firebase_storage/example/ios/Flutter/Debug.xcconfig b/packages/firebase_storage/example/ios/Flutter/Debug.xcconfig deleted file mode 100755 index 9803018ca79d..000000000000 --- a/packages/firebase_storage/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/packages/firebase_storage/example/ios/Flutter/Release.xcconfig b/packages/firebase_storage/example/ios/Flutter/Release.xcconfig deleted file mode 100755 index a4a8c604e13d..000000000000 --- a/packages/firebase_storage/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Generated.xcconfig" -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/packages/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 54e5e34c25f9..000000000000 --- a/packages/firebase_storage/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,481 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */; }; - 7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - CE57DC9C9240FBD15E358E24 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 840012C8B5EDBCF56B0E4AC1 /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 840012C8B5EDBCF56B0E4AC1 /* Pods */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */, - 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */, - 7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */, - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { - isa = PBXGroup; - children = ( - E13AAF33B0B411D7B2D38642 /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7A1ECC911E8EDB6900309407 /* GoogleService-Info.plist in Resources */, - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 95BB15E9E1769C0D146AA592 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - AB1344B0443C71CD721E1BB7 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseStorageExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ARCHS = arm64; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.flutter.plugins.firebaseStorageExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/firebase_storage/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/firebase_storage/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_storage/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_storage/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_storage/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index 1c9580788197..000000000000 --- a/packages/firebase_storage/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_storage/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/firebase_storage/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 21a3cc14c74e..000000000000 --- a/packages/firebase_storage/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/firebase_storage/example/ios/Runner/AppDelegate.h b/packages/firebase_storage/example/ios/Runner/AppDelegate.h deleted file mode 100644 index d9e18e990f2e..000000000000 --- a/packages/firebase_storage/example/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/packages/firebase_storage/example/ios/Runner/AppDelegate.m b/packages/firebase_storage/example/ios/Runner/AppDelegate.m deleted file mode 100644 index a4b51c88eb60..000000000000 --- a/packages/firebase_storage/example/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index d22f10b2ab63..000000000000 --- a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100755 index 28c6bf03016f..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100755 index f091b6b0bca8..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100755 index 4cde12118dda..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100755 index d0ef06e7edb8..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100755 index dcdc2306c285..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100755 index 2ccbfd967d96..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100755 index c8f9ed8f5cee..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100755 index a6d6b8609df0..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100755 index 75b2d164a5a9..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100755 index c4df70d39da7..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100755 index 6a84f41e14e2..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100755 index d0e1f5853602..000000000000 Binary files a/packages/firebase_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/firebase_storage/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_storage/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100755 index ebf48f603974..000000000000 --- a/packages/firebase_storage/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_storage/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_storage/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100755 index f3c28516fb38..000000000000 --- a/packages/firebase_storage/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/firebase_storage/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_storage/example/ios/Runner/GoogleService-Info.plist deleted file mode 100755 index 7444d8aa0ea0..000000000000 --- a/packages/firebase_storage/example/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - AD_UNIT_ID_FOR_BANNER_TEST - ca-app-pub-3940256099942544/2934735716 - AD_UNIT_ID_FOR_INTERSTITIAL_TEST - ca-app-pub-3940256099942544/4411468910 - CLIENT_ID - 159623150305-onp22gvn556sp5l47l9o7r8em82l7f1e.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.159623150305-onp22gvn556sp5l47l9o7r8em82l7f1e - API_KEY - AIzaSyDyzecVw1zXTpBKwfFHxpl7QyYBhimNhUk - GCM_SENDER_ID - 159623150305 - PLIST_VERSION - 1 - BUNDLE_ID - io.flutter.plugins.firebaseStorageExample - PROJECT_ID - flutter-firebase-plugins - STORAGE_BUCKET - flutter-firebase-plugins.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:159623150305:ios:4a213ef3dbd8997b - DATABASE_URL - https://flutter-firebase-plugins.firebaseio.com - - diff --git a/packages/firebase_storage/example/ios/Runner/Info.plist b/packages/firebase_storage/example/ios/Runner/Info.plist deleted file mode 100755 index 6e4ed61c7cbc..000000000000 --- a/packages/firebase_storage/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - firebase_storage_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/packages/firebase_storage/example/ios/Runner/main.m b/packages/firebase_storage/example/ios/Runner/main.m deleted file mode 100644 index bec320c0bee0..000000000000 --- a/packages/firebase_storage/example/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/firebase_storage/example/lib/main.dart b/packages/firebase_storage/example/lib/main.dart deleted file mode 100755 index f388435938c2..000000000000 --- a/packages/firebase_storage/example/lib/main.dart +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:io'; - -import 'package:firebase_core/firebase_core.dart'; -import 'package:firebase_storage/firebase_storage.dart'; -import 'package:flutter/material.dart'; -import 'package:http/http.dart' as http; -import 'package:uuid/uuid.dart'; - -const String kTestString = 'Hello world!'; - -void main() async { - final FirebaseApp app = await FirebaseApp.configure( - name: 'test', - options: FirebaseOptions( - googleAppID: Platform.isIOS - ? '1:159623150305:ios:4a213ef3dbd8997b' - : '1:159623150305:android:ef48439a0cc0263d', - gcmSenderID: '159623150305', - apiKey: 'AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg', - projectID: 'flutter-firebase-plugins', - ), - ); - final FirebaseStorage storage = FirebaseStorage( - app: app, storageBucket: 'gs://flutter-firebase-plugins.appspot.com'); - runApp(MyApp(storage: storage)); -} - -class MyApp extends StatelessWidget { - MyApp({this.storage}); - final FirebaseStorage storage; - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Storage Example', - home: MyHomePage(storage: storage), - ); - } -} - -class MyHomePage extends StatefulWidget { - MyHomePage({this.storage}); - final FirebaseStorage storage; - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - GlobalKey _scaffoldKey = GlobalKey(); - List _tasks = []; - - Future _uploadFile() async { - final String uuid = Uuid().v1(); - final Directory systemTempDir = Directory.systemTemp; - final File file = await File('${systemTempDir.path}/foo$uuid.txt').create(); - await file.writeAsString(kTestString); - assert(await file.readAsString() == kTestString); - final StorageReference ref = - widget.storage.ref().child('text').child('foo$uuid.txt'); - final StorageUploadTask uploadTask = ref.putFile( - file, - StorageMetadata( - contentLanguage: 'en', - customMetadata: {'activity': 'test'}, - ), - ); - - setState(() { - _tasks.add(uploadTask); - }); - } - - Future _downloadFile(StorageReference ref) async { - final String url = await ref.getDownloadURL(); - final String uuid = Uuid().v1(); - final http.Response downloadData = await http.get(url); - final Directory systemTempDir = Directory.systemTemp; - final File tempFile = File('${systemTempDir.path}/tmp$uuid.txt'); - if (tempFile.existsSync()) { - await tempFile.delete(); - } - await tempFile.create(); - assert(await tempFile.readAsString() == ""); - final StorageFileDownloadTask task = ref.writeToFile(tempFile); - final int byteCount = (await task.future).totalByteCount; - final String tempFileContents = await tempFile.readAsString(); - assert(tempFileContents == kTestString); - assert(byteCount == kTestString.length); - - final String fileContents = downloadData.body; - final String name = await ref.getName(); - final String bucket = await ref.getBucket(); - final String path = await ref.getPath(); - _scaffoldKey.currentState.showSnackBar(SnackBar( - content: Text( - 'Success!\n Downloaded $name \n from url: $url @ bucket: $bucket\n ' - 'at path: $path \n\nFile contents: "$fileContents" \n' - 'Wrote "$tempFileContents" to tmp.txt', - style: const TextStyle(color: Color.fromARGB(255, 0, 155, 0)), - ), - )); - } - - @override - Widget build(BuildContext context) { - final List children = []; - _tasks.forEach((StorageUploadTask task) { - final Widget tile = UploadTaskListTile( - task: task, - onDismissed: () => setState(() => _tasks.remove(task)), - onDownload: () => _downloadFile(task.lastSnapshot.ref), - ); - children.add(tile); - }); - return Scaffold( - key: _scaffoldKey, - appBar: AppBar( - title: const Text('Flutter Storage Example'), - actions: [ - IconButton( - icon: const Icon(Icons.clear_all), - onPressed: - _tasks.isNotEmpty ? () => setState(() => _tasks.clear()) : null, - ) - ], - ), - body: ListView( - children: children, - ), - floatingActionButton: FloatingActionButton( - onPressed: _uploadFile, - tooltip: 'Upload', - child: const Icon(Icons.file_upload), - ), - ); - } -} - -class UploadTaskListTile extends StatelessWidget { - const UploadTaskListTile( - {Key key, this.task, this.onDismissed, this.onDownload}) - : super(key: key); - - final StorageUploadTask task; - final VoidCallback onDismissed; - final VoidCallback onDownload; - - String get status { - String result; - if (task.isComplete) { - if (task.isSuccessful) { - result = 'Complete'; - } else if (task.isCanceled) { - result = 'Canceled'; - } else { - result = 'Failed ERROR: ${task.lastSnapshot.error}'; - } - } else if (task.isInProgress) { - result = 'Uploading'; - } else if (task.isPaused) { - result = 'Paused'; - } - return result; - } - - String _bytesTransferred(StorageTaskSnapshot snapshot) { - return '${snapshot.bytesTransferred}/${snapshot.totalByteCount}'; - } - - @override - Widget build(BuildContext context) { - return StreamBuilder( - stream: task.events, - builder: (BuildContext context, - AsyncSnapshot asyncSnapshot) { - Widget subtitle; - if (asyncSnapshot.hasData) { - final StorageTaskEvent event = asyncSnapshot.data; - final StorageTaskSnapshot snapshot = event.snapshot; - subtitle = Text('$status: ${_bytesTransferred(snapshot)} bytes sent'); - } else { - subtitle = const Text('Starting...'); - } - return Dismissible( - key: Key(task.hashCode.toString()), - onDismissed: (_) => onDismissed(), - child: ListTile( - title: Text('Upload Task #${task.hashCode}'), - subtitle: subtitle, - trailing: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Offstage( - offstage: !task.isInProgress, - child: IconButton( - icon: const Icon(Icons.pause), - onPressed: () => task.pause(), - ), - ), - Offstage( - offstage: !task.isPaused, - child: IconButton( - icon: const Icon(Icons.file_upload), - onPressed: () => task.resume(), - ), - ), - Offstage( - offstage: task.isComplete, - child: IconButton( - icon: const Icon(Icons.cancel), - onPressed: () => task.cancel(), - ), - ), - Offstage( - offstage: !(task.isComplete && task.isSuccessful), - child: IconButton( - icon: const Icon(Icons.file_download), - onPressed: onDownload, - ), - ), - ], - ), - ), - ); - }, - ); - } -} diff --git a/packages/firebase_storage/example/pubspec.yaml b/packages/firebase_storage/example/pubspec.yaml deleted file mode 100755 index 321265020fde..000000000000 --- a/packages/firebase_storage/example/pubspec.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: firebase_storage_example -description: Demonstrates how to use the firebase_storage plugin. -author: Flutter Team - -dependencies: - flutter: - sdk: flutter - firebase_storage: - path: ../ - firebase_core: ^0.4.0 - uuid: ^1.0.0 - http: ^0.12.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_driver: - sdk: flutter - test: any - -flutter: - uses-material-design: true - diff --git a/packages/firebase_storage/example/test_driver/firebase_storage.dart b/packages/firebase_storage/example/test_driver/firebase_storage.dart deleted file mode 100644 index 986439b4c649..000000000000 --- a/packages/firebase_storage/example/test_driver/firebase_storage.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'dart:async'; -import 'dart:io'; -import 'package:http/http.dart' as http; -import 'package:flutter_driver/driver_extension.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:firebase_storage/firebase_storage.dart'; -import 'package:uuid/uuid.dart'; - -void main() { - final Completer completer = Completer(); - enableFlutterDriverExtension(handler: (_) => completer.future); - tearDownAll(() => completer.complete(null)); - - group('$FirebaseStorage', () { - const String kTestString = 'hello world'; - FirebaseStorage firebaseStorage; - - setUp(() async { - firebaseStorage = FirebaseStorage(); - }); - - test('putFile, getDownloadURL, writeToFile', () async { - final String uuid = Uuid().v1(); - final Directory systemTempDir = Directory.systemTemp; - final File file = - await File('${systemTempDir.path}/foo$uuid.txt').create(); - await file.writeAsString(kTestString); - final StorageReference ref = - firebaseStorage.ref().child('text').child('foo$uuid.txt'); - expect(await ref.getName(), 'foo$uuid.txt'); - expect(await ref.getPath(), 'text/foo$uuid.txt'); - final StorageUploadTask uploadTask = ref.putFile( - file, - StorageMetadata( - contentLanguage: 'en', - customMetadata: {'activity': 'test'}, - ), - ); - final StorageTaskSnapshot complete = await uploadTask.onComplete; - expect(complete.storageMetadata.sizeBytes, kTestString.length); - expect(complete.storageMetadata.contentLanguage, 'en'); - expect(complete.storageMetadata.customMetadata['activity'], 'test'); - - final String url = await ref.getDownloadURL(); - final http.Response downloadData = await http.get(url); - expect(downloadData.body, kTestString); - expect(downloadData.headers['content-type'], 'text/plain'); - final File tempFile = File('${systemTempDir.path}/tmp$uuid.txt'); - if (tempFile.existsSync()) { - await tempFile.delete(); - } - await tempFile.create(); - expect(await tempFile.readAsString(), ''); - final StorageFileDownloadTask task = ref.writeToFile(tempFile); - final int byteCount = (await task.future).totalByteCount; - final String tempFileContents = await tempFile.readAsString(); - expect(tempFileContents, kTestString); - expect(byteCount, kTestString.length); - }); - }); -} diff --git a/packages/firebase_storage/example/test_driver/firebase_storage_test.dart b/packages/firebase_storage/example/test_driver/firebase_storage_test.dart deleted file mode 100644 index 38fe6c447e05..000000000000 --- a/packages/firebase_storage/example/test_driver/firebase_storage_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_driver/flutter_driver.dart'; - -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); -} diff --git a/packages/firebase_storage/ios/Assets/.gitkeep b/packages/firebase_storage/ios/Assets/.gitkeep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h b/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h deleted file mode 100644 index 4c7a7df05b13..000000000000 --- a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import - -@interface FLTFirebaseStoragePlugin : NSObject -@end diff --git a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m b/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m deleted file mode 100644 index 5fd11add6c85..000000000000 --- a/packages/firebase_storage/ios/Classes/FirebaseStoragePlugin.m +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FirebaseStoragePlugin.h" -#import "UserAgent.h" - -#import - -static FlutterError *getFlutterError(NSError *error) { - return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", (long)error.code] - message:error.domain - details:error.localizedDescription]; -} - -@interface FLTFirebaseStoragePlugin () -@property(nonatomic, retain) FlutterMethodChannel *channel; -@end - -@implementation FLTFirebaseStoragePlugin { - NSMutableDictionary *> *_storageMap; - FIRStorage *storage; - int _nextUploadHandle; - NSMutableDictionary *_uploadTasks; -} - -+ (void)registerWithRegistrar:(NSObject *)registrar { - FlutterMethodChannel *channel = - [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_storage" - binaryMessenger:[registrar messenger]]; - FLTFirebaseStoragePlugin *instance = [[FLTFirebaseStoragePlugin alloc] init]; - instance.channel = channel; - [registrar addMethodCallDelegate:instance channel:channel]; - - SEL sel = NSSelectorFromString(@"registerLibrary:withVersion:"); - if ([FIRApp respondsToSelector:sel]) { - [FIRApp performSelector:sel withObject:LIBRARY_NAME withObject:LIBRARY_VERSION]; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { - NSLog(@"Configuring the default Firebase app..."); - [FIRApp configure]; - NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); - } - _storageMap = [[NSMutableDictionary alloc] init]; - _uploadTasks = [NSMutableDictionary dictionary]; - _nextUploadHandle = 0; - } - return self; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - storage = [self getStorage:call result:result]; - if ([@"FirebaseStorage#getMaxDownloadRetryTime" isEqualToString:call.method]) { - result(@((int64_t)(storage.maxDownloadRetryTime * 1000.0))); - } else if ([@"FirebaseStorage#getMaxUploadRetryTime" isEqualToString:call.method]) { - result(@((int64_t)(storage.maxUploadRetryTime * 1000.0))); - } else if ([@"FirebaseStorage#getMaxOperationRetryTime" isEqualToString:call.method]) { - result(@((int64_t)(storage.maxOperationRetryTime * 1000.0))); - } else if ([@"FirebaseStorage#setMaxDownloadRetryTime" isEqualToString:call.method]) { - [self setMaxDownloadRetryTime:call result:result]; - } else if ([@"FirebaseStorage#setMaxUploadRetryTime" isEqualToString:call.method]) { - [self setMaxUploadRetryTime:call result:result]; - } else if ([@"FirebaseStorage#setMaxOperationRetryTime" isEqualToString:call.method]) { - [self setMaxOperationRetryTime:call result:result]; - } else if ([@"FirebaseStorage#getReferenceFromUrl" isEqualToString:call.method]) { - [self getReferenceFromUrl:call result:result]; - } else if ([@"StorageReference#putFile" isEqualToString:call.method]) { - [self putFile:call result:result]; - } else if ([@"StorageReference#putData" isEqualToString:call.method]) { - [self putData:call result:result]; - } else if ([@"StorageReference#getData" isEqualToString:call.method]) { - [self getData:call result:result]; - } else if ([@"StorageReference#getBucket" isEqualToString:call.method]) { - [self getBucket:call result:result]; - } else if ([@"StorageReference#getPath" isEqualToString:call.method]) { - [self getPath:call result:result]; - } else if ([@"StorageReference#getName" isEqualToString:call.method]) { - [self getName:call result:result]; - } else if ([@"StorageReference#getDownloadUrl" isEqualToString:call.method]) { - [self getDownloadUrl:call result:result]; - } else if ([@"StorageReference#delete" isEqualToString:call.method]) { - [self delete:call result:result]; - } else if ([@"StorageReference#getMetadata" isEqualToString:call.method]) { - [self getMetadata:call result:result]; - } else if ([@"StorageReference#updateMetadata" isEqualToString:call.method]) { - [self updateMetadata:call result:result]; - } else if ([@"StorageReference#writeToFile" isEqualToString:call.method]) { - [self writeToFile:call result:result]; - } else if ([@"UploadTask#pause" isEqualToString:call.method]) { - [self pauseUploadTask:call result:result]; - } else if ([@"UploadTask#resume" isEqualToString:call.method]) { - [self resumeUploadTask:call result:result]; - } else if ([@"UploadTask#cancel" isEqualToString:call.method]) { - [self cancelUploadTask:call result:result]; - } else { - result(FlutterMethodNotImplemented); - } -} - -// Returns a [FIRStorage] instance which is a singleton given a fixed app and bucket. -// This is to be consistent with the Android API so that repated calls to getters/setters -// affect the right [FIRStorage] instance. -- (FIRStorage *)getStorage:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *appName = call.arguments[@"app"]; - NSString *bucketUrl = call.arguments[@"bucket"]; - FIRApp *app; - - if ([appName isEqual:[NSNull null]]) { - app = [FIRApp defaultApp]; - } else { - app = [FIRApp appNamed:appName]; - } - - if ([bucketUrl isEqual:[NSNull null]]) { - if (app.options.storageBucket) { - bucketUrl = [app.options.storageBucket isEqualToString:@""] - ? @"" - : [@"gs://" stringByAppendingString:app.options.storageBucket]; - } else { - bucketUrl = nil; - } - } - - NSURL *url = [NSURL URLWithString:bucketUrl]; - if (!url) { - @try { - // Call storage constructor to raise proper exception. - storage = [FIRStorage storageForApp:app URL:bucketUrl]; - } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"storage_error" - message:[exception name] - details:[exception reason]]); - } - } - - NSMutableDictionary *bucketMap = _storageMap[app.name]; - if (!bucketMap) { - bucketMap = [NSMutableDictionary dictionaryWithCapacity:1]; - _storageMap[app.name] = bucketMap; - } - - NSString *bucketName = [url host]; - FIRStorage *storage = bucketMap[bucketName]; - if (!storage) { - // Raises an exception if bucketUrl is invalid. - @try { - storage = [FIRStorage storageForApp:app URL:bucketUrl]; - } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"storage_error" - message:[exception name] - details:[exception reason]]); - } - bucketMap[bucketName] = storage; - } - - return storage; -} - -- (void)setMaxDownloadRetryTime:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *time = call.arguments[@"time"]; - storage.maxDownloadRetryTime = [time longLongValue] / 1000.0; - result(nil); -} - -- (void)setMaxUploadRetryTime:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *time = call.arguments[@"time"]; - storage.maxUploadRetryTime = [time longLongValue] / 1000.0; - result(nil); -} - -- (void)setMaxOperationRetryTime:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *time = call.arguments[@"time"]; - storage.maxOperationRetryTime = [time longLongValue] / 1000.0; - result(nil); -} - -- (void)getReferenceFromUrl:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *fullUrl = call.arguments[@"fullUrl"]; - result([storage referenceForURL:fullUrl].fullPath); -} - -- (void)putFile:(FlutterMethodCall *)call result:(FlutterResult)result { - NSURL *fileUrl = [NSURL fileURLWithPath:call.arguments[@"filename"]]; - [self - putHandler:^(FIRStorageReference *fileRef, FIRStorageMetadata *metadata) { - return [fileRef putFile:fileUrl metadata:metadata]; - } - call:call - result:result]; -} - -- (void)putData:(FlutterMethodCall *)call result:(FlutterResult)result { - NSData *data = [(FlutterStandardTypedData *)call.arguments[@"data"] data]; - if (data == nil) { - result([FlutterError errorWithCode:@"storage_error" - message:@"Failed to read file" - details:nil]); - return; - } - [self - putHandler:^(FIRStorageReference *fileRef, FIRStorageMetadata *metadata) { - return [fileRef putData:data metadata:metadata]; - } - call:call - result:result]; -} - -- (void)putHandler:(FIRStorageUploadTask * (^)(FIRStorageReference *fileRef, - FIRStorageMetadata *metadata))putHandler - call:(FlutterMethodCall *)call - result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - NSDictionary *metadataDictionary = call.arguments[@"metadata"]; - FIRStorageMetadata *metadata; - if (![metadataDictionary isEqual:[NSNull null]]) { - metadata = [self buildMetadataFromDictionary:metadataDictionary]; - } - FIRStorageReference *fileRef = [storage.reference child:path]; - FIRStorageUploadTask *uploadTask = putHandler(fileRef, metadata); - NSNumber *handle = [NSNumber numberWithInt:_nextUploadHandle++]; - [uploadTask observeStatus:FIRStorageTaskStatusSuccess - handler:^(FIRStorageTaskSnapshot *snapshot) { - [self invokeStorageTaskEvent:handle type:kSuccess snapshot:snapshot]; - [self->_uploadTasks removeObjectForKey:handle]; - }]; - [uploadTask observeStatus:FIRStorageTaskStatusProgress - handler:^(FIRStorageTaskSnapshot *snapshot) { - [self invokeStorageTaskEvent:handle type:kProgress snapshot:snapshot]; - }]; - [uploadTask observeStatus:FIRStorageTaskStatusResume - handler:^(FIRStorageTaskSnapshot *snapshot) { - [self invokeStorageTaskEvent:handle type:kResume snapshot:snapshot]; - }]; - [uploadTask observeStatus:FIRStorageTaskStatusPause - handler:^(FIRStorageTaskSnapshot *snapshot) { - [self invokeStorageTaskEvent:handle type:kPause snapshot:snapshot]; - }]; - [uploadTask observeStatus:FIRStorageTaskStatusFailure - handler:^(FIRStorageTaskSnapshot *snapshot) { - [self invokeStorageTaskEvent:handle type:kFailure snapshot:snapshot]; - [self->_uploadTasks removeObjectForKey:handle]; - }]; - _uploadTasks[handle] = uploadTask; - result(handle); -} - -typedef NS_ENUM(NSUInteger, StorageTaskEventType) { - kResume, - kProgress, - kPause, - kSuccess, - kFailure -}; - -- (void)invokeStorageTaskEvent:(NSNumber *)handle - type:(StorageTaskEventType)type - snapshot:(FIRStorageTaskSnapshot *)snapshot { - NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; - [dictionary setValue:handle forKey:@"handle"]; - [dictionary setValue:@((int)type) forKey:@"type"]; - [dictionary setValue:[self buildDictionaryFromTaskSnapshot:snapshot] forKey:@"snapshot"]; - [self.channel invokeMethod:@"StorageTaskEvent" arguments:dictionary]; -} - -- (NSDictionary *)buildDictionaryFromTaskSnapshot:(FIRStorageTaskSnapshot *)snapshot { - NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; - [dictionary setValue:@((long)([snapshot.progress completedUnitCount])) - forKey:@"bytesTransferred"]; - [dictionary setValue:@((long)([snapshot.progress totalUnitCount])) forKey:@"totalByteCount"]; - if ([snapshot error] != nil) { - [dictionary setValue:@((long)[snapshot.error code]) forKey:@"error"]; - } - if ([snapshot metadata] != nil) { - [dictionary setValue:[self buildDictionaryFromMetadata:snapshot.metadata] - forKey:@"storageMetadata"]; - } - return dictionary; -} - -- (FIRStorageMetadata *)buildMetadataFromDictionary:(NSDictionary *)dictionary { - FIRStorageMetadata *metadata = [[FIRStorageMetadata alloc] init]; - if (dictionary[@"cacheControl"] != [NSNull null]) - metadata.cacheControl = dictionary[@"cacheControl"]; - if (dictionary[@"contentDisposition"] != [NSNull null]) - metadata.contentDisposition = dictionary[@"contentDisposition"]; - if (dictionary[@"contentEncoding"] != [NSNull null]) - metadata.contentEncoding = dictionary[@"contentEncoding"]; - if (dictionary[@"contentLanguage"] != [NSNull null]) - metadata.contentLanguage = dictionary[@"contentLanguage"]; - if (dictionary[@"contentType"] != [NSNull null]) - metadata.contentType = dictionary[@"contentType"]; - if (dictionary[@"customMetadata"] != [NSNull null]) - metadata.customMetadata = dictionary[@"customMetadata"]; - return metadata; -} - -- (NSDictionary *)buildDictionaryFromMetadata:(FIRStorageMetadata *)metadata { - NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; - [dictionary setValue:[metadata bucket] forKey:@"bucket"]; - [dictionary setValue:[NSString stringWithFormat:@"%lld", [metadata generation]] - forKey:@"generation"]; - [dictionary setValue:[NSString stringWithFormat:@"%lld", [metadata metageneration]] - forKey:@"metadataGeneration"]; - [dictionary setValue:[metadata path] forKey:@"path"]; - [dictionary setValue:@((long)([[metadata timeCreated] timeIntervalSince1970] * 1000.0)) - forKey:@"creationTimeMillis"]; - [dictionary setValue:@((long)([[metadata updated] timeIntervalSince1970] * 1000.0)) - forKey:@"updatedTimeMillis"]; - [dictionary setValue:@([metadata size]) forKey:@"sizeBytes"]; - [dictionary setValue:[metadata md5Hash] forKey:@"md5Hash"]; - [dictionary setValue:[metadata cacheControl] forKey:@"cacheControl"]; - [dictionary setValue:[metadata contentDisposition] forKey:@"contentDisposition"]; - [dictionary setValue:[metadata contentEncoding] forKey:@"contentEncoding"]; - [dictionary setValue:[metadata contentLanguage] forKey:@"contentLanguage"]; - [dictionary setValue:[metadata contentType] forKey:@"contentType"]; - [dictionary setValue:[metadata name] forKey:@"name"]; - [dictionary setValue:[metadata customMetadata] forKey:@"customMetadata"]; - return dictionary; -} - -- (void)getData:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *maxSize = call.arguments[@"maxSize"]; - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - [ref dataWithMaxSize:[maxSize longLongValue] - completion:^(NSData *_Nullable data, NSError *_Nullable error) { - if (error != nil) { - result(getFlutterError(error)); - return; - } - if (data == nil) { - result(nil); - return; - } - - FlutterStandardTypedData *dartData = - [FlutterStandardTypedData typedDataWithBytes:data]; - result(dartData); - }]; -} - -- (void)writeToFile:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - NSString *filePath = call.arguments[@"filePath"]; - NSURL *localURL = [NSURL fileURLWithPath:filePath]; - FIRStorageReference *ref = [storage.reference child:path]; - FIRStorageDownloadTask *task = [ref writeToFile:localURL]; - [task observeStatus:FIRStorageTaskStatusSuccess - handler:^(FIRStorageTaskSnapshot *snapshot) { - result(@(snapshot.progress.totalUnitCount)); - }]; - [task observeStatus:FIRStorageTaskStatusFailure - handler:^(FIRStorageTaskSnapshot *snapshot) { - if (snapshot.error != nil) { - result(getFlutterError(snapshot.error)); - } - }]; -} - -- (void)getMetadata:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - [ref metadataWithCompletion:^(FIRStorageMetadata *metadata, NSError *error) { - if (error != nil) { - result(getFlutterError(error)); - } else { - result([self buildDictionaryFromMetadata:metadata]); - } - }]; -} - -- (void)updateMetadata:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - NSDictionary *metadataDictionary = call.arguments[@"metadata"]; - FIRStorageReference *ref = [storage.reference child:path]; - [ref updateMetadata:[self buildMetadataFromDictionary:metadataDictionary] - completion:^(FIRStorageMetadata *metadata, NSError *error) { - if (error != nil) { - result(getFlutterError(error)); - } else { - result([self buildDictionaryFromMetadata:metadata]); - } - }]; -} - -- (void)getBucket:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - result([ref bucket]); -} - -- (void)getName:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - result([ref name]); -} - -- (void)getPath:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - result([ref fullPath]); -} - -- (void)getDownloadUrl:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - [ref downloadURLWithCompletion:^(NSURL *URL, NSError *error) { - if (error != nil) { - result(getFlutterError(error)); - } else { - result(URL.absoluteString); - } - }]; -} - -- (void)delete:(FlutterMethodCall *)call result:(FlutterResult)result { - NSString *path = call.arguments[@"path"]; - FIRStorageReference *ref = [storage.reference child:path]; - [ref deleteWithCompletion:^(NSError *error) { - if (error != nil) { - result(getFlutterError(error)); - } else { - result(nil); - } - }]; -} - -- (void)pauseUploadTask:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *handle = call.arguments[@"handle"]; - FIRStorageUploadTask *task = [_uploadTasks objectForKey:handle]; - if (task != nil) { - [task pause]; - result(nil); - } else { - result([FlutterError errorWithCode:@"pause_error" message:@"task == null" details:nil]); - } -} - -- (void)resumeUploadTask:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *handle = call.arguments[@"handle"]; - FIRStorageUploadTask *task = [_uploadTasks objectForKey:handle]; - if (task != nil) { - [task resume]; - result(nil); - } else { - result([FlutterError errorWithCode:@"resume_error" message:@"task == null" details:nil]); - } -} - -- (void)cancelUploadTask:(FlutterMethodCall *)call result:(FlutterResult)result { - NSNumber *handle = call.arguments[@"handle"]; - FIRStorageUploadTask *task = [_uploadTasks objectForKey:handle]; - if (task != nil) { - [task cancel]; - result(nil); - } else { - result([FlutterError errorWithCode:@"cancel_error" message:@"task == null" details:nil]); - } -} - -@end diff --git a/packages/firebase_storage/ios/firebase_storage.podspec b/packages/firebase_storage/ios/firebase_storage.podspec deleted file mode 100755 index 2fa05a18004a..000000000000 --- a/packages/firebase_storage/ios/firebase_storage.podspec +++ /dev/null @@ -1,32 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -require 'yaml' -pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -libraryVersion = pubspec['version'].gsub('+', '-') - -Pod::Spec.new do |s| - s.name = 'firebase_storage' - s.version = '0.0.1' - s.summary = 'Firebase Storage plugin for Flutter.' - s.description = <<-DESC -Firebase Storage plugin for Flutter. - DESC - s.homepage = 'https://github.com/flutter/plugins/tree/master/packages/firebase_storage' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.ios.deployment_target = '8.0' - s.dependency 'Flutter' - s.dependency 'Firebase/Storage' - s.static_framework = true - - s.prepare_command = <<-CMD - echo // Generated file, do not edit > Classes/UserAgent.h - echo "#define LIBRARY_VERSION @\\"#{libraryVersion}\\"" >> Classes/UserAgent.h - echo "#define LIBRARY_NAME @\\"flutter-fire-gcs\\"" >> Classes/UserAgent.h - CMD -end diff --git a/packages/firebase_storage/lib/firebase_storage.dart b/packages/firebase_storage/lib/firebase_storage.dart deleted file mode 100755 index d37af7f6a21b..000000000000 --- a/packages/firebase_storage/lib/firebase_storage.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -library firebase_storage; - -import 'dart:async'; -import 'dart:io'; -import 'dart:typed_data'; - -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/services.dart'; - -part 'src/error.dart'; -part 'src/event.dart'; -part 'src/firebase_storage.dart'; -part 'src/storage_metadata.dart'; -part 'src/storage_reference.dart'; -part 'src/upload_task.dart'; diff --git a/packages/firebase_storage/lib/src/error.dart b/packages/firebase_storage/lib/src/error.dart deleted file mode 100644 index 62b66d365fe2..000000000000 --- a/packages/firebase_storage/lib/src/error.dart +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_storage; - -class StorageError { - static const int unknown = -13000; - static const int objectNotFound = -13010; - static const int bucketNotFound = -13011; - static const int projectNotFound = -13012; - static const int quotaExceeded = -13013; - static const int notAuthenticated = -13020; - static const int notAuthorized = -13021; - static const int retryLimitExceeded = -13030; - static const int invalidChecksum = -13031; - static const int canceled = -13040; -} diff --git a/packages/firebase_storage/lib/src/event.dart b/packages/firebase_storage/lib/src/event.dart deleted file mode 100644 index 1241e097ce26..000000000000 --- a/packages/firebase_storage/lib/src/event.dart +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_storage; - -enum StorageTaskEventType { - resume, - progress, - pause, - success, - failure, -} - -/// `Event` encapsulates a StorageTaskSnapshot -class StorageTaskEvent { - StorageTaskEvent._(int type, StorageReference ref, Map data) - : type = StorageTaskEventType.values[type], - snapshot = StorageTaskSnapshot._(ref, data.cast()); - - final StorageTaskEventType type; - final StorageTaskSnapshot snapshot; -} - -class StorageTaskSnapshot { - StorageTaskSnapshot._(this.ref, Map m) - : error = m['error'], - bytesTransferred = m['bytesTransferred'], - totalByteCount = m['totalByteCount'], - uploadSessionUri = m['uploadSessionUri'] != null - ? Uri.parse(m['uploadSessionUri']) - : null, - storageMetadata = m['storageMetadata'] != null - ? StorageMetadata._fromMap( - m['storageMetadata'].cast()) - : null; - - final StorageReference ref; - final int error; - final int bytesTransferred; - final int totalByteCount; - final Uri uploadSessionUri; - final StorageMetadata storageMetadata; -} diff --git a/packages/firebase_storage/lib/src/firebase_storage.dart b/packages/firebase_storage/lib/src/firebase_storage.dart deleted file mode 100644 index cbd1131d3880..000000000000 --- a/packages/firebase_storage/lib/src/firebase_storage.dart +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_storage; - -/// FirebaseStorage is a service that supports uploading and downloading large -/// objects to Google Cloud Storage. -class FirebaseStorage { - /// Returns the [FirebaseStorage] instance, initialized with a custom - /// [FirebaseApp] if [app] is specified and a custom Google Cloud Storage - /// bucket if [storageBucket] is specified. Otherwise the instance will be - /// initialized with the default [FirebaseApp]. - /// - /// The [FirebaseStorage] instance is a singleton for fixed [app] and - /// [storageBucket]. - /// - /// The [storageBucket] argument is the gs:// url to the custom Firebase - /// Storage Bucket. - /// - /// The [app] argument is the custom [FirebaseApp]. - FirebaseStorage({this.app, this.storageBucket}) { - if (_initialized) return; - channel.setMethodCallHandler((MethodCall call) async { - _methodStreamController.add(call); - }); - _initialized = true; - } - - static const MethodChannel channel = - MethodChannel('plugins.flutter.io/firebase_storage'); - - static bool _initialized = false; - - static FirebaseStorage _instance = FirebaseStorage(); - - /// The [FirebaseApp] instance to which this [FirebaseStorage] belongs. - /// - /// If null, the default [FirebaseApp] is used. - final FirebaseApp app; - - /// The Google Cloud Storage bucket to which this [FirebaseStorage] belongs. - /// - /// If null, the storage bucket of the specified [FirebaseApp] is used. - final String storageBucket; - - /// Returns the [FirebaseStorage] instance, initialized with the default - /// [FirebaseApp]. - static FirebaseStorage get instance => _instance; - - /// Used to dispatch method calls - static final StreamController _methodStreamController = - StreamController.broadcast(); // ignore: close_sinks - Stream get _methodStream => _methodStreamController.stream; - - /// Creates a new [StorageReference] initialized at the root - /// Firebase Storage location. - StorageReference ref() => StorageReference._(const [], this); - - Future getMaxDownloadRetryTimeMillis() async { - return await channel.invokeMethod( - "FirebaseStorage#getMaxDownloadRetryTime", { - 'app': app?.name, - 'bucket': storageBucket, - }); - } - - Future getMaxUploadRetryTimeMillis() async { - return await channel.invokeMethod( - "FirebaseStorage#getMaxUploadRetryTime", { - 'app': app?.name, - 'bucket': storageBucket, - }); - } - - Future getMaxOperationRetryTimeMillis() async { - return await channel.invokeMethod( - "FirebaseStorage#getMaxOperationRetryTime", { - 'app': app?.name, - 'bucket': storageBucket, - }); - } - - Future setMaxDownloadRetryTimeMillis(int time) { - return channel.invokeMethod( - "FirebaseStorage#setMaxDownloadRetryTime", { - 'app': app?.name, - 'bucket': storageBucket, - 'time': time, - }); - } - - Future setMaxUploadRetryTimeMillis(int time) { - return channel.invokeMethod( - "FirebaseStorage#setMaxUploadRetryTime", { - 'app': app?.name, - 'bucket': storageBucket, - 'time': time, - }); - } - - Future setMaxOperationRetryTimeMillis(int time) { - return channel.invokeMethod( - "FirebaseStorage#setMaxOperationRetryTime", { - 'app': app?.name, - 'bucket': storageBucket, - 'time': time, - }); - } - - /// Creates a [StorageReference] given a gs:// or // URL pointing to a Firebase - /// Storage location. - Future getReferenceFromUrl(String fullUrl) async { - final String path = await channel.invokeMethod( - "FirebaseStorage#getReferenceFromUrl", { - 'app': app?.name, - 'bucket': storageBucket, - 'fullUrl': fullUrl - }); - if (path != null) { - return ref().child(path); - } else { - return null; - } - } -} - -/// TODO: Move into own file and build out progress functionality -class StorageFileDownloadTask { - StorageFileDownloadTask._(this._firebaseStorage, this._path, this._file); - - final FirebaseStorage _firebaseStorage; - final String _path; - final File _file; - - Future _start() async { - final int totalByteCount = await FirebaseStorage.channel.invokeMethod( - "StorageReference#writeToFile", - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'filePath': _file.absolute.path, - 'path': _path, - }, - ); - _completer - .complete(FileDownloadTaskSnapshot(totalByteCount: totalByteCount)); - } - - Completer _completer = - Completer(); - Future get future => _completer.future; -} - -class FileDownloadTaskSnapshot { - FileDownloadTaskSnapshot({this.totalByteCount}); - final int totalByteCount; -} diff --git a/packages/firebase_storage/lib/src/storage_metadata.dart b/packages/firebase_storage/lib/src/storage_metadata.dart deleted file mode 100644 index e452672d7c64..000000000000 --- a/packages/firebase_storage/lib/src/storage_metadata.dart +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_storage; - -/// Metadata for a [StorageReference]. Metadata stores default attributes such as -/// size and content type. -class StorageMetadata { - StorageMetadata({ - this.cacheControl, - this.contentDisposition, - this.contentEncoding, - this.contentLanguage, - this.contentType, - Map customMetadata, - }) : bucket = null, - generation = null, - metadataGeneration = null, - path = null, - name = null, - sizeBytes = null, - creationTimeMillis = null, - updatedTimeMillis = null, - md5Hash = null, - customMetadata = customMetadata == null - ? null - : Map.unmodifiable(customMetadata); - - StorageMetadata._fromMap(Map map) - : bucket = map['bucket'], - generation = map['generation'], - metadataGeneration = map['metadataGeneration'], - path = map['path'], - name = map['name'], - sizeBytes = map['sizeBytes'], - creationTimeMillis = map['creationTimeMillis'], - updatedTimeMillis = map['updatedTimeMillis'], - md5Hash = map['md5Hash'], - cacheControl = map['cacheControl'], - contentDisposition = map['contentDisposition'], - contentLanguage = map['contentLanguage'], - contentType = map['contentType'], - contentEncoding = map['contentEncoding'], - customMetadata = map['customMetadata'] == null - ? null - : Map.unmodifiable( - map['customMetadata'].cast()); - - /// The owning Google Cloud Storage bucket for the [StorageReference]. - final String bucket; - - /// A version String indicating what version of the [StorageReference]. - final String generation; - - /// A version String indicating the version of this [StorageMetadata]. - final String metadataGeneration; - - /// The path of the [StorageReference] object. - final String path; - - /// A simple name of the [StorageReference] object. - final String name; - - /// The stored Size in bytes of the [StorageReference] object. - final int sizeBytes; - - /// The time the [StorageReference] was created in milliseconds since the epoch. - final int creationTimeMillis; - - /// The time the [StorageReference] was last updated in milliseconds since the epoch. - final int updatedTimeMillis; - - /// The MD5Hash of the [StorageReference] object. - final String md5Hash; - - /// The Cache Control setting of the [StorageReference]. - final String cacheControl; - - /// The content disposition of the [StorageReference]. - final String contentDisposition; - - /// The content encoding for the [StorageReference]. - final String contentEncoding; - - /// The content language for the StorageReference, specified as a 2-letter - /// lowercase language code defined by ISO 639-1. - final String contentLanguage; - - /// The content type (MIME type) of the [StorageReference]. - final String contentType; - - /// An unmodifiable map with custom metadata for the [StorageReference]. - final Map customMetadata; -} diff --git a/packages/firebase_storage/lib/src/storage_reference.dart b/packages/firebase_storage/lib/src/storage_reference.dart deleted file mode 100644 index 71a31ff98464..000000000000 --- a/packages/firebase_storage/lib/src/storage_reference.dart +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_storage; - -class StorageReference { - const StorageReference._(this._pathComponents, this._firebaseStorage); - - final FirebaseStorage _firebaseStorage; - final List _pathComponents; - - /// Returns a new instance of [StorageReference] pointing to a child - /// location of the current reference. - StorageReference child(String path) { - final List childPath = List.from(_pathComponents) - ..addAll(path.split("/")); - return StorageReference._(childPath, _firebaseStorage); - } - - /// Returns a new instance of [StorageReference] pointing to the parent - /// location or null if this instance references the root location. - StorageReference getParent() { - if (_pathComponents.isEmpty || - _pathComponents.every((String e) => e.isEmpty)) { - return null; - } - - final List parentPath = List.from(_pathComponents); - // Trim for trailing empty path components that can - // come from trailing slashes in the path. - while (parentPath.last.isEmpty) { - parentPath.removeLast(); - } - parentPath.removeLast(); - - return StorageReference._(parentPath, _firebaseStorage); - } - - /// Returns a new instance of [StorageReference] pointing to the root location. - StorageReference getRoot() { - return StorageReference._([], _firebaseStorage); - } - - /// Returns the [FirebaseStorage] service which created this reference. - FirebaseStorage getStorage() { - return _firebaseStorage; - } - - /// This method is deprecated. Please use [putFile] instead. - /// - /// Asynchronously uploads a file to the currently specified - /// [StorageReference], with an optional [metadata]. - @deprecated - StorageUploadTask put(File file, [StorageMetadata metadata]) { - return putFile(file, metadata); - } - - /// Asynchronously uploads a file to the currently specified - /// [StorageReference], with an optional [metadata]. - StorageUploadTask putFile(File file, [StorageMetadata metadata]) { - assert(file.existsSync()); - final _StorageFileUploadTask task = - _StorageFileUploadTask._(file, _firebaseStorage, this, metadata); - task._start(); - return task; - } - - /// Asynchronously uploads byte data to the currently specified - /// [StorageReference], with an optional [metadata]. - StorageUploadTask putData(Uint8List data, [StorageMetadata metadata]) { - final StorageUploadTask task = - _StorageDataUploadTask._(data, _firebaseStorage, this, metadata); - task._start(); - return task; - } - - /// Returns the Google Cloud Storage bucket that holds this object. - Future getBucket() async { - return await FirebaseStorage.channel - .invokeMethod("StorageReference#getBucket", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/"), - }); - } - - /// Returns the full path to this object, not including the Google Cloud - /// Storage bucket. - Future getPath() async { - final String path = await FirebaseStorage.channel - .invokeMethod("StorageReference#getPath", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/"), - }); - - if (path.startsWith('/')) { - return path.substring(1); - } else { - return path; - } - } - - /// Returns the short name of this object. - Future getName() async { - return await FirebaseStorage.channel - .invokeMethod("StorageReference#getName", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/"), - }); - } - - /// Asynchronously downloads the object at the StorageReference to a list in memory. - /// A list of the provided max size will be allocated. - Future getData(int maxSize) async { - return await FirebaseStorage.channel.invokeMethod( - "StorageReference#getData", - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'maxSize': maxSize, - 'path': _pathComponents.join("/"), - }, - ); - } - - /// Asynchronously downloads the object at this [StorageReference] to a - /// specified system file. - StorageFileDownloadTask writeToFile(File file) { - final StorageFileDownloadTask task = StorageFileDownloadTask._( - _firebaseStorage, _pathComponents.join("/"), file); - task._start(); - return task; - } - - /// Asynchronously retrieves a long lived download URL with a revokable token. - /// This can be used to share the file with others, but can be revoked by a - /// developer in the Firebase Console if desired. - Future getDownloadURL() async { - return await FirebaseStorage.channel.invokeMethod( - "StorageReference#getDownloadUrl", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/"), - }); - } - - Future delete() { - return FirebaseStorage.channel - .invokeMethod("StorageReference#delete", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/") - }); - } - - /// Retrieves metadata associated with an object at this [StorageReference]. - Future getMetadata() async { - return StorageMetadata._fromMap(await FirebaseStorage.channel - .invokeMapMethod( - "StorageReference#getMetadata", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/"), - })); - } - - /// Updates the metadata associated with this [StorageReference]. - /// - /// Returns a [Future] that will complete to the updated [StorageMetadata]. - /// - /// This method ignores fields of [metadata] that cannot be set by the public - /// [StorageMetadata] constructor. Writable metadata properties can be deleted - /// by passing the empty string. - Future updateMetadata(StorageMetadata metadata) async { - return StorageMetadata._fromMap(await FirebaseStorage.channel - .invokeMapMethod( - "StorageReference#updateMetadata", { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'path': _pathComponents.join("/"), - 'metadata': metadata == null ? null : _buildMetadataUploadMap(metadata), - })); - } - - String get path => _pathComponents.join('/'); -} diff --git a/packages/firebase_storage/lib/src/upload_task.dart b/packages/firebase_storage/lib/src/upload_task.dart deleted file mode 100644 index 70d4f9ebcc61..000000000000 --- a/packages/firebase_storage/lib/src/upload_task.dart +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -part of firebase_storage; - -abstract class StorageUploadTask { - StorageUploadTask._(this._firebaseStorage, this._ref, this._metadata); - - final FirebaseStorage _firebaseStorage; - final StorageReference _ref; - final StorageMetadata _metadata; - - Future _platformStart(); - - int _handle; - - bool isCanceled = false; - bool isComplete = false; - bool isInProgress = true; - bool isPaused = false; - bool isSuccessful = false; - - StorageTaskSnapshot lastSnapshot; - - /// Returns a last snapshot when completed - Completer _completer = Completer(); - Future get onComplete => _completer.future; - - StreamController _controller = - StreamController.broadcast(); - Stream get events => _controller.stream; - - Future _start() async { - _handle = await _platformStart(); - final StorageTaskEvent event = await _firebaseStorage._methodStream - .where((MethodCall m) { - return m.method == 'StorageTaskEvent' && m.arguments['handle'] == _handle; - }).map((MethodCall m) { - final Map args = m.arguments; - final StorageTaskEvent e = - StorageTaskEvent._(args['type'], _ref, args['snapshot']); - _changeState(e); - lastSnapshot = e.snapshot; - _controller.add(e); - if (e.type == StorageTaskEventType.success || - e.type == StorageTaskEventType.failure) { - _completer.complete(e.snapshot); - } - return e; - }).firstWhere((StorageTaskEvent e) => - e.type == StorageTaskEventType.success || - e.type == StorageTaskEventType.failure); - return event.snapshot; - } - - void _changeState(StorageTaskEvent event) { - _resetState(); - switch (event.type) { - case StorageTaskEventType.progress: - isInProgress = true; - break; - case StorageTaskEventType.resume: - isInProgress = true; - break; - case StorageTaskEventType.pause: - isPaused = true; - break; - case StorageTaskEventType.success: - isSuccessful = true; - isComplete = true; - break; - case StorageTaskEventType.failure: - isComplete = true; - if (event.snapshot.error == StorageError.canceled) { - isCanceled = true; - } - break; - } - } - - void _resetState() { - isCanceled = false; - isComplete = false; - isInProgress = false; - isPaused = false; - isSuccessful = false; - } - - /// Pause the upload - void pause() => FirebaseStorage.channel.invokeMethod( - 'UploadTask#pause', - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'handle': _handle, - }, - ); - - /// Resume the upload - void resume() => FirebaseStorage.channel.invokeMethod( - 'UploadTask#resume', - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'handle': _handle, - }, - ); - - /// Cancel the upload - void cancel() => FirebaseStorage.channel.invokeMethod( - 'UploadTask#cancel', - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'handle': _handle, - }, - ); -} - -class _StorageFileUploadTask extends StorageUploadTask { - _StorageFileUploadTask._(this._file, FirebaseStorage firebaseStorage, - StorageReference ref, StorageMetadata metadata) - : super._(firebaseStorage, ref, metadata); - - final File _file; - - @override - Future _platformStart() { - return FirebaseStorage.channel.invokeMethod( - 'StorageReference#putFile', - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'filename': _file.absolute.path, - 'path': _ref.path, - 'metadata': - _metadata == null ? null : _buildMetadataUploadMap(_metadata), - }, - ); - } -} - -class _StorageDataUploadTask extends StorageUploadTask { - _StorageDataUploadTask._(this._bytes, FirebaseStorage firebaseStorage, - StorageReference ref, StorageMetadata metadata) - : super._(firebaseStorage, ref, metadata); - - final Uint8List _bytes; - - @override - Future _platformStart() { - return FirebaseStorage.channel.invokeMethod( - 'StorageReference#putData', - { - 'app': _firebaseStorage.app?.name, - 'bucket': _firebaseStorage.storageBucket, - 'data': _bytes, - 'path': _ref.path, - 'metadata': - _metadata == null ? null : _buildMetadataUploadMap(_metadata), - }, - ); - } -} - -Map _buildMetadataUploadMap(StorageMetadata metadata) { - return { - 'cacheControl': metadata.cacheControl, - 'contentDisposition': metadata.contentDisposition, - 'contentLanguage': metadata.contentLanguage, - 'contentType': metadata.contentType, - 'contentEncoding': metadata.contentEncoding, - 'customMetadata': metadata.customMetadata, - }; -} diff --git a/packages/firebase_storage/pubspec.yaml b/packages/firebase_storage/pubspec.yaml deleted file mode 100755 index cffac66c8a1b..000000000000 --- a/packages/firebase_storage/pubspec.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: firebase_storage -description: Flutter plugin for Firebase Cloud Storage, a powerful, simple, and - cost-effective object storage service for Android and iOS. -author: Flutter Team -homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_storage -version: 3.0.5 - -flutter: - plugin: - androidPackage: io.flutter.plugins.firebase.storage - iosPrefix: FLT - pluginClass: FirebaseStoragePlugin - -dependencies: - flutter: - sdk: flutter - firebase_core: ^0.4.0 - -dev_dependencies: - http: ^0.12.0 - flutter_test: - sdk: flutter - uuid: "^1.0.0" - flutter_driver: - sdk: flutter - test: any - -environment: - sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=1.5.0 <2.0.0" diff --git a/packages/firebase_storage/test/firebase_storage_test.dart b/packages/firebase_storage/test/firebase_storage_test.dart deleted file mode 100644 index c03288dade34..000000000000 --- a/packages/firebase_storage/test/firebase_storage_test.dart +++ /dev/null @@ -1,530 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; -import 'dart:typed_data'; - -import 'package:firebase_core/firebase_core.dart'; -import 'package:firebase_storage/firebase_storage.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('FirebaseStorage', () { - final FirebaseApp app = const FirebaseApp( - name: 'testApp', - ); - final String storageBucket = 'gs://fake-storage-bucket-url.com'; - final FirebaseStorage storage = - FirebaseStorage(app: app, storageBucket: storageBucket); - - group('getMaxDownloadRetryTimeMillis', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 1000; - }); - }); - - test('invokes correct method', () async { - await storage.getMaxDownloadRetryTimeMillis(); - - expect(log, [ - isMethodCall( - 'FirebaseStorage#getMaxDownloadRetryTime', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await storage.getMaxDownloadRetryTimeMillis(), 1000); - }); - }); - - group('getMaxUploadRetryTimeMillis', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 2000; - }); - }); - - test('invokes correct method', () async { - await storage.getMaxUploadRetryTimeMillis(); - - expect(log, [ - isMethodCall( - 'FirebaseStorage#getMaxUploadRetryTime', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await storage.getMaxUploadRetryTimeMillis(), 2000); - }); - }); - - group('getMaxOperationRetryTimeMillis', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 3000; - }); - }); - - test('invokes correct method', () async { - await storage.getMaxOperationRetryTimeMillis(); - - expect(log, [ - isMethodCall( - 'FirebaseStorage#getMaxOperationRetryTime', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await storage.getMaxOperationRetryTimeMillis(), 3000); - }); - }); - - group('setMaxDownloadRetryTimeMillis', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - }); - }); - - test('invokes correct method', () async { - await storage.setMaxDownloadRetryTimeMillis(1000); - - expect(log, [ - isMethodCall( - 'FirebaseStorage#setMaxDownloadRetryTime', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'time': 1000, - }, - ), - ]); - }); - }); - - group('setMaxUploadRetryTimeMillis', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - }); - }); - - test('invokes correct method', () async { - await storage.setMaxUploadRetryTimeMillis(2000); - - expect(log, [ - isMethodCall( - 'FirebaseStorage#setMaxUploadRetryTime', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'time': 2000, - }, - ), - ]); - }); - }); - - group('setMaxOperationRetryTimeMillis', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - }); - }); - - test('invokes correct method', () async { - await storage.setMaxOperationRetryTimeMillis(3000); - - expect(log, [ - isMethodCall( - 'FirebaseStorage#setMaxOperationRetryTime', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'time': 3000, - }, - ), - ]); - }); - }); - - group('getReferenceFromUrl', () { - final List log = []; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 'foo'; - }); - }); - - test('invokes correct method', () async { - final String url = - 'https://firebasestorage.googleapis.com/v0/b/fake-21c50.appspot.com/o/'; - final StorageReference reference = - await storage.getReferenceFromUrl(url); - expect(reference.path, 'foo'); - expect(log, [ - isMethodCall( - 'FirebaseStorage#getReferenceFromUrl', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'fullUrl': url, - }, - ), - ]); - }); - }); - - group('StorageReference', () { - group('getData', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) { - log.add(methodCall); - return Future.value( - Uint8List.fromList([1, 2, 3, 4])); - }); - ref = - storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.getData(10); - - expect(log, [ - isMethodCall( - 'StorageReference#getData', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'maxSize': 10, - 'path': 'avatars/large/image.jpg', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await ref.getData(10), - equals(Uint8List.fromList([1, 2, 3, 4]))); - }); - }); - - group('getMetadata', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return {'name': 'image.jpg'}; - }); - ref = - storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.getMetadata(); - - expect(log, [ - isMethodCall( - 'StorageReference#getMetadata', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'avatars/large/image.jpg', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect((await ref.getMetadata()).name, 'image.jpg'); - }); - }); - - group('updateMetadata', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - switch (methodCall.method) { - case 'StorageReference#getMetadata': - return { - 'name': 'image.jpg', - }; - case 'StorageReference#updateMetadata': - return { - 'name': 'image.jpg', - 'contentLanguage': 'en', - 'customMetadata': {'activity': 'test'}, - }; - default: - return null; - } - }); - ref = - storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.updateMetadata(StorageMetadata( - contentLanguage: 'en', - customMetadata: {'activity': 'test'}, - )); - - expect(log, [ - isMethodCall( - 'StorageReference#updateMetadata', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'avatars/large/image.jpg', - 'metadata': { - 'cacheControl': null, - 'contentDisposition': null, - 'contentLanguage': 'en', - 'contentType': null, - 'contentEncoding': null, - 'customMetadata': {'activity': 'test'}, - }, - }, - ), - ]); - }); - - test('returns correct result', () async { - expect((await ref.getMetadata()).contentLanguage, null); - expect( - (await ref.updateMetadata(StorageMetadata(contentLanguage: 'en'))) - .contentLanguage, - 'en'); - }); - }); - - group('getDownloadUrl', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 'https://path/to/file'; - }); - ref = - storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.getDownloadURL(); - - expect(log, [ - isMethodCall( - 'StorageReference#getDownloadUrl', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'avatars/large/image.jpg', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await ref.getDownloadURL(), 'https://path/to/file'); - }); - }); - - group('delete', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return null; - }); - ref = storage.ref().child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.delete(); - - expect( - log, - [ - isMethodCall( - 'StorageReference#delete', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'image.jpg', - }, - ), - ], - ); - }); - }); - - group('getBucket', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 'foo'; - }); - ref = - storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.getBucket(); - - expect(log, [ - isMethodCall( - 'StorageReference#getBucket', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'avatars/large/image.jpg', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await ref.getBucket(), 'foo'); - }); - }); - - group('getName', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 'image.jpg'; - }); - ref = - storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.getName(); - - expect(log, [ - isMethodCall( - 'StorageReference#getName', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'avatars/large/image.jpg', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await ref.getName(), 'image.jpg'); - }); - }); - }); - - group('getPath', () { - final List log = []; - - StorageReference ref; - - setUp(() { - FirebaseStorage.channel - .setMockMethodCallHandler((MethodCall methodCall) async { - log.add(methodCall); - return 'avatars/large/image.jpg'; - }); - ref = storage.ref().child('avatars').child('large').child('image.jpg'); - }); - - test('invokes correct method', () async { - await ref.getPath(); - - expect(log, [ - isMethodCall( - 'StorageReference#getPath', - arguments: { - 'app': 'testApp', - 'bucket': 'gs://fake-storage-bucket-url.com', - 'path': 'avatars/large/image.jpg', - }, - ), - ]); - }); - - test('returns correct result', () async { - expect(await ref.getPath(), 'avatars/large/image.jpg'); - }); - }); - }); -} diff --git a/script/build_all_plugins_app.sh b/script/build_all_plugins_app.sh index 9cb4b9656c38..4d30ad73e8a1 100755 --- a/script/build_all_plugins_app.sh +++ b/script/build_all_plugins_app.sh @@ -12,7 +12,7 @@ check_changed_packages > /dev/null cd $REPO_DIR/examples/all_plugins flutter clean > /dev/null -(cd "$REPO_DIR" && pub global run flutter_plugin_tools gen-pubspec --exclude firebase_core,firebase_ml_vision) +(cd "$REPO_DIR" && pub global run flutter_plugin_tools gen-pubspec) function error() { echo "$@" 1>&2