Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ let package = Package(
dependencies: [
.product(name: "FirebaseInstallations", package: "firebase-ios-sdk"),
],
path: "Sources/firebase_core_shared",
publicHeadersPath: "include",
cSettings: [
.headerSearchPath("include/firebase_core"),
.define("LIBRARY_VERSION", to: "\"\(firebase_core_version)\""),
.define("LIBRARY_NAME", to: "\"flutter-fire-core\""),
]
path: "packages/firebase_core/firebase_core/ios/firebase_core/Sources/firebase_core"
),
]
)
1 change: 0 additions & 1 deletion Sources/firebase_core_shared/FLTFirebaseCorePlugin.m

This file was deleted.

1 change: 0 additions & 1 deletion Sources/firebase_core_shared/FLTFirebasePlugin.m

This file was deleted.

1 change: 0 additions & 1 deletion Sources/firebase_core_shared/FLTFirebasePluginRegistry.m

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Sources/firebase_core_shared/include/FLTFirebasePlugin.h

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Sources/firebase_core_shared/include/messages.g.h

This file was deleted.

1 change: 0 additions & 1 deletion Sources/firebase_core_shared/messages.g.m

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
// found in the LICENSE file.

@import FirebaseFirestore;
#if __has_include(<firebase_core/FLTFirebasePluginRegistry.h>)
#import <firebase_core/FLTFirebasePluginRegistry.h>
#else
#import <FLTFirebasePluginRegistry.h>
#endif
@import firebase_core;

#import "include/cloud_firestore/Private/FLTDocumentSnapshotStreamHandler.h"
#import "include/cloud_firestore/Private/FLTFirebaseFirestoreUtils.h"
Expand Down Expand Up @@ -48,10 +44,10 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments
@"message" : message,
};
dispatch_async(dispatch_get_main_queue(), ^{
events([FLTFirebasePlugin createFlutterErrorFromCode:code
message:message
optionalDetails:details
andOptionalNSError:error]);
events([FLTFirebasePluginHelper createFlutterErrorWithCode:code
message:message
optionalDetails:details
andOptionalError:error]);
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
// found in the LICENSE file.

@import FirebaseFirestore;
#if __has_include(<firebase_core/FLTFirebasePluginRegistry.h>)
#import <firebase_core/FLTFirebasePluginRegistry.h>
#else
#import <FLTFirebasePluginRegistry.h>
#endif
@import firebase_core;
@import FirebaseCore;

#import <TargetConditionals.h>
#import "FirebaseFirestoreInternal/FIRPersistentCacheIndexManager.h"
Expand Down Expand Up @@ -220,7 +217,8 @@ - (FIRFirestore *_Nullable)getFIRFirestoreFromAppNameFromPigeon:
NSString *appNameDart = pigeonApp.appName;
NSString *databaseUrl = pigeonApp.databaseURL;

FIRApp *app = [FLTFirebasePlugin firebaseAppNamed:appNameDart];
FIRApp *app =
[FIRApp appNamed:[FLTFirebasePluginHelper firebaseAppNameFromDartName:appNameDart]];

if ([FLTFirebaseFirestoreUtils getFirestoreInstanceByName:app.name
databaseURL:databaseUrl] != nil) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@

@import FirebaseFirestore;
@import FirebaseCore;
@import firebase_core;

#if __has_include(<firebase_core/FLTFirebasePlugin.h>)
#import <firebase_core/FLTFirebasePlugin.h>
#else
#import <FLTFirebasePlugin.h>
#endif
#import "include/cloud_firestore/Private/FLTFirebaseFirestoreReader.h"
#import "include/cloud_firestore/Private/FLTFirebaseFirestoreUtils.h"

Expand Down Expand Up @@ -297,7 +293,8 @@ - (FIRFirestore *)FIRFirestore {
NSString *appNameDart = [self readValue];
NSString *databaseUrl = [self readValue];
FIRFirestoreSettings *settings = [self readValue];
FIRApp *app = [FLTFirebasePlugin firebaseAppNamed:appNameDart];
FIRApp *app =
[FIRApp appNamed:[FLTFirebasePluginHelper firebaseAppNameFromDartName:appNameDart]];

if ([FLTFirebaseFirestoreUtils getFirestoreInstanceByName:app.name
databaseURL:databaseUrl] != nil) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@import FirebaseFirestore;
@import FirebaseCore;
@import firebase_core;

#import "include/cloud_firestore/Private/FLTFirebaseFirestoreWriter.h"
#import "include/cloud_firestore/Private/FLTFirebaseFirestoreUtils.h"
Expand Down Expand Up @@ -39,7 +40,8 @@ - (void)writeValue:(id)value {
} else if ([value isKindOfClass:[FIRDocumentReference class]]) {
FIRDocumentReference *document = value;
NSString *documentPath = [document path];
NSString *appName = [FLTFirebasePlugin firebaseAppNameFromIosName:document.firestore.app.name];
NSString *appName =
[FLTFirebasePluginHelper firebaseAppNameFromIosName:document.firestore.app.name];
[self writeByte:FirestoreDataTypeDocumentReference];
[self writeValue:appName];
[self writeValue:documentPath];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
//

@import FirebaseFirestore;
#if __has_include(<firebase_core/FLTFirebasePluginRegistry.h>)
#import <firebase_core/FLTFirebasePluginRegistry.h>
#else
#import <FLTFirebasePluginRegistry.h>
#endif
@import firebase_core;

#import "include/cloud_firestore/Private/FLTFirebaseFirestoreUtils.h"
#import "include/cloud_firestore/Private/FLTLoadBundleStreamHandler.h"
Expand Down Expand Up @@ -52,10 +48,10 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments
};

dispatch_async(dispatch_get_main_queue(), ^{
events([FLTFirebasePlugin createFlutterErrorFromCode:code
message:message
optionalDetails:details
andOptionalNSError:error]);
events([FLTFirebasePluginHelper createFlutterErrorWithCode:code
message:message
optionalDetails:details
andOptionalError:error]);
});
}
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
// found in the LICENSE file.

@import FirebaseFirestore;
#if __has_include(<firebase_core/FLTFirebasePluginRegistry.h>)
#import <firebase_core/FLTFirebasePluginRegistry.h>
#else
#import <FLTFirebasePluginRegistry.h>
#endif
@import firebase_core;

#import "include/cloud_firestore/Private/FLTFirebaseFirestoreUtils.h"
#import "include/cloud_firestore/Private/FLTQuerySnapshotStreamHandler.h"
Expand Down Expand Up @@ -58,10 +54,10 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments
@"message" : message,
};
dispatch_async(dispatch_get_main_queue(), ^{
events([FLTFirebasePlugin createFlutterErrorFromCode:code
message:message
optionalDetails:details
andOptionalNSError:error]);
events([FLTFirebasePluginHelper createFlutterErrorWithCode:code
message:message
optionalDetails:details
andOptionalError:error]);
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
// found in the LICENSE file.

@import FirebaseFirestore;
#if __has_include(<firebase_core/FLTFirebasePluginRegistry.h>)
#import <firebase_core/FLTFirebasePluginRegistry.h>
#else
#import <FLTFirebasePluginRegistry.h>
#endif
@import firebase_core;
@import FirebaseCore;

#import "include/cloud_firestore/Private/FLTFirebaseFirestoreUtils.h"
#import "include/cloud_firestore/Private/FLTTransactionStreamHandler.h"
Expand Down Expand Up @@ -55,8 +52,9 @@ - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments
strongSelf.started(transaction);

dispatch_async(dispatch_get_main_queue(), ^{
events(
@{@"appName" : [FLTFirebasePlugin firebaseAppNameFromIosName:self.firestore.app.name]});
events(@{
@"appName" : [FLTFirebasePluginHelper firebaseAppNameFromIosName:self.firestore.app.name]
});
});

long timedOut = dispatch_semaphore_wait(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@
#endif

#import <Foundation/Foundation.h>
#if __has_include(<firebase_core/FLTFirebasePlugin.h>)
#import <firebase_core/FLTFirebasePlugin.h>
#else
#import <FLTFirebasePlugin.h>
#endif
@import firebase_core;
#import "FirestoreMessages.g.h"

@interface FLTFirebaseFirestorePlugin
: FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin, FirebaseFirestoreHostApi>
: NSObject <FlutterPlugin, FLTFirebasePlugin, FirebaseFirestoreHostApi>
+ (NSMutableDictionary<NSNumber *, NSString *> *)serverTimestampMap;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ class FlutterFirebaseFunctionsPlugin
return taskCompletionSource.task
}

override fun didReinitializeFirebaseCore(): Task<Void> {
val taskCompletionSource = TaskCompletionSource<Void>()
override fun didReinitializeFirebaseCore(): Task<Void?> {
val taskCompletionSource = TaskCompletionSource<Void?>()

FlutterFirebasePlugin.cachedThreadPool.execute { taskCompletionSource.setResult(null) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
#else
import firebase_core_shared
#endif
import FirebaseCore
import FirebaseFunctions

extension FlutterError: Error {}

let kFLTFirebaseFunctionsChannelName = "plugins.flutter.io/firebase_functions"

public class FirebaseFunctionsPlugin: NSObject, FLTFirebasePluginProtocol, FlutterPlugin,
public class FirebaseFunctionsPlugin: NSObject, FLTFirebasePlugin, FlutterPlugin,
CloudFunctionsHostApi {
func call(arguments: [String: Any?], completion: @escaping (Result<Any?, any Error>) -> Void) {
httpsFunctionCall(arguments: arguments) { result, error in
Expand Down Expand Up @@ -48,23 +49,23 @@ public class FirebaseFunctionsPlugin: NSObject, FLTFirebasePluginProtocol, Flutt
self.binaryMessenger = binaryMessenger
}

public func firebaseLibraryVersion() -> String {
public var firebaseLibraryVersion: String {
versionNumber
}

public func didReinitializeFirebaseCore(_ completion: @escaping () -> Void) {
public func didReinitializeFirebaseCore(completion: @escaping () -> Void) {
completion()
}

public func pluginConstants(for firebaseApp: FirebaseApp) -> [AnyHashable: Any] {
public func pluginConstants(for firebaseApp: FirebaseApp) -> [String: Any] {
[:]
}

@objc public func firebaseLibraryName() -> String {
public var firebaseLibraryName: String {
"flutter-fire-fn"
}

@objc public func flutterChannelName() -> String {
public var flutterChannelName: String {
kFLTFirebaseFunctionsChannelName
}

Expand All @@ -91,7 +92,7 @@ public class FirebaseFunctionsPlugin: NSObject, FLTFirebasePluginProtocol, Flutt
let parameters = arguments["parameters"]
let limitedUseAppCheckToken = arguments["limitedUseAppCheckToken"] as? Bool ?? false

let app = FLTFirebasePlugin.firebaseAppNamed(appName)!
let app = FLTFirebasePluginHelper.firebaseApp(named: appName)!

let functions = Functions.functions(app: app, region: region ?? "")

Expand Down Expand Up @@ -138,7 +139,7 @@ public class FirebaseFunctionsPlugin: NSObject, FLTFirebasePluginProtocol, Flutt
private func getFunctions(arguments: [String: Any]) -> Functions {
let appName = arguments["appName"] as? String ?? ""
let region = arguments["region"] as? String
let app = FLTFirebasePlugin.firebaseAppNamed(appName)!
let app = FLTFirebasePluginHelper.firebaseApp(named: appName)!
return Functions.functions(app: app, region: region ?? "")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Pod::Spec.new do |s|
s.authors = 'The Chromium Authors'
s.source = { :path => '.' }
s.source_files = 'cloud_functions/Sources/**/*.swift'
s.public_header_files = 'cloud_functions/Sources/cloud_functions/include/*.h'
s.platform = :osx, '10.15'

s.swift_version = '5.0'
Expand Down
Loading
Loading