diff --git a/.gitignore b/.gitignore index 8a36711..7b5be46 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ nbproject /metadata.json /ios/metadata.json ios/firebase.performance-iphone-*.zip +/ios/dist diff --git a/ios/Classes/FirebasePerformanceModuleAssets.m b/ios/Classes/FirebasePerformanceModuleAssets.m index 598a46d..f04d36b 100644 --- a/ios/Classes/FirebasePerformanceModuleAssets.m +++ b/ios/Classes/FirebasePerformanceModuleAssets.m @@ -7,18 +7,18 @@ @implementation FirebasePerformanceModuleAssets -- (NSData*) moduleAsset +- (NSData *)moduleAsset { - + - return nil; + return nil; } -- (NSData*) resolveModuleAsset:(NSString*)path +- (NSData *)resolveModuleAsset:(NSString *)path { - + - return nil; + return nil; } @end diff --git a/ios/manifest b/ios/manifest index fa46fe0..cfc42e6 100644 --- a/ios/manifest +++ b/ios/manifest @@ -2,17 +2,17 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 1.0.0 +version: 1.1.0 apiversion: 2 architectures: armv7 arm64 i386 x86_64 description: titanium-firebase-performance author: Hans Knoechel license: Apache 2 -copyright: Copyright (c) 2017 by Hans Knöchel +copyright: Copyright (c) 2017-present by Hans Knöchel # these should not be edited name: titanium-firebase-performance moduleid: firebase.performance guid: 0f3ea40e-0a87-4ded-8402-44770ed6a41e platform: iphone -minsdk: 6.2.0 +minsdk: 6.3.0 diff --git a/ios/platform/FirebasePerformance.framework/FirebasePerformance b/ios/platform/FirebasePerformance.framework/FirebasePerformance index 86c881f..3470a03 100755 Binary files a/ios/platform/FirebasePerformance.framework/FirebasePerformance and b/ios/platform/FirebasePerformance.framework/FirebasePerformance differ diff --git a/ios/platform/FirebasePerformance.framework/Headers/FIRHTTPMetric.h b/ios/platform/FirebasePerformance.framework/Headers/FIRHTTPMetric.h new file mode 100755 index 0000000..91264ed --- /dev/null +++ b/ios/platform/FirebasePerformance.framework/Headers/FIRHTTPMetric.h @@ -0,0 +1,68 @@ +#import + +#import "FIRPerformanceAttributable.h" + +/* Different HTTP methods. */ +typedef NS_ENUM(NSInteger, FIRHTTPMethod) { + FIRHTTPMethodGET NS_SWIFT_NAME(get), + FIRHTTPMethodPUT NS_SWIFT_NAME(put), + FIRHTTPMethodPOST NS_SWIFT_NAME(post), + FIRHTTPMethodDELETE NS_SWIFT_NAME(delete), + FIRHTTPMethodHEAD NS_SWIFT_NAME(head), + FIRHTTPMethodPATCH NS_SWIFT_NAME(patch), + FIRHTTPMethodOPTIONS NS_SWIFT_NAME(options), + FIRHTTPMethodTRACE NS_SWIFT_NAME(trace), + FIRHTTPMethodCONNECT NS_SWIFT_NAME(connect) +} NS_SWIFT_NAME(HTTPMethod); + +/** + * FIRHTTPMetric object can be used to make the SDK record information about a HTTP network request. + */ +NS_SWIFT_NAME(HTTPMetric) +@interface FIRHTTPMetric : NSObject + +/** + * Creates HTTPMetric object for a network request. + * @param URL The URL for which the metrics are recorded. + * @param httpMethod HTTP method used by the request. + */ +- (nullable instancetype)initWithURL:(nonnull NSURL *)URL HTTPMethod:(FIRHTTPMethod)httpMethod + NS_SWIFT_NAME(init(url:httpMethod:)); + +/** + * Use `initWithURL:HTTPMethod:` for Objective-C and `init(url:httpMethod:)` for Swift. + */ +- (nonnull instancetype)init NS_UNAVAILABLE; + +/** + * @brief HTTP Response code. Values are greater than 0. + */ +@property(nonatomic, assign) NSInteger responseCode; + +/** + * @brief Size of the request payload. + */ +@property(nonatomic, assign) long requestPayloadSize; + +/** + * @brief Size of the response payload. + */ +@property(nonatomic, assign) long responsePayloadSize; + +/** + * @brief HTTP Response content type. + */ +@property(nonatomic, nullable, copy) NSString *responseContentType; + +/** + * Marks the start time of the request. + */ +- (void)start; + +/** + * Marks the end time of the response and queues the network request metric on the device for + * transmission. Check the logs if the metric is valid. + */ +- (void)stop; + +@end diff --git a/ios/platform/FirebasePerformance.framework/Headers/FIRPerformance.h b/ios/platform/FirebasePerformance.framework/Headers/FIRPerformance.h index f36f023..8cb2b72 100755 --- a/ios/platform/FirebasePerformance.framework/Headers/FIRPerformance.h +++ b/ios/platform/FirebasePerformance.framework/Headers/FIRPerformance.h @@ -1,13 +1,12 @@ #import -#import "FIRPerformanceSwiftNameSupport.h" #import "FIRTrace.h" /** This class allows you to configure the Firebase Performance Reporting SDK. It also provides the * interfaces to create timers and enable or disable automatic metrics capture. */ NS_EXTENSION_UNAVAILABLE("FirebasePerformance does not support app extensions at this time.") -FIR_SWIFT_NAME(Performance) +NS_SWIFT_NAME(Performance) @interface FIRPerformance : NSObject /** @@ -30,7 +29,7 @@ FIR_SWIFT_NAME(Performance) @property(nonatomic, assign, getter=isInstrumentationEnabled) BOOL instrumentationEnabled; /** @return The shared instance. */ -+ (nonnull instancetype)sharedInstance FIR_SWIFT_NAME(sharedInstance()); ++ (nonnull instancetype)sharedInstance NS_SWIFT_NAME(sharedInstance()); /** * Creates an instance of FIRTrace after creating the shared instance of FIRPerformance. The trace @@ -41,7 +40,7 @@ FIR_SWIFT_NAME(Performance) * @return The FIRTrace object. */ + (nullable FIRTrace *)startTraceWithName:(nonnull NSString *)name - FIR_SWIFT_NAME(startTrace(name:)); + NS_SWIFT_NAME(startTrace(name:)); /** * Creates an instance of FIRTrace. This API does not start the trace. To start the trace, use the @@ -50,6 +49,6 @@ FIR_SWIFT_NAME(Performance) * @param name The name of the Trace. * @return The FIRTrace object. */ -- (nullable FIRTrace *)traceWithName:(nonnull NSString *)name FIR_SWIFT_NAME(trace(name:)); +- (nullable FIRTrace *)traceWithName:(nonnull NSString *)name NS_SWIFT_NAME(trace(name:)); @end diff --git a/ios/platform/FirebasePerformance.framework/Headers/FIRPerformanceAttributable.h b/ios/platform/FirebasePerformance.framework/Headers/FIRPerformanceAttributable.h new file mode 100755 index 0000000..5bf6871 --- /dev/null +++ b/ios/platform/FirebasePerformance.framework/Headers/FIRPerformanceAttributable.h @@ -0,0 +1,38 @@ +#import + +/** Defines the interface that allows adding/removing attributes to any object. + */ +NS_SWIFT_NAME(PerformanceAttributable) +@protocol FIRPerformanceAttributable + +/** List of attributes. */ +@property(nonatomic, nonnull, readonly) NSDictionary *attributes; + +/** + * Sets a value as a string for the specified attribute. Updates the value of the attribute if a + * value had already existed. + * + * @param value The value that needs to be set/updated for an attribute. If the length of the value + * exceeds the maximum allowed, the value will be truncated to the maximum allowed. + * @param attribute The name of the attribute. If the length of the value exceeds the maximum + * allowed, the value will be truncated to the maximum allowed. + */ +- (void)setValue:(nonnull NSString *)value forAttribute:(nonnull NSString *)attribute; + +/** + * Reads the value for the specified attribute. If the attribute does not exist, returns nil. + * + * @param attribute The name of the attribute. + * @return The value for the attribute. Returns nil if the attribute does not exist. + */ +- (nullable NSString *)valueForAttribute:(nonnull NSString *)attribute; + +/** + * Removes an attribute from the list. Does nothing if the attribute does not exist. + * + * @param attribute The name of the attribute. + */ +- (void)removeAttribute:(nonnull NSString *)attribute; + +@end + diff --git a/ios/platform/FirebasePerformance.framework/Headers/FIRPerformanceSwiftNameSupport.h b/ios/platform/FirebasePerformance.framework/Headers/FIRPerformanceSwiftNameSupport.h deleted file mode 100755 index 785b3c7..0000000 --- a/ios/platform/FirebasePerformance.framework/Headers/FIRPerformanceSwiftNameSupport.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef FIR_SWIFT_NAME // NOLINT - -#import - -// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. -// // Wrap it in our own macro if it's a non-compatible SDK. -#ifdef __IPHONE_9_3 -#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) -#else -#define FIR_SWIFT_NAME(X) // Intentionally blank. -#endif // #ifdef __IPHONE_9_3 - -#endif // FIR_SWIFT_NAME // NOLINT - diff --git a/ios/platform/FirebasePerformance.framework/Headers/FIRTrace.h b/ios/platform/FirebasePerformance.framework/Headers/FIRTrace.h index b243c3a..8d4e8ae 100755 --- a/ios/platform/FirebasePerformance.framework/Headers/FIRTrace.h +++ b/ios/platform/FirebasePerformance.framework/Headers/FIRTrace.h @@ -1,6 +1,6 @@ #import -#import "FIRPerformanceSwiftNameSupport.h" +#import "FIRPerformanceAttributable.h" /** * FIRTrace objects contain information about a "Trace", which is a sequence of steps. Traces can be @@ -9,8 +9,8 @@ * nature (e.g., Bytes downloaded). Counters are scoped to an FIRTrace object. */ NS_EXTENSION_UNAVAILABLE("FirebasePerformance does not support app extensions at this time.") -FIR_SWIFT_NAME(Trace) -@interface FIRTrace : NSObject +NS_SWIFT_NAME(Trace) +@interface FIRTrace : NSObject /** @brief Name of the trace. */ @property(nonatomic, copy, readonly, nonnull) NSString *name; @@ -36,7 +36,7 @@ FIR_SWIFT_NAME(Trace) * @param counterName The name of the counter to increment. */ - (void)incrementCounterNamed:(nonnull NSString *)counterName - FIR_SWIFT_NAME(incrementCounter(named:)); + NS_SWIFT_NAME(incrementCounter(named:)); /** * Increments the counter for the provided counter name with the provided value. If it is a new @@ -47,6 +47,6 @@ FIR_SWIFT_NAME(Trace) * @param incrementValue The value the counter would be incremented with. */ - (void)incrementCounterNamed:(nonnull NSString *)counterName by:(NSInteger)incrementValue - FIR_SWIFT_NAME(incrementCounter(named:by:)); + NS_SWIFT_NAME(incrementCounter(named:by:)); @end diff --git a/ios/platform/FirebasePerformance.framework/Headers/FirebasePerformance.h b/ios/platform/FirebasePerformance.framework/Headers/FirebasePerformance.h index aca1a82..8654e87 100755 --- a/ios/platform/FirebasePerformance.framework/Headers/FirebasePerformance.h +++ b/ios/platform/FirebasePerformance.framework/Headers/FirebasePerformance.h @@ -1,3 +1,4 @@ +#import "FIRHTTPMetric.h" #import "FIRPerformance.h" -#import "FIRPerformanceSwiftNameSupport.h" +#import "FIRPerformanceAttributable.h" #import "FIRTrace.h" diff --git a/ios/platform/FirebasePerformance.framework/Modules/module.modulemap b/ios/platform/FirebasePerformance.framework/Modules/module.modulemap index dd3567e..25f5c43 100755 --- a/ios/platform/FirebasePerformance.framework/Modules/module.modulemap +++ b/ios/platform/FirebasePerformance.framework/Modules/module.modulemap @@ -8,5 +8,6 @@ framework module FirebasePerformance { link framework "CoreTelephony" link framework "QuartzCore" link framework "Security" + link framework "StoreKit" link framework "SystemConfiguration" link framework "UIKit"} diff --git a/ios/platform/FirebaseSwizzlingUtilities.framework/FirebaseSwizzlingUtilities b/ios/platform/FirebaseSwizzlingUtilities.framework/FirebaseSwizzlingUtilities new file mode 100755 index 0000000..9296a46 Binary files /dev/null and b/ios/platform/FirebaseSwizzlingUtilities.framework/FirebaseSwizzlingUtilities differ diff --git a/ios/platform/FirebaseSwizzlingUtilities.framework/Modules/module.modulemap b/ios/platform/FirebaseSwizzlingUtilities.framework/Modules/module.modulemap new file mode 100755 index 0000000..fbfcc6a --- /dev/null +++ b/ios/platform/FirebaseSwizzlingUtilities.framework/Modules/module.modulemap @@ -0,0 +1,4 @@ +framework module FirebaseSwizzlingUtilities { + export * + module * { export *} + link "c++"}