Skip to content

Commit

Permalink
Merge pull request #60 from hansemannn/ios-latest
Browse files Browse the repository at this point in the history
feat(ios): update firebase to latest
  • Loading branch information
hansemannn authored Aug 20, 2020
2 parents afecc66 + 98a2cc4 commit 0a5e8a9
Show file tree
Hide file tree
Showing 117 changed files with 18,050 additions and 626 deletions.
1 change: 1 addition & 0 deletions ios/Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
1 change: 1 addition & 0 deletions ios/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" "6.29.0"
8 changes: 5 additions & 3 deletions ios/Classes/FirebaseAnalyticsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)setUserID:(NSString *)userID

- (void)setEnabled:(NSNumber *)enabled
{
[[FIRAnalyticsConfiguration sharedInstance] setAnalyticsCollectionEnabled:[TiUtils boolValue:enabled]];
[FIRAnalytics setAnalyticsCollectionEnabled:[TiUtils boolValue:enabled]];
}

- (void)resetAnalyticsData:(id)unused
Expand All @@ -82,8 +82,10 @@ - (void)setScreenNameAndScreenClass:(id)arguments
NSString *screenName = [TiUtils stringValue:@"screenName" properties:arguments];
NSString *screenClass = [TiUtils stringValue:@"screenClass" properties:arguments def:@"TiController"];

[FIRAnalytics setScreenName:screenName
screenClass:screenClass];
[FIRAnalytics logEventWithName:kFIREventScreenView parameters:@{
kFIRParameterScreenClass: screenClass,
kFIRParameterScreenName: screenName}
];
}

- (NSString *)appInstanceID
Expand Down
4 changes: 2 additions & 2 deletions ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.4.1
version: 2.0.0
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: titanium-firebase-analytics
Expand All @@ -15,4 +15,4 @@ name: titanium-firebase-analytics
moduleid: firebase.analytics
guid: 9800b2f6-460e-4caa-bf9a-35b206c5d3af
platform: iphone
minsdk: 6.3.0.GA
minsdk: 8.3.1.GA
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
framework module FIRAnalyticsConnector {
export *
module * { export *}
module * { export * }
link "sqlite3"
link "z"
link framework "CoreData"
link framework "Security"
link framework "SystemConfiguration"}
link framework "StoreKit"
link framework "SystemConfiguration"
link framework "UIKit"
}
Binary file modified ios/platform/FirebaseAnalytics.framework/FirebaseAnalytics
Binary file not shown.
48 changes: 41 additions & 7 deletions ios/platform/FirebaseAnalytics.framework/Headers/FIRAnalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ NS_ASSUME_NONNULL_BEGIN
/// The top level Firebase Analytics singleton that provides methods for logging events and setting
/// user properties. See <a href="http://goo.gl/gz8SLz">the developer guides</a> for general
/// information on using Firebase Analytics in your apps.
///
/// @note The Analytics SDK uses SQLite to persist events and other app-specific data. Calling
/// certain thread-unsafe global SQLite methods like `sqlite3_shutdown()` can result in
/// unexpected crashes at runtime.
NS_SWIFT_NAME(Analytics)
@interface FIRAnalytics : NSObject

Expand Down Expand Up @@ -86,26 +90,42 @@ NS_SWIFT_NAME(Analytics)
/// Must be called on the main thread.
///
/// Note that screen reporting is enabled automatically and records the class name of the current
/// UIViewController for you without requiring you to call this method. If you implement
/// viewDidAppear in your UIViewController but do not call [super viewDidAppear:], that screen class
/// will not be automatically tracked. The class name can optionally be overridden by calling this
/// method in the viewDidAppear callback of your UIViewController and specifying the
/// screenClassOverride parameter. setScreenName:screenClass: must be called after
/// [super viewDidAppear:].
/// UIViewController for you without requiring you to call this method. The class name can
/// optionally be overridden by calling this method in the viewDidAppear callback of your
/// UIViewController and specifying the screenClassOverride parameter.
/// `setScreenName:screenClass:` must be called after `[super viewDidAppear:]`.
///
/// If your app does not use a distinct UIViewController for each screen, you should call this
/// method and specify a distinct screenName each time a new screen is presented to the user.
///
/// The screen name and screen class remain in effect until the current UIViewController changes or
/// a new call to setScreenName:screenClass: is made.
///
/// @warning If you override `viewDidAppear:` in your UIViewController but do not call
/// `[super viewDidAppear:]`, that screen class will not be tracked.
///
/// @param screenName The name of the current screen. Should contain 1 to 100 characters. Set to nil
/// to clear the current screen name.
/// @param screenClassOverride The name of the screen class. Should contain 1 to 100 characters. By
/// default this is the class name of the current UIViewController. Set to nil to revert to the
/// default class name.
+ (void)setScreenName:(nullable NSString *)screenName
screenClass:(nullable NSString *)screenClassOverride;
screenClass:(nullable NSString *)screenClassOverride
DEPRECATED_MSG_ATTRIBUTE(
"Use +[FIRAnalytics logEventWithName:kFIREventScreenView parameters:] instead.");

/// Sets whether analytics collection is enabled for this app on this device. This setting is
/// persisted across app sessions. By default it is enabled.
///
/// @param analyticsCollectionEnabled A flag that enables or disables Analytics collection.
+ (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled;

/// Sets the interval of inactivity in seconds that terminates the current session. The default
/// value is 1800 seconds (30 minutes).
///
/// @param sessionTimeoutInterval The custom time of inactivity in seconds before the current
/// session terminates.
+ (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval;

/// The unique ID for this instance of the application.
+ (NSString *)appInstanceID;
Expand All @@ -114,6 +134,20 @@ NS_SWIFT_NAME(Analytics)
/// FIRAnalyticsConfiguration values will be reset to the default values.
+ (void)resetAnalyticsData;

/// Adds parameters that will be set on every event logged from the SDK, including automatic ones.
/// The values passed in the parameters dictionary will be added to the dictionary of default event
/// parameters. These parameters persist across app runs. They are of lower precedence than event
/// parameters, so if an event parameter and a parameter set using this API have the same name, the
/// value of the event parameter will be used. The same limitations on event parameters apply to
/// default event parameters.
///
/// @param parameters Parameters to be added to the dictionary of parameters added to every event.
/// They will be added to the dictionary of default event parameters, replacing any existing
/// parameter with the same name. Valid parameters are NSString and NSNumber (signed 64-bit
/// integer and 64-bit floating-point number). Setting a key's value to [NSNull null] will clear
/// that parameter. Passing in a nil dictionary will clear all parameters.
+ (void)setDefaultEventParameters:(nullable NSDictionary<NSString *, id> *)parameters;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 0a5e8a9

Please sign in to comment.