diff --git a/packages/cloud_firestore/CHANGELOG.md b/packages/cloud_firestore/CHANGELOG.md index f31bb80854b0..ed8162e75f90 100644 --- a/packages/cloud_firestore/CHANGELOG.md +++ b/packages/cloud_firestore/CHANGELOG.md @@ -1,3 +1,12 @@ +## 0.12.10 + +* Added `FieldPath` class and `FieldPath.documentId` to refer to the document id in queries. +* Added assertions and exceptions that help you building correct queries. + +## 0.12.9+8 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.12.9+7 * Remove AndroidX warning. diff --git a/packages/cloud_firestore/README.md b/packages/cloud_firestore/README.md index 7331afbdea3e..4fec33d2edaf 100755 --- a/packages/cloud_firestore/README.md +++ b/packages/cloud_firestore/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Cloud Firestore API](https://firebase.google.com/do For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! - ## Setup To use this plugin: @@ -102,3 +100,13 @@ Firestore.instance.runTransaction((Transaction tx) async { ## Getting Started See the `example` directory for a complete sample app using Cloud Firestore. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). 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 index eddabe3aa400..c4e75669d517 100644 --- 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 @@ -129,16 +129,32 @@ private Object[] getDocumentValues( 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]); + final Object field = order.get(0); + + if (field instanceof FieldPath) { + if (field == FieldPath.documentId()) { + // This is also checked by an assertion on the Dart side. + throw new IllegalArgumentException( + "You cannot order by the document id when using" + + "{start/end}{At/After/Before}Document as the library will order by the document" + + " id implicitly in order to to add other fields to the order clause."); + } else { + // Unsupported type. + } + } else if (field instanceof String) { + String orderByFieldName = (String) field; + 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(current.get(fieldNameParts[fieldNameParts.length - 1])); } else { - data.add(documentData.get(orderByFieldName)); + // Invalid type. } } } @@ -213,21 +229,67 @@ private Query getQuery(Map arguments) { @SuppressWarnings("unchecked") List> whereConditions = (List>) parameters.get("where"); for (List condition : whereConditions) { - String fieldName = (String) condition.get(0); + String fieldName = null; + FieldPath fieldPath = null; + final Object field = condition.get(0); + if (field instanceof String) { + fieldName = (String) field; + } else if (field instanceof FieldPath) { + fieldPath = (FieldPath) field; + } else { + // Invalid type. + } + String operator = (String) condition.get(1); Object value = condition.get(2); if ("==".equals(operator)) { - query = query.whereEqualTo(fieldName, value); + if (fieldName != null) { + query = query.whereEqualTo(fieldName, value); + } else if (fieldPath != null) { + query = query.whereEqualTo(fieldPath, value); + } else { + // Invalid type. + } } else if ("<".equals(operator)) { - query = query.whereLessThan(fieldName, value); + if (fieldName != null) { + query = query.whereLessThan(fieldName, value); + } else if (fieldPath != null) { + query = query.whereLessThan(fieldPath, value); + } else { + // Invalid type. + } } else if ("<=".equals(operator)) { - query = query.whereLessThanOrEqualTo(fieldName, value); + if (fieldName != null) { + query = query.whereLessThanOrEqualTo(fieldName, value); + } else if (fieldPath != null) { + query = query.whereLessThanOrEqualTo(fieldPath, value); + } else { + // Invalid type. + } } else if (">".equals(operator)) { - query = query.whereGreaterThan(fieldName, value); + if (fieldName != null) { + query = query.whereGreaterThan(fieldName, value); + } else if (fieldPath != null) { + query = query.whereGreaterThan(fieldPath, value); + } else { + // Invalid type. + } } else if (">=".equals(operator)) { - query = query.whereGreaterThanOrEqualTo(fieldName, value); + if (fieldName != null) { + query = query.whereGreaterThanOrEqualTo(fieldName, value); + } else if (fieldPath != null) { + query = query.whereGreaterThanOrEqualTo(fieldPath, value); + } else { + // Invalid type. + } } else if ("array-contains".equals(operator)) { - query = query.whereArrayContains(fieldName, value); + if (fieldName != null) { + query = query.whereArrayContains(fieldName, value); + } else if (fieldPath != null) { + query = query.whereArrayContains(fieldPath, value); + } else { + // Invalid type. + } } else { // Invalid operator. } @@ -239,11 +301,28 @@ private Query getQuery(Map arguments) { List> orderBy = (List>) parameters.get("orderBy"); if (orderBy == null) return query; for (List order : orderBy) { - String orderByFieldName = (String) order.get(0); + String fieldName = null; + FieldPath fieldPath = null; + final Object field = order.get(0); + if (field instanceof String) { + fieldName = (String) field; + } else if (field instanceof FieldPath) { + fieldPath = (FieldPath) field; + } else { + // Invalid type. + } + boolean descending = (boolean) order.get(1); Query.Direction direction = descending ? Query.Direction.DESCENDING : Query.Direction.ASCENDING; - query = query.orderBy(orderByFieldName, direction); + + if (fieldName != null) { + query = query.orderBy(fieldName, direction); + } else if (fieldPath != null) { + query = query.orderBy(fieldPath, direction); + } else { + // Invalid type. + } } @SuppressWarnings("unchecked") Map startAtDocument = (Map) parameters.get("startAtDocument"); @@ -259,6 +338,11 @@ private Query getQuery(Map arguments) { || startAfterDocument != null || endAtDocument != null || endBeforeDocument != null) { + if (orderBy.isEmpty()) { + throw new IllegalStateException( + "You need to order by at least one field when using " + + "{start/end}{At/After/Before}Document as you need some value to e.g. start after."); + } boolean descending = (boolean) orderBy.get(orderBy.size() - 1).get(1); Query.Direction direction = descending ? Query.Direction.DESCENDING : Query.Direction.ASCENDING; @@ -859,6 +943,7 @@ final class FirestoreMessageCodec extends StandardMessageCodec { private static final byte TIMESTAMP = (byte) 136; private static final byte INCREMENT_DOUBLE = (byte) 137; private static final byte INCREMENT_INTEGER = (byte) 138; + private static final byte DOCUMENT_ID = (byte) 139; @Override protected void writeValue(ByteArrayOutputStream stream, Object value) { @@ -922,6 +1007,8 @@ protected Object readValueOfType(byte type, ByteBuffer buffer) { case INCREMENT_DOUBLE: final Number doubleIncrementValue = (Number) readValue(buffer); return FieldValue.increment(doubleIncrementValue.doubleValue()); + case DOCUMENT_ID: + return FieldPath.documentId(); default: return super.readValueOfType(type, buffer); } diff --git a/packages/cloud_firestore/example/test_driver/cloud_firestore.dart b/packages/cloud_firestore/example/test_driver/cloud_firestore.dart index 12460b7ad07f..21d51b538722 100644 --- a/packages/cloud_firestore/example/test_driver/cloud_firestore.dart +++ b/packages/cloud_firestore/example/test_driver/cloud_firestore.dart @@ -294,5 +294,39 @@ void main() { await doc1.delete(); await doc2.delete(); }); + + test('FieldPath.documentId', () async { + // Populate the database with two test documents. + final CollectionReference messages = firestore.collection('messages'); + + // Use document ID as a unique identifier to ensure that we don't + // collide with other tests running against this database. + final DocumentReference doc = messages.document(); + final String documentId = doc.documentID; + + await doc.setData({ + 'message': 'testing field path', + 'created_at': FieldValue.serverTimestamp(), + }); + + // This tests the native implementations of the where and + // orderBy methods handling FieldPath.documentId. + // There is also an error thrown when ordering by document id + // natively, however, that is also covered by assertion + // on the Dart side, which is tested with a unit test. + final QuerySnapshot querySnapshot = await messages + .orderBy(FieldPath.documentId) + .where(FieldPath.documentId, isEqualTo: documentId) + .getDocuments(); + + await doc.delete(); + + final List results = querySnapshot.documents; + final DocumentSnapshot result = results[0]; + + expect(results.length, 1); + expect(result.data['message'], 'testing field path'); + expect(result.documentID, documentId); + }); }); } diff --git a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m index ccb7dee868fc..5a612480180f 100644 --- a/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m +++ b/packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m @@ -31,17 +31,36 @@ 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]]; + NSObject *field = orderByParameters[0]; + + if ([field isKindOfClass:[FIRFieldPath class]]) { + if ([field isEqual:FIRFieldPath.documentID]) { + // This is also checked by an assertion on the Dart side. + [NSException + raise:@"Invalid use of FieldValue.documentId" + format: + @"You cannot order by the document id when using " + "{start/end}{At/After/Before}Document as the library will order by the document" + " id implicitly in order to to add other fields to the order clause."]; + } else { + // Unsupported type. + } + } else if ([field isKindOfClass:[NSString class]]) { + 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]]; } - [values addObject:[currentMap objectForKey:[fieldNameParts - objectAtIndex:[fieldNameParts count] - 1]]]; } else { - [values addObject:[documentData objectForKey:fieldName]]; + // Invalid type. } } } @@ -68,21 +87,69 @@ NSArray *whereConditions = parameters[@"where"]; for (id item in whereConditions) { NSArray *condition = item; - NSString *fieldName = condition[0]; + + FIRFieldPath *fieldPath = nil; + NSString *fieldName = nil; + NSObject *field = condition[0]; + + if ([field isKindOfClass:[NSString class]]) { + fieldName = (NSString *)field; + } else if ([field isKindOfClass:[FIRFieldPath class]]) { + fieldPath = (FIRFieldPath *)field; + } else { + // Invalid type. + } + NSString *op = condition[1]; id value = condition[2]; if ([op isEqualToString:@"=="]) { - query = [query queryWhereField:fieldName isEqualTo:value]; + if (fieldName != nil) { + query = [query queryWhereField:fieldName isEqualTo:value]; + } else if (fieldPath != nil) { + query = [query queryWhereFieldPath:fieldPath isEqualTo:value]; + } else { + // Invalid type. + } } else if ([op isEqualToString:@"<"]) { - query = [query queryWhereField:fieldName isLessThan:value]; + if (fieldName != nil) { + query = [query queryWhereField:fieldName isLessThan:value]; + } else if (fieldPath != nil) { + query = [query queryWhereFieldPath:fieldPath isLessThan:value]; + } else { + // Invalid type. + } } else if ([op isEqualToString:@"<="]) { - query = [query queryWhereField:fieldName isLessThanOrEqualTo:value]; + if (fieldName != nil) { + query = [query queryWhereField:fieldName isLessThanOrEqualTo:value]; + } else if (fieldPath != nil) { + query = [query queryWhereFieldPath:fieldPath isLessThanOrEqualTo:value]; + } else { + // Invalid type. + } } else if ([op isEqualToString:@">"]) { - query = [query queryWhereField:fieldName isGreaterThan:value]; + if (fieldName != nil) { + query = [query queryWhereField:fieldName isGreaterThan:value]; + } else if (fieldPath != nil) { + query = [query queryWhereFieldPath:fieldPath isGreaterThan:value]; + } else { + // Invalid type. + } } else if ([op isEqualToString:@">="]) { - query = [query queryWhereField:fieldName isGreaterThanOrEqualTo:value]; + if (fieldName != nil) { + query = [query queryWhereField:fieldName isGreaterThanOrEqualTo:value]; + } else if (fieldPath != nil) { + query = [query queryWhereFieldPath:fieldPath isGreaterThanOrEqualTo:value]; + } else { + // Invalid type. + } } else if ([op isEqualToString:@"array-contains"]) { - query = [query queryWhereField:fieldName arrayContains:value]; + if (fieldName != nil) { + query = [query queryWhereField:fieldName arrayContains:value]; + } else if (fieldPath != nil) { + query = [query queryWhereFieldPath:fieldPath arrayContains:value]; + } else { + // Invalid type. + } } else { // Unsupported operator } @@ -95,9 +162,26 @@ NSArray *orderBy = parameters[@"orderBy"]; if (orderBy) { for (NSArray *orderByParameters in orderBy) { - NSString *fieldName = orderByParameters[0]; + FIRFieldPath *fieldPath = nil; + NSString *fieldName = nil; + NSObject *field = orderByParameters[0]; + if ([field isKindOfClass:[NSString class]]) { + fieldName = (NSString *)field; + } else if ([field isKindOfClass:[FIRFieldPath class]]) { + fieldPath = (FIRFieldPath *)field; + } else { + // Invalid type. + } + NSNumber *descending = orderByParameters[1]; - query = [query queryOrderedByField:fieldName descending:[descending boolValue]]; + + if (fieldName != nil) { + query = [query queryOrderedByField:fieldName descending:[descending boolValue]]; + } else if (fieldPath != nil) { + query = [query queryOrderedByFieldPath:fieldPath descending:[descending boolValue]]; + } else { + // Invalid type. + } } } id startAt = parameters[@"startAt"]; @@ -110,6 +194,11 @@ id endAtDocument = parameters[@"endAtDocument"]; id endBeforeDocument = parameters[@"endBeforeDocument"]; if (startAtDocument || startAfterDocument || endAtDocument || endBeforeDocument) { + if ([orderBy count] == 0) { + [NSException raise:@"No order by clause specified" + format:@"You need to order by at least one field when using {start/end}{At/" + "After/Before}Document as you need some value to e.g. start after."]; + } NSArray *orderByParameters = [orderBy lastObject]; NSNumber *descending = orderByParameters[1]; query = [query queryOrderedByFieldPath:FIRFieldPath.documentID @@ -221,6 +310,7 @@ static FIRFirestoreSource getSource(NSDictionary *arguments) { const UInt8 TIMESTAMP = 136; const UInt8 INCREMENT_DOUBLE = 137; const UInt8 INCREMENT_INTEGER = 138; +const UInt8 DOCUMENT_ID = 139; @interface FirestoreWriter : FlutterStandardWriter - (void)writeValue:(id)value; @@ -323,6 +413,9 @@ - (id)readValueOfType:(UInt8)type { NSNumber *value = [self readValue]; return [FIRFieldValue fieldValueForIntegerIncrement:value.intValue]; } + case DOCUMENT_ID: { + return [FIRFieldPath documentID]; + } default: return [super readValueOfType:type]; } diff --git a/packages/cloud_firestore/lib/cloud_firestore.dart b/packages/cloud_firestore/lib/cloud_firestore.dart index fba72b049cb6..aef386e77d26 100755 --- a/packages/cloud_firestore/lib/cloud_firestore.dart +++ b/packages/cloud_firestore/lib/cloud_firestore.dart @@ -22,6 +22,7 @@ part 'src/collection_reference.dart'; part 'src/document_change.dart'; part 'src/document_reference.dart'; part 'src/document_snapshot.dart'; +part 'src/field_path.dart'; part 'src/field_value.dart'; part 'src/firestore.dart'; part 'src/firestore_message_codec.dart'; diff --git a/packages/cloud_firestore/lib/src/field_path.dart b/packages/cloud_firestore/lib/src/field_path.dart new file mode 100644 index 000000000000..64cdde8fad31 --- /dev/null +++ b/packages/cloud_firestore/lib/src/field_path.dart @@ -0,0 +1,21 @@ +// 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; + +enum _FieldPathType { + documentId, +} + +/// A [FieldPath] refers to a field in a document. +class FieldPath { + const FieldPath._(this.type); + + @visibleForTesting + final _FieldPathType type; + + /// The path to the document id, which can be used in queries. + static FieldPath get documentId => + const FieldPath._(_FieldPathType.documentId); +} diff --git a/packages/cloud_firestore/lib/src/firestore_message_codec.dart b/packages/cloud_firestore/lib/src/firestore_message_codec.dart index 14f6e020675c..9f658cd1c84b 100644 --- a/packages/cloud_firestore/lib/src/firestore_message_codec.dart +++ b/packages/cloud_firestore/lib/src/firestore_message_codec.dart @@ -19,6 +19,7 @@ class FirestoreMessageCodec extends StandardMessageCodec { static const int _kTimestamp = 136; static const int _kIncrementDouble = 137; static const int _kIncrementInteger = 138; + static const int _kDocumentId = 139; static const Map _kFieldValueCodes = { @@ -30,6 +31,11 @@ class FirestoreMessageCodec extends StandardMessageCodec { FieldValueType.incrementInteger: _kIncrementInteger, }; + static const Map<_FieldPathType, int> _kFieldPathCodes = + <_FieldPathType, int>{ + _FieldPathType.documentId: _kDocumentId, + }; + @override void writeValue(WriteBuffer buffer, dynamic value) { if (value is DateTime) { @@ -60,6 +66,10 @@ class FirestoreMessageCodec extends StandardMessageCodec { assert(code != null); buffer.putUint8(code); if (value.value != null) writeValue(buffer, value.value); + } else if (value is FieldPath) { + final int code = _kFieldPathCodes[value.type]; + assert(code != null); + buffer.putUint8(code); } else { super.writeValue(buffer, value); } @@ -104,6 +114,8 @@ class FirestoreMessageCodec extends StandardMessageCodec { case _kIncrementInteger: final int value = readValue(buffer); return FieldValue.increment(value); + case _kDocumentId: + return FieldPath.documentId; default: return super.readValueOfType(type, buffer); } diff --git a/packages/cloud_firestore/lib/src/query.dart b/packages/cloud_firestore/lib/src/query.dart index 114b48a6df57..9b273a9bb501 100644 --- a/packages/cloud_firestore/lib/src/query.dart +++ b/packages/cloud_firestore/lib/src/query.dart @@ -110,14 +110,16 @@ class Query { /// 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 '.' + /// The [field] may be a [String] consisting of a single field name + /// (referring to a top level field in the document), + /// or a series of field names separated by dots '.' /// (referring to a nested field in the document). + /// Alternatively, the [field] can also be a [FieldPath]. /// /// Only documents satisfying provided condition are included in the result /// set. Query where( - String field, { + dynamic field, { dynamic isEqualTo, dynamic isLessThan, dynamic isLessThanOrEqualTo, @@ -126,11 +128,14 @@ class Query { dynamic arrayContains, bool isNull, }) { + assert(field is String || field is FieldPath, + 'Supported [field] types are [String] and [FieldPath].'); + final ListEquality equality = const ListEquality(); final List> conditions = List>.from(_parameters['where']); - void addCondition(String field, String operator, dynamic value) { + void addCondition(dynamic field, String operator, dynamic value) { final List condition = [field, operator, value]; assert( conditions @@ -162,13 +167,38 @@ class Query { /// Creates and returns a new [Query] that's additionally sorted by the specified /// [field]. - Query orderBy(String field, {bool descending = false}) { + /// The field may be a [String] representing a single field name or a [FieldPath]. + /// + /// After a [FieldPath.documentId] order by call, you cannot add any more [orderBy] + /// calls. + /// Furthermore, you may not use [orderBy] on the [FieldPath.documentId] [field] when + /// using [startAfterDocument], [startAtDocument], [endAfterDocument], + /// or [endAtDocument] because the order by clause on the document id + /// is added by these methods implicitly. + Query orderBy(dynamic field, {bool descending = false}) { + assert(field != null && descending != null); + assert(field is String || field is FieldPath, + 'Supported [field] types are [String] and [FieldPath].'); + 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'); + + assert(() { + if (field == FieldPath.documentId) { + return !(_parameters.containsKey('startAfterDocument') || + _parameters.containsKey('startAtDocument') || + _parameters.containsKey('endAfterDocument') || + _parameters.containsKey('endAtDocument')); + } + return true; + }(), + '{start/end}{At/After/Before}Document order by document id themselves. ' + 'Hence, you may not use an order by [FieldPath.documentId] when using any of these methods for a query.'); + orders.add(order); return _copyWithParameters({'orderBy': orders}); } @@ -192,6 +222,12 @@ class Query { assert(!_parameters.containsKey('startAt')); assert(!_parameters.containsKey('startAfterDocument')); assert(!_parameters.containsKey('startAtDocument')); + assert( + List>.from(_parameters['orderBy']) + .where((List item) => item[0] == FieldPath.documentId) + .isEmpty, + '[startAfterDocument] orders by document id itself. ' + 'Hence, you may not use an order by [FieldPath.documentId] when using [startAfterDocument].'); return _copyWithParameters({ 'startAfterDocument': { 'id': documentSnapshot.documentID, @@ -220,6 +256,12 @@ class Query { assert(!_parameters.containsKey('startAt')); assert(!_parameters.containsKey('startAfterDocument')); assert(!_parameters.containsKey('startAtDocument')); + assert( + List>.from(_parameters['orderBy']) + .where((List item) => item[0] == FieldPath.documentId) + .isEmpty, + '[startAtDocument] orders by document id itself. ' + 'Hence, you may not use an order by [FieldPath.documentId] when using [startAtDocument].'); return _copyWithParameters({ 'startAtDocument': { 'id': documentSnapshot.documentID, @@ -282,6 +324,12 @@ class Query { assert(!_parameters.containsKey('endAt')); assert(!_parameters.containsKey('endBeforeDocument')); assert(!_parameters.containsKey('endAtDocument')); + assert( + List>.from(_parameters['orderBy']) + .where((List item) => item[0] == FieldPath.documentId) + .isEmpty, + '[endAtDocument] orders by document id itself. ' + 'Hence, you may not use an order by [FieldPath.documentId] when using [endAtDocument].'); return _copyWithParameters({ 'endAtDocument': { 'id': documentSnapshot.documentID, @@ -327,6 +375,12 @@ class Query { assert(!_parameters.containsKey('endAt')); assert(!_parameters.containsKey('endBeforeDocument')); assert(!_parameters.containsKey('endAtDocument')); + assert( + List>.from(_parameters['orderBy']) + .where((List item) => item[0] == FieldPath.documentId) + .isEmpty, + '[endBeforeDocument] orders by document id itself. ' + 'Hence, you may not use an order by [FieldPath.documentId] when using [endBeforeDocument].'); return _copyWithParameters({ 'endBeforeDocument': { 'id': documentSnapshot.documentID, diff --git a/packages/cloud_firestore/pubspec.yaml b/packages/cloud_firestore/pubspec.yaml index a7bc30a56fdb..b244f0e728b4 100755 --- a/packages/cloud_firestore/pubspec.yaml +++ b/packages/cloud_firestore/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Cloud Firestore, a cloud-hosted, noSQL database live synchronization and offline support on Android and iOS. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_firestore -version: 0.12.9+7 +version: 0.12.10 flutter: plugin: diff --git a/packages/cloud_firestore/test/cloud_firestore_test.dart b/packages/cloud_firestore/test/cloud_firestore_test.dart index 32729d6954d7..967e27b991b1 100755 --- a/packages/cloud_firestore/test/cloud_firestore_test.dart +++ b/packages/cloud_firestore/test/cloud_firestore_test.dart @@ -968,6 +968,80 @@ void main() { ), ); }); + + test('FieldPath', () async { + await collectionReference + .where(FieldPath.documentId, isEqualTo: 'bar') + .getDocuments(); + expect( + log, + equals([ + isMethodCall( + 'Query#getDocuments', + arguments: { + 'app': app.name, + 'path': 'foo', + 'isCollectionGroup': false, + 'parameters': { + 'where': >[ + [FieldPath.documentId, '==', 'bar'], + ], + 'orderBy': >[], + }, + 'source': 'default', + }, + ), + ]), + ); + }); + test('orderBy assertions', () async { + // Can only order by the same field once. + expect(() { + firestore.collection('foo').orderBy('bar').orderBy('bar'); + }, throwsAssertionError); + // Cannot order by unsupported types. + expect(() { + firestore.collection('foo').orderBy(0); + }, throwsAssertionError); + // Parameters cannot be null. + expect(() { + firestore.collection('foo').orderBy(null); + }, throwsAssertionError); + expect(() { + firestore.collection('foo').orderBy('bar', descending: null); + }, throwsAssertionError); + + // Cannot order by document id when paginating with documents. + final DocumentReference documentReference = + firestore.document('foo/bar'); + final DocumentSnapshot snapshot = await documentReference.get(); + expect(() { + firestore + .collection('foo') + .startAfterDocument(snapshot) + .orderBy(FieldPath.documentId); + }, throwsAssertionError); + }); + test('document pagination FieldPath assertions', () async { + final DocumentReference documentReference = + firestore.document('foo/bar'); + final DocumentSnapshot snapshot = await documentReference.get(); + final Query query = + firestore.collection('foo').orderBy(FieldPath.documentId); + + expect(() { + query.startAfterDocument(snapshot); + }, throwsAssertionError); + expect(() { + query.startAtDocument(snapshot); + }, throwsAssertionError); + expect(() { + query.endAtDocument(snapshot); + }, throwsAssertionError); + expect(() { + query.endBeforeDocument(snapshot); + }, throwsAssertionError); + }); }); group('FirestoreMessageCodec', () { @@ -1004,6 +1078,10 @@ void main() { _checkEncodeDecode(codec, FieldValue.increment(1.0)); _checkEncodeDecode(codec, FieldValue.increment(1)); }); + + test('encode and decode FieldPath', () { + _checkEncodeDecode(codec, FieldPath.documentId); + }); }); group('Timestamp', () { @@ -1234,6 +1312,8 @@ bool _deepEquals(dynamic valueA, dynamic valueB) { if (valueA is FieldValue) { return valueB is FieldValue && _deepEqualsFieldValue(valueA, valueB); } + if (valueA is FieldPath) + return valueB is FieldPath && valueA.type == valueB.type; return valueA == valueB; } diff --git a/packages/cloud_functions/CHANGELOG.md b/packages/cloud_functions/CHANGELOG.md index 1c35a34d5b95..e8ce93bfe0a0 100644 --- a/packages/cloud_functions/CHANGELOG.md +++ b/packages/cloud_functions/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.1+4 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.4.1+3 * Remove AndroidX warning. diff --git a/packages/cloud_functions/README.md b/packages/cloud_functions/README.md index 3f6ff884bda3..72ec8c24a5d1 100644 --- a/packages/cloud_functions/README.md +++ b/packages/cloud_functions/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Cloud Functions for Firebase API](https://firebase. For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! - ## Setup To use this plugin: @@ -54,3 +52,13 @@ dynamic resp = await callable.call({ ## Getting Started See the `example` directory for a complete sample app using Cloud Functions for Firebase. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/cloud_functions/pubspec.yaml b/packages/cloud_functions/pubspec.yaml index 81b99e2c53bc..acd1ee7ebd22 100644 --- a/packages/cloud_functions/pubspec.yaml +++ b/packages/cloud_functions/pubspec.yaml @@ -1,6 +1,6 @@ name: cloud_functions description: Flutter plugin for Cloud Functions. -version: 0.4.1+3 +version: 0.4.1+4 author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_functions diff --git a/packages/firebase_admob/CHANGELOG.md b/packages/firebase_admob/CHANGELOG.md index b2290d9332d7..62fdb2ff820e 100644 --- a/packages/firebase_admob/CHANGELOG.md +++ b/packages/firebase_admob/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.0+9 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.9.0+8 * Remove AndroidX warning. diff --git a/packages/firebase_admob/README.md b/packages/firebase_admob/README.md index ffee85f2a86c..57069e8f3380 100644 --- a/packages/firebase_admob/README.md +++ b/packages/firebase_admob/README.md @@ -4,9 +4,7 @@ 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/FirebaseExtended/flutterfire/issues) and -[Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are welcome. +For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). ## AndroidManifest changes @@ -186,8 +184,7 @@ method. ## Limitations -This is just an initial version of the plugin. There are still some -limitations: +This plugin currently has some limitations: - Banner ads cannot be animated into view. - It's not possible to specify a banner ad's size. @@ -197,5 +194,12 @@ limitations: - The example should demonstrate how to show gate a route push with an interstitial ad -For Flutter plugins for other Firebase products, see -[README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_admob/pubspec.yaml b/packages/firebase_admob/pubspec.yaml index f719fe72d82c..0204093fe642 100644 --- a/packages/firebase_admob/pubspec.yaml +++ b/packages/firebase_admob/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase AdMob, supporting banner, interstitial (full-screen), and rewarded video ads author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_admob -version: 0.9.0+8 +version: 0.9.0+9 flutter: plugin: diff --git a/packages/firebase_analytics/CHANGELOG.md b/packages/firebase_analytics/CHANGELOG.md index e54ce5885216..88dd434bec37 100644 --- a/packages/firebase_analytics/CHANGELOG.md +++ b/packages/firebase_analytics/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.0.6 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 5.0.5 * Remove AndroidX warning. diff --git a/packages/firebase_analytics/README.md b/packages/firebase_analytics/README.md index 7bbf6d3ad084..56f26582f098 100755 --- a/packages/firebase_analytics/README.md +++ b/packages/firebase_analytics/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Google Analytics for Firebase API](https://firebase For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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). @@ -37,4 +35,14 @@ for an example of how to wire that up. See the [`example`][example] directory for a complete sample app using Google Analytics for Firebase. [example]: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_analytics/example -[tabs_page]: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_analytics/example/lib/tabs_page.dart \ No newline at end of file +[tabs_page]: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_analytics/example/lib/tabs_page.dart + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_analytics/pubspec.yaml b/packages/firebase_analytics/pubspec.yaml index cd772b1bb181..7645250c7a13 100755 --- a/packages/firebase_analytics/pubspec.yaml +++ b/packages/firebase_analytics/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Analytics for Firebase, an app measuremen solution that provides insight on app usage and user engagement on Android and iOS. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_analytics -version: 5.0.5 +version: 5.0.6 flutter: plugin: diff --git a/packages/firebase_auth/CHANGELOG.md b/packages/firebase_auth/CHANGELOG.md index 372ea17b8c1a..134ac8763d1f 100644 --- a/packages/firebase_auth/CHANGELOG.md +++ b/packages/firebase_auth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.14.0+8 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.14.0+7 * Remove AndroidX warning. diff --git a/packages/firebase_auth/README.md b/packages/firebase_auth/README.md index a8b4098a3c41..5bd8e5c25a4f 100755 --- a/packages/firebase_auth/README.md +++ b/packages/firebase_auth/README.md @@ -5,8 +5,6 @@ A Flutter plugin to use the [Firebase Authentication API](https://firebase.googl For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! - ## Usage ### Configure the Google sign-in plugin @@ -139,5 +137,10 @@ for a complete sample app using the Firebase authentication. ## Issues and feedback -Please file [issues](https://github.com/FirebaseExtended/flutterfire/issues/new) -to send feedback or report a bug. Thank you! +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_auth/pubspec.yaml b/packages/firebase_auth/pubspec.yaml index be3207757abe..398d4238c312 100755 --- a/packages/firebase_auth/pubspec.yaml +++ b/packages/firebase_auth/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS like Google, Facebook and Twitter. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_auth -version: 0.14.0+7 +version: 0.14.0+8 flutter: plugin: diff --git a/packages/firebase_core/CHANGELOG.md b/packages/firebase_core/CHANGELOG.md index 8fc333b7810c..3e37e59d79aa 100644 --- a/packages/firebase_core/CHANGELOG.md +++ b/packages/firebase_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.1+3 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.4.1+2 * Remove AndroidX warning. diff --git a/packages/firebase_core/README.md b/packages/firebase_core/README.md index 5f5008e85bfb..127944bad9a6 100644 --- a/packages/firebase_core/README.md +++ b/packages/firebase_core/README.md @@ -6,11 +6,20 @@ A Flutter plugin to use the Firebase Core API, which enables connecting to multi For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_core/pubspec.yaml b/packages/firebase_core/pubspec.yaml index 05130accde4b..8a54c7dcc512 100644 --- a/packages/firebase_core/pubspec.yaml +++ b/packages/firebase_core/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Core, enabling connecting to multiple Firebase apps. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core -version: 0.4.1+2 +version: 0.4.1+3 flutter: plugin: diff --git a/packages/firebase_crashlytics/CHANGELOG.md b/packages/firebase_crashlytics/CHANGELOG.md index b72c1bd639ee..17bf38da9b6f 100644 --- a/packages/firebase_crashlytics/CHANGELOG.md +++ b/packages/firebase_crashlytics/CHANGELOG.md @@ -1,3 +1,14 @@ +## 0.1.1+2 + +* When reporting to Crashlytics on iOS, and printing supplied logs, do not + prepend each line with "FirebaseCrashlyticsPlugin.m line 44". +* Prepend `firebase_crashlytics: ` to the final answer from Crashlytics + plugin in the log to realize where it's coming from. + +## 0.1.1+1 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.1.1 * Log FlutterErrorDetails using Flutter's standard `FlutterError.dumpErrorToConsole`. diff --git a/packages/firebase_crashlytics/README.md b/packages/firebase_crashlytics/README.md index e22b1a2cb8cb..48f6a4ec482a 100644 --- a/packages/firebase_crashlytics/README.md +++ b/packages/firebase_crashlytics/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Firebase Crashlytics Service](https://firebase.goog For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! - ## Usage ### Import the firebase_crashlytics plugin @@ -124,5 +122,10 @@ for a complete sample app using `firebase_crashlytics`. ## Issues and feedback -Please file [issues](https://github.com/FirebaseExtended/flutterfire/issues/new) -to send feedback or report a bug. Thank you! +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m b/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m index 01f233cbd347..889b879745c7 100644 --- a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m +++ b/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m @@ -42,7 +42,12 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result // Add logs. NSArray *logs = call.arguments[@"logs"]; for (NSString *log in logs) { - CLS_LOG(@"%@", log); + // Here and below, use CLSLog instead of CLS_LOG to try and avoid + // automatic inclusion of the current code location. 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 + CLSLog(@"%@", log); } // Set keys. @@ -64,14 +69,10 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result } // 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. + // Crashlytics. NSString *information = call.arguments[@"information"]; if ([information length] != 0) { - CLSLog(information); + CLSLog(@"%@", information); } // Report crash. diff --git a/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart b/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart index 355d187807f1..daad45cb7de2 100644 --- a/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart +++ b/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart @@ -264,7 +264,7 @@ class Crashlytics { }); // Print result. - print(result); + print('firebase_crashlytics: $result'); } } } diff --git a/packages/firebase_crashlytics/pubspec.yaml b/packages/firebase_crashlytics/pubspec.yaml index 5bd9bc8bbadd..826dcad698af 100644 --- a/packages/firebase_crashlytics/pubspec.yaml +++ b/packages/firebase_crashlytics/pubspec.yaml @@ -2,7 +2,7 @@ name: firebase_crashlytics description: Flutter plugin for Firebase Crashlytics. It reports uncaught errors to the Firebase console. -version: 0.1.1 +version: 0.1.1+2 author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_crashlytics diff --git a/packages/firebase_database/CHANGELOG.md b/packages/firebase_database/CHANGELOG.md index ef3923387c52..aa9a08bdcb25 100644 --- a/packages/firebase_database/CHANGELOG.md +++ b/packages/firebase_database/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.9 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 3.0.8 * Remove AndroidX warning. diff --git a/packages/firebase_database/README.md b/packages/firebase_database/README.md index ad675c1c41ad..e9adc646cbad 100755 --- a/packages/firebase_database/README.md +++ b/packages/firebase_database/README.md @@ -6,11 +6,19 @@ A Flutter plugin to use the [Firebase Realtime Database API](https://firebase.go For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_database/pubspec.yaml b/packages/firebase_database/pubspec.yaml index 740084f6389e..bbfcb78b560b 100755 --- a/packages/firebase_database/pubspec.yaml +++ b/packages/firebase_database/pubspec.yaml @@ -3,7 +3,7 @@ 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/FirebaseExtended/flutterfire/tree/master/packages/firebase_database -version: 3.0.8 +version: 3.0.9 flutter: plugin: diff --git a/packages/firebase_dynamic_links/CHANGELOG.md b/packages/firebase_dynamic_links/CHANGELOG.md index 96d535835b24..d68336cfe70f 100644 --- a/packages/firebase_dynamic_links/CHANGELOG.md +++ b/packages/firebase_dynamic_links/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.0+6 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.5.0+5 * Remove AndroidX warning. diff --git a/packages/firebase_dynamic_links/README.md b/packages/firebase_dynamic_links/README.md index 96a4b1b176af..adee21062b89 100644 --- a/packages/firebase_dynamic_links/README.md +++ b/packages/firebase_dynamic_links/README.md @@ -10,8 +10,6 @@ In addition, Dynamic Links work across app installs: if a user opens a Dynamic L For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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). @@ -154,3 +152,13 @@ If your app did not open from a dynamic link, `getInitialLink()` will return `nu ## Getting Started See the `example` directory for a complete sample app using Google Dynamic Links for Firebase. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_dynamic_links/pubspec.yaml b/packages/firebase_dynamic_links/pubspec.yaml index 0662b786a9ee..6e65ada6f417 100644 --- a/packages/firebase_dynamic_links/pubspec.yaml +++ b/packages/firebase_dynamic_links/pubspec.yaml @@ -1,7 +1,7 @@ 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+5 +version: 0.5.0+6 author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_dynamic_links diff --git a/packages/firebase_in_app_messaging/CHANGELOG.md b/packages/firebase_in_app_messaging/CHANGELOG.md index 8dc01def7cd9..ef9f9aa49b15 100644 --- a/packages/firebase_in_app_messaging/CHANGELOG.md +++ b/packages/firebase_in_app_messaging/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.0 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.0.1+4 * Update example app with correct const constructors. diff --git a/packages/firebase_in_app_messaging/README.md b/packages/firebase_in_app_messaging/README.md index 24e904e950cb..fc3b4d35060e 100644 --- a/packages/firebase_in_app_messaging/README.md +++ b/packages/firebase_in_app_messaging/README.md @@ -2,7 +2,7 @@ A Flutter plugin to use the [Firebase In-App Messaging API](https://firebase.google.com/products/in-app-messaging). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! +For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). ## Usage @@ -84,5 +84,10 @@ 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! +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_in_app_messaging/pubspec.yaml b/packages/firebase_in_app_messaging/pubspec.yaml index 95241d8fa95c..51e3323ec523 100644 --- a/packages/firebase_in_app_messaging/pubspec.yaml +++ b/packages/firebase_in_app_messaging/pubspec.yaml @@ -1,6 +1,6 @@ name: firebase_in_app_messaging description: Flutter plugin for Firebase In-App Messaging. -version: 0.0.1+4 +version: 0.1.0 author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_in_app_messaging diff --git a/packages/firebase_messaging/CHANGELOG.md b/packages/firebase_messaging/CHANGELOG.md index 274523449f0c..84c360d37a87 100644 --- a/packages/firebase_messaging/CHANGELOG.md +++ b/packages/firebase_messaging/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.1.8 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 5.1.7 * Remove AndroidX warning. diff --git a/packages/firebase_messaging/README.md b/packages/firebase_messaging/README.md index 4e126949b929..619e1c6ed34c 100644 --- a/packages/firebase_messaging/README.md +++ b/packages/firebase_messaging/README.md @@ -8,8 +8,6 @@ With this plugin, your Flutter app can receive and process push notifications as For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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/). @@ -196,3 +194,13 @@ curl https://fcm.googleapis.com/fcm/send -H "Content-Type:application/json" -X P ``` Remove the `notification` property in `DATA` to send a data message. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_messaging/pubspec.yaml b/packages/firebase_messaging/pubspec.yaml index f3aeb9f2789a..55b00a8d5328 100644 --- a/packages/firebase_messaging/pubspec.yaml +++ b/packages/firebase_messaging/pubspec.yaml @@ -3,7 +3,7 @@ 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/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging -version: 5.1.7 +version: 5.1.8 flutter: plugin: diff --git a/packages/firebase_ml_vision/CHANGELOG.md b/packages/firebase_ml_vision/CHANGELOG.md index 5ea8535e5249..a68316415d83 100644 --- a/packages/firebase_ml_vision/CHANGELOG.md +++ b/packages/firebase_ml_vision/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.3+3 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.9.3+2 * Remove AndroidX warning. diff --git a/packages/firebase_ml_vision/README.md b/packages/firebase_ml_vision/README.md index 8bece4b85e6e..198a2d0578db 100644 --- a/packages/firebase_ml_vision/README.md +++ b/packages/firebase_ml_vision/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [ML Kit Vision for Firebase API](https://firebase.go For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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). @@ -205,3 +203,13 @@ textRecognizer.close(); ## Getting Started See the `example` directory for a complete sample app using ML Kit Vision for Firebase. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_ml_vision/pubspec.yaml b/packages/firebase_ml_vision/pubspec.yaml index 68eaa5ed88f3..61155067c5e1 100644 --- a/packages/firebase_ml_vision/pubspec.yaml +++ b/packages/firebase_ml_vision/pubspec.yaml @@ -2,7 +2,7 @@ name: firebase_ml_vision description: Flutter plugin for Firebase machine learning vision services. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_ml_vision -version: 0.9.3+2 +version: 0.9.3+3 dependencies: flutter: diff --git a/packages/firebase_performance/CHANGELOG.md b/packages/firebase_performance/CHANGELOG.md index 3d68023eacb0..598fdde5d645 100644 --- a/packages/firebase_performance/CHANGELOG.md +++ b/packages/firebase_performance/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.1+2 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.3.1+1 * Remove AndroidX warning. diff --git a/packages/firebase_performance/README.md b/packages/firebase_performance/README.md index e854b462534a..4ee698b61f36 100644 --- a/packages/firebase_performance/README.md +++ b/packages/firebase_performance/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Google Performance Monitoring for Firebase API](htt For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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). @@ -86,3 +84,13 @@ class _MyAppState extends State { ## Getting Started See the `example` directory for a complete sample app using Google Performance Monitoring for Firebase. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_performance/pubspec.yaml b/packages/firebase_performance/pubspec.yaml index 6247d37c2481..ec90bc828f4f 100644 --- a/packages/firebase_performance/pubspec.yaml +++ b/packages/firebase_performance/pubspec.yaml @@ -4,7 +4,7 @@ description: Flutter plugin for Google Performance Monitoring for Firebase, an a iOS. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_performance -version: 0.3.1+1 +version: 0.3.1+2 dependencies: flutter: diff --git a/packages/firebase_remote_config/CHANGELOG.md b/packages/firebase_remote_config/CHANGELOG.md index aea74f26bdf6..1421eeebe871 100644 --- a/packages/firebase_remote_config/CHANGELOG.md +++ b/packages/firebase_remote_config/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.0+9 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 0.2.0+8 * Remove AndroidX warning. diff --git a/packages/firebase_remote_config/README.md b/packages/firebase_remote_config/README.md index 72828234bc59..72a0339f8ad7 100644 --- a/packages/firebase_remote_config/README.md +++ b/packages/firebase_remote_config/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Firebase Remote Config API](https://firebase.google For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! - ## Usage ### Import the firebase_remote_config plugin @@ -72,5 +70,10 @@ for a complete sample app using the Firebase Remote Config. ## Issues and feedback -Please file [issues](https://github.com/FirebaseExtended/flutterfire/issues/new) -to send feedback or report a bug. Thank you! +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_remote_config/pubspec.yaml b/packages/firebase_remote_config/pubspec.yaml index 4561a043d966..8f9cf2d4f347 100644 --- a/packages/firebase_remote_config/pubspec.yaml +++ b/packages/firebase_remote_config/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Remote Config. Update your application re-releasing. author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_remote_config -version: 0.2.0+8 +version: 0.2.0+9 dependencies: flutter: diff --git a/packages/firebase_storage/CHANGELOG.md b/packages/firebase_storage/CHANGELOG.md index 82f689f7ff2e..38875cb045ee 100644 --- a/packages/firebase_storage/CHANGELOG.md +++ b/packages/firebase_storage/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.8 + +* Updated README instructions for contributing for consistency with other Flutterfire plugins. + ## 3.0.7 * Remove AndroidX warning. diff --git a/packages/firebase_storage/README.md b/packages/firebase_storage/README.md index ed92b3fbf4a4..0985eefa2ca9 100755 --- a/packages/firebase_storage/README.md +++ b/packages/firebase_storage/README.md @@ -6,8 +6,6 @@ A Flutter plugin to use the [Firebase Cloud Storage API](https://firebase.google For Flutter plugins for other Firebase products, see [README.md](https://github.com/FirebaseExtended/flutterfire/blob/master/README.md). -*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/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/). @@ -40,3 +38,13 @@ streamSubscription.cancel(); ## Getting Started See the `example` directory for a complete sample app using Firebase Cloud Storage. + +## Issues and feedback + +Please file Flutterfire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FirebaseExtended/flutterfire/issues/new). + +Plugin issues that are not specific to Flutterfire can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +To contribute a change to this plugin, +please review our [contribution guide](https://github.com/FirebaseExtended/flutterfire/blob/master/CONTRIBUTING.md), +and send a [pull request](https://github.com/FirebaseExtended/flutterfire/pulls). diff --git a/packages/firebase_storage/pubspec.yaml b/packages/firebase_storage/pubspec.yaml index c5f20d13cfa2..3a42689f5ba0 100755 --- a/packages/firebase_storage/pubspec.yaml +++ b/packages/firebase_storage/pubspec.yaml @@ -3,7 +3,7 @@ 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/FirebaseExtended/flutterfire/tree/master/packages/firebase_storage -version: 3.0.7 +version: 3.0.8 flutter: plugin: