From ca280131985078bfb40248040b05882b3038651d Mon Sep 17 00:00:00 2001 From: Guillaume Bernos Date: Tue, 14 Mar 2023 14:29:50 +0100 Subject: [PATCH] feat(core, windows): update pigeon --- .../core/GeneratedAndroidFirebaseCore.java | 276 +++++++------- .../firebase_core/ios/Classes/messages.g.h | 95 +++-- .../firebase_core/ios/Classes/messages.g.m | 339 +++++++----------- .../lib/src/pigeon/messages.pigeon.dart | 260 +++++++------- .../lib/src/pigeon/test_api.dart | 84 ++--- 5 files changed, 455 insertions(+), 599 deletions(-) diff --git a/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java b/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java index d3f4b5ed3b83..c19c5b8b4ca3 100644 --- a/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java +++ b/packages/firebase_core/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/GeneratedAndroidFirebaseCore.java @@ -1,10 +1,4 @@ -/* - * Copyright 2022, 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. - */ - -// Autogenerated from Pigeon (v3.2.0), do not edit directly. +// Autogenerated from Pigeon (v9.0.6), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.firebase.core; @@ -19,6 +13,8 @@ import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -26,9 +22,18 @@ /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression"}) public class GeneratedAndroidFirebaseCore { + @NonNull + private static ArrayList wrapError(@NonNull Throwable exception) { + ArrayList errorList = new ArrayList(3); + errorList.add(exception.toString()); + errorList.add(exception.getClass().getSimpleName()); + errorList.add( + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + return errorList; + } /** Generated class from Pigeon that represents data sent in messages. */ - public static class PigeonFirebaseOptions { + public static final class PigeonFirebaseOptions { private @NonNull String apiKey; public @NonNull String getApiKey() { @@ -185,6 +190,7 @@ public void setAppGroupId(@Nullable String setterArg) { private PigeonFirebaseOptions() {} public static final class Builder { + private @Nullable String apiKey; public @NonNull Builder setApiKey(@NonNull String setterArg) { @@ -304,61 +310,61 @@ public static final class Builder { } @NonNull - Map toMap() { - Map toMapResult = new HashMap<>(); - toMapResult.put("apiKey", apiKey); - toMapResult.put("appId", appId); - toMapResult.put("messagingSenderId", messagingSenderId); - toMapResult.put("projectId", projectId); - toMapResult.put("authDomain", authDomain); - toMapResult.put("databaseURL", databaseURL); - toMapResult.put("storageBucket", storageBucket); - toMapResult.put("measurementId", measurementId); - toMapResult.put("trackingId", trackingId); - toMapResult.put("deepLinkURLScheme", deepLinkURLScheme); - toMapResult.put("androidClientId", androidClientId); - toMapResult.put("iosClientId", iosClientId); - toMapResult.put("iosBundleId", iosBundleId); - toMapResult.put("appGroupId", appGroupId); - return toMapResult; - } - - static @NonNull PigeonFirebaseOptions fromMap(@NonNull Map map) { + ArrayList toList() { + ArrayList toListResult = new ArrayList(14); + toListResult.add(apiKey); + toListResult.add(appId); + toListResult.add(messagingSenderId); + toListResult.add(projectId); + toListResult.add(authDomain); + toListResult.add(databaseURL); + toListResult.add(storageBucket); + toListResult.add(measurementId); + toListResult.add(trackingId); + toListResult.add(deepLinkURLScheme); + toListResult.add(androidClientId); + toListResult.add(iosClientId); + toListResult.add(iosBundleId); + toListResult.add(appGroupId); + return toListResult; + } + + static @NonNull PigeonFirebaseOptions fromList(@NonNull ArrayList list) { PigeonFirebaseOptions pigeonResult = new PigeonFirebaseOptions(); - Object apiKey = map.get("apiKey"); + Object apiKey = list.get(0); pigeonResult.setApiKey((String) apiKey); - Object appId = map.get("appId"); + Object appId = list.get(1); pigeonResult.setAppId((String) appId); - Object messagingSenderId = map.get("messagingSenderId"); + Object messagingSenderId = list.get(2); pigeonResult.setMessagingSenderId((String) messagingSenderId); - Object projectId = map.get("projectId"); + Object projectId = list.get(3); pigeonResult.setProjectId((String) projectId); - Object authDomain = map.get("authDomain"); + Object authDomain = list.get(4); pigeonResult.setAuthDomain((String) authDomain); - Object databaseURL = map.get("databaseURL"); + Object databaseURL = list.get(5); pigeonResult.setDatabaseURL((String) databaseURL); - Object storageBucket = map.get("storageBucket"); + Object storageBucket = list.get(6); pigeonResult.setStorageBucket((String) storageBucket); - Object measurementId = map.get("measurementId"); + Object measurementId = list.get(7); pigeonResult.setMeasurementId((String) measurementId); - Object trackingId = map.get("trackingId"); + Object trackingId = list.get(8); pigeonResult.setTrackingId((String) trackingId); - Object deepLinkURLScheme = map.get("deepLinkURLScheme"); + Object deepLinkURLScheme = list.get(9); pigeonResult.setDeepLinkURLScheme((String) deepLinkURLScheme); - Object androidClientId = map.get("androidClientId"); + Object androidClientId = list.get(10); pigeonResult.setAndroidClientId((String) androidClientId); - Object iosClientId = map.get("iosClientId"); + Object iosClientId = list.get(11); pigeonResult.setIosClientId((String) iosClientId); - Object iosBundleId = map.get("iosBundleId"); + Object iosBundleId = list.get(12); pigeonResult.setIosBundleId((String) iosBundleId); - Object appGroupId = map.get("appGroupId"); + Object appGroupId = list.get(13); pigeonResult.setAppGroupId((String) appGroupId); return pigeonResult; } } /** Generated class from Pigeon that represents data sent in messages. */ - public static class PigeonInitializeResponse { + public static final class PigeonInitializeResponse { private @NonNull String name; public @NonNull String getName() { @@ -412,6 +418,7 @@ public void setPluginConstants(@NonNull Map setterArg) { private PigeonInitializeResponse() {} public static final class Builder { + private @Nullable String name; public @NonNull Builder setName(@NonNull String setterArg) { @@ -451,25 +458,24 @@ public static final class Builder { } @NonNull - Map toMap() { - Map toMapResult = new HashMap<>(); - toMapResult.put("name", name); - toMapResult.put("options", (options == null) ? null : options.toMap()); - toMapResult.put("isAutomaticDataCollectionEnabled", isAutomaticDataCollectionEnabled); - toMapResult.put("pluginConstants", pluginConstants); - return toMapResult; + ArrayList toList() { + ArrayList toListResult = new ArrayList(4); + toListResult.add(name); + toListResult.add((options == null) ? null : options.toList()); + toListResult.add(isAutomaticDataCollectionEnabled); + toListResult.add(pluginConstants); + return toListResult; } - static @NonNull PigeonInitializeResponse fromMap(@NonNull Map map) { + static @NonNull PigeonInitializeResponse fromList(@NonNull ArrayList list) { PigeonInitializeResponse pigeonResult = new PigeonInitializeResponse(); - Object name = map.get("name"); + Object name = list.get(0); pigeonResult.setName((String) name); - Object options = map.get("options"); - pigeonResult.setOptions( - (options == null) ? null : PigeonFirebaseOptions.fromMap((Map) options)); - Object isAutomaticDataCollectionEnabled = map.get("isAutomaticDataCollectionEnabled"); + Object options = list.get(1); + pigeonResult.setOptions((options == null) ? null : PigeonFirebaseOptions.fromList((ArrayList) options)); + Object isAutomaticDataCollectionEnabled = list.get(2); pigeonResult.setIsAutomaticDataCollectionEnabled((Boolean) isAutomaticDataCollectionEnabled); - Object pluginConstants = map.get("pluginConstants"); + Object pluginConstants = list.get(3); pigeonResult.setPluginConstants((Map) pluginConstants); return pigeonResult; } @@ -487,27 +493,25 @@ private static class FirebaseCoreHostApiCodec extends StandardMessageCodec { private FirebaseCoreHostApiCodec() {} @Override - protected Object readValueOfType(byte type, ByteBuffer buffer) { + protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { case (byte) 128: - return PigeonFirebaseOptions.fromMap((Map) readValue(buffer)); - + return PigeonFirebaseOptions.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return PigeonInitializeResponse.fromMap((Map) readValue(buffer)); - + return PigeonInitializeResponse.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } } @Override - protected void writeValue(ByteArrayOutputStream stream, Object value) { + protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { if (value instanceof PigeonFirebaseOptions) { stream.write(128); - writeValue(stream, ((PigeonFirebaseOptions) value).toMap()); + writeValue(stream, ((PigeonFirebaseOptions) value).toList()); } else if (value instanceof PigeonInitializeResponse) { stream.write(129); - writeValue(stream, ((PigeonInitializeResponse) value).toMap()); + writeValue(stream, ((PigeonInitializeResponse) value).toList()); } else { super.writeValue(stream, value); } @@ -516,10 +520,8 @@ protected void writeValue(ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FirebaseCoreHostApi { - void initializeApp( - @NonNull String appName, - @NonNull PigeonFirebaseOptions initializeAppRequest, - Result result); + + void initializeApp(@NonNull String appName, @NonNull PigeonFirebaseOptions initializeAppRequest, Result result); void initializeCore(Result> result); @@ -529,50 +531,44 @@ void initializeApp( static MessageCodec getCodec() { return FirebaseCoreHostApiCodec.INSTANCE; } - - /** - * Sets up an instance of `FirebaseCoreHostApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `FirebaseCoreHostApi` to handle messages through the `binaryMessenger`. */ static void setup(BinaryMessenger binaryMessenger, FirebaseCoreHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - Map wrapped = new HashMap<>(); + ArrayList wrapped = new ArrayList(); try { ArrayList args = (ArrayList) message; + assert args != null; String appNameArg = (String) args.get(0); if (appNameArg == null) { throw new NullPointerException("appNameArg unexpectedly null."); } - PigeonFirebaseOptions initializeAppRequestArg = - (PigeonFirebaseOptions) args.get(1); + PigeonFirebaseOptions initializeAppRequestArg = (PigeonFirebaseOptions) args.get(1); if (initializeAppRequestArg == null) { throw new NullPointerException("initializeAppRequestArg unexpectedly null."); } Result resultCallback = new Result() { public void success(PigeonInitializeResponse result) { - wrapped.put("result", result); + wrapped.add(0, result); reply.reply(wrapped); } public void error(Throwable error) { - wrapped.put("error", wrapError(error)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); } }; api.initializeApp(appNameArg, initializeAppRequestArg, resultCallback); } catch (Error | RuntimeException exception) { - wrapped.put("error", wrapError(exception)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); } }); } else { @@ -582,31 +578,29 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FirebaseCoreHostApi.initializeCore", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FirebaseCoreHostApi.initializeCore", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - Map wrapped = new HashMap<>(); + ArrayList wrapped = new ArrayList(); try { Result> resultCallback = new Result>() { public void success(List result) { - wrapped.put("result", result); + wrapped.add(0, result); reply.reply(wrapped); } public void error(Throwable error) { - wrapped.put("error", wrapError(error)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); } }; api.initializeCore(resultCallback); } catch (Error | RuntimeException exception) { - wrapped.put("error", wrapError(exception)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); } }); } else { @@ -616,31 +610,29 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FirebaseCoreHostApi.optionsFromResource", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FirebaseCoreHostApi.optionsFromResource", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - Map wrapped = new HashMap<>(); + ArrayList wrapped = new ArrayList(); try { Result resultCallback = new Result() { public void success(PigeonFirebaseOptions result) { - wrapped.put("result", result); + wrapped.add(0, result); reply.reply(wrapped); } public void error(Throwable error) { - wrapped.put("error", wrapError(error)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); } }; api.optionsFromResource(resultCallback); } catch (Error | RuntimeException exception) { - wrapped.put("error", wrapError(exception)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); } }); } else { @@ -649,44 +641,32 @@ public void error(Throwable error) { } } } - - private static class FirebaseAppHostApiCodec extends StandardMessageCodec { - public static final FirebaseAppHostApiCodec INSTANCE = new FirebaseAppHostApiCodec(); - - private FirebaseAppHostApiCodec() {} - } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FirebaseAppHostApi { - void setAutomaticDataCollectionEnabled( - @NonNull String appName, @NonNull Boolean enabled, Result result); - void setAutomaticResourceManagementEnabled( - @NonNull String appName, @NonNull Boolean enabled, Result result); + void setAutomaticDataCollectionEnabled(@NonNull String appName, @NonNull Boolean enabled, Result result); + + void setAutomaticResourceManagementEnabled(@NonNull String appName, @NonNull Boolean enabled, Result result); void delete(@NonNull String appName, Result result); /** The codec used by FirebaseAppHostApi. */ static MessageCodec getCodec() { - return FirebaseAppHostApiCodec.INSTANCE; + return new StandardMessageCodec(); } - - /** - * Sets up an instance of `FirebaseAppHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `FirebaseAppHostApi` to handle messages through the `binaryMessenger`. */ static void setup(BinaryMessenger binaryMessenger, FirebaseAppHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - Map wrapped = new HashMap<>(); + ArrayList wrapped = new ArrayList(); try { ArrayList args = (ArrayList) message; + assert args != null; String appNameArg = (String) args.get(0); if (appNameArg == null) { throw new NullPointerException("appNameArg unexpectedly null."); @@ -698,20 +678,20 @@ static void setup(BinaryMessenger binaryMessenger, FirebaseAppHostApi api) { Result resultCallback = new Result() { public void success(Void result) { - wrapped.put("result", null); + wrapped.add(0, null); reply.reply(wrapped); } public void error(Throwable error) { - wrapped.put("error", wrapError(error)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); } }; api.setAutomaticDataCollectionEnabled(appNameArg, enabledArg, resultCallback); } catch (Error | RuntimeException exception) { - wrapped.put("error", wrapError(exception)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); } }); } else { @@ -721,15 +701,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - Map wrapped = new HashMap<>(); + ArrayList wrapped = new ArrayList(); try { ArrayList args = (ArrayList) message; + assert args != null; String appNameArg = (String) args.get(0); if (appNameArg == null) { throw new NullPointerException("appNameArg unexpectedly null."); @@ -741,20 +720,20 @@ public void error(Throwable error) { Result resultCallback = new Result() { public void success(Void result) { - wrapped.put("result", null); + wrapped.add(0, null); reply.reply(wrapped); } public void error(Throwable error) { - wrapped.put("error", wrapError(error)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); } }; api.setAutomaticResourceManagementEnabled(appNameArg, enabledArg, resultCallback); } catch (Error | RuntimeException exception) { - wrapped.put("error", wrapError(exception)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); } }); } else { @@ -768,9 +747,10 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - Map wrapped = new HashMap<>(); + ArrayList wrapped = new ArrayList(); try { ArrayList args = (ArrayList) message; + assert args != null; String appNameArg = (String) args.get(0); if (appNameArg == null) { throw new NullPointerException("appNameArg unexpectedly null."); @@ -778,20 +758,20 @@ public void error(Throwable error) { Result resultCallback = new Result() { public void success(Void result) { - wrapped.put("result", null); + wrapped.add(0, null); reply.reply(wrapped); } public void error(Throwable error) { - wrapped.put("error", wrapError(error)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); } }; api.delete(appNameArg, resultCallback); } catch (Error | RuntimeException exception) { - wrapped.put("error", wrapError(exception)); - reply.reply(wrapped); + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); } }); } else { @@ -800,14 +780,4 @@ public void error(Throwable error) { } } } - - private static Map wrapError(Throwable exception) { - Map errorMap = new HashMap<>(); - errorMap.put("message", exception.toString()); - errorMap.put("code", exception.getClass().getSimpleName()); - errorMap.put( - "details", - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); - return errorMap; - } } diff --git a/packages/firebase_core/firebase_core/ios/Classes/messages.g.h b/packages/firebase_core/firebase_core/ios/Classes/messages.g.h index 70cdb4f374a9..621dc1a79ccf 100644 --- a/packages/firebase_core/firebase_core/ios/Classes/messages.g.h +++ b/packages/firebase_core/firebase_core/ios/Classes/messages.g.h @@ -1,6 +1,8 @@ -// Autogenerated from Pigeon (v3.2.0), do not edit directly. +// Autogenerated from Pigeon (v9.0.6), do not edit directly. // See also: https://pub.dev/packages/pigeon + #import + @protocol FlutterBinaryMessenger; @protocol FlutterMessageCodec; @class FlutterError; @@ -15,79 +17,68 @@ NS_ASSUME_NONNULL_BEGIN /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithApiKey:(NSString *)apiKey - appId:(NSString *)appId - messagingSenderId:(NSString *)messagingSenderId - projectId:(NSString *)projectId - authDomain:(nullable NSString *)authDomain - databaseURL:(nullable NSString *)databaseURL - storageBucket:(nullable NSString *)storageBucket - measurementId:(nullable NSString *)measurementId - trackingId:(nullable NSString *)trackingId - deepLinkURLScheme:(nullable NSString *)deepLinkURLScheme - androidClientId:(nullable NSString *)androidClientId - iosClientId:(nullable NSString *)iosClientId - iosBundleId:(nullable NSString *)iosBundleId - appGroupId:(nullable NSString *)appGroupId; -@property(nonatomic, copy) NSString *apiKey; -@property(nonatomic, copy) NSString *appId; -@property(nonatomic, copy) NSString *messagingSenderId; -@property(nonatomic, copy) NSString *projectId; -@property(nonatomic, copy, nullable) NSString *authDomain; -@property(nonatomic, copy, nullable) NSString *databaseURL; -@property(nonatomic, copy, nullable) NSString *storageBucket; -@property(nonatomic, copy, nullable) NSString *measurementId; -@property(nonatomic, copy, nullable) NSString *trackingId; -@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; -@property(nonatomic, copy, nullable) NSString *androidClientId; -@property(nonatomic, copy, nullable) NSString *iosClientId; -@property(nonatomic, copy, nullable) NSString *iosBundleId; -@property(nonatomic, copy, nullable) NSString *appGroupId; + appId:(NSString *)appId + messagingSenderId:(NSString *)messagingSenderId + projectId:(NSString *)projectId + authDomain:(nullable NSString *)authDomain + databaseURL:(nullable NSString *)databaseURL + storageBucket:(nullable NSString *)storageBucket + measurementId:(nullable NSString *)measurementId + trackingId:(nullable NSString *)trackingId + deepLinkURLScheme:(nullable NSString *)deepLinkURLScheme + androidClientId:(nullable NSString *)androidClientId + iosClientId:(nullable NSString *)iosClientId + iosBundleId:(nullable NSString *)iosBundleId + appGroupId:(nullable NSString *)appGroupId; +@property(nonatomic, copy) NSString * apiKey; +@property(nonatomic, copy) NSString * appId; +@property(nonatomic, copy) NSString * messagingSenderId; +@property(nonatomic, copy) NSString * projectId; +@property(nonatomic, copy, nullable) NSString * authDomain; +@property(nonatomic, copy, nullable) NSString * databaseURL; +@property(nonatomic, copy, nullable) NSString * storageBucket; +@property(nonatomic, copy, nullable) NSString * measurementId; +@property(nonatomic, copy, nullable) NSString * trackingId; +@property(nonatomic, copy, nullable) NSString * deepLinkURLScheme; +@property(nonatomic, copy, nullable) NSString * androidClientId; +@property(nonatomic, copy, nullable) NSString * iosClientId; +@property(nonatomic, copy, nullable) NSString * iosBundleId; +@property(nonatomic, copy, nullable) NSString * appGroupId; @end @interface PigeonInitializeResponse : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithName:(NSString *)name - options:(PigeonFirebaseOptions *)options + options:(PigeonFirebaseOptions *)options isAutomaticDataCollectionEnabled:(nullable NSNumber *)isAutomaticDataCollectionEnabled - pluginConstants:(NSDictionary *)pluginConstants; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, strong) PigeonFirebaseOptions *options; -@property(nonatomic, strong, nullable) NSNumber *isAutomaticDataCollectionEnabled; -@property(nonatomic, strong) NSDictionary *pluginConstants; + pluginConstants:(NSDictionary *)pluginConstants; +@property(nonatomic, copy) NSString * name; +@property(nonatomic, strong) PigeonFirebaseOptions * options; +@property(nonatomic, strong, nullable) NSNumber * isAutomaticDataCollectionEnabled; +@property(nonatomic, strong) NSDictionary * pluginConstants; @end /// The codec used by FirebaseCoreHostApi. NSObject *FirebaseCoreHostApiGetCodec(void); @protocol FirebaseCoreHostApi -- (void)initializeAppAppName:(NSString *)appName - initializeAppRequest:(PigeonFirebaseOptions *)initializeAppRequest - completion:(void (^)(PigeonInitializeResponse *_Nullable, - FlutterError *_Nullable))completion; -- (void)initializeCoreWithCompletion:(void (^)(NSArray *_Nullable, - FlutterError *_Nullable))completion; -- (void)optionsFromResourceWithCompletion:(void (^)(PigeonFirebaseOptions *_Nullable, - FlutterError *_Nullable))completion; +- (void)initializeAppAppName:(NSString *)appName initializeAppRequest:(PigeonFirebaseOptions *)initializeAppRequest completion:(void (^)(PigeonInitializeResponse *_Nullable, FlutterError *_Nullable))completion; +- (void)initializeCoreWithCompletion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)optionsFromResourceWithCompletion:(void (^)(PigeonFirebaseOptions *_Nullable, FlutterError *_Nullable))completion; @end -extern void FirebaseCoreHostApiSetup(id binaryMessenger, - NSObject *_Nullable api); +extern void FirebaseCoreHostApiSetup(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FirebaseAppHostApi. NSObject *FirebaseAppHostApiGetCodec(void); @protocol FirebaseAppHostApi -- (void)setAutomaticDataCollectionEnabledAppName:(NSString *)appName - enabled:(NSNumber *)enabled - completion:(void (^)(FlutterError *_Nullable))completion; -- (void)setAutomaticResourceManagementEnabledAppName:(NSString *)appName - enabled:(NSNumber *)enabled - completion:(void (^)(FlutterError *_Nullable))completion; +- (void)setAutomaticDataCollectionEnabledAppName:(NSString *)appName enabled:(NSNumber *)enabled completion:(void (^)(FlutterError *_Nullable))completion; +- (void)setAutomaticResourceManagementEnabledAppName:(NSString *)appName enabled:(NSNumber *)enabled completion:(void (^)(FlutterError *_Nullable))completion; - (void)deleteAppName:(NSString *)appName completion:(void (^)(FlutterError *_Nullable))completion; @end -extern void FirebaseAppHostApiSetup(id binaryMessenger, - NSObject *_Nullable api); +extern void FirebaseAppHostApiSetup(id binaryMessenger, NSObject *_Nullable api); NS_ASSUME_NONNULL_END diff --git a/packages/firebase_core/firebase_core/ios/Classes/messages.g.m b/packages/firebase_core/firebase_core/ios/Classes/messages.g.m index 1c22807964d1..8d6cda3d45af 100644 --- a/packages/firebase_core/firebase_core/ios/Classes/messages.g.m +++ b/packages/firebase_core/firebase_core/ios/Classes/messages.g.m @@ -1,33 +1,20 @@ -// Autogenerated from Pigeon (v3.2.0), do not edit directly. +// Autogenerated from Pigeon (v9.0.6), do not edit directly. // See also: https://pub.dev/packages/pigeon + #import "messages.g.h" -#if TARGET_OS_OSX -#import -#else #import -#endif #if !__has_feature(objc_arc) #error File requires ARC to be enabled. #endif -static NSDictionary *wrapResult(id result, FlutterError *error) { - NSDictionary *errorDict = (NSDictionary *)[NSNull null]; +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { - errorDict = @{ - @"code" : (error.code ?: [NSNull null]), - @"message" : (error.message ?: [NSNull null]), - @"details" : (error.details ?: [NSNull null]), - }; + return @[ + error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] + ]; } - return @{ - @"result" : (result ?: [NSNull null]), - @"error" : errorDict, - }; -} -static id GetNullableObject(NSDictionary *dict, id key) { - id result = dict[key]; - return (result == [NSNull null]) ? nil : result; + return @[ result ?: [NSNull null] ]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; @@ -35,32 +22,33 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { } @interface PigeonFirebaseOptions () -+ (PigeonFirebaseOptions *)fromMap:(NSDictionary *)dict; -+ (nullable PigeonFirebaseOptions *)nullableFromMap:(NSDictionary *)dict; -- (NSDictionary *)toMap; ++ (PigeonFirebaseOptions *)fromList:(NSArray *)list; ++ (nullable PigeonFirebaseOptions *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end + @interface PigeonInitializeResponse () -+ (PigeonInitializeResponse *)fromMap:(NSDictionary *)dict; -+ (nullable PigeonInitializeResponse *)nullableFromMap:(NSDictionary *)dict; -- (NSDictionary *)toMap; ++ (PigeonInitializeResponse *)fromList:(NSArray *)list; ++ (nullable PigeonInitializeResponse *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @implementation PigeonFirebaseOptions + (instancetype)makeWithApiKey:(NSString *)apiKey - appId:(NSString *)appId - messagingSenderId:(NSString *)messagingSenderId - projectId:(NSString *)projectId - authDomain:(nullable NSString *)authDomain - databaseURL:(nullable NSString *)databaseURL - storageBucket:(nullable NSString *)storageBucket - measurementId:(nullable NSString *)measurementId - trackingId:(nullable NSString *)trackingId - deepLinkURLScheme:(nullable NSString *)deepLinkURLScheme - androidClientId:(nullable NSString *)androidClientId - iosClientId:(nullable NSString *)iosClientId - iosBundleId:(nullable NSString *)iosBundleId - appGroupId:(nullable NSString *)appGroupId { - PigeonFirebaseOptions *pigeonResult = [[PigeonFirebaseOptions alloc] init]; + appId:(NSString *)appId + messagingSenderId:(NSString *)messagingSenderId + projectId:(NSString *)projectId + authDomain:(nullable NSString *)authDomain + databaseURL:(nullable NSString *)databaseURL + storageBucket:(nullable NSString *)storageBucket + measurementId:(nullable NSString *)measurementId + trackingId:(nullable NSString *)trackingId + deepLinkURLScheme:(nullable NSString *)deepLinkURLScheme + androidClientId:(nullable NSString *)androidClientId + iosClientId:(nullable NSString *)iosClientId + iosBundleId:(nullable NSString *)iosBundleId + appGroupId:(nullable NSString *)appGroupId { + PigeonFirebaseOptions* pigeonResult = [[PigeonFirebaseOptions alloc] init]; pigeonResult.apiKey = apiKey; pigeonResult.appId = appId; pigeonResult.messagingSenderId = messagingSenderId; @@ -77,86 +65,84 @@ + (instancetype)makeWithApiKey:(NSString *)apiKey pigeonResult.appGroupId = appGroupId; return pigeonResult; } -+ (PigeonFirebaseOptions *)fromMap:(NSDictionary *)dict { ++ (PigeonFirebaseOptions *)fromList:(NSArray *)list { PigeonFirebaseOptions *pigeonResult = [[PigeonFirebaseOptions alloc] init]; - pigeonResult.apiKey = GetNullableObject(dict, @"apiKey"); + pigeonResult.apiKey = GetNullableObjectAtIndex(list, 0); NSAssert(pigeonResult.apiKey != nil, @""); - pigeonResult.appId = GetNullableObject(dict, @"appId"); + pigeonResult.appId = GetNullableObjectAtIndex(list, 1); NSAssert(pigeonResult.appId != nil, @""); - pigeonResult.messagingSenderId = GetNullableObject(dict, @"messagingSenderId"); + pigeonResult.messagingSenderId = GetNullableObjectAtIndex(list, 2); NSAssert(pigeonResult.messagingSenderId != nil, @""); - pigeonResult.projectId = GetNullableObject(dict, @"projectId"); + pigeonResult.projectId = GetNullableObjectAtIndex(list, 3); NSAssert(pigeonResult.projectId != nil, @""); - pigeonResult.authDomain = GetNullableObject(dict, @"authDomain"); - pigeonResult.databaseURL = GetNullableObject(dict, @"databaseURL"); - pigeonResult.storageBucket = GetNullableObject(dict, @"storageBucket"); - pigeonResult.measurementId = GetNullableObject(dict, @"measurementId"); - pigeonResult.trackingId = GetNullableObject(dict, @"trackingId"); - pigeonResult.deepLinkURLScheme = GetNullableObject(dict, @"deepLinkURLScheme"); - pigeonResult.androidClientId = GetNullableObject(dict, @"androidClientId"); - pigeonResult.iosClientId = GetNullableObject(dict, @"iosClientId"); - pigeonResult.iosBundleId = GetNullableObject(dict, @"iosBundleId"); - pigeonResult.appGroupId = GetNullableObject(dict, @"appGroupId"); + pigeonResult.authDomain = GetNullableObjectAtIndex(list, 4); + pigeonResult.databaseURL = GetNullableObjectAtIndex(list, 5); + pigeonResult.storageBucket = GetNullableObjectAtIndex(list, 6); + pigeonResult.measurementId = GetNullableObjectAtIndex(list, 7); + pigeonResult.trackingId = GetNullableObjectAtIndex(list, 8); + pigeonResult.deepLinkURLScheme = GetNullableObjectAtIndex(list, 9); + pigeonResult.androidClientId = GetNullableObjectAtIndex(list, 10); + pigeonResult.iosClientId = GetNullableObjectAtIndex(list, 11); + pigeonResult.iosBundleId = GetNullableObjectAtIndex(list, 12); + pigeonResult.appGroupId = GetNullableObjectAtIndex(list, 13); return pigeonResult; } -+ (nullable PigeonFirebaseOptions *)nullableFromMap:(NSDictionary *)dict { - return (dict) ? [PigeonFirebaseOptions fromMap:dict] : nil; ++ (nullable PigeonFirebaseOptions *)nullableFromList:(NSArray *)list { + return (list) ? [PigeonFirebaseOptions fromList:list] : nil; } -- (NSDictionary *)toMap { - return @{ - @"apiKey" : (self.apiKey ?: [NSNull null]), - @"appId" : (self.appId ?: [NSNull null]), - @"messagingSenderId" : (self.messagingSenderId ?: [NSNull null]), - @"projectId" : (self.projectId ?: [NSNull null]), - @"authDomain" : (self.authDomain ?: [NSNull null]), - @"databaseURL" : (self.databaseURL ?: [NSNull null]), - @"storageBucket" : (self.storageBucket ?: [NSNull null]), - @"measurementId" : (self.measurementId ?: [NSNull null]), - @"trackingId" : (self.trackingId ?: [NSNull null]), - @"deepLinkURLScheme" : (self.deepLinkURLScheme ?: [NSNull null]), - @"androidClientId" : (self.androidClientId ?: [NSNull null]), - @"iosClientId" : (self.iosClientId ?: [NSNull null]), - @"iosBundleId" : (self.iosBundleId ?: [NSNull null]), - @"appGroupId" : (self.appGroupId ?: [NSNull null]), - }; +- (NSArray *)toList { + return @[ + (self.apiKey ?: [NSNull null]), + (self.appId ?: [NSNull null]), + (self.messagingSenderId ?: [NSNull null]), + (self.projectId ?: [NSNull null]), + (self.authDomain ?: [NSNull null]), + (self.databaseURL ?: [NSNull null]), + (self.storageBucket ?: [NSNull null]), + (self.measurementId ?: [NSNull null]), + (self.trackingId ?: [NSNull null]), + (self.deepLinkURLScheme ?: [NSNull null]), + (self.androidClientId ?: [NSNull null]), + (self.iosClientId ?: [NSNull null]), + (self.iosBundleId ?: [NSNull null]), + (self.appGroupId ?: [NSNull null]), + ]; } @end @implementation PigeonInitializeResponse + (instancetype)makeWithName:(NSString *)name - options:(PigeonFirebaseOptions *)options + options:(PigeonFirebaseOptions *)options isAutomaticDataCollectionEnabled:(nullable NSNumber *)isAutomaticDataCollectionEnabled - pluginConstants:(NSDictionary *)pluginConstants { - PigeonInitializeResponse *pigeonResult = [[PigeonInitializeResponse alloc] init]; + pluginConstants:(NSDictionary *)pluginConstants { + PigeonInitializeResponse* pigeonResult = [[PigeonInitializeResponse alloc] init]; pigeonResult.name = name; pigeonResult.options = options; pigeonResult.isAutomaticDataCollectionEnabled = isAutomaticDataCollectionEnabled; pigeonResult.pluginConstants = pluginConstants; return pigeonResult; } -+ (PigeonInitializeResponse *)fromMap:(NSDictionary *)dict { ++ (PigeonInitializeResponse *)fromList:(NSArray *)list { PigeonInitializeResponse *pigeonResult = [[PigeonInitializeResponse alloc] init]; - pigeonResult.name = GetNullableObject(dict, @"name"); + pigeonResult.name = GetNullableObjectAtIndex(list, 0); NSAssert(pigeonResult.name != nil, @""); - pigeonResult.options = - [PigeonFirebaseOptions nullableFromMap:GetNullableObject(dict, @"options")]; + pigeonResult.options = [PigeonFirebaseOptions nullableFromList:(GetNullableObjectAtIndex(list, 1))]; NSAssert(pigeonResult.options != nil, @""); - pigeonResult.isAutomaticDataCollectionEnabled = - GetNullableObject(dict, @"isAutomaticDataCollectionEnabled"); - pigeonResult.pluginConstants = GetNullableObject(dict, @"pluginConstants"); + pigeonResult.isAutomaticDataCollectionEnabled = GetNullableObjectAtIndex(list, 2); + pigeonResult.pluginConstants = GetNullableObjectAtIndex(list, 3); NSAssert(pigeonResult.pluginConstants != nil, @""); return pigeonResult; } -+ (nullable PigeonInitializeResponse *)nullableFromMap:(NSDictionary *)dict { - return (dict) ? [PigeonInitializeResponse fromMap:dict] : nil; ++ (nullable PigeonInitializeResponse *)nullableFromList:(NSArray *)list { + return (list) ? [PigeonInitializeResponse fromList:list] : nil; } -- (NSDictionary *)toMap { - return @{ - @"name" : (self.name ?: [NSNull null]), - @"options" : (self.options ? [self.options toMap] : [NSNull null]), - @"isAutomaticDataCollectionEnabled" : (self.isAutomaticDataCollectionEnabled ?: [NSNull null]), - @"pluginConstants" : (self.pluginConstants ?: [NSNull null]), - }; +- (NSArray *)toList { + return @[ + (self.name ?: [NSNull null]), + (self.options ? [self.options toList] : [NSNull null]), + (self.isAutomaticDataCollectionEnabled ?: [NSNull null]), + (self.pluginConstants ?: [NSNull null]), + ]; } @end @@ -165,12 +151,10 @@ @interface FirebaseCoreHostApiCodecReader : FlutterStandardReader @implementation FirebaseCoreHostApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: - return [PigeonFirebaseOptions fromMap:[self readValue]]; - - case 129: - return [PigeonInitializeResponse fromMap:[self readValue]]; - + case 128: + return [PigeonFirebaseOptions fromList:[self readValue]]; + case 129: + return [PigeonInitializeResponse fromList:[self readValue]]; default: return [super readValueOfType:type]; } @@ -183,10 +167,10 @@ @implementation FirebaseCoreHostApiCodecWriter - (void)writeValue:(id)value { if ([value isKindOfClass:[PigeonFirebaseOptions class]]) { [self writeByte:128]; - [self writeValue:[value toMap]]; + [self writeValue:[value toList]]; } else if ([value isKindOfClass:[PigeonInitializeResponse class]]) { [self writeByte:129]; - [self writeValue:[value toMap]]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } @@ -205,57 +189,46 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { @end NSObject *FirebaseCoreHostApiGetCodec() { - static dispatch_once_t sPred = 0; static FlutterStandardMessageCodec *sSharedObject = nil; + static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FirebaseCoreHostApiCodecReaderWriter *readerWriter = - [[FirebaseCoreHostApiCodecReaderWriter alloc] init]; + FirebaseCoreHostApiCodecReaderWriter *readerWriter = [[FirebaseCoreHostApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void FirebaseCoreHostApiSetup(id binaryMessenger, - NSObject *api) { +void FirebaseCoreHostApiSetup(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp" binaryMessenger:binaryMessenger - codec:FirebaseCoreHostApiGetCodec()]; + codec:FirebaseCoreHostApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(initializeAppAppName: - initializeAppRequest:completion:)], - @"FirebaseCoreHostApi api (%@) doesn't respond to " - @"@selector(initializeAppAppName:initializeAppRequest:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(initializeAppAppName:initializeAppRequest:completion:)], @"FirebaseCoreHostApi api (%@) doesn't respond to @selector(initializeAppAppName:initializeAppRequest:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_appName = GetNullableObjectAtIndex(args, 0); PigeonFirebaseOptions *arg_initializeAppRequest = GetNullableObjectAtIndex(args, 1); - [api initializeAppAppName:arg_appName - initializeAppRequest:arg_initializeAppRequest - completion:^(PigeonInitializeResponse *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api initializeAppAppName:arg_appName initializeAppRequest:arg_initializeAppRequest completion:^(PigeonInitializeResponse *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.FirebaseCoreHostApi.initializeCore" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.FirebaseCoreHostApi.initializeCore" binaryMessenger:binaryMessenger - codec:FirebaseCoreHostApiGetCodec()]; + codec:FirebaseCoreHostApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(initializeCoreWithCompletion:)], - @"FirebaseCoreHostApi api (%@) doesn't respond to " - @"@selector(initializeCoreWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(initializeCoreWithCompletion:)], @"FirebaseCoreHostApi api (%@) doesn't respond to @selector(initializeCoreWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api initializeCoreWithCompletion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { + [api initializeCoreWithCompletion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -264,18 +237,15 @@ void FirebaseCoreHostApiSetup(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.FirebaseCoreHostApi.optionsFromResource" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.FirebaseCoreHostApi.optionsFromResource" binaryMessenger:binaryMessenger - codec:FirebaseCoreHostApiGetCodec()]; + codec:FirebaseCoreHostApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(optionsFromResourceWithCompletion:)], - @"FirebaseCoreHostApi api (%@) doesn't respond to " - @"@selector(optionsFromResourceWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(optionsFromResourceWithCompletion:)], @"FirebaseCoreHostApi api (%@) doesn't respond to @selector(optionsFromResourceWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api optionsFromResourceWithCompletion:^(PigeonFirebaseOptions *_Nullable output, - FlutterError *_Nullable error) { + [api optionsFromResourceWithCompletion:^(PigeonFirebaseOptions *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -284,108 +254,67 @@ void FirebaseCoreHostApiSetup(id binaryMessenger, } } } -@interface FirebaseAppHostApiCodecReader : FlutterStandardReader -@end -@implementation FirebaseAppHostApiCodecReader -@end - -@interface FirebaseAppHostApiCodecWriter : FlutterStandardWriter -@end -@implementation FirebaseAppHostApiCodecWriter -@end - -@interface FirebaseAppHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FirebaseAppHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FirebaseAppHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FirebaseAppHostApiCodecReader alloc] initWithData:data]; -} -@end - NSObject *FirebaseAppHostApiGetCodec() { - static dispatch_once_t sPred = 0; static FlutterStandardMessageCodec *sSharedObject = nil; - dispatch_once(&sPred, ^{ - FirebaseAppHostApiCodecReaderWriter *readerWriter = - [[FirebaseAppHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); + sSharedObject = [FlutterStandardMessageCodec sharedInstance]; return sSharedObject; } -void FirebaseAppHostApiSetup(id binaryMessenger, - NSObject *api) { +void FirebaseAppHostApiSetup(id binaryMessenger, NSObject *api) { { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled" binaryMessenger:binaryMessenger - codec:FirebaseAppHostApiGetCodec()]; + codec:FirebaseAppHostApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (setAutomaticDataCollectionEnabledAppName:enabled:completion:)], - @"FirebaseAppHostApi api (%@) doesn't respond to " - @"@selector(setAutomaticDataCollectionEnabledAppName:enabled:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(setAutomaticDataCollectionEnabledAppName:enabled:completion:)], @"FirebaseAppHostApi api (%@) doesn't respond to @selector(setAutomaticDataCollectionEnabledAppName:enabled:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_appName = GetNullableObjectAtIndex(args, 0); NSNumber *arg_enabled = GetNullableObjectAtIndex(args, 1); - [api setAutomaticDataCollectionEnabledAppName:arg_appName - enabled:arg_enabled - completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + [api setAutomaticDataCollectionEnabledAppName:arg_appName enabled:arg_enabled completion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled" binaryMessenger:binaryMessenger - codec:FirebaseAppHostApiGetCodec()]; + codec:FirebaseAppHostApiGetCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (setAutomaticResourceManagementEnabledAppName:enabled:completion:)], - @"FirebaseAppHostApi api (%@) doesn't respond to " - @"@selector(setAutomaticResourceManagementEnabledAppName:enabled:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(setAutomaticResourceManagementEnabledAppName:enabled:completion:)], @"FirebaseAppHostApi api (%@) doesn't respond to @selector(setAutomaticResourceManagementEnabledAppName:enabled:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_appName = GetNullableObjectAtIndex(args, 0); NSNumber *arg_enabled = GetNullableObjectAtIndex(args, 1); - [api setAutomaticResourceManagementEnabledAppName:arg_appName - enabled:arg_enabled - completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + [api setAutomaticResourceManagementEnabledAppName:arg_appName enabled:arg_enabled completion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.FirebaseAppHostApi.delete" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.FirebaseAppHostApi.delete" binaryMessenger:binaryMessenger - codec:FirebaseAppHostApiGetCodec()]; + codec:FirebaseAppHostApiGetCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(deleteAppName:completion:)], - @"FirebaseAppHostApi api (%@) doesn't respond to @selector(deleteAppName:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(deleteAppName:completion:)], @"FirebaseAppHostApi api (%@) doesn't respond to @selector(deleteAppName:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_appName = GetNullableObjectAtIndex(args, 0); - [api deleteAppName:arg_appName - completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + [api deleteAppName:arg_appName completion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; diff --git a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart index 9420915342de..034242fe27b6 100644 --- a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart +++ b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/messages.pigeon.dart @@ -1,15 +1,11 @@ -// Copyright 2022, 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. - -// Autogenerated from Pigeon (v3.2.0), do not edit directly. +// Autogenerated from Pigeon (v9.0.6), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name -// @dart = 2.12 +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import + import 'dart:async'; -import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; class PigeonFirebaseOptions { @@ -31,56 +27,69 @@ class PigeonFirebaseOptions { }); String apiKey; + String appId; + String messagingSenderId; + String projectId; + String? authDomain; + String? databaseURL; + String? storageBucket; + String? measurementId; + String? trackingId; + String? deepLinkURLScheme; + String? androidClientId; + String? iosClientId; + String? iosBundleId; + String? appGroupId; Object encode() { - final Map pigeonMap = {}; - pigeonMap['apiKey'] = apiKey; - pigeonMap['appId'] = appId; - pigeonMap['messagingSenderId'] = messagingSenderId; - pigeonMap['projectId'] = projectId; - pigeonMap['authDomain'] = authDomain; - pigeonMap['databaseURL'] = databaseURL; - pigeonMap['storageBucket'] = storageBucket; - pigeonMap['measurementId'] = measurementId; - pigeonMap['trackingId'] = trackingId; - pigeonMap['deepLinkURLScheme'] = deepLinkURLScheme; - pigeonMap['androidClientId'] = androidClientId; - pigeonMap['iosClientId'] = iosClientId; - pigeonMap['iosBundleId'] = iosBundleId; - pigeonMap['appGroupId'] = appGroupId; - return pigeonMap; + return [ + apiKey, + appId, + messagingSenderId, + projectId, + authDomain, + databaseURL, + storageBucket, + measurementId, + trackingId, + deepLinkURLScheme, + androidClientId, + iosClientId, + iosBundleId, + appGroupId, + ]; } - static PigeonFirebaseOptions decode(Object message) { - final Map pigeonMap = message as Map; + static PigeonFirebaseOptions decode(Object result) { + result as List; return PigeonFirebaseOptions( - apiKey: pigeonMap['apiKey']! as String, - appId: pigeonMap['appId']! as String, - messagingSenderId: pigeonMap['messagingSenderId']! as String, - projectId: pigeonMap['projectId']! as String, - authDomain: pigeonMap['authDomain'] as String?, - databaseURL: pigeonMap['databaseURL'] as String?, - storageBucket: pigeonMap['storageBucket'] as String?, - measurementId: pigeonMap['measurementId'] as String?, - trackingId: pigeonMap['trackingId'] as String?, - deepLinkURLScheme: pigeonMap['deepLinkURLScheme'] as String?, - androidClientId: pigeonMap['androidClientId'] as String?, - iosClientId: pigeonMap['iosClientId'] as String?, - iosBundleId: pigeonMap['iosBundleId'] as String?, - appGroupId: pigeonMap['appGroupId'] as String?, + apiKey: result[0]! as String, + appId: result[1]! as String, + messagingSenderId: result[2]! as String, + projectId: result[3]! as String, + authDomain: result[4] as String?, + databaseURL: result[5] as String?, + storageBucket: result[6] as String?, + measurementId: result[7] as String?, + trackingId: result[8] as String?, + deepLinkURLScheme: result[9] as String?, + androidClientId: result[10] as String?, + iosClientId: result[11] as String?, + iosBundleId: result[12] as String?, + appGroupId: result[13] as String?, ); } } @@ -94,29 +103,29 @@ class PigeonInitializeResponse { }); String name; + PigeonFirebaseOptions options; + bool? isAutomaticDataCollectionEnabled; + Map pluginConstants; Object encode() { - final Map pigeonMap = {}; - pigeonMap['name'] = name; - pigeonMap['options'] = options.encode(); - pigeonMap['isAutomaticDataCollectionEnabled'] = - isAutomaticDataCollectionEnabled; - pigeonMap['pluginConstants'] = pluginConstants; - return pigeonMap; + return [ + name, + options.encode(), + isAutomaticDataCollectionEnabled, + pluginConstants, + ]; } - static PigeonInitializeResponse decode(Object message) { - final Map pigeonMap = message as Map; + static PigeonInitializeResponse decode(Object result) { + result as List; return PigeonInitializeResponse( - name: pigeonMap['name']! as String, - options: PigeonFirebaseOptions.decode(pigeonMap['options']!), - isAutomaticDataCollectionEnabled: - pigeonMap['isAutomaticDataCollectionEnabled'] as bool?, - pluginConstants: (pigeonMap['pluginConstants'] as Map?)! - .cast(), + name: result[0]! as String, + options: PigeonFirebaseOptions.decode(result[1]! as List), + isAutomaticDataCollectionEnabled: result[2] as bool?, + pluginConstants: (result[3] as Map?)!.cast(), ); } } @@ -139,12 +148,10 @@ class _FirebaseCoreHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return PigeonFirebaseOptions.decode(readValue(buffer)!); - - case 129: + case 129: return PigeonInitializeResponse.decode(readValue(buffer)!); - default: return super.readValueOfType(type, buffer); } @@ -157,39 +164,34 @@ class FirebaseCoreHostApi { /// BinaryMessenger will be used which routes to the host platform. FirebaseCoreHostApi({BinaryMessenger? binaryMessenger}) : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; static const MessageCodec codec = _FirebaseCoreHostApiCodec(); - Future initializeApp(String arg_appName, - PigeonFirebaseOptions arg_initializeAppRequest) async { + Future initializeApp(String arg_appName, PigeonFirebaseOptions arg_initializeAppRequest) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp', codec, binaryMessenger: _binaryMessenger); - final Map? replyMap = - await channel.send([arg_appName, arg_initializeAppRequest]) - as Map?; - if (replyMap == null) { + final List? replyList = + await channel.send([arg_appName, arg_initializeAppRequest]) as List?; + if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); - } else if (replyMap['error'] != null) { - final Map error = - (replyMap['error'] as Map?)!; + } else if (replyList.length > 1) { throw PlatformException( - code: (error['code'] as String?)!, - message: error['message'] as String?, - details: error['details'], + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], ); - } else if (replyMap['result'] == null) { + } else if (replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyMap['result'] as PigeonInitializeResponse?)!; + return (replyList[0] as PigeonInitializeResponse?)!; } } @@ -197,29 +199,26 @@ class FirebaseCoreHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FirebaseCoreHostApi.initializeCore', codec, binaryMessenger: _binaryMessenger); - final Map? replyMap = - await channel.send(null) as Map?; - if (replyMap == null) { + final List? replyList = + await channel.send(null) as List?; + if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); - } else if (replyMap['error'] != null) { - final Map error = - (replyMap['error'] as Map?)!; + } else if (replyList.length > 1) { throw PlatformException( - code: (error['code'] as String?)!, - message: error['message'] as String?, - details: error['details'], + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], ); - } else if (replyMap['result'] == null) { + } else if (replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyMap['result'] as List?)! - .cast(); + return (replyList[0] as List?)!.cast(); } } @@ -227,93 +226,78 @@ class FirebaseCoreHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FirebaseCoreHostApi.optionsFromResource', codec, binaryMessenger: _binaryMessenger); - final Map? replyMap = - await channel.send(null) as Map?; - if (replyMap == null) { + final List? replyList = + await channel.send(null) as List?; + if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); - } else if (replyMap['error'] != null) { - final Map error = - (replyMap['error'] as Map?)!; + } else if (replyList.length > 1) { throw PlatformException( - code: (error['code'] as String?)!, - message: error['message'] as String?, - details: error['details'], + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], ); - } else if (replyMap['result'] == null) { + } else if (replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyMap['result'] as PigeonFirebaseOptions?)!; + return (replyList[0] as PigeonFirebaseOptions?)!; } } } -class _FirebaseAppHostApiCodec extends StandardMessageCodec { - const _FirebaseAppHostApiCodec(); -} - class FirebaseAppHostApi { /// Constructor for [FirebaseAppHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. FirebaseAppHostApi({BinaryMessenger? binaryMessenger}) : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - static const MessageCodec codec = _FirebaseAppHostApiCodec(); + static const MessageCodec codec = StandardMessageCodec(); - Future setAutomaticDataCollectionEnabled( - String arg_appName, bool arg_enabled) async { + Future setAutomaticDataCollectionEnabled(String arg_appName, bool arg_enabled) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled', - codec, + 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled', codec, binaryMessenger: _binaryMessenger); - final Map? replyMap = await channel - .send([arg_appName, arg_enabled]) as Map?; - if (replyMap == null) { + final List? replyList = + await channel.send([arg_appName, arg_enabled]) as List?; + if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); - } else if (replyMap['error'] != null) { - final Map error = - (replyMap['error'] as Map?)!; + } else if (replyList.length > 1) { throw PlatformException( - code: (error['code'] as String?)!, - message: error['message'] as String?, - details: error['details'], + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], ); } else { return; } } - Future setAutomaticResourceManagementEnabled( - String arg_appName, bool arg_enabled) async { + Future setAutomaticResourceManagementEnabled(String arg_appName, bool arg_enabled) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled', - codec, + 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled', codec, binaryMessenger: _binaryMessenger); - final Map? replyMap = await channel - .send([arg_appName, arg_enabled]) as Map?; - if (replyMap == null) { + final List? replyList = + await channel.send([arg_appName, arg_enabled]) as List?; + if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); - } else if (replyMap['error'] != null) { - final Map error = - (replyMap['error'] as Map?)!; + } else if (replyList.length > 1) { throw PlatformException( - code: (error['code'] as String?)!, - message: error['message'] as String?, - details: error['details'], + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], ); } else { return; @@ -324,20 +308,18 @@ class FirebaseAppHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FirebaseAppHostApi.delete', codec, binaryMessenger: _binaryMessenger); - final Map? replyMap = - await channel.send([arg_appName]) as Map?; - if (replyMap == null) { + final List? replyList = + await channel.send([arg_appName]) as List?; + if (replyList == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', ); - } else if (replyMap['error'] != null) { - final Map error = - (replyMap['error'] as Map?)!; + } else if (replyList.length > 1) { throw PlatformException( - code: (error['code'] as String?)!, - message: error['message'] as String?, - details: error['details'], + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], ); } else { return; diff --git a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart index 95751f138e27..617ae9eb93ee 100644 --- a/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart +++ b/packages/firebase_core/firebase_core_platform_interface/lib/src/pigeon/test_api.dart @@ -1,15 +1,10 @@ -// Copyright 2022, 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. - -// Autogenerated from Pigeon (v3.2.0), do not edit directly. +// Autogenerated from Pigeon (v9.0.6), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import // ignore_for_file: avoid_relative_lib_imports -// @dart = 2.12 import 'dart:async'; -import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List; -import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -33,12 +28,10 @@ class _TestFirebaseCoreHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return PigeonFirebaseOptions.decode(readValue(buffer)!); - - case 129: + case 129: return PigeonInitializeResponse.decode(readValue(buffer)!); - default: return super.readValueOfType(type, buffer); } @@ -48,12 +41,13 @@ class _TestFirebaseCoreHostApiCodec extends StandardMessageCodec { abstract class TestFirebaseCoreHostApi { static const MessageCodec codec = _TestFirebaseCoreHostApiCodec(); - Future initializeApp( - String appName, PigeonFirebaseOptions initializeAppRequest); + Future initializeApp(String appName, PigeonFirebaseOptions initializeAppRequest); + Future> initializeCore(); + Future optionsFromResource(); - static void setup(TestFirebaseCoreHostApi? api, - {BinaryMessenger? binaryMessenger}) { + + static void setup(TestFirebaseCoreHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp', codec, @@ -63,18 +57,16 @@ abstract class TestFirebaseCoreHostApi { } else { channel.setMockMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null.'); + 'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null.'); final List args = (message as List?)!; final String? arg_appName = (args[0] as String?); assert(arg_appName != null, 'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null, expected non-null String.'); - final PigeonFirebaseOptions? arg_initializeAppRequest = - (args[1] as PigeonFirebaseOptions?); + final PigeonFirebaseOptions? arg_initializeAppRequest = (args[1] as PigeonFirebaseOptions?); assert(arg_initializeAppRequest != null, 'Argument for dev.flutter.pigeon.FirebaseCoreHostApi.initializeApp was null, expected non-null PigeonFirebaseOptions.'); - final PigeonInitializeResponse output = - await api.initializeApp(arg_appName!, arg_initializeAppRequest!); - return {'result': output}; + final PigeonInitializeResponse output = await api.initializeApp(arg_appName!, arg_initializeAppRequest!); + return [output]; }); } } @@ -87,9 +79,8 @@ abstract class TestFirebaseCoreHostApi { } else { channel.setMockMessageHandler((Object? message) async { // ignore message - final List output = - await api.initializeCore(); - return {'result': output}; + final List output = await api.initializeCore(); + return [output]; }); } } @@ -103,37 +94,33 @@ abstract class TestFirebaseCoreHostApi { channel.setMockMessageHandler((Object? message) async { // ignore message final PigeonFirebaseOptions output = await api.optionsFromResource(); - return {'result': output}; + return [output]; }); } } } } -class _TestFirebaseAppHostApiCodec extends StandardMessageCodec { - const _TestFirebaseAppHostApiCodec(); -} - abstract class TestFirebaseAppHostApi { - static const MessageCodec codec = _TestFirebaseAppHostApiCodec(); + static const MessageCodec codec = StandardMessageCodec(); Future setAutomaticDataCollectionEnabled(String appName, bool enabled); - Future setAutomaticResourceManagementEnabled( - String appName, bool enabled); + + Future setAutomaticResourceManagementEnabled(String appName, bool enabled); + Future delete(String appName); - static void setup(TestFirebaseAppHostApi? api, - {BinaryMessenger? binaryMessenger}) { + + static void setup(TestFirebaseAppHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled', - codec, + 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMockMessageHandler(null); } else { channel.setMockMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null.'); + 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null.'); final List args = (message as List?)!; final String? arg_appName = (args[0] as String?); assert(arg_appName != null, @@ -141,23 +128,21 @@ abstract class TestFirebaseAppHostApi { final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null, expected non-null bool.'); - await api.setAutomaticDataCollectionEnabled( - arg_appName!, arg_enabled!); - return {}; + await api.setAutomaticDataCollectionEnabled(arg_appName!, arg_enabled!); + return []; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled', - codec, + 'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMockMessageHandler(null); } else { channel.setMockMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null.'); + 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null.'); final List args = (message as List?)!; final String? arg_appName = (args[0] as String?); assert(arg_appName != null, @@ -165,9 +150,8 @@ abstract class TestFirebaseAppHostApi { final bool? arg_enabled = (args[1] as bool?); assert(arg_enabled != null, 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null, expected non-null bool.'); - await api.setAutomaticResourceManagementEnabled( - arg_appName!, arg_enabled!); - return {}; + await api.setAutomaticResourceManagementEnabled(arg_appName!, arg_enabled!); + return []; }); } } @@ -180,13 +164,13 @@ abstract class TestFirebaseAppHostApi { } else { channel.setMockMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.delete was null.'); + 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.delete was null.'); final List args = (message as List?)!; final String? arg_appName = (args[0] as String?); assert(arg_appName != null, 'Argument for dev.flutter.pigeon.FirebaseAppHostApi.delete was null, expected non-null String.'); await api.delete(arg_appName!); - return {}; + return []; }); } }