Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Removed GCM files and added FCM files
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored and macdonst committed May 4, 2017
1 parent 24f0a77 commit 9d5dbb1
Show file tree
Hide file tree
Showing 25 changed files with 1,547 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#import <Foundation/Foundation.h>

#import "FIRAnalytics.h"

/**
* Provides App Delegate handlers to be used in your App Delegate.
*
* To save time integrating Firebase Analytics in an application, Firebase Analytics does not
* require delegation implementation from the AppDelegate. Instead this is automatically done by
* Firebase Analytics. Should you choose instead to delegate manually, you can turn off the App
* Delegate Proxy by adding FirebaseAppDelegateProxyEnabled into your Info.plist and setting it
* to NO, and adding the methods in this category to corresponding delegation handlers.
*
* To handle Universal Links, you must return YES in
* [UIApplicationDelegate application:didFinishLaunchingWithOptions:].
*/
@interface FIRAnalytics (AppDelegate)

/**
* Handles events related to a URL session that are waiting to be processed.
*
* For optimal use of Firebase Analytics, call this method from the
* [UIApplicationDelegate application:handleEventsForBackgroundURLSession:completionHandler]
* method of the app delegate in your app.
*
* @param identifier The identifier of the URL session requiring attention.
* @param completionHandler The completion handler to call when you finish processing the events.
* Calling this completion handler lets the system know that your app's user interface is
* updated and a new snapshot can be taken.
*/
+ (void)handleEventsForBackgroundURLSession:(NSString *)identifier
completionHandler:(void (^)(void))completionHandler;

/**
* Handles the event when the app is launched by a URL.
*
* Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and
* above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on iOS 8.x
* and below) in your app.
*
* @param url The URL resource to open. This resource can be a network resource or a file.
*/
+ (void)handleOpenURL:(NSURL *)url;

/**
* Handles the event when the app receives data associated with user activity that includes a
* Universal Link (on iOS 9.0 and above).
*
* Call this method from [UIApplication continueUserActivity:restorationHandler:] in your app
* delegate (on iOS 9.0 and above).
*
* @param userActivity The activity object containing the data associated with the task the user
* was performing.
*/
+ (void)handleUserActivity:(id)userActivity;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#import <Foundation/Foundation.h>

#import "FIREventNames.h"
#import "FIRParameterNames.h"
#import "FIRUserPropertyNames.h"

/// The top level Firebase Analytics singleton that provides methods for logging events and setting
/// user properties. See <a href="http://goo.gl/C2PPSP">the developer guides</a> for general
/// information on using Firebase Analytics in your apps.
@interface FIRAnalytics : NSObject

/// Logs an app event. The event can have up to 25 parameters. Events with the same name must have
/// the same parameters. Up to 500 event names are supported. Using predefined events and/or
/// parameters is recommended for optimal reporting.
///
/// The following event names are reserved and cannot be used:
/// <ul>
/// <li>app_clear_data</li>
/// <li>app_uninstall</li>
/// <li>app_update</li>
/// <li>error</li>
/// <li>first_open</li>
/// <li>in_app_purchase</li>
/// <li>notification_dismiss</li>
/// <li>notification_foreground</li>
/// <li>notification_open</li>
/// <li>notification_receive</li>
/// <li>os_update</li>
/// <li>session_start</li>
/// <li>user_engagement</li>
/// </ul>
///
/// @param name The name of the event. Should contain 1 to 32 alphanumeric characters or
/// underscores. The name must start with an alphabetic character. Some event names are
/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_" prefix
/// is reserved and should not be used. Note that event names are case-sensitive and that
/// logging two events whose names differ only in case will result in two distinct events.
/// @param parameters The dictionary of event parameters. Passing nil indicates that the event has
/// no parameters. Parameter names can be up to 24 characters long and must start with an
/// alphabetic character and contain only alphanumeric characters and underscores. Only NSString
/// and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are
/// supported. NSString parameter values can be up to 36 characters long. The "firebase_" prefix
/// is reserved and should not be used for parameter names.
+ (void)logEventWithName:(nonnull NSString *)name
parameters:(nullable NSDictionary<NSString *, NSObject *> *)parameters;

/// Sets a user property to a given value. Up to 25 user property names are supported.
///
/// The following user property names are reserved and cannot be used:
/// <ul>
/// <li>first_open_time</li>
/// <li>last_deep_link_referrer</li>
/// <li>user_id</li>
/// </ul>
///
/// @param value The value of the user property. Values can be up to 36 characters long. Setting the
/// value to nil removes the user property.
/// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters
/// or underscores and must start with an alphabetic character. The "firebase_" prefix is
/// reserved and should not be used for user property names.
+ (void)setUserPropertyString:(nullable NSString *)value forName:(nonnull NSString *)name;

/// Sets the user ID property. This feature must be used in accordance with
/// <a href="https://www.google.com/policies/privacy">Google's Privacy Policy</a>
///
/// @param userID The user ID to ascribe to the user of this app on this device, which must be
/// non-empty and no more than 36 characters long. Setting userID to nil removes the user ID.
+ (void)setUserID:(nullable NSString *)userID;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#import <Foundation/Foundation.h>

/**
* This class provides configuration fields for Firebase Analytics.
*/
@interface FIRAnalyticsConfiguration : NSObject

/**
* Returns the shared instance of FIRAnalyticsConfiguration.
*/
+ (FIRAnalyticsConfiguration *)sharedInstance;

/**
* Sets the minimum engagement time in seconds required to start a new session. The default value
* is 10 seconds.
*/
- (void)setMinimumSessionInterval:(NSTimeInterval)minimumSessionInterval;

/**
* Sets the interval of inactivity in seconds that terminates the current session. The default
* value is 1800 seconds (30 minutes).
*/
- (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval;

/**
* Sets whether analytics collection is enabled for this app on this device. This setting is
* persisted across app sessions. By default it is enabled.
*/
- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled;

/**
* Deprecated. Sets whether measurement and reporting are enabled for this app on this device. By
* default they are enabled.
*/
- (void)setIsEnabled:(BOOL)isEnabled
DEPRECATED_MSG_ATTRIBUTE("Use setAnalyticsCollectionEnabled: instead.");

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class FIROptions;

NS_ASSUME_NONNULL_BEGIN

typedef void (^FIRAppVoidBoolCallback)(BOOL success);

/**
* The entry point of Firebase SDKs.
*
* Initialize and configure FIRApp using [FIRApp configure];
* Or other customized ways as shown below.
*/
@interface FIRApp : NSObject

/**
* Configures a default Firebase app. Raises an exception if any configuration step fails. The
* default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched
* and before using Firebase services. This method is thread safe.
*/
+ (void)configure;

/**
* Configures the default Firebase app with the provided options. The default app is named
* "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread
* safe.
*
* @param options The Firebase application options used to configure the service.
*/
+ (void)configureWithOptions:(FIROptions *)options;

/**
* Configures a Firebase app with the given name and options. Raises an exception if any
* configuration step fails. This method is thread safe.
*
* @param name The application's name given by the developer. The name should should only contain
Letters, Numbers and Underscore.
* @param options The Firebase application options used to configure the services.
*/
+ (void)configureWithName:(NSString *)name options:(FIROptions *)options;

/**
* Returns the default app, or nil if the default app does not exist.
*/
+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp());

/**
* Returns a previously created FIRApp instance with the given name, or nil if no such app exists.
* This method is thread safe.
*/
+ (nullable FIRApp *)appNamed:(NSString *)name;

/**
* Returns the set of all extant FIRApp instances, or nil if there is no FIRApp instance. This
* method is thread safe.
*/
+ (nullable NSDictionary *)allApps;

/**
* Cleans up the current FIRApp, freeing associated data and returning its name to the pool for
* future use. This method is thread safe in class level.
*/
- (void)deleteApp:(FIRAppVoidBoolCallback)completion;

/**
* FIRFirebaseApp instances should not be initialized directly. Call |FIRApp configure|, or
* |FIRApp configureWithOptions:|, or |FIRApp configureWithNames:options| directly.
*/
- (nullable instancetype)init NS_UNAVAILABLE;

/**
* Gets the name of this app.
*/
@property(nonatomic, copy, readonly) NSString *name;

/**
* Gets the options for this app.
*/
@property(nonatomic, readonly) FIROptions *options;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#import <Foundation/Foundation.h>

#import "FIRAnalyticsConfiguration.h"

/**
* The log levels used by FIRConfiguration.
*/
typedef NS_ENUM(NSInteger, FIRLogLevel) {
kFIRLogLevelError = 0,
kFIRLogLevelWarning,
kFIRLogLevelInfo,
kFIRLogLevelDebug,
kFIRLogLevelAssert,
kFIRLogLevelMax = kFIRLogLevelAssert
};

/**
* This interface provides global level properties that the developer can tweak, and the singleton
* of each Google service configuration class.
*/
@interface FIRConfiguration : NSObject

+ (FIRConfiguration *)sharedInstance;

// The configuration class for Firebase Analytics.
@property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration;

// Global log level. Defaults to kFIRLogLevelError.
@property(nonatomic, readwrite, assign) FIRLogLevel logLevel;

@end
Loading

0 comments on commit 9d5dbb1

Please sign in to comment.