Abhishek
3 years ago
208 changed files with 10358 additions and 10942 deletions
@ -0,0 +1,81 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <FirebaseCore/FirebaseCore.h> |
||||
|
||||
#if !defined(__has_include) |
||||
#error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \ |
||||
import the headers individually." |
||||
#else |
||||
#if __has_include(<FirebaseAnalytics/FirebaseAnalytics.h>) |
||||
#import <FirebaseAnalytics/FirebaseAnalytics.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseAppCheck/FirebaseAppCheck.h>) |
||||
#import <FirebaseAppCheck/FirebaseAppCheck.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseAppDistribution/FirebaseAppDistribution.h>) |
||||
#import <FirebaseAppDistribution/FirebaseAppDistribution.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseAuth/FirebaseAuth.h>) |
||||
#import <FirebaseAuth/FirebaseAuth.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseCrashlytics/FirebaseCrashlytics.h>) |
||||
#import <FirebaseCrashlytics/FirebaseCrashlytics.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseDatabase/FirebaseDatabase.h>) |
||||
#import <FirebaseDatabase/FirebaseDatabase.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>) |
||||
#import <FirebaseDynamicLinks/FirebaseDynamicLinks.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseFirestore/FirebaseFirestore.h>) |
||||
#import <FirebaseFirestore/FirebaseFirestore.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseFunctions/FirebaseFunctions.h>) |
||||
#import <FirebaseFunctions/FirebaseFunctions.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseInAppMessaging/FirebaseInAppMessaging.h>) |
||||
#import <FirebaseInAppMessaging/FirebaseInAppMessaging.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseInstallations/FirebaseInstallations.h>) |
||||
#import <FirebaseInstallations/FirebaseInstallations.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseMessaging/FirebaseMessaging.h>) |
||||
#import <FirebaseMessaging/FirebaseMessaging.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebasePerformance/FirebasePerformance.h>) |
||||
#import <FirebasePerformance/FirebasePerformance.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>) |
||||
#import <FirebaseRemoteConfig/FirebaseRemoteConfig.h> |
||||
#endif |
||||
|
||||
#if __has_include(<FirebaseStorage/FirebaseStorage.h>) |
||||
#import <FirebaseStorage/FirebaseStorage.h> |
||||
#endif |
||||
|
||||
#endif // defined(__has_include)
|
@ -1 +0,0 @@
|
||||
Versions/Current/Crashlytics |
@ -1 +0,0 @@
|
||||
Versions/Current/Headers |
@ -1 +0,0 @@
|
||||
Versions/Current/Modules |
@ -1 +0,0 @@
|
||||
Versions/Current/Resources |
Binary file not shown.
@ -1,31 +0,0 @@
|
||||
//
|
||||
// ANSCompatibility.h
|
||||
// AnswersKit
|
||||
//
|
||||
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once |
||||
|
||||
#if !__has_feature(nullability) |
||||
#define nonnull |
||||
#define nullable |
||||
#define _Nullable |
||||
#define _Nonnull |
||||
#endif |
||||
|
||||
#ifndef NS_ASSUME_NONNULL_BEGIN |
||||
#define NS_ASSUME_NONNULL_BEGIN |
||||
#endif |
||||
|
||||
#ifndef NS_ASSUME_NONNULL_END |
||||
#define NS_ASSUME_NONNULL_END |
||||
#endif |
||||
|
||||
#if __has_feature(objc_generics) |
||||
#define ANS_GENERIC_NSARRAY(type) NSArray<type> |
||||
#define ANS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary<key_type, object_key> |
||||
#else |
||||
#define ANS_GENERIC_NSARRAY(type) NSArray |
||||
#define ANS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary |
||||
#endif |
@ -1,210 +0,0 @@
|
||||
//
|
||||
// Answers.h
|
||||
// Crashlytics
|
||||
//
|
||||
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "ANSCompatibility.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* This class exposes the Answers Events API, allowing you to track key
|
||||
* user user actions and metrics in your app. |
||||
*/ |
||||
@interface Answers : NSObject |
||||
|
||||
/**
|
||||
* Log a Sign Up event to see users signing up for your app in real-time, understand how |
||||
* many users are signing up with different methods and their success rate signing up. |
||||
* |
||||
* @param signUpMethodOrNil The method by which a user logged in, e.g. Twitter or Digits. |
||||
* @param signUpSucceededOrNil The ultimate success or failure of the login |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logSignUpWithMethod:(nullable NSString *)signUpMethodOrNil |
||||
success:(nullable NSNumber *)signUpSucceededOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log an Log In event to see users logging into your app in real-time, understand how many |
||||
* users are logging in with different methods and their success rate logging into your app. |
||||
* |
||||
* @param loginMethodOrNil The method by which a user logged in, e.g. email, Twitter or Digits. |
||||
* @param loginSucceededOrNil The ultimate success or failure of the login |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logLoginWithMethod:(nullable NSString *)loginMethodOrNil |
||||
success:(nullable NSNumber *)loginSucceededOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Share event to see users sharing from your app in real-time, letting you |
||||
* understand what content they're sharing from the type or genre down to the specific id. |
||||
* |
||||
* @param shareMethodOrNil The method by which a user shared, e.g. email, Twitter, SMS. |
||||
* @param contentNameOrNil The human readable name for this piece of content. |
||||
* @param contentTypeOrNil The type of content shared. |
||||
* @param contentIdOrNil The unique identifier for this piece of content. Useful for finding the top shared item. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logShareWithMethod:(nullable NSString *)shareMethodOrNil |
||||
contentName:(nullable NSString *)contentNameOrNil |
||||
contentType:(nullable NSString *)contentTypeOrNil |
||||
contentId:(nullable NSString *)contentIdOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log an Invite Event to track how users are inviting other users into |
||||
* your application. |
||||
* |
||||
* @param inviteMethodOrNil The method of invitation, e.g. GameCenter, Twitter, email. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logInviteWithMethod:(nullable NSString *)inviteMethodOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Purchase event to see your revenue in real-time, understand how many users are making purchases, see which |
||||
* items are most popular, and track plenty of other important purchase-related metrics. |
||||
* |
||||
* @param itemPriceOrNil The purchased item's price. |
||||
* @param currencyOrNil The ISO4217 currency code. Example: USD |
||||
* @param purchaseSucceededOrNil Was the purchase succesful or unsuccesful |
||||
* @param itemNameOrNil The human-readable form of the item's name. Example: |
||||
* @param itemTypeOrNil The type, or genre of the item. Example: Song |
||||
* @param itemIdOrNil The machine-readable, unique item identifier Example: SKU |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this purchase. |
||||
*/ |
||||
+ (void)logPurchaseWithPrice:(nullable NSDecimalNumber *)itemPriceOrNil |
||||
currency:(nullable NSString *)currencyOrNil |
||||
success:(nullable NSNumber *)purchaseSucceededOrNil |
||||
itemName:(nullable NSString *)itemNameOrNil |
||||
itemType:(nullable NSString *)itemTypeOrNil |
||||
itemId:(nullable NSString *)itemIdOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Level Start Event to track where users are in your game. |
||||
* |
||||
* @param levelNameOrNil The level name |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this level start event. |
||||
*/ |
||||
+ (void)logLevelStart:(nullable NSString *)levelNameOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Level End event to track how users are completing levels in your game. |
||||
* |
||||
* @param levelNameOrNil The name of the level completed, E.G. "1" or "Training" |
||||
* @param scoreOrNil The score the user completed the level with. |
||||
* @param levelCompletedSuccesfullyOrNil A boolean representing whether or not the level was completed succesfully. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logLevelEnd:(nullable NSString *)levelNameOrNil |
||||
score:(nullable NSNumber *)scoreOrNil |
||||
success:(nullable NSNumber *)levelCompletedSuccesfullyOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log an Add to Cart event to see users adding items to a shopping cart in real-time, understand how |
||||
* many users start the purchase flow, see which items are most popular, and track plenty of other important |
||||
* purchase-related metrics. |
||||
* |
||||
* @param itemPriceOrNil The purchased item's price. |
||||
* @param currencyOrNil The ISO4217 currency code. Example: USD |
||||
* @param itemNameOrNil The human-readable form of the item's name. Example: |
||||
* @param itemTypeOrNil The type, or genre of the item. Example: Song |
||||
* @param itemIdOrNil The machine-readable, unique item identifier Example: SKU |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logAddToCartWithPrice:(nullable NSDecimalNumber *)itemPriceOrNil |
||||
currency:(nullable NSString *)currencyOrNil |
||||
itemName:(nullable NSString *)itemNameOrNil |
||||
itemType:(nullable NSString *)itemTypeOrNil |
||||
itemId:(nullable NSString *)itemIdOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Start Checkout event to see users moving through the purchase funnel in real-time, understand how many |
||||
* users are doing this and how much they're spending per checkout, and see how it related to other important |
||||
* purchase-related metrics. |
||||
* |
||||
* @param totalPriceOrNil The total price of the cart. |
||||
* @param currencyOrNil The ISO4217 currency code. Example: USD |
||||
* @param itemCountOrNil The number of items in the cart. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logStartCheckoutWithPrice:(nullable NSDecimalNumber *)totalPriceOrNil |
||||
currency:(nullable NSString *)currencyOrNil |
||||
itemCount:(nullable NSNumber *)itemCountOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Rating event to see users rating content within your app in real-time and understand what |
||||
* content is most engaging, from the type or genre down to the specific id. |
||||
* |
||||
* @param ratingOrNil The integer rating given by the user. |
||||
* @param contentNameOrNil The human readable name for this piece of content. |
||||
* @param contentTypeOrNil The type of content shared. |
||||
* @param contentIdOrNil The unique identifier for this piece of content. Useful for finding the top shared item. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logRating:(nullable NSNumber *)ratingOrNil |
||||
contentName:(nullable NSString *)contentNameOrNil |
||||
contentType:(nullable NSString *)contentTypeOrNil |
||||
contentId:(nullable NSString *)contentIdOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Content View event to see users viewing content within your app in real-time and |
||||
* understand what content is most engaging, from the type or genre down to the specific id. |
||||
* |
||||
* @param contentNameOrNil The human readable name for this piece of content. |
||||
* @param contentTypeOrNil The type of content shared. |
||||
* @param contentIdOrNil The unique identifier for this piece of content. Useful for finding the top shared item. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logContentViewWithName:(nullable NSString *)contentNameOrNil |
||||
contentType:(nullable NSString *)contentTypeOrNil |
||||
contentId:(nullable NSString *)contentIdOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Search event allows you to see users searching within your app in real-time and understand |
||||
* exactly what they're searching for. |
||||
* |
||||
* @param queryOrNil The user's query. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. |
||||
*/ |
||||
+ (void)logSearchWithQuery:(nullable NSString *)queryOrNil |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
/**
|
||||
* Log a Custom Event to see user actions that are uniquely important for your app in real-time, to see how often |
||||
* they're performing these actions with breakdowns by different categories you add. Use a human-readable name for |
||||
* the name of the event, since this is how the event will appear in Answers. |
||||
* |
||||
* @param eventName The human-readable name for the event. |
||||
* @param customAttributesOrNil A dictionary of custom attributes to associate with this event. Attribute keys |
||||
* must be <code>NSString</code> and and values must be <code>NSNumber</code> or <code>NSString</code>. |
||||
* @discussion How we treat <code>NSNumbers</code>: |
||||
* We will provide information about the distribution of values over time. |
||||
* |
||||
* How we treat <code>NSStrings</code>: |
||||
* NSStrings are used as categorical data, allowing comparison across different category values. |
||||
* Strings are limited to a maximum length of 100 characters, attributes over this length will be |
||||
* truncated. |
||||
* |
||||
* When tracking the Tweet views to better understand user engagement, sending the tweet's length |
||||
* and the type of media present in the tweet allows you to track how tweet length and the type of media influence |
||||
* engagement. |
||||
*/ |
||||
+ (void)logCustomEventWithName:(NSString *)eventName |
||||
customAttributes:(nullable ANS_GENERIC_NSDICTIONARY(NSString *, id) *)customAttributesOrNil; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -1,33 +0,0 @@
|
||||
//
|
||||
// CLSAttributes.h
|
||||
// Crashlytics
|
||||
//
|
||||
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once |
||||
|
||||
#define CLS_DEPRECATED(x) __attribute__ ((deprecated(x))) |
||||
|
||||
#if !__has_feature(nullability) |
||||
#define nonnull |
||||
#define nullable |
||||
#define _Nullable |
||||
#define _Nonnull |
||||
#endif |
||||
|
||||
#ifndef NS_ASSUME_NONNULL_BEGIN |
||||
#define NS_ASSUME_NONNULL_BEGIN |
||||
#endif |
||||
|
||||
#ifndef NS_ASSUME_NONNULL_END |
||||
#define NS_ASSUME_NONNULL_END |
||||
#endif |
||||
|
||||
#if __has_feature(objc_generics) |
||||
#define CLS_GENERIC_NSARRAY(type) NSArray<type> |
||||
#define CLS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary<key_type, object_key> |
||||
#else |
||||
#define CLS_GENERIC_NSARRAY(type) NSArray |
||||
#define CLS_GENERIC_NSDICTIONARY(key_type,object_key) NSDictionary |
||||
#endif |
@ -1,64 +0,0 @@
|
||||
//
|
||||
// CLSLogging.h
|
||||
// Crashlytics
|
||||
//
|
||||
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
#ifdef __OBJC__ |
||||
#import "CLSAttributes.h" |
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
#endif |
||||
|
||||
|
||||
|
||||
/**
|
||||
* |
||||
* The CLS_LOG macro provides as easy way to gather more information in your log messages that are |
||||
* sent with your crash data. CLS_LOG prepends your custom log message with the function name and |
||||
* line number where the macro was used. If your app was built with the DEBUG preprocessor macro |
||||
* defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog. |
||||
* If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only. |
||||
* |
||||
* Example output: |
||||
* -[AppDelegate login:] line 134 $ login start |
||||
* |
||||
* If you would like to change this macro, create a new header file, unset our define and then define |
||||
* your own version. Make sure this new header file is imported after the Crashlytics header file. |
||||
* |
||||
* #undef CLS_LOG |
||||
* #define CLS_LOG(__FORMAT__, ...) CLSNSLog... |
||||
* |
||||
**/ |
||||
#ifdef __OBJC__ |
||||
#ifdef DEBUG |
||||
#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) |
||||
#else |
||||
#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) |
||||
#endif |
||||
#endif |
||||
|
||||
/**
|
||||
* |
||||
* Add logging that will be sent with your crash data. This logging will not show up in the system.log |
||||
* and will only be visible in your Crashlytics dashboard. |
||||
* |
||||
**/ |
||||
|
||||
#ifdef __OBJC__ |
||||
OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); |
||||
OBJC_EXTERN void CLSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0); |
||||
|
||||
/**
|
||||
* |
||||
* Add logging that will be sent with your crash data. This logging will show up in the system.log |
||||
* and your Crashlytics dashboard. It is not recommended for Release builds. |
||||
* |
||||
**/ |
||||
OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); |
||||
OBJC_EXTERN void CLSNSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0); |
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END |
||||
#endif |
@ -1,103 +0,0 @@
|
||||
//
|
||||
// CLSReport.h
|
||||
// Crashlytics
|
||||
//
|
||||
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "CLSAttributes.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* The CLSCrashReport protocol is deprecated. See the CLSReport class and the CrashyticsDelegate changes for details. |
||||
**/ |
||||
@protocol CLSCrashReport <NSObject> |
||||
|
||||
@property (nonatomic, copy, readonly) NSString *identifier; |
||||
@property (nonatomic, copy, readonly) NSDictionary *customKeys; |
||||
@property (nonatomic, copy, readonly) NSString *bundleVersion; |
||||
@property (nonatomic, copy, readonly) NSString *bundleShortVersionString; |
||||
@property (nonatomic, readonly, nullable) NSDate *crashedOnDate; |
||||
@property (nonatomic, copy, readonly) NSString *OSVersion; |
||||
@property (nonatomic, copy, readonly) NSString *OSBuildVersion; |
||||
|
||||
@end |
||||
|
||||
/**
|
||||
* The CLSReport exposes an interface to the phsyical report that Crashlytics has created. You can |
||||
* use this class to get information about the event, and can also set some values after the |
||||
* event has occured. |
||||
**/ |
||||
@interface CLSReport : NSObject <CLSCrashReport> |
||||
|
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
+ (instancetype)new NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Returns the session identifier for the report. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSString *identifier; |
||||
|
||||
/**
|
||||
* Returns the custom key value data for the report. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSDictionary *customKeys; |
||||
|
||||
/**
|
||||
* Returns the CFBundleVersion of the application that generated the report. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSString *bundleVersion; |
||||
|
||||
/**
|
||||
* Returns the CFBundleShortVersionString of the application that generated the report. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSString *bundleShortVersionString; |
||||
|
||||
/**
|
||||
* Returns the date that the report was created. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSDate *dateCreated; |
||||
|
||||
/**
|
||||
* Returns the os version that the application crashed on. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSString *OSVersion; |
||||
|
||||
/**
|
||||
* Returns the os build version that the application crashed on. |
||||
**/ |
||||
@property (nonatomic, copy, readonly) NSString *OSBuildVersion; |
||||
|
||||
/**
|
||||
* Returns YES if the report contains any crash information, otherwise returns NO. |
||||
**/ |
||||
@property (nonatomic, assign, readonly) BOOL isCrash; |
||||
|
||||
/**
|
||||
* You can use this method to set, after the event, additional custom keys. The rules |
||||
* and semantics for this method are the same as those documented in Crashlytics.h. Be aware |
||||
* that the maximum size and count of custom keys is still enforced, and you can overwrite keys |
||||
* and/or cause excess keys to be deleted by using this method. |
||||
**/ |
||||
- (void)setObjectValue:(nullable id)value forKey:(NSString *)key; |
||||
|
||||
/**
|
||||
* Record an application-specific user identifier. See Crashlytics.h for details. |
||||
**/ |
||||
@property (nonatomic, copy, nullable) NSString * userIdentifier; |
||||
|
||||
/**
|
||||
* Record a user name. See Crashlytics.h for details. |
||||
**/ |
||||
@property (nonatomic, copy, nullable) NSString * userName; |
||||
|
||||
/**
|
||||
* Record a user email. See Crashlytics.h for details. |
||||
**/ |
||||
@property (nonatomic, copy, nullable) NSString * userEmail; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -1,38 +0,0 @@
|
||||
//
|
||||
// CLSStackFrame.h
|
||||
// Crashlytics
|
||||
//
|
||||
// Copyright 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "CLSAttributes.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* |
||||
* This class is used in conjunction with -[Crashlytics recordCustomExceptionName:reason:frameArray:] to |
||||
* record information about non-ObjC/C++ exceptions. All information included here will be displayed
|
||||
* in the Crashlytics UI, and can influence crash grouping. Be particularly careful with the use of the
|
||||
* address property. If set, Crashlytics will attempt symbolication and could overwrite other properities
|
||||
* in the process. |
||||
* |
||||
**/ |
||||
@interface CLSStackFrame : NSObject |
||||
|
||||
+ (instancetype)stackFrame; |
||||
+ (instancetype)stackFrameWithAddress:(NSUInteger)address; |
||||
+ (instancetype)stackFrameWithSymbol:(NSString *)symbol; |
||||
|
||||
@property (nonatomic, copy, nullable) NSString *symbol; |
||||
@property (nonatomic, copy, nullable) NSString *rawSymbol; |
||||
@property (nonatomic, copy, nullable) NSString *library; |
||||
@property (nonatomic, copy, nullable) NSString *fileName; |
||||
@property (nonatomic, assign) uint32_t lineNumber; |
||||
@property (nonatomic, assign) uint64_t offset; |
||||
@property (nonatomic, assign) uint64_t address; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -1,288 +0,0 @@
|
||||
//
|
||||
// Crashlytics.h
|
||||
// Crashlytics
|
||||
//
|
||||
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
#import "CLSAttributes.h" |
||||
#import "CLSLogging.h" |
||||
#import "CLSReport.h" |
||||
#import "CLSStackFrame.h" |
||||
#import "Answers.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@protocol CrashlyticsDelegate; |
||||
|
||||
/**
|
||||
* Crashlytics. Handles configuration and initialization of Crashlytics. |
||||
* |
||||
* Note: The Crashlytics class cannot be subclassed. If this is causing you pain for |
||||
* testing, we suggest using either a wrapper class or a protocol extension. |
||||
*/ |
||||
@interface Crashlytics : NSObject |
||||
|
||||
@property (nonatomic, readonly, copy) NSString *APIKey; |
||||
@property (nonatomic, readonly, copy) NSString *version; |
||||
@property (nonatomic, assign) BOOL debugMode; |
||||
|
||||
/**
|
||||
* |
||||
* The delegate can be used to influence decisions on reporting and behavior, as well as reacting |
||||
* to previous crashes. |
||||
* |
||||
* Make certain that the delegate is setup before starting Crashlytics with startWithAPIKey:... or |
||||
* via +[Fabric with:...]. Failure to do will result in missing any delegate callbacks that occur |
||||
* synchronously during start. |
||||
* |
||||
**/ |
||||
@property (nonatomic, assign, nullable) id <CrashlyticsDelegate> delegate; |
||||
|
||||
/**
|
||||
* The recommended way to install Crashlytics into your application is to place a call to +startWithAPIKey:
|
||||
* in your -application:didFinishLaunchingWithOptions: or -applicationDidFinishLaunching: |
||||
* method. |
||||
* |
||||
* Note: Starting with 3.0, the submission process has been significantly improved. The delay parameter |
||||
* is no longer required to throttle submissions on launch, performance will be great without it. |
||||
* |
||||
* @param apiKey The Crashlytics API Key for this app |
||||
* |
||||
* @return The singleton Crashlytics instance |
||||
*/ |
||||
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey; |
||||
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay CLS_DEPRECATED("Crashlytics no longer needs or uses the delay parameter. Please use +startWithAPIKey: instead."); |
||||
|
||||
/**
|
||||
* If you need the functionality provided by the CrashlyticsDelegate protocol, you can use |
||||
* these convenience methods to activate the framework and set the delegate in one call. |
||||
*
|
||||
* @param apiKey The Crashlytics API Key for this app |
||||
* @param delegate A delegate object which conforms to CrashlyticsDelegate. |
||||
* |
||||
* @return The singleton Crashlytics instance |
||||
*/ |
||||
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(nullable id<CrashlyticsDelegate>)delegate; |
||||
+ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(nullable id<CrashlyticsDelegate>)delegate afterDelay:(NSTimeInterval)delay CLS_DEPRECATED("Crashlytics no longer needs or uses the delay parameter. Please use +startWithAPIKey:delegate: instead."); |
||||
|
||||
/**
|
||||
* Access the singleton Crashlytics instance. |
||||
* |
||||
* @return The singleton Crashlytics instance |
||||
*/ |
||||
+ (Crashlytics *)sharedInstance; |
||||
|
||||
/**
|
||||
* The easiest way to cause a crash - great for testing! |
||||
*/ |
||||
- (void)crash; |
||||
|
||||
/**
|
||||
* The easiest way to cause a crash with an exception - great for testing. |
||||
*/ |
||||
- (void)throwException; |
||||
|
||||
/**
|
||||
* Specify a user identifier which will be visible in the Crashlytics UI. |
||||
* |
||||
* Many of our customers have requested the ability to tie crashes to specific end-users of their |
||||
* application in order to facilitate responses to support requests or permit the ability to reach |
||||
* out for more information. We allow you to specify up to three separate values for display within |
||||
* the Crashlytics UI - but please be mindful of your end-user's privacy. |
||||
* |
||||
* We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record |
||||
* in your system. This could be a database id, hash, or other value that is meaningless to a |
||||
* third-party observer but can be indexed and queried by you. |
||||
* |
||||
* Optionally, you may also specify the end-user's name or username, as well as email address if you |
||||
* do not have a system that works well with obscured identifiers. |
||||
* |
||||
* Pursuant to our EULA, this data is transferred securely throughout our system and we will not |
||||
* disseminate end-user data unless required to by law. That said, if you choose to provide end-user |
||||
* contact information, we strongly recommend that you disclose this in your application's privacy |
||||
* policy. Data privacy is of our utmost concern. |
||||
* |
||||
* @param identifier An arbitrary user identifier string which ties an end-user to a record in your system. |
||||
*/ |
||||
- (void)setUserIdentifier:(nullable NSString *)identifier; |
||||
|
||||
/**
|
||||
* Specify a user name which will be visible in the Crashlytics UI. |
||||
* Please be mindful of your end-user's privacy and see if setUserIdentifier: can fulfil your needs. |
||||
* @see setUserIdentifier: |
||||
* |
||||
* @param name An end user's name. |
||||
*/ |
||||
- (void)setUserName:(nullable NSString *)name; |
||||
|
||||
/**
|
||||
* Specify a user email which will be visible in the Crashlytics UI. |
||||
* Please be mindful of your end-user's privacy and see if setUserIdentifier: can fulfil your needs. |
||||
*
|
||||
* @see setUserIdentifier: |
||||
* |
||||
* @param email An end user's email address. |
||||
*/ |
||||
- (void)setUserEmail:(nullable NSString *)email; |
||||
|
||||
+ (void)setUserIdentifier:(nullable NSString *)identifier CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
+ (void)setUserName:(nullable NSString *)name CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
+ (void)setUserEmail:(nullable NSString *)email CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
|
||||
/**
|
||||
* Set a value for a for a key to be associated with your crash data which will be visible in the Crashlytics UI. |
||||
* When setting an object value, the object is converted to a string. This is typically done by calling
|
||||
* -[NSObject description]. |
||||
* |
||||
* @param value The object to be associated with the key |
||||
* @param key The key with which to associate the value |
||||
*/ |
||||
- (void)setObjectValue:(nullable id)value forKey:(NSString *)key; |
||||
|
||||
/**
|
||||
* Set an int value for a key to be associated with your crash data which will be visible in the Crashlytics UI. |
||||
* |
||||
* @param value The integer value to be set |
||||
* @param key The key with which to associate the value |
||||
*/ |
||||
- (void)setIntValue:(int)value forKey:(NSString *)key; |
||||
|
||||
/**
|
||||
* Set an BOOL value for a key to be associated with your crash data which will be visible in the Crashlytics UI. |
||||
* |
||||
* @param value The BOOL value to be set |
||||
* @param key The key with which to associate the value |
||||
*/ |
||||
- (void)setBoolValue:(BOOL)value forKey:(NSString *)key; |
||||
|
||||
/**
|
||||
* Set an float value for a key to be associated with your crash data which will be visible in the Crashlytics UI. |
||||
* |
||||
* @param value The float value to be set |
||||
* @param key The key with which to associate the value |
||||
*/ |
||||
- (void)setFloatValue:(float)value forKey:(NSString *)key; |
||||
|
||||
+ (void)setObjectValue:(nullable id)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
+ (void)setIntValue:(int)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
+ (void)setBoolValue:(BOOL)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
+ (void)setFloatValue:(float)value forKey:(NSString *)key CLS_DEPRECATED("Please access this method via +sharedInstance"); |
||||
|
||||
/**
|
||||
* This method can be used to record a single exception structure in a report. This is particularly useful |
||||
* when your code interacts with non-native languages like Lua, C#, or Javascript. This call can be |
||||
* expensive and should only be used shortly before process termination. This API is not intended be to used |
||||
* to log NSException objects. All safely-reportable NSExceptions are automatically captured by |
||||
* Crashlytics. |
||||
* |
||||
* @param name The name of the custom exception |
||||
* @param reason The reason this exception occured |
||||
* @param frameArray An array of CLSStackFrame objects |
||||
*/ |
||||
- (void)recordCustomExceptionName:(NSString *)name reason:(nullable NSString *)reason frameArray:(CLS_GENERIC_NSARRAY(CLSStackFrame *) *)frameArray; |
||||
|
||||
/**
|
||||
* |
||||
* This allows you to record a non-fatal event, described by an NSError object. These events will be grouped and |
||||
* displayed similarly to crashes. Keep in mind that this method can be expensive. Also, the total number of |
||||
* NSErrors that can be recorded during your app's life-cycle is limited by a fixed-size circular buffer. If the |
||||
* buffer is overrun, the oldest data is dropped. Errors are relayed to Crashlytics on a subsequent launch |
||||
* of your application. |
||||
* |
||||
* You can also use the -recordError:withAdditionalUserInfo: to include additional context not represented |
||||
* by the NSError instance itself. |
||||
* |
||||
**/ |
||||
- (void)recordError:(NSError *)error; |
||||
- (void)recordError:(NSError *)error withAdditionalUserInfo:(nullable CLS_GENERIC_NSDICTIONARY(NSString *, id) *)userInfo; |
||||
|
||||
- (void)logEvent:(NSString *)eventName CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); |
||||
- (void)logEvent:(NSString *)eventName attributes:(nullable NSDictionary *) attributes CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); |
||||
+ (void)logEvent:(NSString *)eventName CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); |
||||
+ (void)logEvent:(NSString *)eventName attributes:(nullable NSDictionary *) attributes CLS_DEPRECATED("Please refer to Answers +logCustomEventWithName:"); |
||||
|
||||
@end |
||||
|
||||
/**
|
||||
* |
||||
* The CrashlyticsDelegate protocol provides a mechanism for your application to take |
||||
* action on events that occur in the Crashlytics crash reporting system. You can make |
||||
* use of these calls by assigning an object to the Crashlytics' delegate property directly, |
||||
* or through the convenience +startWithAPIKey:delegate: method. |
||||
* |
||||
*/ |
||||
@protocol CrashlyticsDelegate <NSObject> |
||||
@optional |
||||
|
||||
|
||||
- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics CLS_DEPRECATED("Please refer to -crashlyticsDidDetectReportForLastExecution:"); |
||||
- (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id <CLSCrashReport>)crash CLS_DEPRECATED("Please refer to -crashlyticsDidDetectReportForLastExecution:"); |
||||
|
||||
/**
|
||||
* |
||||
* Called when a Crashlytics instance has determined that the last execution of the |
||||
* application resulted in a saved report. This is called synchronously on Crashlytics |
||||
* initialization. Your delegate must invoke the completionHandler, but does not need to do so |
||||
* synchronously, or even on the main thread. Invoking completionHandler with NO will cause the |
||||
* detected report to be deleted and not submitted to Crashlytics. This is useful for |
||||
* implementing permission prompts, or other more-complex forms of logic around submitting crashes. |
||||
* |
||||
* Instead of using this method, you should try to make use of -crashlyticsDidDetectReportForLastExecution:
|
||||
* if you can. |
||||
* |
||||
* @warning Failure to invoke the completionHandler will prevent submissions from being reported. Watch out. |
||||
* |
||||
* @warning Just implementing this delegate method will disable all forms of synchronous report submission. This can |
||||
* impact the reliability of reporting crashes very early in application launch. |
||||
* |
||||
* @param report The CLSReport object representing the last detected report |
||||
* @param completionHandler The completion handler to call when your logic has completed. |
||||
* |
||||
*/ |
||||
- (void)crashlyticsDidDetectReportForLastExecution:(CLSReport *)report completionHandler:(void (^)(BOOL submit))completionHandler; |
||||
|
||||
/**
|
||||
* |
||||
* Called when a Crashlytics instance has determined that the last execution of the |
||||
* application resulted in a saved report. This method differs from |
||||
* -crashlyticsDidDetectReportForLastExecution:completionHandler: in three important ways: |
||||
* |
||||
* - it is not called synchronously during initialization |
||||
* - it does not give you the ability to prevent the report from being submitted |
||||
* - the report object itself is immutable |
||||
* |
||||
* Thanks to these limitations, making use of this method does not impact reporting
|
||||
* reliabilty in any way. |
||||
* |
||||
* @param report The read-only CLSReport object representing the last detected report |
||||
* |
||||
*/ |
||||
|
||||
- (void)crashlyticsDidDetectReportForLastExecution:(CLSReport *)report; |
||||
|
||||
/**
|
||||
* If your app is running on an OS that supports it (OS X 10.9+, iOS 7.0+), Crashlytics will submit |
||||
* most reports using out-of-process background networking operations. This results in a significant |
||||
* improvement in reliability of reporting, as well as power and performance wins for your users. |
||||
* If you don't want this functionality, you can disable by returning NO from this method. |
||||
* |
||||
* @warning Background submission is not supported for extensions on iOS or OS X. |
||||
* |
||||
* @param crashlytics The Crashlytics singleton instance |
||||
* |
||||
* @return Return NO if you don't want out-of-process background network operations. |
||||
* |
||||
*/ |
||||
- (BOOL)crashlyticsCanUseBackgroundSessions:(Crashlytics *)crashlytics; |
||||
|
||||
@end |
||||
|
||||
/**
|
||||
* `CrashlyticsKit` can be used as a parameter to `[Fabric with:@[CrashlyticsKit]];` in Objective-C. In Swift, use Crashlytics.sharedInstance() |
||||
*/ |
||||
#define CrashlyticsKit [Crashlytics sharedInstance] |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -1,14 +0,0 @@
|
||||
framework module Crashlytics { |
||||
header "Crashlytics.h" |
||||
header "Answers.h" |
||||
header "ANSCompatibility.h" |
||||
header "CLSLogging.h" |
||||
header "CLSReport.h" |
||||
header "CLSStackFrame.h" |
||||
header "CLSAttributes.h" |
||||
|
||||
export * |
||||
|
||||
link "z" |
||||
link "c++" |
||||
} |
@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>BuildMachineOSBuild</key> |
||||
<string>15G31</string> |
||||
<key>CFBundleDevelopmentRegion</key> |
||||
<string>English</string> |
||||
<key>CFBundleExecutable</key> |
||||
<string>Crashlytics</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.twitter.crashlytics.mac</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>Crashlytics</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleShortVersionString</key> |
||||
<string>3.8.5</string> |
||||
<key>CFBundleSignature</key> |
||||
<string>????</string> |
||||
<key>CFBundleSupportedPlatforms</key> |
||||
<array> |
||||
<string>MacOSX</string> |
||||
</array> |
||||
<key>CFBundleVersion</key> |
||||
<string>123</string> |
||||
<key>DTCompiler</key> |
||||
<string>com.apple.compilers.llvm.clang.1_0</string> |
||||
<key>DTPlatformBuild</key> |
||||
<string>8C1002</string> |
||||
<key>DTPlatformVersion</key> |
||||
<string>GM</string> |
||||
<key>DTSDKBuild</key> |
||||
<string>16C58</string> |
||||
<key>DTSDKName</key> |
||||
<string>macosx10.12</string> |
||||
<key>DTXcode</key> |
||||
<string>0821</string> |
||||
<key>DTXcodeBuild</key> |
||||
<string>8C1002</string> |
||||
<key>NSHumanReadableCopyright</key> |
||||
<string>Copyright © 2016 Crashlytics, Inc. All rights reserved.</string> |
||||
<key>UIDeviceFamily</key> |
||||
<array> |
||||
<integer>3</integer> |
||||
<integer>2</integer> |
||||
<integer>1</integer> |
||||
<integer>4</integer> |
||||
</array> |
||||
</dict> |
||||
</plist> |
@ -1 +0,0 @@
|
||||
A |
@ -1,28 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
# run |
||||
# |
||||
# Copyright (c) 2015 Crashlytics. All rights reserved. |
||||
|
||||
# Figure out where we're being called from |
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
||||
|
||||
# Quote path in case of spaces or special chars |
||||
DIR="\"${DIR}" |
||||
|
||||
PATH_SEP="/" |
||||
VALIDATE_COMMAND="uploadDSYM\" $@ validate run-script" |
||||
UPLOAD_COMMAND="uploadDSYM\" $@ run-script" |
||||
|
||||
# Ensure params are as expected, run in sync mode to validate |
||||
eval $DIR$PATH_SEP$VALIDATE_COMMAND |
||||
return_code=$? |
||||
|
||||
if [[ $return_code != 0 ]]; then |
||||
exit $return_code |
||||
fi |
||||
|
||||
# Verification passed, upload dSYM in background to prevent Xcode from waiting |
||||
# Note: Validation is performed again before upload. |
||||
# Output can still be found in Console.app |
||||
eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 & |
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
Versions/Current/Fabric |
@ -1 +0,0 @@
|
||||
Versions/Current/Headers |
@ -1 +0,0 @@
|
||||
Versions/Current/Modules |
@ -1 +0,0 @@
|
||||
Versions/Current/Resources |
Binary file not shown.
@ -1,48 +0,0 @@
|
||||
//
|
||||
// FABAttributes.h
|
||||
// Fabric
|
||||
//
|
||||
// Copyright (c) 2015 Twitter. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once |
||||
|
||||
#define FAB_UNAVAILABLE(x) __attribute__((unavailable(x))) |
||||
|
||||
#if __has_feature(nullability) |
||||
#define fab_nullable nullable |
||||
#define fab_nonnull nonnull |
||||
#define fab_null_unspecified null_unspecified |
||||
#define fab_null_resettable null_resettable |
||||
#define __fab_nullable __nullable |
||||
#define __fab_nonnull __nonnull |
||||
#define __fab_null_unspecified __null_unspecified |
||||
#else |
||||
#define fab_nullable |
||||
#define fab_nonnull |
||||
#define fab_null_unspecified |
||||
#define fab_null_resettable |
||||
#define __fab_nullable |
||||
#define __fab_nonnull |
||||
#define __fab_null_unspecified |
||||
#endif |
||||
|
||||
#ifndef NS_ASSUME_NONNULL_BEGIN |
||||
#define NS_ASSUME_NONNULL_BEGIN |
||||
#endif |
||||
|
||||
#ifndef NS_ASSUME_NONNULL_END |
||||
#define NS_ASSUME_NONNULL_END |
||||
#endif |
||||
|
||||
|
||||
/**
|
||||
* The following macros are defined here to provide |
||||
* backwards compatability. If you are still using |
||||
* them you should migrate to the new versions that |
||||
* are defined above. |
||||
*/ |
||||
#define FAB_NONNULL __fab_nonnull |
||||
#define FAB_NULLABLE __fab_nullable |
||||
#define FAB_START_NONNULL NS_ASSUME_NONNULL_BEGIN |
||||
#define FAB_END_NONNULL NS_ASSUME_NONNULL_END |
@ -1,64 +0,0 @@
|
||||
//
|
||||
// Fabric.h
|
||||
//
|
||||
// Copyright (c) 2015 Twitter. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "FABAttributes.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
#if TARGET_OS_IPHONE |
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 |
||||
#error "Fabric's minimum iOS version is 6.0" |
||||
#endif |
||||
#else |
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070 |
||||
#error "Fabric's minimum OS X version is 10.7" |
||||
#endif |
||||
#endif |
||||
|
||||
/**
|
||||
* Fabric Base. Coordinates configuration and starts all provided kits. |
||||
*/ |
||||
@interface Fabric : NSObject |
||||
|
||||
/**
|
||||
* Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use. |
||||
* |
||||
* For example, in Objective-C: |
||||
* |
||||
* `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];` |
||||
* |
||||
* Swift: |
||||
* |
||||
* `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])` |
||||
* |
||||
* Only the first call to this method is honored. Subsequent calls are no-ops. |
||||
* |
||||
* @param kitClasses An array of kit Class objects |
||||
* |
||||
* @return Returns the shared Fabric instance. In most cases this can be ignored. |
||||
*/ |
||||
+ (instancetype)with:(NSArray *)kitClasses; |
||||
|
||||
/**
|
||||
* Returns the Fabric singleton object. |
||||
*/ |
||||
+ (instancetype)sharedSDK; |
||||
|
||||
/**
|
||||
* This BOOL enables or disables debug logging, such as kit version information. The default value is NO. |
||||
*/ |
||||
@property (nonatomic, assign) BOOL debug; |
||||
|
||||
/**
|
||||
* Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance. |
||||
*/ |
||||
- (id)init FAB_UNAVAILABLE("Use +sharedSDK to retrieve the shared Fabric instance."); |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
||||
|
@ -1,6 +0,0 @@
|
||||
framework module Fabric { |
||||
umbrella header "Fabric.h" |
||||
|
||||
export * |
||||
module * { export * } |
||||
} |
@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>BuildMachineOSBuild</key> |
||||
<string>14F1021</string> |
||||
<key>CFBundleDevelopmentRegion</key> |
||||
<string>en</string> |
||||
<key>CFBundleExecutable</key> |
||||
<string>Fabric</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>io.fabric.sdk.mac</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>Fabric</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleShortVersionString</key> |
||||
<string>1.6.1</string> |
||||
<key>CFBundleSignature</key> |
||||
<string>????</string> |
||||
<key>CFBundleSupportedPlatforms</key> |
||||
<array> |
||||
<string>MacOSX</string> |
||||
</array> |
||||
<key>CFBundleVersion</key> |
||||
<string>37</string> |
||||
<key>DTCompiler</key> |
||||
<string>com.apple.compilers.llvm.clang.1_0</string> |
||||
<key>DTPlatformBuild</key> |
||||
<string>7B91b</string> |
||||
<key>DTPlatformVersion</key> |
||||
<string>GM</string> |
||||
<key>DTSDKBuild</key> |
||||
<string>15A278</string> |
||||
<key>DTSDKName</key> |
||||
<string>macosx10.11</string> |
||||
<key>DTXcode</key> |
||||
<string>0710</string> |
||||
<key>DTXcodeBuild</key> |
||||
<string>7B91b</string> |
||||
<key>NSHumanReadableCopyright</key> |
||||
<string>Copyright © 2015 Twitter. All rights reserved.</string> |
||||
<key>UIDeviceFamily</key> |
||||
<array> |
||||
<integer>1</integer> |
||||
<integer>2</integer> |
||||
</array> |
||||
</dict> |
||||
</plist> |
@ -1,28 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
# run |
||||
# |
||||
# Copyright (c) 2015 Crashlytics. All rights reserved. |
||||
|
||||
# Figure out where we're being called from |
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
||||
|
||||
# Quote path in case of spaces or special chars |
||||
DIR="\"${DIR}" |
||||
|
||||
PATH_SEP="/" |
||||
VALIDATE_COMMAND="uploadDSYM\" $@ validate" |
||||
UPLOAD_COMMAND="uploadDSYM\" $@" |
||||
|
||||
# Ensure params are as expected, run in sync mode to validate |
||||
eval $DIR$PATH_SEP$VALIDATE_COMMAND |
||||
return_code=$? |
||||
|
||||
if [[ $return_code != 0 ]]; then |
||||
exit $return_code |
||||
fi |
||||
|
||||
# Verification passed, upload dSYM in background to prevent Xcode from waiting |
||||
# Note: Validation is performed again before upload. |
||||
# Output can still be found in Console.app |
||||
eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 & |
Binary file not shown.
@ -1 +0,0 @@
|
||||
Versions/Current/Firebase |
@ -1 +0,0 @@
|
||||
Versions/Current/Headers |
@ -1 +0,0 @@
|
||||
Versions/Current/Modules |
@ -1,47 +0,0 @@
|
||||
Google LevelDB |
||||
Copyright (c) 2011 The LevelDB Authors. All rights reserved. |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
|
||||
* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
-- |
||||
|
||||
Square Socket Rocket |
||||
Copyright 2012 Square Inc. |
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at |
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
||||
|
||||
-- |
||||
|
||||
APLevelDB |
||||
Created by Adam Preble on 1/23/12. |
||||
Copyright (c) 2012 Adam Preble. All rights reserved. |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in |
||||
all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
THE SOFTWARE. |
Binary file not shown.
@ -1,54 +0,0 @@
|
||||
//
|
||||
// FAuthData.h
|
||||
// Firebase
|
||||
//
|
||||
// Created by Katherine Fang on 7/30/14.
|
||||
//
|
||||
|
||||
#import "FAuthType.h" |
||||
|
||||
|
||||
/**
|
||||
* The FAuthData class is a wrapper around the user metadata returned from the Firebase auth server. |
||||
* It includes the provider authenticated against, a uid (with the possible exception of authenticating against a custom |
||||
* backend), and a token used to authenticate with Firebase. |
||||
* |
||||
* It may include other metadata about the user, depending on the provider used to do the authentication. |
||||
*/ |
||||
@interface FAuthData : NSObject |
||||
|
||||
/**
|
||||
* @return Raw authentication token payload returned by the server |
||||
*/ |
||||
@property (nonatomic, strong, readonly) NSDictionary *auth; |
||||
|
||||
/**
|
||||
* @return Authentication token expiration timestamp (seconds since epoch) returned by the server |
||||
*/ |
||||
@property (nonatomic, strong, readonly) NSNumber *expires; |
||||
|
||||
/**
|
||||
* @return A uid for this user. It is unique across all auth providers. |
||||
*/ |
||||
@property (nonatomic, strong, readonly) NSString *uid; |
||||
|
||||
|
||||
/**
|
||||
* @return The provider that authenticated this user |
||||
*/ |
||||
@property (nonatomic, readonly) NSString *provider; |
||||
|
||||
|
||||
/**
|
||||
* @return The token that was used to authenticate this user with Firebase |
||||
*/ |
||||
@property (nonatomic, strong, readonly) NSString *token; |
||||
|
||||
|
||||
/**
|
||||
* @return Provider data keyed by provider. Includes cached data from third-party providers |
||||
*/ |
||||
@property (nonatomic, strong, readonly) NSDictionary *providerData; |
||||
|
||||
|
||||
@end |
@ -1,41 +0,0 @@
|
||||
//
|
||||
// FAuthType.h
|
||||
// Firebase
|
||||
//
|
||||
// Created by Katherine Fang on 7/30/14.
|
||||
//
|
||||
// All public-facing auth enums.
|
||||
//
|
||||
|
||||
#ifndef Firebase_FAuthenticationTypes_h |
||||
#define Firebase_FAuthenticationTypes_h |
||||
|
||||
typedef NS_ENUM(NSInteger, FAuthenticationError) { |
||||
// Developer / Config Errors
|
||||
FAuthenticationErrorProviderDisabled = -1, |
||||
FAuthenticationErrorInvalidConfiguration = -2, |
||||
FAuthenticationErrorInvalidOrigin = -3, |
||||
FAuthenticationErrorInvalidProvider = -4, |
||||
|
||||
// User Errors (Email / Password)
|
||||
FAuthenticationErrorInvalidEmail = -5, |
||||
FAuthenticationErrorInvalidPassword = -6, |
||||
FAuthenticationErrorInvalidToken = -7, |
||||
FAuthenticationErrorUserDoesNotExist = -8, |
||||
FAuthenticationErrorEmailTaken = -9, |
||||
|
||||
// User Errors (Facebook / Twitter / Github / Google)
|
||||
FAuthenticationErrorDeniedByUser = -10, |
||||
FAuthenticationErrorInvalidCredentials = -11, |
||||
FAuthenticationErrorInvalidArguments = -12, |
||||
FAuthenticationErrorProviderError = -13, |
||||
FAuthenticationErrorLimitsExceeded = -14, |
||||
|
||||
// Client side errors
|
||||
FAuthenticationErrorNetworkError = -15, |
||||
FAuthenticationErrorPreempted = -16, |
||||
|
||||
FAuthenticationErrorUnknown = -9999 |
||||
}; |
||||
|
||||
#endif |
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Firebase iOS Client Library |
||||
* |
||||
* Copyright © 2015 Firebase - All Rights Reserved |
||||
* https://www.firebase.com
|
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, this |
||||
* list of conditions and the following disclaimer. |
||||
* |
||||
* 2. Redistributions in binaryform must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR |
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
||||
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, |
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
/**
|
||||
* Configuration object for Firebase. You can get the default FConfig object via |
||||
* `[Firebase defaultConfig]` and modify it. You must make all changes to it before |
||||
* you create your first Firebase instance. |
||||
*/ |
||||
@interface FConfig : NSObject |
||||
|
||||
/**
|
||||
* By default the Firebase client will keep data in memory while your application is running, but not |
||||
* when it is restarted. By setting this value to YES, the data will be persisted to on-device (disk) |
||||
* storage and will thus be available again when the app is restarted (even when there is no network |
||||
* connectivity at that time). Note that this property must be set before creating your first Firebase |
||||
* reference and only needs to be called once per application. |
||||
* |
||||
* If your app uses Firebase Authentication, the client will automatically persist the user's authentication |
||||
* token across restarts, even without persistence enabled. But if the auth token expired while offline and |
||||
* you've enabled persistence, the client will pause write operations until you successfully re-authenticate |
||||
* (or explicitly unauthenticate) to prevent your writes from being sent unauthenticated and failing due to |
||||
* security rules. |
||||
*/ |
||||
@property (nonatomic) BOOL persistenceEnabled; |
||||
|
||||
/**
|
||||
* By default Firebase will use up to 10MB of disk space to cache data. If the cache grows beyond this size, |
||||
* Firebase will start removing data that hasn't been recently used. If you find that your application caches too |
||||
* little or too much data, call this method to change the cache size. This property must be set before creating |
||||
* your first Firebase reference and only needs to be called once per application. |
||||
* |
||||
* Note that the specified cache size is only an approximation and the size on disk may temporarily exceed it |
||||
* at times. |
||||
*/ |
||||
@property (nonatomic) NSUInteger persistenceCacheSizeBytes; |
||||
|
||||
/**
|
||||
* Sets the dispatch queue on which all events are raised. The default queue is the main queue. |
||||
*/ |
||||
@property (nonatomic, strong) dispatch_queue_t callbackQueue; |
||||
|
||||
@end |
@ -1,154 +0,0 @@
|
||||
/*
|
||||
* Firebase iOS Client Library |
||||
* |
||||
* Copyright © 2013 Firebase - All Rights Reserved |
||||
* https://www.firebase.com
|
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, this |
||||
* list of conditions and the following disclaimer. |
||||
* |
||||
* 2. Redistributions in binaryform must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR |
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
||||
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, |
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
@class Firebase; |
||||
|
||||
/**
|
||||
* An FDataSnapshot contains data from a Firebase location. Any time you read
|
||||
* Firebase data, you receive the data as an FDataSnapshot. |
||||
* |
||||
* FDataSnapshots are passed to the blocks you attach with observeEventType:withBlock: or observeSingleEvent:withBlock:. |
||||
* They are efficiently-generated immutable copies of the data at a Firebase location. |
||||
* They can't be modified and will never change. To modify data at a location, |
||||
* use a Firebase reference (e.g. with setValue:). |
||||
*/ |
||||
@interface FDataSnapshot : NSObject |
||||
|
||||
|
||||
/** @name Navigating and inspecting a snapshot */ |
||||
|
||||
/**
|
||||
* Get an FDataSnapshot for the location at the specified relative path. |
||||
* The relative path can either be a simple child key (e.g. 'fred')
|
||||
* or a deeper slash-separated path (e.g. 'fred/name/first'). If the child |
||||
* location has no data, an empty FDataSnapshot is returned. |
||||
* |
||||
* @param childPathString A relative path to the location of child data. |
||||
* @return The FDataSnapshot for the child location. |
||||
*/ |
||||
- (FDataSnapshot *) childSnapshotForPath:(NSString *)childPathString; |
||||
|
||||
|
||||
/**
|
||||
* Return YES if the specified child exists. |
||||
* |
||||
* @param childPathString A relative path to the location of a potential child. |
||||
* @return YES if data exists at the specified childPathString, else false. |
||||
*/ |
||||
- (BOOL) hasChild:(NSString *)childPathString; |
||||
|
||||
|
||||
/**
|
||||
* Return YES if the DataSnapshot has any children. |
||||
*
|
||||
* @return YES if this snapshot has any children, else NO. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasChildren; |
||||
|
||||
|
||||
/**
|
||||
* Return YES if the DataSnapshot contains a non-null value. |
||||
* |
||||
* @return YES if this snapshot contains a non-null value, otherwise NO. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL exists; |
||||
|
||||
|
||||
/** @name Data export */ |
||||
|
||||
/**
|
||||
* Returns the raw value at this location, coupled with any metadata, such as priority. |
||||
* |
||||
* Priorities, where they exist, are accessible under the ".priority" key in instances of NSDictionary.
|
||||
* For leaf locations with priorities, the value will be under the ".value" key. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly, strong) id valueInExportFormat; |
||||
|
||||
|
||||
/** @name Properties */ |
||||
|
||||
/**
|
||||
* Returns the contents of this data snapshot as native types. |
||||
* |
||||
* Data types returned: |
||||
* * NSDictionary |
||||
* * NSArray |
||||
* * NSNumber (also includes booleans) |
||||
* * NSString |
||||
* |
||||
* @return The data as a native object. |
||||
*/ |
||||
@property (strong, readonly, nonatomic) id value; |
||||
|
||||
|
||||
/**
|
||||
* Get the number of children for this DataSnapshot. |
||||
* |
||||
* @return An integer indicating the number of children. |
||||
*/ |
||||
@property (readonly, nonatomic) NSUInteger childrenCount; |
||||
|
||||
|
||||
/**
|
||||
* Get a Firebase reference for the location that this data came from |
||||
* |
||||
* @return A Firebase instance for the location of this data |
||||
*/ |
||||
@property (nonatomic, readonly, strong) Firebase* ref; |
||||
|
||||
|
||||
/**
|
||||
* The key of the location that generated this FDataSnapshot. |
||||
* |
||||
* @return An NSString containing the key for the location of this FDataSnapshot. |
||||
*/ |
||||
@property (strong, readonly, nonatomic) NSString* key; |
||||
|
||||
|
||||
/**
|
||||
* An iterator for snapshots of the child nodes in this snapshot. |
||||
* You can use the native for..in syntax: |
||||
* |
||||
* for (FDataSnapshot* child in snapshot.children) { |
||||
* ... |
||||
* } |
||||
* |
||||
* @return An NSEnumerator of the children |
||||
*/ |
||||
@property (strong, readonly, nonatomic) NSEnumerator* children; |
||||
|
||||
/**
|
||||
* The priority of the data in this FDataSnapshot. |
||||
* |
||||
* @return The priority as a string, or nil if no priority was set. |
||||
*/ |
||||
@property (strong, readonly, nonatomic) id priority; |
||||
|
||||
@end |
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Firebase iOS Client Library |
||||
* |
||||
* Copyright © 2013 Firebase - All Rights Reserved |
||||
* https://www.firebase.com
|
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, this |
||||
* list of conditions and the following disclaimer. |
||||
* |
||||
* 2. Redistributions in binaryform must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR |
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
||||
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, |
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#ifndef Firebase_FEventType_h |
||||
#define Firebase_FEventType_h |
||||
|
||||
/**
|
||||
* This enum is the set of events that you can observe at a Firebase location. |
||||
*/ |
||||
typedef NS_ENUM(NSInteger, FEventType) { |
||||
FEventTypeChildAdded, // 0, fired when a new child node is added to a location
|
||||
FEventTypeChildRemoved, // 1, fired when a child node is removed from a location
|
||||
FEventTypeChildChanged, // 2, fired when a child node at a location changes
|
||||
FEventTypeChildMoved, // 3, fired when a child node moves relative to the other child nodes at a location
|
||||
FEventTypeValue // 4, fired when any data changes at a location and, recursively, any children
|
||||
}; |
||||
|
||||
#endif |
@ -1,143 +0,0 @@
|
||||
/*
|
||||
* Firebase iOS Client Library |
||||
* |
||||
* Copyright © 2013 Firebase - All Rights Reserved |
||||
* https://www.firebase.com
|
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, this |
||||
* list of conditions and the following disclaimer. |
||||
* |
||||
* 2. Redistributions in binaryform must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR |
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
||||
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, |
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
/**
|
||||
* An FMutableData instance is populated with data from a Firebase location.
|
||||
* When you are using runTransactionBlock:, you will be given an instance containing the current |
||||
* data at that location. Your block will be responsible for updating that instance to the data |
||||
* you wish to save at that location, and then returning using [FTransactionResult successWithValue:]. |
||||
* |
||||
* To modify the data, set its value property to any of the native types support by Firebase: |
||||
* * NSNumber (includes BOOL) |
||||
* * NSDictionary |
||||
* * NSArray |
||||
* * NSString |
||||
* * nil / NSNull to remove the data |
||||
* |
||||
* Note that changes made to a child FMutableData instance will be visible to the parent. |
||||
*/ |
||||
@interface FMutableData : NSObject |
||||
|
||||
|
||||
/** @name Inspecting and navigating the data */ |
||||
|
||||
|
||||
/**
|
||||
* Returns boolean indicating whether this mutable data has children. |
||||
* |
||||
* @return YES if this data contains child nodes. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasChildren; |
||||
|
||||
|
||||
/**
|
||||
* Indicates whether this mutable data has a child at the given path. |
||||
* |
||||
* @param path A path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child' |
||||
* @return YES if this data contains a child at the specified relative path |
||||
*/ |
||||
- (BOOL) hasChildAtPath:(NSString *)path; |
||||
|
||||
|
||||
/**
|
||||
* Used to obtain an FMutableData instance that encapsulates the data at the given relative path. |
||||
* Note that changes made to the child will be visible to the parent. |
||||
* |
||||
* @param path A path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child' |
||||
* @return An FMutableData instance containing the data at the given path |
||||
*/ |
||||
- (FMutableData *) childDataByAppendingPath:(NSString *)path; |
||||
|
||||
|
||||
/** @name Properties */ |
||||
|
||||
|
||||
/**
|
||||
* This method is deprecated. |
||||
* |
||||
* @return An FMutableData instance containing the data at the parent location, or nil if this is the top-most location |
||||
*/ |
||||
@property (strong, readonly, nonatomic) FMutableData* parent __attribute__((deprecated("Deprecated. Do not use.")));; |
||||
|
||||
|
||||
/**
|
||||
* To modify the data contained by this instance of FMutableData, set this to any of the native types support by Firebase: |
||||
* |
||||
* * NSNumber (includes BOOL) |
||||
* * NSDictionary |
||||
* * NSArray |
||||
* * NSString |
||||
* * nil / NSNull to remove the data |
||||
* |
||||
* Note that setting the value will override the priority at this location. |
||||
* |
||||
* @return The current data at this location as a native object |
||||
*/ |
||||
@property (strong, nonatomic) id value; |
||||
|
||||
|
||||
/**
|
||||
* Set this property to update the priority of the data at this location. Can be set to the following types: |
||||
* |
||||
* * NSNumber |
||||
* * NSString |
||||
* * nil / NSNull to remove the priority |
||||
* |
||||
* @return The priority of the data at this location |
||||
*/ |
||||
@property (strong, nonatomic) id priority; |
||||
|
||||
|
||||
/**
|
||||
* @return The number of child nodes at this location |
||||
*/ |
||||
@property (readonly, nonatomic) NSUInteger childrenCount; |
||||
|
||||
|
||||
/**
|
||||
* Used to iterate over the children at this location. You can use the native for .. in syntax: |
||||
* |
||||
* for (FMutableData* child in data.children) { |
||||
* ... |
||||
* } |
||||
* |
||||
* Note that this enumerator operates on an immutable copy of the child list. So, you can modify the instance |
||||
* during iteration, but the new additions will not be visible until you get a new enumerator. |
||||
*/ |
||||
@property (readonly, nonatomic, strong) NSEnumerator* children; |
||||
|
||||
|
||||
/**
|
||||
* @return The key name of this node, or nil if it is the top-most location |
||||
*/ |
||||
@property (readonly, nonatomic, strong) NSString* key; |
||||
|
||||
|
||||
@end |
@ -1,412 +0,0 @@
|
||||
/*
|
||||
* Firebase iOS Client Library |
||||
* |
||||
* Copyright © 2013 Firebase - All Rights Reserved |
||||
* https://www.firebase.com
|
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, this |
||||
* list of conditions and the following disclaimer. |
||||
* |
||||
* 2. Redistributions in binaryform must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR |
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
||||
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, |
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "FEventType.h" |
||||
#import "FDataSnapshot.h" |
||||
|
||||
typedef NSUInteger FirebaseHandle; |
||||
|
||||
/**
|
||||
* An FQuery instance represents a query over the data at a particular location. |
||||
*
|
||||
* You create one by calling one of the query methods (queryStartingAtPriority:, queryEndingAtPriority:, etc.)
|
||||
* on a Firebase reference. The query methods can be chained to further specify the data you are interested in
|
||||
* observing |
||||
*/ |
||||
@interface FQuery : NSObject |
||||
|
||||
|
||||
/** @name Attaching observers to read data */ |
||||
|
||||
/**
|
||||
* observeEventType:withBlock: is used to listen for data changes at a particular location. |
||||
* This is the primary way to read data from Firebase. Your block will be triggered |
||||
* for the initial data and again whenever the data changes. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot. |
||||
* @return A handle used to unregister this block later using removeObserverWithHandle: |
||||
*/ |
||||
- (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block; |
||||
|
||||
|
||||
/**
|
||||
* observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location. |
||||
* This is the primary way to read data from Firebase. Your block will be triggered |
||||
* for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and |
||||
* FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot |
||||
* and the previous child's key. |
||||
* @return A handle used to unregister this block later using removeObserverWithHandle: |
||||
*/ |
||||
- (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block; |
||||
|
||||
|
||||
/**
|
||||
* observeEventType:withBlock: is used to listen for data changes at a particular location. |
||||
* This is the primary way to read data from Firebase. Your block will be triggered |
||||
* for the initial data and again whenever the data changes. |
||||
* |
||||
* The cancelBlock will be called if you will no longer receive new events due to no longer having permission. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot. |
||||
* @param cancelBlock The block that should be called if this client no longer has permission to receive these events |
||||
* @return A handle used to unregister this block later using removeObserverWithHandle: |
||||
*/ |
||||
- (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock; |
||||
|
||||
|
||||
/**
|
||||
* observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location. |
||||
* This is the primary way to read data from Firebase. Your block will be triggered |
||||
* for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and |
||||
* FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. |
||||
* |
||||
* The cancelBlock will be called if you will no longer receive new events due to no longer having permission. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. It is passed the data as an FDataSnapshot |
||||
* and the previous child's key. |
||||
* @param cancelBlock The block that should be called if this client no longer has permission to receive these events |
||||
* @return A handle used to unregister this block later using removeObserverWithHandle: |
||||
*/ |
||||
- (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock; |
||||
|
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as an FDataSnapshot. |
||||
*/ |
||||
- (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block; |
||||
|
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and |
||||
* FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as an FDataSnapshot and the previous child's key. |
||||
*/ |
||||
- (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block; |
||||
|
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. |
||||
* |
||||
* The cancelBlock will be called if you do not have permission to read data at this location. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as an FDataSnapshot. |
||||
* @param cancelBlock The block that will be called if you don't have permission to access this data |
||||
*/ |
||||
- (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock; |
||||
|
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and |
||||
* FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order. |
||||
* |
||||
* The cancelBlock will be called if you do not have permission to read data at this location. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as an FDataSnapshot and the previous child's key. |
||||
* @param cancelBlock The block that will be called if you don't have permission to access this data |
||||
*/ |
||||
- (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock; |
||||
|
||||
/** @name Detaching observers */ |
||||
|
||||
/**
|
||||
* Detach a block previously attached with observeEventType:withBlock:. |
||||
* |
||||
* @param handle The handle returned by the call to observeEventType:withBlock: which we are trying to remove. |
||||
*/ |
||||
- (void) removeObserverWithHandle:(FirebaseHandle)handle; |
||||
|
||||
|
||||
/**
|
||||
* Detach all blocks previously attached to this Firebase location with observeEventType:withBlock: |
||||
*/ |
||||
- (void) removeAllObservers; |
||||
|
||||
/**
|
||||
* By calling `keepSynced:YES` on a location, the data for that location will automatically be downloaded and |
||||
* kept in sync, even when no listeners are attached for that location. Additionally, while a location is kept |
||||
* synced, it will not be evicted from the persistent disk cache. |
||||
* |
||||
* @param keepSynced Pass YES to keep this location synchronized, pass NO to stop synchronization. |
||||
*/ |
||||
- (void) keepSynced:(BOOL)keepSynced; |
||||
|
||||
|
||||
/** @name Querying and limiting */ |
||||
|
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryStartingAtValue:. This can be used with queryOrderedByPriority |
||||
* to query by priority. |
||||
* |
||||
* queryStartingAtPriority: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryStartingAtPriority: will respond to events at nodes with a priority |
||||
* greater than or equal to startPriority |
||||
* |
||||
* @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery |
||||
* @return An FQuery instance, limited to data with priority greater than or equal to startPriority |
||||
*/ |
||||
- (FQuery *) queryStartingAtPriority:(id)startPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:] instead"))); |
||||
|
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryStartingAtValue:childKey:. This can be used with queryOrderedByPriority |
||||
* to query by priority. |
||||
* |
||||
* queryStartingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryStartingAtPriority:andChildName will respond to events at nodes with a priority |
||||
* greater than startPriority, or equal to startPriority and with a name greater than or equal to childName |
||||
* |
||||
* @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery |
||||
* @param childName The lower bound, inclusive, for the name of nodes with priority equal to startPriority |
||||
* @return An FQuery instance, limited to data with priority greater than or equal to startPriority |
||||
*/ |
||||
- (FQuery *) queryStartingAtPriority:(id)startPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:childKey:] instead"))); |
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryEndingAtValue:. This can be used with queryOrderedByPriority |
||||
* to query by priority. |
||||
* |
||||
* queryEndingAtPriority: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEndingAtPriority: will respond to events at nodes with a priority |
||||
* less than or equal to startPriority and with a name greater than or equal to childName |
||||
* |
||||
* @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery |
||||
* @return An FQuery instance, limited to data with priority less than or equal to endPriority |
||||
*/ |
||||
- (FQuery *) queryEndingAtPriority:(id)endPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:] instead"))); |
||||
|
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryEndingAtValue:childKey:. This can be used with queryOrderedByPriority |
||||
* to query by priority. |
||||
* |
||||
* queryEndingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEndingAtPriority:andChildName will respond to events at nodes with a priority |
||||
* less than endPriority, or equal to endPriority and with a name less than or equal to childName |
||||
* |
||||
* @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery |
||||
* @param childName The upper bound, inclusive, for the name of nodes with priority equal to endPriority |
||||
* @return An FQuery instance, limited to data with priority less than endPriority or equal to endPriority and with a name less than or equal to childName |
||||
*/ |
||||
- (FQuery *) queryEndingAtPriority:(id)endPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:childKey:] instead"))); |
||||
|
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryEqualToValue:. This can be used with queryOrderedByPriority |
||||
* to query by priority. |
||||
* |
||||
* queryEqualToPriority: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEqualToPriority: will respond to events at nodes with a priority equal to |
||||
* supplied argument. |
||||
* |
||||
* @param priority The priority that the data returned by this FQuery will have |
||||
* @return An Fquery instance, limited to data with the supplied priority. |
||||
*/ |
||||
- (FQuery *) queryEqualToPriority:(id)priority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:] instead"))); |
||||
|
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryEqualAtValue:childKey:. This can be used with queryOrderedByPriority |
||||
* to query by priority. |
||||
* |
||||
* queryEqualToPriority:andChildName: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEqualToPriority:andChildName will respond to events at nodes with a priority |
||||
* equal to the supplied argument with a name equal to childName. There will be at most one node that matches because |
||||
* child names are unique. |
||||
* |
||||
* @param priority The priority that the data returned by this FQuery will have |
||||
* @param childName The name of nodes with the right priority |
||||
* @return An FQuery instance, limited to data with the supplied priority and the name. |
||||
*/ |
||||
- (FQuery *) queryEqualToPriority:(id)priority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:childKey:] instead"))); |
||||
|
||||
/**
|
||||
* This method is deprecated in favor of using queryLimitedToFirst:limit or queryLimitedToLast:limit instead. |
||||
* |
||||
* queryLimitedToNumberOfChildren: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryLimitedToNumberOfChildren: will respond to events from at most limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to receive events for |
||||
* @return An FQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FQuery *) queryLimitedToNumberOfChildren:(NSUInteger)limit __attribute__((deprecated("Use [FQuery queryLimitedToFirst:limit] or [FQuery queryLimitedToLast:limit] instead"))); |
||||
|
||||
|
||||
/**
|
||||
* queryLimitedToFirst: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryLimitedToFirst: will respond to at most the first limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to receive events for |
||||
* @return An FQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FQuery *) queryLimitedToFirst:(NSUInteger)limit; |
||||
|
||||
|
||||
/**
|
||||
* queryLimitedToLast: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryLimitedToLast: will respond to at most the last limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to receive events for |
||||
* @return An FQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FQuery *) queryLimitedToLast:(NSUInteger)limit; |
||||
|
||||
/**
|
||||
* queryOrderBy: is used to generate a reference to a view of the data that's been sorted by the values of |
||||
* a particular child key. This method is intended to be used in combination with queryStartingAtValue:, |
||||
* queryEndingAtValue:, or queryEqualToValue:. |
||||
* |
||||
* @param key The child key to use in ordering data visible to the returned FQuery |
||||
* @return An FQuery instance, ordered by the values of the specified child key. |
||||
*/ |
||||
- (FQuery *) queryOrderedByChild:(NSString *)key; |
||||
|
||||
/**
|
||||
* queryOrderedByKey: is used to generate a reference to a view of the data that's been sorted by child key. |
||||
* This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, |
||||
* or queryEqualToValue:. |
||||
* |
||||
* @return An FQuery instance, ordered by child keys. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly, strong) FQuery *queryOrderedByKey; |
||||
|
||||
/**
|
||||
* queryOrderedByValue: is used to generate a reference to a view of the data that's been sorted by child value. |
||||
* This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, |
||||
* or queryEqualToValue:. |
||||
* |
||||
* @return An FQuery instance, ordered by child value. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly, strong) FQuery *queryOrderedByValue; |
||||
|
||||
/**
|
||||
* queryOrderedByPriority: is used to generate a reference to a view of the data that's been sorted by child |
||||
* priority. This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:, |
||||
* or queryEqualToValue:. |
||||
* |
||||
* @return An FQuery instance, ordered by child priorities. |
||||
*/ |
||||
@property (NS_NONATOMIC_IOSONLY, readonly, strong) FQuery *queryOrderedByPriority; |
||||
|
||||
/**
|
||||
* queryStartingAtValue: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryStartingAtValue: will respond to events at nodes with a value |
||||
* greater than or equal to startValue. |
||||
* |
||||
* @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery |
||||
* @return An FQuery instance, limited to data with value greater than or equal to startValue |
||||
*/ |
||||
- (FQuery *) queryStartingAtValue:(id)startValue; |
||||
|
||||
/**
|
||||
* queryStartingAtValue:childKey: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryStartingAtValue:childKey will respond to events at nodes with a value |
||||
* greater than startValue, or equal to startValue and with a key greater than or equal to childKey. |
||||
* |
||||
* @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery |
||||
* @param childKey The lower bound, inclusive, for the key of nodes with value equal to startValue |
||||
* @return An FQuery instance, limited to data with value greater than or equal to startValue |
||||
*/ |
||||
- (FQuery *) queryStartingAtValue:(id)startValue childKey:(NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryEndingAtValue: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEndingAtValue: will respond to events at nodes with a value |
||||
* less than or equal to endValue. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery |
||||
* @return An FQuery instance, limited to data with value less than or equal to endValue |
||||
*/ |
||||
- (FQuery *) queryEndingAtValue:(id)endValue; |
||||
|
||||
/**
|
||||
* queryEndingAtValue:childKey: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEndingAtValue:childKey will respond to events at nodes with a value |
||||
* less than endValue, or equal to endValue and with a key less than or equal to childKey. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery |
||||
* @param childKey The upper bound, inclusive, for the key of nodes with value equal to endValue |
||||
* @return An FQuery instance, limited to data with value less than or equal to endValue |
||||
*/ |
||||
- (FQuery *) queryEndingAtValue:(id)endValue childKey:(NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryEqualToValue: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEqualToValue: will respond to events at nodes with a value equal |
||||
* to the supplied argument. |
||||
* |
||||
* @param value The value that the data returned by this FQuery will have |
||||
* @return An Fquery instance, limited to data with the supplied value. |
||||
*/ |
||||
- (FQuery *) queryEqualToValue:(id)value; |
||||
|
||||
/**
|
||||
* queryEqualToValue:childKey: is used to generate a reference to a limited view of the data at this location. |
||||
* The FQuery instance returned by queryEqualToValue:childKey will respond to events at nodes with a value |
||||
* equal to the supplied argument with a name equal to childKey. There will be at most one node that matches because |
||||
* child keys are unique. |
||||
* |
||||
* @param value The value that the data returned by this FQuery will have |
||||
* @param childKey The name of nodes with the right value |
||||
* @return An FQuery instance, limited to data with the supplied value and the key. |
||||
*/ |
||||
- (FQuery *) queryEqualToValue:(id)value childKey:(NSString *)childKey; |
||||
|
||||
|
||||
/** @name Properties */ |
||||
|
||||
|
||||
/**
|
||||
* Get a Firebase reference for the location of this query. |
||||
* |
||||
* @return A Firebase instance for the location of this query. |
||||
*/ |
||||
@property (nonatomic, readonly, strong) Firebase* ref; |
||||
|
||||
@end |
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Firebase iOS Client Library |
||||
* |
||||
* Copyright © 2013 Firebase - All Rights Reserved |
||||
* https://www.firebase.com
|
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, this |
||||
* list of conditions and the following disclaimer. |
||||
* |
||||
* 2. Redistributions in binaryform must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR |
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
||||
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT, |
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "FMutableData.h" |
||||
|
||||
/**
|
||||
* Used for runTransactionBlock:. An FTransactionResult instance is a container for the results of the transaction. |
||||
*/ |
||||
@interface FTransactionResult : NSObject |
||||
|
||||
/**
|
||||
* Used for runTransactionBlock:. Indicates that the new value should be saved at this location |
||||
* |
||||
* @param value An FMutableData instance containing the new value to be set |
||||
* @return An FTransactionResult instance that can be used as a return value from the block given to runTransactionBlock: |
||||
*/ |
||||
+ (FTransactionResult *) successWithValue:(FMutableData *)value; |
||||
|
||||
|
||||
/**
|
||||
* Used for runTransactionBlock:. Indicates that the current transaction should no longer proceed. |
||||
* |
||||
* @return An FTransactionResult instance that can be used as a return value from the block given to runTransactionBlock: |
||||
*/ |
||||
+ (FTransactionResult *) abort; |
||||
|
||||
@end |
File diff suppressed because it is too large
Load Diff
@ -1,34 +0,0 @@
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
/**
|
||||
* All Firebase references to the same database share a connection, persistent cache, etc. FirebaseApp |
||||
* represents this shared state and can be accessed from any reference via its `app` property. |
||||
* It has methods for managing your Firebase connection, etc. |
||||
* |
||||
* There is a one-to-one relationship between a FirebaseApp instance and a connection to Firebase. |
||||
*/ |
||||
@interface FirebaseApp : NSObject |
||||
|
||||
/**
|
||||
* The Firebase client automatically queues writes and sends them to the server at the earliest opportunity, |
||||
* depending on network connectivity. In some cases (e.g. offline usage) there may be a large number of writes |
||||
* waiting to be sent. Calling this method will purge all outstanding writes so they are abandoned. |
||||
* |
||||
* All writes will be purged, including transactions and {@link Firebase#onDisconnect} writes. The writes will |
||||
* be rolled back locally, perhaps triggering events for affected event listeners, and the client will not |
||||
* (re-)send them to the Firebase backend. |
||||
*/ |
||||
- (void)purgeOutstandingWrites; |
||||
|
||||
|
||||
/**
|
||||
* Shuts down our connection to the Firebase backend until goOnline is called. |
||||
*/ |
||||
- (void)goOffline; |
||||
|
||||
/**
|
||||
* Resumes our connection to the Firebase backend after a previous goOffline call. |
||||
*/ |
||||
- (void)goOnline; |
||||
|
||||
@end |
@ -1,5 +0,0 @@
|
||||
@interface FirebaseServerValue : NSObject |
||||
|
||||
+ (NSDictionary *) timestamp; |
||||
|
||||
@end |
@ -1,6 +0,0 @@
|
||||
framework module Firebase { |
||||
umbrella header "Firebase.h" |
||||
|
||||
export * |
||||
module * { export * } |
||||
} |
Binary file not shown.
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
@class FIROptions; |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** A block that takes a BOOL and has no return value. */ |
||||
typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback); |
||||
|
||||
/**
|
||||
* The entry point of Firebase SDKs. |
||||
* |
||||
* Initialize and configure FIRApp using +[FIRApp configure] |
||||
* or other customized ways as shown below. |
||||
* |
||||
* The logging system has two modes: default mode and debug mode. In default mode, only logs with |
||||
* log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent |
||||
* to device. The log levels that Firebase uses are consistent with the ASL log levels. |
||||
* |
||||
* Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this |
||||
* argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, |
||||
* further executions of the application will also be in debug mode. In order to return to default |
||||
* mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled. |
||||
* |
||||
* It is also possible to change the default logging level in code by calling setLoggerLevel: on |
||||
* the FIRConfiguration interface. |
||||
*/ |
||||
NS_SWIFT_NAME(FirebaseApp) |
||||
@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 should be called from the main thread and |
||||
* contains synchronous file I/O (reading GoogleService-Info.plist from disk). |
||||
*/ |
||||
+ (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 should be |
||||
* called from the main thread. |
||||
* |
||||
* @param options The Firebase application options used to configure the service. |
||||
*/ |
||||
+ (void)configureWithOptions:(FIROptions *)options NS_SWIFT_NAME(configure(options:)); |
||||
|
||||
/**
|
||||
* Configures a Firebase app with the given name and options. Raises an exception if any |
||||
* configuration step fails. This method should be called from the main thread. |
||||
* |
||||
* @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. |
||||
*/ |
||||
// clang-format off
|
||||
+ (void)configureWithName:(NSString *)name |
||||
options:(FIROptions *)options NS_SWIFT_NAME(configure(name:options:)); |
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Returns the default app, or nil if the default app does not exist. |
||||
*/ |
||||
+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app()); |
||||
|
||||
/**
|
||||
* 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 NS_SWIFT_NAME(app(name:)); |
||||
|
||||
/**
|
||||
* Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This |
||||
* method is thread safe. |
||||
*/ |
||||
@property(class, readonly, nullable) NSDictionary<NSString *, FIRApp *> *allApps; |
||||
|
||||
/**
|
||||
* Cleans up the current FIRApp, freeing associated data and returning its name to the pool for |
||||
* future use. This method is thread safe. |
||||
*/ |
||||
- (void)deleteApp:(FIRAppVoidBoolCallback)completion; |
||||
|
||||
/**
|
||||
* FIRApp instances should not be initialized directly. Call +[FIRApp configure], |
||||
* +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly. |
||||
*/ |
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Gets the name of this app. |
||||
*/ |
||||
@property(nonatomic, copy, readonly) NSString *name; |
||||
|
||||
/**
|
||||
* Gets a copy of the options for this app. These are non-modifiable. |
||||
*/ |
||||
@property(nonatomic, copy, readonly) FIROptions *options; |
||||
|
||||
/**
|
||||
* Gets or sets whether automatic data collection is enabled for all products. Defaults to `YES` |
||||
* unless `FirebaseDataCollectionDefaultEnabled` is set to `NO` in your app's Info.plist. This value |
||||
* is persisted across runs of the app so that it can be set once when users have consented to |
||||
* collection. |
||||
*/ |
||||
@property(nonatomic, readwrite, getter=isDataCollectionDefaultEnabled) |
||||
BOOL dataCollectionDefaultEnabled; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
#import "FIRLoggerLevel.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* This interface provides global level properties that the developer can tweak. |
||||
*/ |
||||
NS_SWIFT_NAME(FirebaseConfiguration) |
||||
@interface FIRConfiguration : NSObject |
||||
|
||||
/** Returns the shared configuration object. */ |
||||
@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance NS_SWIFT_NAME(shared); |
||||
|
||||
/**
|
||||
* Sets the logging level for internal Firebase logging. Firebase will only log messages |
||||
* that are logged at or below loggerLevel. The messages are logged both to the Xcode |
||||
* console and to the device's log. Note that if an app is running from AppStore, it will |
||||
* never log above FIRLoggerLevelNotice even if loggerLevel is set to a higher (more verbose) |
||||
* setting. |
||||
* |
||||
* @param loggerLevel The maximum logging level. The default level is set to FIRLoggerLevelNotice. |
||||
*/ |
||||
- (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
// Note that importing GULLoggerLevel.h will lead to a non-modular header
|
||||
// import error.
|
||||
|
||||
/**
|
||||
* The log levels used by internal logging. |
||||
*/ |
||||
typedef NS_ENUM(NSInteger, FIRLoggerLevel) { |
||||
/** Error level, matches ASL_LEVEL_ERR. */ |
||||
FIRLoggerLevelError = 3, |
||||
/** Warning level, matches ASL_LEVEL_WARNING. */ |
||||
FIRLoggerLevelWarning = 4, |
||||
/** Notice level, matches ASL_LEVEL_NOTICE. */ |
||||
FIRLoggerLevelNotice = 5, |
||||
/** Info level, matches ASL_LEVEL_INFO. */ |
||||
FIRLoggerLevelInfo = 6, |
||||
/** Debug level, matches ASL_LEVEL_DEBUG. */ |
||||
FIRLoggerLevelDebug = 7, |
||||
/** Minimum log level. */ |
||||
FIRLoggerLevelMin = FIRLoggerLevelError, |
||||
/** Maximum log level. */ |
||||
FIRLoggerLevelMax = FIRLoggerLevelDebug |
||||
} NS_SWIFT_NAME(FirebaseLoggerLevel); |
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* This class provides constant fields of Google APIs. |
||||
*/ |
||||
NS_SWIFT_NAME(FirebaseOptions) |
||||
@interface FIROptions : NSObject <NSCopying> |
||||
|
||||
/**
|
||||
* Returns the default options. The first time this is called it synchronously reads |
||||
* GoogleService-Info.plist from disk. |
||||
*/ |
||||
+ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions()); |
||||
|
||||
/**
|
||||
* An iOS API key used for authenticating requests from your app, e.g. |
||||
* @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey); |
||||
|
||||
/**
|
||||
* The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set |
||||
* manually or in a plist. |
||||
*/ |
||||
@property(nonatomic, copy) NSString *bundleID; |
||||
|
||||
/**
|
||||
* The OAuth2 client ID for iOS application used to authenticate Google users, for example |
||||
* @"12345.apps.googleusercontent.com", used for signing in with Google. |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *clientID; |
||||
|
||||
/**
|
||||
* The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *trackingID; |
||||
|
||||
/**
|
||||
* The Project Number from the Google Developer's console, for example @"012345678901", used to |
||||
* configure Google Cloud Messaging. |
||||
*/ |
||||
@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID); |
||||
|
||||
/**
|
||||
* The Project ID from the Firebase console, for example @"abc-xyz-123". |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *projectID; |
||||
|
||||
/**
|
||||
* The Android client ID used in Google AppInvite when an iOS app has its Android version, for |
||||
* example @"12345.apps.googleusercontent.com". |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *androidClientID; |
||||
|
||||
/**
|
||||
* The Google App ID that is used to uniquely identify an instance of an app. |
||||
*/ |
||||
@property(nonatomic, copy) NSString *googleAppID; |
||||
|
||||
/**
|
||||
* The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *databaseURL; |
||||
|
||||
/**
|
||||
* The URL scheme used to set up Durable Deep Link service. |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; |
||||
|
||||
/**
|
||||
* The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *storageBucket; |
||||
|
||||
/**
|
||||
* The App Group identifier to share data between the application and the application extensions. |
||||
* The App Group must be configured in the application and on the Apple Developer Portal. Default |
||||
* value `nil`. |
||||
*/ |
||||
@property(nonatomic, copy, nullable) NSString *appGroupID; |
||||
|
||||
/**
|
||||
* Initializes a customized instance of FIROptions from the file at the given plist file path. This |
||||
* will read the file synchronously from disk. |
||||
* For example, |
||||
* NSString *filePath = |
||||
* [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; |
||||
* FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; |
||||
* Returns nil if the plist file does not exist or is invalid. |
||||
*/ |
||||
- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath NS_DESIGNATED_INITIALIZER; |
||||
|
||||
/**
|
||||
* Initializes a customized instance of FIROptions with required fields. Use the mutable properties |
||||
* to modify fields for configuring specific services. |
||||
*/ |
||||
// clang-format off
|
||||
- (instancetype)initWithGoogleAppID:(NSString *)googleAppID |
||||
GCMSenderID:(NSString *)GCMSenderID |
||||
NS_SWIFT_NAME(init(googleAppID:gcmSenderID:)) NS_DESIGNATED_INITIALIZER; |
||||
// clang-format on
|
||||
|
||||
/** Unavailable. Please use `init(contentsOfFile:)` or `init(googleAppID:gcmSenderID:)` instead. */ |
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2020 Google LLC |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** Returns the current version of Firebase. */ |
||||
NS_SWIFT_NAME(FirebaseVersion()) |
||||
NSString* FIRFirebaseVersion(void); |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRApp.h" |
||||
#import "FIRConfiguration.h" |
||||
#import "FIRLoggerLevel.h" |
||||
#import "FIROptions.h" |
||||
#import "FIRVersion.h" |
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleExecutable</key> |
||||
<string>FirebaseCore</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.firebase.Firebase-FirebaseCore</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>FirebaseCore</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>8.2.0</string> |
||||
<key>DTSDKName</key> |
||||
<string>iphonesimulator11.2</string> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,11 @@
|
||||
framework module FirebaseCore { |
||||
umbrella header "FirebaseCore.h" |
||||
export * |
||||
module * { export * } |
||||
link framework "AppKit" |
||||
link framework "CoreTelephony" |
||||
link framework "Foundation" |
||||
link framework "Security" |
||||
link framework "SystemConfiguration" |
||||
link "z" |
||||
} |
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2020 Google LLC |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
// There are no actual public headers in the lib. This is a dummy public header to prevent Cocoapods
|
||||
// from adding all internal headers as public.
|
@ -0,0 +1,17 @@
|
||||
#ifdef __OBJC__ |
||||
#import <Cocoa/Cocoa.h> |
||||
#else |
||||
#ifndef FOUNDATION_EXPORT |
||||
#if defined(__cplusplus) |
||||
#define FOUNDATION_EXPORT extern "C" |
||||
#else |
||||
#define FOUNDATION_EXPORT extern |
||||
#endif |
||||
#endif |
||||
#endif |
||||
|
||||
#import "FIRCoreDiagnostics.h" |
||||
|
||||
FOUNDATION_EXPORT double FirebaseCoreDiagnosticsVersionNumber; |
||||
FOUNDATION_EXPORT const unsigned char FirebaseCoreDiagnosticsVersionString[]; |
||||
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleExecutable</key> |
||||
<string>FirebaseCoreDiagnostics</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.firebase.Firebase-FirebaseCoreDiagnostics</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>FirebaseCoreDiagnostics</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>8.2.0</string> |
||||
<key>DTSDKName</key> |
||||
<string>iphonesimulator11.2</string> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,10 @@
|
||||
framework module FirebaseCoreDiagnostics { |
||||
umbrella header "FirebaseCoreDiagnostics-umbrella.h" |
||||
export * |
||||
module * { export * } |
||||
link framework "CoreTelephony" |
||||
link framework "Foundation" |
||||
link framework "Security" |
||||
link framework "SystemConfiguration" |
||||
link "z" |
||||
} |
Binary file not shown.
@ -0,0 +1,230 @@
|
||||
// Copyright 2019 Google
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
#import "FIRCrashlyticsReport.h" |
||||
#import "FIRExceptionModel.h" |
||||
|
||||
#if __has_include(<Crashlytics/Crashlytics.h>) |
||||
#warning "FirebaseCrashlytics and Crashlytics are not compatible \ |
||||
in the same app because including multiple crash reporters can \
|
||||
cause problems when registering exception handlers." |
||||
#endif |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* The Firebase Crashlytics API provides methods to annotate and manage fatal and |
||||
* non-fatal reports captured and reported to Firebase Crashlytics. |
||||
* |
||||
* By default, Firebase Crashlytics is initialized with `[FIRApp configure]`. |
||||
* |
||||
* Note: The Crashlytics class cannot be subclassed. If this makes testing difficult, |
||||
* we suggest using a wrapper class or a protocol extension. |
||||
*/ |
||||
NS_SWIFT_NAME(Crashlytics) |
||||
@interface FIRCrashlytics : NSObject |
||||
|
||||
/** :nodoc: */ |
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Accesses the singleton Crashlytics instance. |
||||
* |
||||
* @return The singleton Crashlytics instance. |
||||
*/ |
||||
+ (instancetype)crashlytics NS_SWIFT_NAME(crashlytics()); |
||||
|
||||
/**
|
||||
* Adds logging that is sent with your crash data. The logging does not appear in the |
||||
* system.log and is only visible in the Crashlytics dashboard. |
||||
* |
||||
* @param msg Message to log |
||||
*/ |
||||
- (void)log:(NSString *)msg; |
||||
|
||||
/**
|
||||
* Adds logging that is sent with your crash data. The logging does not appear in the |
||||
* system.log and is only visible in the Crashlytics dashboard. |
||||
* |
||||
* @param format Format of string |
||||
* @param ... A comma-separated list of arguments to substitute into format |
||||
*/ |
||||
- (void)logWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2); |
||||
|
||||
/**
|
||||
* Adds logging that is sent with your crash data. The logging does not appear in the |
||||
* system.log and is only visible in the Crashlytics dashboard. |
||||
* |
||||
* @param format Format of string |
||||
* @param args Arguments to substitute into format |
||||
*/ |
||||
- (void)logWithFormat:(NSString *)format |
||||
arguments:(va_list)args NS_SWIFT_NAME(log(format:arguments:)); |
||||
|
||||
/**
|
||||
* Sets a custom key and value to be associated with subsequent fatal and non-fatal reports. |
||||
* When setting an object value, the object is converted to a string. This is |
||||
* typically done by calling "-[NSObject description]". |
||||
* |
||||
* @param value The value to be associated with the key |
||||
* @param key A unique key |
||||
*/ |
||||
- (void)setCustomValue:(id)value forKey:(NSString *)key; |
||||
|
||||
/**
|
||||
* Sets custom keys and values to be associated with subsequent fatal and non-fatal reports. |
||||
* The objects in the dictionary are converted to strings. This is |
||||
* typically done by calling "-[NSObject description]". |
||||
* |
||||
* @param keysAndValues The values to be associated with the corresponding keys |
||||
*/ |
||||
- (void)setCustomKeysAndValues:(NSDictionary *)keysAndValues; |
||||
|
||||
/**
|
||||
* Records a user ID (identifier) that's associated with subsequent fatal and non-fatal reports. |
||||
* |
||||
* If you want to associate a crash with a specific user, we recommend specifying an arbitrary |
||||
* string (e.g., a database, ID, hash, or other value that you can index and query, but is |
||||
* meaningless to a third-party observer). This allows you to facilitate responses for support |
||||
* requests and reach out to users for more information. |
||||
* |
||||
* @param userID An arbitrary user identifier string that associates a user to a record in your |
||||
* system. |
||||
*/ |
||||
- (void)setUserID:(NSString *)userID; |
||||
|
||||
/**
|
||||
* Records a non-fatal event described by an NSError object. The events are |
||||
* grouped and displayed similarly to crashes. Keep in mind that this method can be expensive. |
||||
* The total number of NSErrors that can be recorded during your app's life-cycle is limited by a |
||||
* fixed-size circular buffer. If the buffer is overrun, the oldest data is dropped. Errors are |
||||
* relayed to Crashlytics on a subsequent launch of your application. |
||||
* |
||||
* @param error Non-fatal error to be recorded |
||||
*/ |
||||
- (void)recordError:(NSError *)error NS_SWIFT_NAME(record(error:)); |
||||
|
||||
/**
|
||||
* Records an Exception Model described by an FIRExceptionModel object. The events are |
||||
* grouped and displayed similarly to crashes. Keep in mind that this method can be expensive. |
||||
* The total number of FIRExceptionModels that can be recorded during your app's life-cycle is |
||||
* limited by a fixed-size circular buffer. If the buffer is overrun, the oldest data is dropped. |
||||
* Exception Models are relayed to Crashlytics on a subsequent launch of your application. |
||||
* |
||||
* @param exceptionModel Instance of the FIRExceptionModel to be recorded |
||||
*/ |
||||
- (void)recordExceptionModel:(FIRExceptionModel *)exceptionModel |
||||
NS_SWIFT_NAME(record(exceptionModel:)); |
||||
|
||||
/**
|
||||
* Returns whether the app crashed during the previous execution. |
||||
*/ |
||||
- (BOOL)didCrashDuringPreviousExecution; |
||||
|
||||
/**
|
||||
* Enables/disables automatic data collection. |
||||
* |
||||
* Calling this method overrides both the FirebaseCrashlyticsCollectionEnabled flag in your |
||||
* App's Info.plist and FIRApp's isDataCollectionDefaultEnabled flag. |
||||
* |
||||
* When you set a value for this method, it persists across runs of the app. |
||||
* |
||||
* The value does not apply until the next run of the app. If you want to disable data |
||||
* collection without rebooting, add the FirebaseCrashlyticsCollectionEnabled flag to your app's |
||||
* Info.plist. |
||||
* * |
||||
* @param enabled Determines whether automatic data collection is enabled |
||||
*/ |
||||
- (void)setCrashlyticsCollectionEnabled:(BOOL)enabled; |
||||
|
||||
/**
|
||||
* Indicates whether or not automatic data collection is enabled |
||||
* |
||||
* This method uses three ways to decide whether automatic data collection is enabled, |
||||
* in order of priority: |
||||
* - If setCrashlyticsCollectionEnabled is called with a value, use it |
||||
* - If the FirebaseCrashlyticsCollectionEnabled key is in your app's Info.plist, use it |
||||
* - Otherwise, use the default isDataCollectionDefaultEnabled in FIRApp |
||||
*/ |
||||
- (BOOL)isCrashlyticsCollectionEnabled; |
||||
|
||||
/**
|
||||
* Determines whether there are any unsent crash reports cached on the device, then calls the given |
||||
* callback. |
||||
* |
||||
* The callback only executes if automatic data collection is disabled. You can use |
||||
* the callback to get one-time consent from a user upon a crash, and then call |
||||
* sendUnsentReports or deleteUnsentReports, depending on whether or not the user gives consent. |
||||
* |
||||
* Disable automatic collection by: |
||||
* - Adding the FirebaseCrashlyticsCollectionEnabled: NO key to your App's Info.plist |
||||
* - Calling [[FIRCrashlytics crashlytics] setCrashlyticsCollectionEnabled:NO] in your app |
||||
* - Setting FIRApp's isDataCollectionDefaultEnabled to NO |
||||
* |
||||
* @param completion The callback that's executed once Crashlytics finishes checking for unsent |
||||
* reports. The callback is set to YES if there are unsent reports on disk. |
||||
*/ |
||||
- (void)checkForUnsentReportsWithCompletion:(void (^)(BOOL))completion |
||||
NS_SWIFT_NAME(checkForUnsentReports(completion:)); |
||||
|
||||
/**
|
||||
* Determines whether there are any unsent crash reports cached on the device, then calls the given |
||||
* callback with a CrashlyticsReport object that you can use to update the unsent report. |
||||
* CrashlyticsReports have a lot of the familiar Crashlytics methods like setting custom keys and |
||||
* logs. |
||||
* |
||||
* The callback only executes if automatic data collection is disabled. You can use |
||||
* the callback to get one-time consent from a user upon a crash, and then call |
||||
* sendUnsentReports or deleteUnsentReports, depending on whether or not the user gives consent. |
||||
* |
||||
* Disable automatic collection by: |
||||
* - Adding the FirebaseCrashlyticsCollectionEnabled: NO key to your App's Info.plist |
||||
* - Calling [[FIRCrashlytics crashlytics] setCrashlyticsCollectionEnabled:NO] in your app |
||||
* - Setting FIRApp's isDataCollectionDefaultEnabled to NO |
||||
* |
||||
* Not calling send/deleteUnsentReports will result in the report staying on disk, which means the |
||||
* same CrashlyticsReport can show up in multiple runs of the app. If you want avoid duplicates, |
||||
* ensure there was a crash on the last run of the app by checking the value of |
||||
* didCrashDuringPreviousExecution. |
||||
* |
||||
* @param completion The callback that's executed once Crashlytics finishes checking for unsent |
||||
* reports. The callback is called with the newest unsent Crashlytics Report, or nil if there are |
||||
* none cached on disk. |
||||
*/ |
||||
- (void)checkAndUpdateUnsentReportsWithCompletion: |
||||
(void (^)(FIRCrashlyticsReport *_Nullable))completion |
||||
NS_SWIFT_NAME(checkAndUpdateUnsentReports(completion:)); |
||||
|
||||
/**
|
||||
* Enqueues any unsent reports on the device to upload to Crashlytics. |
||||
* |
||||
* This method only applies if automatic data collection is disabled. |
||||
* |
||||
* When automatic data collection is enabled, Crashlytics automatically uploads and deletes reports |
||||
* at startup, so this method is ignored. |
||||
*/ |
||||
- (void)sendUnsentReports; |
||||
|
||||
/**
|
||||
* Deletes any unsent reports on the device. |
||||
* |
||||
* This method only applies if automatic data collection is disabled. |
||||
*/ |
||||
- (void)deleteUnsentReports; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,108 @@
|
||||
// Copyright 2021 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* The Firebase Crashlytics Report provides a way to read and write information |
||||
* to a past Crashlytics reports. A common use case is gathering end-user feedback |
||||
* on the next run of the app. |
||||
* |
||||
* The CrashlyticsReport should be modified before calling send/deleteUnsentReports. |
||||
*/ |
||||
NS_SWIFT_NAME(CrashlyticsReport) |
||||
@interface FIRCrashlyticsReport : NSObject |
||||
|
||||
/** :nodoc: */ |
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Returns the unique ID for the Crashlytics report. |
||||
*/ |
||||
@property(nonatomic, readonly) NSString *reportID; |
||||
|
||||
/**
|
||||
* Returns the date that the report was created. |
||||
*/ |
||||
@property(nonatomic, readonly) NSDate *dateCreated; |
||||
|
||||
/**
|
||||
* Returns true when one of the events in the Crashlytics report is a crash. |
||||
*/ |
||||
@property(nonatomic, readonly) BOOL hasCrash; |
||||
|
||||
/**
|
||||
* Adds logging that is sent with your crash data. The logging does not appear in the |
||||
* system.log and is only visible in the Crashlytics dashboard. |
||||
* |
||||
* @param msg Message to log |
||||
*/ |
||||
- (void)log:(NSString *)msg; |
||||
|
||||
/**
|
||||
* Adds logging that is sent with your crash data. The logging does not appear in the |
||||
* system.log and is only visible in the Crashlytics dashboard. |
||||
* |
||||
* @param format Format of string |
||||
* @param ... A comma-separated list of arguments to substitute into format |
||||
*/ |
||||
- (void)logWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2); |
||||
|
||||
/**
|
||||
* Adds logging that is sent with your crash data. The logging does not appear in the |
||||
* system.log and is only visible in the Crashlytics dashboard. |
||||
* |
||||
* @param format Format of string |
||||
* @param args Arguments to substitute into format |
||||
*/ |
||||
- (void)logWithFormat:(NSString *)format |
||||
arguments:(va_list)args NS_SWIFT_NAME(log(format:arguments:)); |
||||
|
||||
/**
|
||||
* Sets a custom key and value to be associated with subsequent fatal and non-fatal reports. |
||||
* When setting an object value, the object is converted to a string. This is |
||||
* typically done by calling "-[NSObject description]". |
||||
* |
||||
* @param value The value to be associated with the key |
||||
* @param key A unique key |
||||
*/ |
||||
- (void)setCustomValue:(id)value forKey:(NSString *)key; |
||||
|
||||
/**
|
||||
* Sets custom keys and values to be associated with subsequent fatal and non-fatal reports. |
||||
* The objects in the dictionary are converted to strings. This is |
||||
* typically done by calling "-[NSObject description]". |
||||
* |
||||
* @param keysAndValues The values to be associated with the corresponding keys |
||||
*/ |
||||
- (void)setCustomKeysAndValues:(NSDictionary *)keysAndValues; |
||||
|
||||
/**
|
||||
* Records a user ID (identifier) that's associated with subsequent fatal and non-fatal reports. |
||||
* |
||||
* If you want to associate a crash with a specific user, we recommend specifying an arbitrary |
||||
* string (e.g., a database, ID, hash, or other value that you can index and query, but is |
||||
* meaningless to a third-party observer). This allows you to facilitate responses for support |
||||
* requests and reach out to users for more information. |
||||
* |
||||
* @param userID An arbitrary user identifier string that associates a user to a record in your |
||||
* system. |
||||
*/ |
||||
- (void)setUserID:(NSString *)userID; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,57 @@
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
#import "FIRStackFrame.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* The Firebase Crashlytics Exception Model provides a way to report custom exceptions |
||||
* to Crashlytics that came from a runtime environment outside of the native |
||||
* platform Crashlytics is running in. |
||||
*/ |
||||
NS_SWIFT_NAME(ExceptionModel) |
||||
@interface FIRExceptionModel : NSObject |
||||
|
||||
/** :nodoc: */ |
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Initializes an Exception Model model with the given required fields. |
||||
* |
||||
* @param name - typically the type of the Exception class |
||||
* @param reason - the human-readable reason the issue occurred |
||||
*/ |
||||
- (instancetype)initWithName:(NSString *)name reason:(NSString *)reason; |
||||
|
||||
/**
|
||||
* Creates an Exception Model model with the given required fields. |
||||
* |
||||
* @param name - typically the type of the Exception class |
||||
* @param reason - the human-readable reason the issue occurred |
||||
*/ |
||||
+ (instancetype)exceptionModelWithName:(NSString *)name |
||||
reason:(NSString *)reason NS_SWIFT_UNAVAILABLE(""); |
||||
|
||||
/**
|
||||
* A list of Stack Frames that make up the stack trace. The order of the stack trace is top-first, |
||||
* so typically the "main" function is the last element in this list. |
||||
*/ |
||||
@property(nonatomic, copy) NSArray<FIRStackFrame *> *stackTrace; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,63 @@
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* The Firebase Crashlytics Stack Frame provides a way to construct the lines of |
||||
* a stack trace for reporting along with a recorded Exception Model. |
||||
*/ |
||||
NS_SWIFT_NAME(StackFrame) |
||||
@interface FIRStackFrame : NSObject |
||||
|
||||
/** :nodoc: */ |
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Initializes a symbolicated Stack Frame with the given required fields. Symbolicated |
||||
* Stack Frames will appear in the Crashlytics dashboard as reported in these fields. |
||||
* |
||||
* @param symbol - The function or method name |
||||
* @param file - the file where the exception occurred |
||||
* @param line - the line number |
||||
*/ |
||||
- (instancetype)initWithSymbol:(NSString *)symbol file:(NSString *)file line:(NSInteger)line; |
||||
|
||||
/**
|
||||
* Creates a symbolicated Stack Frame from an address. The address will be |
||||
* symbolicated in the Crashlytics backend for the customer and reported in the |
||||
* Crahslytics dashboard with the appropriate file name and line number. If an |
||||
* invalid address is provided it will appear in the dashboard as missing. |
||||
* |
||||
* @param address - the address where the exception occurred |
||||
*/ |
||||
+ (instancetype)stackFrameWithAddress:(NSUInteger)address; |
||||
|
||||
/**
|
||||
* Creates a symbolicated Stack Frame with the given required fields. Symbolicated |
||||
* Stack Frames will appear in the Crashlytics dashboard as reported in these fields. * |
||||
* |
||||
* @param symbol - The function or method name |
||||
* @param file - the file where the exception occurred |
||||
* @param line - the line number |
||||
*/ |
||||
+ (instancetype)stackFrameWithSymbol:(NSString *)symbol |
||||
file:(NSString *)file |
||||
line:(NSInteger)line NS_SWIFT_UNAVAILABLE(""); |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2019 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRCrashlytics.h" |
||||
#import "FIRCrashlyticsReport.h" |
||||
#import "FIRExceptionModel.h" |
||||
#import "FIRStackFrame.h" |
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleExecutable</key> |
||||
<string>FirebaseCrashlytics</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.firebase.Firebase-FirebaseCrashlytics</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>FirebaseCrashlytics</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>8.2.0</string> |
||||
<key>DTSDKName</key> |
||||
<string>iphonesimulator11.2</string> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,12 @@
|
||||
framework module FirebaseCrashlytics { |
||||
umbrella header "FirebaseCrashlytics.h" |
||||
export * |
||||
module * { export * } |
||||
link framework "AppKit" |
||||
link framework "CoreTelephony" |
||||
link framework "Foundation" |
||||
link framework "Security" |
||||
link framework "SystemConfiguration" |
||||
link "c++" |
||||
link "z" |
||||
} |
Binary file not shown.
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#ifndef Firebase_FIRDataEventType_h |
||||
#define Firebase_FIRDataEventType_h |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
/**
|
||||
* This enum is the set of events that you can observe at a Firebase Database |
||||
* location. |
||||
*/ |
||||
typedef NS_ENUM(NSInteger, FIRDataEventType) { |
||||
/// A new child node is added to a location.
|
||||
FIRDataEventTypeChildAdded, |
||||
/// A child node is removed from a location.
|
||||
FIRDataEventTypeChildRemoved, |
||||
/// A child node at a location changes.
|
||||
FIRDataEventTypeChildChanged, |
||||
/// A child node moves relative to the other child nodes at a location.
|
||||
FIRDataEventTypeChildMoved, |
||||
/// Any data changes at a location or, recursively, at any child node.
|
||||
FIRDataEventTypeValue |
||||
} NS_SWIFT_NAME(DataEventType); |
||||
|
||||
#endif |
@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@class FIRDatabaseReference; |
||||
|
||||
/**
|
||||
* A FIRDataSnapshot contains data from a Firebase Database location. Any time |
||||
* you read Firebase data, you receive the data as a FIRDataSnapshot. |
||||
* |
||||
* FIRDataSnapshots are passed to the blocks you attach with |
||||
* observeEventType:withBlock: or observeSingleEvent:withBlock:. They are |
||||
* efficiently-generated immutable copies of the data at a Firebase Database |
||||
* location. They can't be modified and will never change. To modify data at a |
||||
* location, use a FIRDatabaseReference (e.g. with setValue:). |
||||
*/ |
||||
NS_SWIFT_NAME(DataSnapshot) |
||||
@interface FIRDataSnapshot : NSObject |
||||
|
||||
#pragma mark - Navigating and inspecting a snapshot |
||||
|
||||
/**
|
||||
* Gets a FIRDataSnapshot for the location at the specified relative path. |
||||
* The relative path can either be a simple child key (e.g. 'fred') |
||||
* or a deeper slash-separated path (e.g. 'fred/name/first'). If the child |
||||
* location has no data, an empty FIRDataSnapshot is returned. |
||||
* |
||||
* @param childPathString A relative path to the location of child data. |
||||
* @return The FIRDataSnapshot for the child location. |
||||
*/ |
||||
- (FIRDataSnapshot *)childSnapshotForPath:(NSString *)childPathString; |
||||
|
||||
/**
|
||||
* Return YES if the specified child exists. |
||||
* |
||||
* @param childPathString A relative path to the location of a potential child. |
||||
* @return YES if data exists at the specified childPathString, else NO. |
||||
*/ |
||||
- (BOOL)hasChild:(NSString *)childPathString; |
||||
|
||||
/**
|
||||
* Return YES if the DataSnapshot has any children. |
||||
* |
||||
* @return YES if this snapshot has any children, else NO. |
||||
*/ |
||||
- (BOOL)hasChildren; |
||||
|
||||
/**
|
||||
* Return YES if the DataSnapshot contains a non-null value. |
||||
* |
||||
* @return YES if this snapshot contains a non-null value, else NO. |
||||
*/ |
||||
- (BOOL)exists; |
||||
|
||||
#pragma mark - Data export |
||||
|
||||
/**
|
||||
* Returns the raw value at this location, coupled with any metadata, such as |
||||
* priority. |
||||
* |
||||
* Priorities, where they exist, are accessible under the ".priority" key in |
||||
* instances of NSDictionary. For leaf locations with priorities, the value will |
||||
* be under the ".value" key. |
||||
*/ |
||||
- (id __nullable)valueInExportFormat; |
||||
|
||||
#pragma mark - Properties |
||||
|
||||
/**
|
||||
* Returns the contents of this data snapshot as native types. |
||||
* |
||||
* Data types returned: |
||||
* + NSDictionary |
||||
* + NSArray |
||||
* + NSNumber (also includes booleans) |
||||
* + NSString |
||||
* |
||||
* @return The data as a native object. |
||||
*/ |
||||
@property(strong, readonly, nonatomic, nullable) id value; |
||||
|
||||
/**
|
||||
* Gets the number of children for this DataSnapshot. |
||||
* |
||||
* @return An integer indicating the number of children. |
||||
*/ |
||||
@property(readonly, nonatomic) NSUInteger childrenCount; |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the location that this data came from. |
||||
* |
||||
* @return A FIRDatabaseReference instance for the location of this data. |
||||
*/ |
||||
@property(nonatomic, readonly, strong) FIRDatabaseReference *ref; |
||||
|
||||
/**
|
||||
* The key of the location that generated this FIRDataSnapshot. |
||||
* |
||||
* @return An NSString containing the key for the location of this |
||||
* FIRDataSnapshot. |
||||
*/ |
||||
@property(strong, readonly, nonatomic) NSString *key; |
||||
|
||||
/**
|
||||
* An iterator for snapshots of the child nodes in this snapshot. |
||||
* You can use the native for..in syntax: |
||||
* |
||||
* for (FIRDataSnapshot* child in snapshot.children) { |
||||
* ... |
||||
* } |
||||
* |
||||
* @return An NSEnumerator of the children. |
||||
*/ |
||||
@property(strong, readonly, nonatomic) |
||||
NSEnumerator<FIRDataSnapshot *> *children; |
||||
|
||||
/**
|
||||
* The priority of the data in this FIRDataSnapshot. |
||||
* |
||||
* @return The priority as a string, or nil if no priority was set. |
||||
*/ |
||||
@property(strong, readonly, nonatomic, nullable) id priority; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRDatabaseReference.h" |
||||
#import <Foundation/Foundation.h> |
||||
|
||||
@class FIRApp; |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* The entry point for accessing a Firebase Database. You can get an instance |
||||
* by calling [FIRDatabase database]. To access a location in the database and |
||||
* read or write data, use [FIRDatabase reference]. |
||||
*/ |
||||
NS_SWIFT_NAME(Database) |
||||
@interface FIRDatabase : NSObject |
||||
|
||||
/**
|
||||
* The NSObject initializer that has been marked as unavailable. Use the |
||||
* `database` class method instead. |
||||
*/ |
||||
- (instancetype)init |
||||
__attribute__((unavailable("use the database method instead"))); |
||||
|
||||
/**
|
||||
* Gets the instance of FIRDatabase for the default FIRApp. |
||||
* |
||||
* @return A FIRDatabase instance. |
||||
*/ |
||||
+ (FIRDatabase *)database NS_SWIFT_NAME(database()); |
||||
|
||||
/**
|
||||
* Gets a FirebaseDatabase instance for the specified URL. |
||||
* |
||||
* @param url The URL to the Firebase Database instance you want to access. |
||||
* @return A FIRDatabase instance. |
||||
*/ |
||||
+ (FIRDatabase *)databaseWithURL:(NSString *)url NS_SWIFT_NAME(database(url:)); |
||||
|
||||
/**
|
||||
* Gets a FirebaseDatabase instance for the specified URL, using the specified |
||||
* FirebaseApp. |
||||
* |
||||
* @param app The FIRApp to get a FIRDatabase for. |
||||
* @param url The URL to the Firebase Database instance you want to access. |
||||
* @return A FIRDatabase instance. |
||||
*/ |
||||
// clang-format off
|
||||
+ (FIRDatabase *)databaseForApp:(FIRApp *)app |
||||
URL:(NSString *)url NS_SWIFT_NAME(database(app:url:)); |
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* Gets an instance of FIRDatabase for a specific FIRApp. |
||||
* |
||||
* @param app The FIRApp to get a FIRDatabase for. |
||||
* @return A FIRDatabase instance. |
||||
*/ |
||||
+ (FIRDatabase *)databaseForApp:(FIRApp *)app NS_SWIFT_NAME(database(app:)); |
||||
|
||||
/** The FIRApp instance to which this FIRDatabase belongs. */ |
||||
@property(weak, readonly, nonatomic) FIRApp *app; |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the root of your Firebase Database. |
||||
*/ |
||||
- (FIRDatabaseReference *)reference; |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the provided path. |
||||
* |
||||
* @param path Path to a location in your Firebase Database. |
||||
* @return A FIRDatabaseReference pointing to the specified path. |
||||
*/ |
||||
- (FIRDatabaseReference *)referenceWithPath:(NSString *)path; |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the provided URL. The URL must be a URL to a |
||||
* path within this Firebase Database. To create a FIRDatabaseReference to a |
||||
* different database, create a FIRApp with a FIROptions object configured with |
||||
* the appropriate database URL. |
||||
* |
||||
* @param databaseUrl A URL to a path within your database. |
||||
* @return A FIRDatabaseReference for the provided URL. |
||||
*/ |
||||
- (FIRDatabaseReference *)referenceFromURL:(NSString *)databaseUrl; |
||||
|
||||
/**
|
||||
* The Firebase Database client automatically queues writes and sends them to |
||||
* the server at the earliest opportunity, depending on network connectivity. In |
||||
* some cases (e.g. offline usage) there may be a large number of writes waiting |
||||
* to be sent. Calling this method will purge all outstanding writes so they are |
||||
* abandoned. |
||||
* |
||||
* All writes will be purged, including transactions and onDisconnect writes. |
||||
* The writes will be rolled back locally, perhaps triggering events for |
||||
* affected event listeners, and the client will not (re-)send them to the |
||||
* Firebase Database backend. |
||||
*/ |
||||
- (void)purgeOutstandingWrites; |
||||
|
||||
/**
|
||||
* Shuts down our connection to the Firebase Database backend until goOnline is |
||||
* called. |
||||
*/ |
||||
- (void)goOffline; |
||||
|
||||
/**
|
||||
* Resumes our connection to the Firebase Database backend after a previous |
||||
* goOffline call. |
||||
*/ |
||||
- (void)goOnline; |
||||
|
||||
/**
|
||||
* The Firebase Database client will cache synchronized data and keep track of |
||||
* all writes you've initiated while your application is running. It seamlessly |
||||
* handles intermittent network connections and re-sends write operations when |
||||
* the network connection is restored. |
||||
* |
||||
* However by default your write operations and cached data are only stored |
||||
* in-memory and will be lost when your app restarts. By setting this value to |
||||
* `YES`, the data will be persisted to on-device (disk) storage and will thus |
||||
* be available again when the app is restarted (even when there is no network |
||||
* connectivity at that time). Note that this property must be set before |
||||
* creating your first Database reference and only needs to be called once per |
||||
* application. |
||||
* |
||||
*/ |
||||
@property(nonatomic) BOOL persistenceEnabled NS_SWIFT_NAME(isPersistenceEnabled) |
||||
; |
||||
|
||||
/**
|
||||
* By default the Firebase Database client will use up to 10MB of disk space to |
||||
* cache data. If the cache grows beyond this size, the client will start |
||||
* removing data that hasn't been recently used. If you find that your |
||||
* application caches too little or too much data, call this method to change |
||||
* the cache size. This property must be set before creating your first |
||||
* FIRDatabaseReference and only needs to be called once per application. |
||||
* |
||||
* Note that the specified cache size is only an approximation and the size on |
||||
* disk may temporarily exceed it at times. Cache sizes smaller than 1 MB or |
||||
* greater than 100 MB are not supported. |
||||
*/ |
||||
@property(nonatomic) NSUInteger persistenceCacheSizeBytes; |
||||
|
||||
/**
|
||||
* Sets the dispatch queue on which all events are raised. The default queue is |
||||
* the main queue. |
||||
* |
||||
* Note that this must be set before creating your first Database reference. |
||||
*/ |
||||
@property(nonatomic, strong) dispatch_queue_t callbackQueue; |
||||
|
||||
/**
|
||||
* Enables verbose diagnostic logging. |
||||
* |
||||
* @param enabled YES to enable logging, NO to disable. |
||||
*/ |
||||
+ (void)setLoggingEnabled:(BOOL)enabled; |
||||
|
||||
/** Retrieve the Firebase Database SDK version. */ |
||||
+ (NSString *)sdkVersion; |
||||
|
||||
/**
|
||||
* Configures the database to use an emulated backend instead of the default |
||||
* remote backend. |
||||
*/ |
||||
- (void)useEmulatorWithHost:(NSString *)host port:(NSInteger)port; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,467 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRDataEventType.h" |
||||
#import "FIRDataSnapshot.h" |
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* A FIRDatabaseHandle is used to identify listeners of Firebase Database |
||||
* events. These handles are returned by observeEventType: and can later be |
||||
* passed to removeObserverWithHandle: to stop receiving updates. |
||||
*/ |
||||
typedef NSUInteger FIRDatabaseHandle NS_SWIFT_NAME(DatabaseHandle); |
||||
|
||||
/**
|
||||
* A FIRDatabaseQuery instance represents a query over the data at a particular |
||||
* location. |
||||
* |
||||
* You create one by calling one of the query methods (queryOrderedByChild:, |
||||
* queryStartingAtValue:, etc.) on a FIRDatabaseReference. The query methods can |
||||
* be chained to further specify the data you are interested in observing |
||||
*/ |
||||
NS_SWIFT_NAME(DatabaseQuery) |
||||
@interface FIRDatabaseQuery : NSObject |
||||
|
||||
#pragma mark - Attach observers to read data |
||||
|
||||
/**
|
||||
* observeEventType:withBlock: is used to listen for data changes at a |
||||
* particular location. This is the primary way to read data from the Firebase |
||||
* Database. Your block will be triggered for the initial data and again |
||||
* whenever the data changes. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot. |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
withBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot))block; |
||||
|
||||
/**
|
||||
* observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data |
||||
* changes at a particular location. This is the primary way to read data from |
||||
* the Firebase Database. Your block will be triggered for the initial data and |
||||
* again whenever the data changes. In addition, for FIRDataEventTypeChildAdded, |
||||
* FIRDataEventTypeChildMoved, and FIRDataEventTypeChildChanged events, your |
||||
* block will be passed the key of the previous node by priority order. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot and the previous child's key. |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block; |
||||
|
||||
/**
|
||||
* observeEventType:withBlock: is used to listen for data changes at a |
||||
* particular location. This is the primary way to read data from the Firebase |
||||
* Database. Your block will be triggered for the initial data and again |
||||
* whenever the data changes. |
||||
* |
||||
* The cancelBlock will be called if you will no longer receive new events due |
||||
* to no longer having permission. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot. |
||||
* @param cancelBlock The block that should be called if this client no longer |
||||
* has permission to receive these events |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
withBlock:(void (^)(FIRDataSnapshot *snapshot))block |
||||
withCancelBlock: |
||||
(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data |
||||
* changes at a particular location. This is the primary way to read data from |
||||
* the Firebase Database. Your block will be triggered for the initial data and |
||||
* again whenever the data changes. In addition, for FIRDataEventTypeChildAdded, |
||||
* FIRDataEventTypeChildMoved, and FIRDataEventTypeChildChanged events, your |
||||
* block will be passed the key of the previous node by priority order. |
||||
* |
||||
* The cancelBlock will be called if you will no longer receive new events due |
||||
* to no longer having permission. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot and the previous child's key. |
||||
* @param cancelBlock The block that should be called if this client no longer |
||||
* has permission to receive these events |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block |
||||
withCancelBlock: |
||||
(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* getDataWithCompletionBlock: is used to get the most up-to-date value for |
||||
* this query. This method updates the cache and raises events if successful. If |
||||
* not connected, falls back to a locally-cached value. |
||||
* |
||||
* @param block The block that should be called with the most up-to-date value |
||||
* of this query, or an error if no such value could be retrieved. |
||||
*/ |
||||
- (void)getDataWithCompletionBlock: |
||||
(void (^_Nonnull)(NSError *__nullable error, |
||||
FIRDataSnapshot *snapshot))block |
||||
NS_SWIFT_NAME(getData(completion:)); |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot. |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
withBlock:(void (^)(FIRDataSnapshot *snapshot))block; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. In addition, for |
||||
* FIRDataEventTypeChildAdded, FIRDataEventTypeChildMoved, and |
||||
* FIRDataEventTypeChildChanged events, your block will be passed the key of the |
||||
* previous node by priority order. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot and the previous child's key. |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. |
||||
* |
||||
* The cancelBlock will be called if you do not have permission to read data at |
||||
* this location. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot. |
||||
* @param cancelBlock The block that will be called if you don't have permission |
||||
* to access this data |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
withBlock:(void (^)(FIRDataSnapshot *snapshot))block |
||||
withCancelBlock:(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. In addition, for |
||||
* FIRDataEventTypeChildAdded, FIRDataEventTypeChildMoved, and |
||||
* FIRDataEventTypeChildChanged events, your block will be passed the key of the |
||||
* previous node by priority order. |
||||
* |
||||
* The cancelBlock will be called if you do not have permission to read data at |
||||
* this location. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot and the previous child's key. |
||||
* @param cancelBlock The block that will be called if you don't have permission |
||||
* to access this data |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock:(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block |
||||
withCancelBlock: |
||||
(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
#pragma mark - Detaching observers |
||||
|
||||
/**
|
||||
* Detach a block previously attached with observeEventType:withBlock:. |
||||
* |
||||
* @param handle The handle returned by the call to observeEventType:withBlock: |
||||
* which we are trying to remove. |
||||
*/ |
||||
- (void)removeObserverWithHandle:(FIRDatabaseHandle)handle; |
||||
|
||||
/**
|
||||
* Detach all blocks previously attached to this Firebase Database location with |
||||
* observeEventType:withBlock: |
||||
*/ |
||||
- (void)removeAllObservers; |
||||
|
||||
/**
|
||||
* By calling `keepSynced:YES` on a location, the data for that location will |
||||
* automatically be downloaded and kept in sync, even when no listeners are |
||||
* attached for that location. Additionally, while a location is kept synced, it |
||||
* will not be evicted from the persistent disk cache. |
||||
* |
||||
* @param keepSynced Pass YES to keep this location synchronized, pass NO to |
||||
* stop synchronization. |
||||
*/ |
||||
- (void)keepSynced:(BOOL)keepSynced; |
||||
|
||||
#pragma mark - Querying and limiting |
||||
|
||||
/**
|
||||
* queryLimitedToFirst: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryLimitedToFirst: will respond to at most the first limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to |
||||
* receive events for |
||||
* @return A FIRDatabaseQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryLimitedToFirst:(NSUInteger)limit; |
||||
|
||||
/**
|
||||
* queryLimitedToLast: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryLimitedToLast: will respond to at most the last limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to |
||||
* receive events for |
||||
* @return A FIRDatabaseQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryLimitedToLast:(NSUInteger)limit; |
||||
|
||||
/**
|
||||
* queryOrderBy: is used to generate a reference to a view of the data that's |
||||
* been sorted by the values of a particular child key. This method is intended |
||||
* to be used in combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @param key The child key to use in ordering data visible to the returned |
||||
* FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, ordered by the values of the specified |
||||
* child key. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByChild:(NSString *)key; |
||||
|
||||
/**
|
||||
* queryOrderedByKey: is used to generate a reference to a view of the data |
||||
* that's been sorted by child key. This method is intended to be used in |
||||
* combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @return A FIRDatabaseQuery instance, ordered by child keys. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByKey; |
||||
|
||||
/**
|
||||
* queryOrderedByValue: is used to generate a reference to a view of the data |
||||
* that's been sorted by child value. This method is intended to be used in |
||||
* combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @return A FIRDatabaseQuery instance, ordered by child value. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByValue; |
||||
|
||||
/**
|
||||
* queryOrderedByPriority: is used to generate a reference to a view of the data |
||||
* that's been sorted by child priority. This method is intended to be used in |
||||
* combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @return A FIRDatabaseQuery instance, ordered by child priorities. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByPriority; |
||||
|
||||
/**
|
||||
* queryStartingAtValue: is used to generate a reference to a limited view of |
||||
* the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryStartingAtValue: will respond to events at nodes with a value greater |
||||
* than or equal to startValue. |
||||
* |
||||
* @param startValue The lower bound, inclusive, for the value of data visible |
||||
* to the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* or equal to startValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAtValue:(nullable id)startValue; |
||||
|
||||
/**
|
||||
* queryStartingAtValue:childKey: is used to generate a reference to a limited |
||||
* view of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryStartingAtValue:childKey will respond to events at nodes with a value |
||||
* greater than startValue, or equal to startValue and with a key greater than |
||||
* or equal to childKey. This is most useful when implementing pagination in a |
||||
* case where multiple nodes can match the startValue. |
||||
* |
||||
* @param startValue The lower bound, inclusive, for the value of data visible |
||||
* to the returned FIRDatabaseQuery |
||||
* @param childKey The lower bound, inclusive, for the key of nodes with value |
||||
* equal to startValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* or equal to startValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAtValue:(nullable id)startValue |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryStartingAfterValue: is used to generate a reference to a |
||||
* limited view of the data at this location. The FIRDatabaseQuery instance |
||||
* returned by queryStartingAfterValue: will respond to events at nodes |
||||
* with a value greater than startAfterValue. |
||||
* |
||||
* @param startAfterValue The lower bound, exclusive, for the value of data |
||||
* visible to the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater |
||||
* startAfterValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAfterValue:(nullable id)startAfterValue; |
||||
|
||||
/**
|
||||
* queryStartingAfterValue:childKey: is used to generate a reference to a |
||||
* limited view of the data at this location. The FIRDatabaseQuery instance |
||||
* returned by queryStartingAfterValue:childKey will respond to events at nodes |
||||
* with a value greater than startAfterValue, or equal to startAfterValue and |
||||
* with a key greater than childKey. This is most useful when implementing |
||||
* pagination in a case where multiple nodes can match the startAfterValue. |
||||
* |
||||
* @param startAfterValue The lower bound, inclusive, for the value of data |
||||
* visible to the returned FIRDatabaseQuery |
||||
* @param childKey The lower bound, exclusive, for the key of nodes with value |
||||
* equal to startAfterValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* startAfterValue, or equal to startAfterValue with a key greater than childKey |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAfterValue:(nullable id)startAfterValue |
||||
childKey:(nullable NSString *)childKey; |
||||
/**
|
||||
* queryEndingAtValue: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEndingAtValue: will respond to events at nodes with a value less than or |
||||
* equal to endValue. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to |
||||
* the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value less than or |
||||
* equal to endValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEndingAtValue:(nullable id)endValue; |
||||
|
||||
/**
|
||||
* queryEndingAtValue:childKey: is used to generate a reference to a limited |
||||
* view of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEndingAtValue:childKey will respond to events at nodes with a value less |
||||
* than endValue, or equal to endValue and with a key less than or equal to |
||||
* childKey. This is most useful when implementing pagination in a case where |
||||
* multiple nodes can match the endValue. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to |
||||
* the returned FIRDatabaseQuery |
||||
* @param childKey The upper bound, inclusive, for the key of nodes with value |
||||
* equal to endValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value less than or |
||||
* equal to endValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEndingAtValue:(nullable id)endValue |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryEndingBeforeValue: is used to generate a reference to a limited view of |
||||
* the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEndingBeforeValue: will respond to events at nodes with a value less |
||||
* than endValue. |
||||
* |
||||
* @param endValue The upper bound, exclusive, for the value of data visible to |
||||
* the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value less than |
||||
* endValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEndingBeforeValue:(nullable id)endValue; |
||||
|
||||
/**
|
||||
* queryEndingBeforeValue:childKey: is used to generate a reference to a limited |
||||
* view of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEndingBeforeValue:childKey will respond to events at nodes with a value |
||||
* less than endValue, or equal to endValue and with a key less than childKey. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to |
||||
* the returned FIRDatabaseQuery |
||||
* @param childKey The upper bound, exclusive, for the key of nodes with value |
||||
* equal to endValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value less than or |
||||
* equal to endValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEndingBeforeValue:(nullable id)endValue |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryEqualToValue: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEqualToValue: will respond to events at nodes with a value equal to the |
||||
* supplied argument. |
||||
* |
||||
* @param value The value that the data returned by this FIRDatabaseQuery will |
||||
* have |
||||
* @return A FIRDatabaseQuery instance, limited to data with the supplied value. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEqualToValue:(nullable id)value; |
||||
|
||||
/**
|
||||
* queryEqualToValue:childKey: is used to generate a reference to a limited view |
||||
* of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEqualToValue:childKey will respond to events at nodes with a value equal |
||||
* to the supplied argument and with their key equal to childKey. There will be |
||||
* at most one node that matches because child keys are unique. |
||||
* |
||||
* @param value The value that the data returned by this FIRDatabaseQuery will |
||||
* have |
||||
* @param childKey The name of nodes with the right value |
||||
* @return A FIRDatabaseQuery instance, limited to data with the supplied value |
||||
* and the key. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEqualToValue:(nullable id)value |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
#pragma mark - Properties |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the location of this query. |
||||
* |
||||
* @return A FIRDatabaseReference for the location of this query. |
||||
*/ |
||||
@property(nonatomic, readonly, strong) FIRDatabaseReference *ref; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,906 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRDataSnapshot.h" |
||||
#import "FIRDatabase.h" |
||||
#import "FIRDatabaseQuery.h" |
||||
#import "FIRMutableData.h" |
||||
#import "FIRServerValue.h" |
||||
#import "FIRTransactionResult.h" |
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@class FIRDatabase; |
||||
|
||||
/**
|
||||
* A FIRDatabaseReference represents a particular location in your Firebase |
||||
* Database and can be used for reading or writing data to that Firebase |
||||
* Database location. |
||||
* |
||||
* This class is the starting point for all Firebase Database operations. After |
||||
* you've obtained your first FIRDatabaseReference via [FIRDatabase reference], |
||||
* you can use it to read data (ie. observeEventType:withBlock:), write data |
||||
* (ie. setValue:), and to create new FIRDatabaseReferences (ie. child:). |
||||
*/ |
||||
NS_SWIFT_NAME(DatabaseReference) |
||||
@interface FIRDatabaseReference : FIRDatabaseQuery |
||||
|
||||
#pragma mark - Getting references to children locations |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the location at the specified relative path. |
||||
* The relative path can either be a simple child key (e.g. 'fred') or a |
||||
* deeper slash-separated path (e.g. 'fred/name/first'). |
||||
* |
||||
* @param pathString A relative path from this location to the desired child |
||||
* location. |
||||
* @return A FIRDatabaseReference for the specified relative path. |
||||
*/ |
||||
- (FIRDatabaseReference *)child:(NSString *)pathString; |
||||
|
||||
/**
|
||||
* childByAutoId generates a new child location using a unique key and returns a |
||||
* FIRDatabaseReference to it. This is useful when the children of a Firebase |
||||
* Database location represent a list of items. |
||||
* |
||||
* The unique key generated by childByAutoId: is prefixed with a |
||||
* client-generated timestamp so that the resulting list will be |
||||
* chronologically-sorted. |
||||
* |
||||
* @return A FIRDatabaseReference for the generated location. |
||||
*/ |
||||
- (FIRDatabaseReference *)childByAutoId; |
||||
|
||||
#pragma mark - Writing data |
||||
|
||||
/** Write data to this Firebase Database location.
|
||||
|
||||
This will overwrite any data at this location and all child locations. |
||||
|
||||
Data types that can be set are: |
||||
|
||||
- NSString -- @"Hello World" |
||||
- NSNumber (also includes boolean) -- @YES, @43, @4.333 |
||||
- NSDictionary -- @{@"key": @"value", @"nested": @{@"another": @"value"} } |
||||
- NSArray |
||||
|
||||
The effect of the write will be visible immediately and the corresponding |
||||
events will be triggered. Synchronization of the data to the Firebase Database |
||||
servers will also be started. |
||||
|
||||
Passing null for the new value is equivalent to calling remove:; |
||||
all data at this location or any child location will be deleted. |
||||
|
||||
Note that setValue: will remove any priority stored at this location, so if |
||||
priority is meant to be preserved, you should use setValue:andPriority: instead. |
||||
|
||||
@param value The value to be written. |
||||
*/ |
||||
- (void)setValue:(nullable id)value; |
||||
|
||||
/**
|
||||
* The same as setValue: with a block that gets triggered after the write |
||||
* operation has been committed to the Firebase Database servers. |
||||
* |
||||
* @param value The value to be written. |
||||
* @param block The block to be called after the write has been committed to the |
||||
* Firebase Database servers. |
||||
*/ |
||||
- (void)setValue:(nullable id)value |
||||
withCompletionBlock: |
||||
(void (^)(NSError *__nullable error, FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* The same as setValue: with an additional priority to be attached to the data |
||||
* being written. Priorities are used to order items. |
||||
* |
||||
* @param value The value to be written. |
||||
* @param priority The priority to be attached to that data. |
||||
*/ |
||||
- (void)setValue:(nullable id)value andPriority:(nullable id)priority; |
||||
|
||||
/**
|
||||
* The same as setValue:andPriority: with a block that gets triggered after the |
||||
* write operation has been committed to the Firebase Database servers. |
||||
* |
||||
* @param value The value to be written. |
||||
* @param priority The priority to be attached to that data. |
||||
* @param block The block to be called after the write has been committed to the |
||||
* Firebase Database servers. |
||||
*/ |
||||
- (void)setValue:(nullable id)value |
||||
andPriority:(nullable id)priority |
||||
withCompletionBlock: |
||||
(void (^)(NSError *__nullable error, FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Remove the data at this Firebase Database location. Any data at child |
||||
* locations will also be deleted. |
||||
* |
||||
* The effect of the delete will be visible immediately and the corresponding |
||||
* events will be triggered. Synchronization of the delete to the Firebase |
||||
* Database servers will also be started. |
||||
* |
||||
* remove: is equivalent to calling setValue:nil |
||||
*/ |
||||
- (void)removeValue; |
||||
|
||||
/**
|
||||
* The same as remove: with a block that gets triggered after the remove |
||||
* operation has been committed to the Firebase Database servers. |
||||
* |
||||
* @param block The block to be called after the remove has been committed to |
||||
* the Firebase Database servers. |
||||
*/ |
||||
- (void)removeValueWithCompletionBlock: |
||||
(void (^)(NSError *__nullable error, FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Sets a priority for the data at this Firebase Database location. |
||||
* Priorities can be used to provide a custom ordering for the children at a |
||||
* location (if no priorities are specified, the children are ordered by key). |
||||
* |
||||
* You cannot set a priority on an empty location. For this reason |
||||
* setValue:andPriority: should be used when setting initial data with a |
||||
* specific priority and setPriority: should be used when updating the priority |
||||
* of existing data. |
||||
* |
||||
* Children are sorted based on this priority using the following rules: |
||||
* |
||||
* Children with no priority come first. |
||||
* Children with a number as their priority come next. They are sorted |
||||
* numerically by priority (small to large). Children with a string as their |
||||
* priority come last. They are sorted lexicographically by priority. Whenever |
||||
* two children have the same priority (including no priority), they are sorted |
||||
* by key. Numeric keys come first (sorted numerically), followed by the |
||||
* remaining keys (sorted lexicographically). |
||||
* |
||||
* Note that priorities are parsed and ordered as IEEE 754 double-precision |
||||
* floating-point numbers. Keys are always stored as strings and are treated as |
||||
* numbers only when they can be parsed as a 32-bit integer |
||||
* |
||||
* @param priority The priority to set at the specified location. |
||||
*/ |
||||
- (void)setPriority:(nullable id)priority; |
||||
|
||||
/**
|
||||
* The same as setPriority: with a block that is called once the priority has |
||||
* been committed to the Firebase Database servers. |
||||
* |
||||
* @param priority The priority to set at the specified location. |
||||
* @param block The block that is triggered after the priority has been written |
||||
* on the servers. |
||||
*/ |
||||
- (void)setPriority:(nullable id)priority |
||||
withCompletionBlock: |
||||
(void (^)(NSError *__nullable error, FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Updates the values at the specified paths in the dictionary without |
||||
* overwriting other keys at this location. |
||||
* |
||||
* @param values A dictionary of the keys to change and their new values |
||||
*/ |
||||
- (void)updateChildValues:(NSDictionary *)values; |
||||
|
||||
/**
|
||||
* The same as update: with a block that is called once the update has been |
||||
* committed to the Firebase Database servers |
||||
* |
||||
* @param values A dictionary of the keys to change and their new values |
||||
* @param block The block that is triggered after the update has been written on |
||||
* the Firebase Database servers |
||||
*/ |
||||
- (void)updateChildValues:(NSDictionary *)values |
||||
withCompletionBlock: |
||||
(void (^)(NSError *__nullable error, FIRDatabaseReference *ref))block; |
||||
|
||||
#pragma mark - Attaching observers to read data |
||||
|
||||
/**
|
||||
* observeEventType:withBlock: is used to listen for data changes at a |
||||
* particular location. This is the primary way to read data from the Firebase |
||||
* Database. Your block will be triggered for the initial data and again |
||||
* whenever the data changes. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot. |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
withBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot))block; |
||||
|
||||
/**
|
||||
* observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data |
||||
* changes at a particular location. This is the primary way to read data from |
||||
* the Firebase Database. Your block will be triggered for the initial data and |
||||
* again whenever the data changes. In addition, for FIRDataEventTypeChildAdded, |
||||
* FIRDataEventTypeChildMoved, and FIRDataEventTypeChildChanged events, your |
||||
* block will be passed the key of the previous node by priority order. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot and the previous child's key. |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block; |
||||
|
||||
/**
|
||||
* observeEventType:withBlock: is used to listen for data changes at a |
||||
* particular location. This is the primary way to read data from the Firebase |
||||
* Database. Your block will be triggered for the initial data and again |
||||
* whenever the data changes. |
||||
* |
||||
* The cancelBlock will be called if you will no longer receive new events due |
||||
* to no longer having permission. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot. |
||||
* @param cancelBlock The block that should be called if this client no longer |
||||
* has permission to receive these events |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
withBlock:(void (^)(FIRDataSnapshot *snapshot))block |
||||
withCancelBlock: |
||||
(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data |
||||
* changes at a particular location. This is the primary way to read data from |
||||
* the Firebase Database. Your block will be triggered for the initial data and |
||||
* again whenever the data changes. In addition, for FIRDataEventTypeChildAdded, |
||||
* FIRDataEventTypeChildMoved, and FIRDataEventTypeChildChanged events, your |
||||
* block will be passed the key of the previous node by priority order. |
||||
* |
||||
* The cancelBlock will be called if you will no longer receive new events due |
||||
* to no longer having permission. |
||||
* |
||||
* Use removeObserverWithHandle: to stop receiving updates. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called with initial data and updates. |
||||
* It is passed the data as a FIRDataSnapshot and the previous child's key. |
||||
* @param cancelBlock The block that should be called if this client no longer |
||||
* has permission to receive these events |
||||
* @return A handle used to unregister this block later using |
||||
* removeObserverWithHandle: |
||||
*/ |
||||
- (FIRDatabaseHandle)observeEventType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block |
||||
withCancelBlock: |
||||
(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot. |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
withBlock:(void (^)(FIRDataSnapshot *snapshot))block; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. In addition, for |
||||
* FIRDataEventTypeChildAdded, FIRDataEventTypeChildMoved, and |
||||
* FIRDataEventTypeChildChanged events, your block will be passed the key of the |
||||
* previous node by priority order. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot and the previous child's key. |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock: |
||||
(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. |
||||
* |
||||
* The cancelBlock will be called if you do not have permission to read data at |
||||
* this location. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot. |
||||
* @param cancelBlock The block that will be called if you don't have permission |
||||
* to access this data |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
withBlock:(void (^)(FIRDataSnapshot *snapshot))block |
||||
withCancelBlock:(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* This is equivalent to observeEventType:withBlock:, except the block is |
||||
* immediately canceled after the initial data is returned. In addition, for |
||||
* FIRDataEventTypeChildAdded, FIRDataEventTypeChildMoved, and |
||||
* FIRDataEventTypeChildChanged events, your block will be passed the key of the |
||||
* previous node by priority order. |
||||
* |
||||
* The cancelBlock will be called if you do not have permission to read data at |
||||
* this location. |
||||
* |
||||
* @param eventType The type of event to listen for. |
||||
* @param block The block that should be called. It is passed the data as a |
||||
* FIRDataSnapshot and the previous child's key. |
||||
* @param cancelBlock The block that will be called if you don't have permission |
||||
* to access this data |
||||
*/ |
||||
- (void)observeSingleEventOfType:(FIRDataEventType)eventType |
||||
andPreviousSiblingKeyWithBlock:(void (^)(FIRDataSnapshot *snapshot, |
||||
NSString *__nullable prevKey))block |
||||
withCancelBlock: |
||||
(nullable void (^)(NSError *error))cancelBlock; |
||||
|
||||
/**
|
||||
* getDataWithCompletionBlock: is used to get the most up-to-date value for |
||||
* this query. This method updates the cache and raises events if successful. If |
||||
* not connected, falls back to a locally-cached value. |
||||
* |
||||
* @param block The block that should be called with the most up-to-date value |
||||
* of this query, or an error if no such value could be retrieved. |
||||
*/ |
||||
- (void)getDataWithCompletionBlock: |
||||
(void (^_Nonnull)(NSError *__nullable error, |
||||
FIRDataSnapshot *snapshot))block |
||||
NS_SWIFT_NAME(getData(completion:)); |
||||
|
||||
#pragma mark - Detaching observers |
||||
|
||||
/**
|
||||
* Detach a block previously attached with observeEventType:withBlock:. |
||||
* |
||||
* @param handle The handle returned by the call to observeEventType:withBlock: |
||||
* which we are trying to remove. |
||||
*/ |
||||
- (void)removeObserverWithHandle:(FIRDatabaseHandle)handle; |
||||
|
||||
/**
|
||||
* By calling `keepSynced:YES` on a location, the data for that location will |
||||
* automatically be downloaded and kept in sync, even when no listeners are |
||||
* attached for that location. Additionally, while a location is kept synced, it |
||||
* will not be evicted from the persistent disk cache. |
||||
* |
||||
* @param keepSynced Pass YES to keep this location synchronized, pass NO to |
||||
* stop synchronization. |
||||
*/ |
||||
- (void)keepSynced:(BOOL)keepSynced; |
||||
|
||||
/**
|
||||
* Removes all observers at the current reference, but does not remove any |
||||
* observers at child references. removeAllObservers must be called again for |
||||
* each child reference where a listener was established to remove the |
||||
* observers. |
||||
*/ |
||||
- (void)removeAllObservers; |
||||
|
||||
#pragma mark - Querying and limiting |
||||
|
||||
/**
|
||||
* queryLimitedToFirst: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryLimitedToFirst: will respond to at most the first limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to |
||||
* receive events for |
||||
* @return A FIRDatabaseQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryLimitedToFirst:(NSUInteger)limit; |
||||
|
||||
/**
|
||||
* queryLimitedToLast: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryLimitedToLast: will respond to at most the last limit child nodes. |
||||
* |
||||
* @param limit The upper bound, inclusive, for the number of child nodes to |
||||
* receive events for |
||||
* @return A FIRDatabaseQuery instance, limited to at most limit child nodes. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryLimitedToLast:(NSUInteger)limit; |
||||
|
||||
/**
|
||||
* queryOrderBy: is used to generate a reference to a view of the data that's |
||||
* been sorted by the values of a particular child key. This method is intended |
||||
* to be used in combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @param key The child key to use in ordering data visible to the returned |
||||
* FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, ordered by the values of the specified |
||||
* child key. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByChild:(NSString *)key; |
||||
|
||||
/**
|
||||
* queryOrderedByKey: is used to generate a reference to a view of the data |
||||
* that's been sorted by child key. This method is intended to be used in |
||||
* combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @return A FIRDatabaseQuery instance, ordered by child keys. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByKey; |
||||
|
||||
/**
|
||||
* queryOrderedByPriority: is used to generate a reference to a view of the data |
||||
* that's been sorted by child priority. This method is intended to be used in |
||||
* combination with queryStartingAtValue:, queryEndingAtValue:, or |
||||
* queryEqualToValue:. |
||||
* |
||||
* @return A FIRDatabaseQuery instance, ordered by child priorities. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryOrderedByPriority; |
||||
|
||||
/**
|
||||
* queryStartingAtValue: is used to generate a reference to a limited view of |
||||
* the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryStartingAtValue: will respond to events at nodes with a value greater |
||||
* than or equal to startValue. |
||||
* |
||||
* @param startValue The lower bound, inclusive, for the value of data visible |
||||
* to the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* or equal to startValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAtValue:(nullable id)startValue; |
||||
|
||||
/**
|
||||
* queryStartingAtValue:childKey: is used to generate a reference to a limited |
||||
* view of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryStartingAtValue:childKey will respond to events at nodes with a value |
||||
* greater than startValue, or equal to startValue and with a key greater than |
||||
* or equal to childKey. |
||||
* |
||||
* @param startValue The lower bound, inclusive, for the value of data visible |
||||
* to the returned FIRDatabaseQuery |
||||
* @param childKey The lower bound, inclusive, for the key of nodes with value |
||||
* equal to startValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* or equal to startValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAtValue:(nullable id)startValue |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryStartingAfterValue: is used to generate a reference to a limited view of |
||||
* the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryStartingAfterValue: will respond to events at nodes with a value greater |
||||
* than startAfterValue. |
||||
* |
||||
* @param startAfterValue The lower bound, exclusive, for the value of data |
||||
* visible to the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* startAfterValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAfterValue:(nullable id)startAfterValue; |
||||
|
||||
/**
|
||||
* queryStartingAfterValue:childKey: is used to generate a reference to a |
||||
* limited view of the data at this location. The FIRDatabaseQuery instance |
||||
* returned by queryStartingAfterValue:childKey will respond to events at nodes |
||||
* with a value greater than startAfterValue, or equal to startAfterValue and |
||||
* with a key greater than childKey. This is most useful when implementing |
||||
* pagination in a case where multiple nodes can match the startAfterValue. |
||||
* |
||||
* @param startAfterValue The lower bound, inclusive, for the value of data |
||||
* visible to the returned FIRDatabaseQuery |
||||
* @param childKey The lower bound, exclusive, for the key of nodes with value |
||||
* equal to startAfterValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value greater than |
||||
* or equal to startAfterValue, or equal to startAfterValue and with a key |
||||
* greater than childKey. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryStartingAfterValue:(nullable id)startAfterValue |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryEndingAtValue: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEndingAtValue: will respond to events at nodes with a value less than or |
||||
* equal to endValue. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to |
||||
* the returned FIRDatabaseQuery |
||||
* @return A FIRDatabaseQuery instance, limited to data with value less than or |
||||
* equal to endValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEndingAtValue:(nullable id)endValue; |
||||
|
||||
/**
|
||||
* queryEndingAtValue:childKey: is used to generate a reference to a limited |
||||
* view of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEndingAtValue:childKey will respond to events at nodes with a value less |
||||
* than endValue, or equal to endValue and with a key less than or equal to |
||||
* childKey. |
||||
* |
||||
* @param endValue The upper bound, inclusive, for the value of data visible to |
||||
* the returned FIRDatabaseQuery |
||||
* @param childKey The upper bound, inclusive, for the key of nodes with value |
||||
* equal to endValue |
||||
* @return A FIRDatabaseQuery instance, limited to data with value less than or |
||||
* equal to endValue |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEndingAtValue:(nullable id)endValue |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
/**
|
||||
* queryEqualToValue: is used to generate a reference to a limited view of the |
||||
* data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEqualToValue: will respond to events at nodes with a value equal to the |
||||
* supplied argument. |
||||
* |
||||
* @param value The value that the data returned by this FIRDatabaseQuery will |
||||
* have |
||||
* @return A FIRDatabaseQuery instance, limited to data with the supplied value. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEqualToValue:(nullable id)value; |
||||
|
||||
/**
|
||||
* queryEqualToValue:childKey: is used to generate a reference to a limited view |
||||
* of the data at this location. The FIRDatabaseQuery instance returned by |
||||
* queryEqualToValue:childKey will respond to events at nodes with a value equal |
||||
* to the supplied argument with a key equal to childKey. There will be at most |
||||
* one node that matches because child keys are unique. |
||||
* |
||||
* @param value The value that the data returned by this FIRDatabaseQuery will |
||||
* have |
||||
* @param childKey The key of nodes with the right value |
||||
* @return A FIRDatabaseQuery instance, limited to data with the supplied value |
||||
* and the key. |
||||
*/ |
||||
- (FIRDatabaseQuery *)queryEqualToValue:(nullable id)value |
||||
childKey:(nullable NSString *)childKey; |
||||
|
||||
#pragma mark - Managing presence |
||||
|
||||
/**
|
||||
* Ensure the data at this location is set to the specified value when |
||||
* the client is disconnected (due to closing the browser, navigating |
||||
* to a new page, or network issues). |
||||
* |
||||
* onDisconnectSetValue: is especially useful for implementing "presence" |
||||
* systems, where a value should be changed or cleared when a user disconnects |
||||
* so that he appears "offline" to other users. |
||||
* |
||||
* @param value The value to be set after the connection is lost. |
||||
*/ |
||||
- (void)onDisconnectSetValue:(nullable id)value; |
||||
|
||||
/**
|
||||
* Ensure the data at this location is set to the specified value when |
||||
* the client is disconnected (due to closing the browser, navigating |
||||
* to a new page, or network issues). |
||||
* |
||||
* The completion block will be triggered when the operation has been |
||||
* successfully queued up on the Firebase Database servers |
||||
* |
||||
* @param value The value to be set after the connection is lost. |
||||
* @param block Block to be triggered when the operation has been queued up on |
||||
* the Firebase Database servers |
||||
*/ |
||||
- (void)onDisconnectSetValue:(nullable id)value |
||||
withCompletionBlock:(void (^)(NSError *__nullable error, |
||||
FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Ensure the data at this location is set to the specified value and priority |
||||
* when the client is disconnected (due to closing the browser, navigating to a |
||||
* new page, or network issues). |
||||
* |
||||
* @param value The value to be set after the connection is lost. |
||||
* @param priority The priority to be set after the connection is lost. |
||||
*/ |
||||
- (void)onDisconnectSetValue:(nullable id)value andPriority:(id)priority; |
||||
|
||||
/**
|
||||
* Ensure the data at this location is set to the specified value and priority |
||||
* when the client is disconnected (due to closing the browser, navigating to a |
||||
* new page, or network issues). |
||||
* |
||||
* The completion block will be triggered when the operation has been |
||||
* successfully queued up on the Firebase Database servers |
||||
* |
||||
* @param value The value to be set after the connection is lost. |
||||
* @param priority The priority to be set after the connection is lost. |
||||
* @param block Block to be triggered when the operation has been queued up on |
||||
* the Firebase Database servers |
||||
*/ |
||||
- (void)onDisconnectSetValue:(nullable id)value |
||||
andPriority:(nullable id)priority |
||||
withCompletionBlock:(void (^)(NSError *__nullable error, |
||||
FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Ensure the data at this location is removed when |
||||
* the client is disconnected (due to closing the app, navigating |
||||
* to a new page, or network issues). |
||||
* |
||||
* onDisconnectRemoveValue is especially useful for implementing "presence" |
||||
* systems. |
||||
*/ |
||||
- (void)onDisconnectRemoveValue; |
||||
|
||||
/**
|
||||
* Ensure the data at this location is removed when |
||||
* the client is disconnected (due to closing the app, navigating |
||||
* to a new page, or network issues). |
||||
* |
||||
* onDisconnectRemoveValueWithCompletionBlock: is especially useful for |
||||
* implementing "presence" systems. |
||||
* |
||||
* @param block Block to be triggered when the operation has been queued up on |
||||
* the Firebase Database servers |
||||
*/ |
||||
- (void)onDisconnectRemoveValueWithCompletionBlock: |
||||
(void (^)(NSError *__nullable error, FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Ensure the data has the specified child values updated when |
||||
* the client is disconnected (due to closing the browser, navigating |
||||
* to a new page, or network issues). |
||||
* |
||||
* |
||||
* @param values A dictionary of child node keys and the values to set them to |
||||
* after the connection is lost. |
||||
*/ |
||||
- (void)onDisconnectUpdateChildValues:(NSDictionary *)values; |
||||
|
||||
/**
|
||||
* Ensure the data has the specified child values updated when |
||||
* the client is disconnected (due to closing the browser, navigating |
||||
* to a new page, or network issues). |
||||
* |
||||
* |
||||
* @param values A dictionary of child node keys and the values to set them to |
||||
* after the connection is lost. |
||||
* @param block A block that will be called once the operation has been queued |
||||
* up on the Firebase Database servers |
||||
*/ |
||||
- (void)onDisconnectUpdateChildValues:(NSDictionary *)values |
||||
withCompletionBlock: |
||||
(void (^)(NSError *__nullable error, |
||||
FIRDatabaseReference *ref))block; |
||||
|
||||
/**
|
||||
* Cancel any operations that are set to run on disconnect. If you previously |
||||
* called onDisconnectSetValue:, onDisconnectRemoveValue:, or |
||||
* onDisconnectUpdateChildValues:, and no longer want the values updated when |
||||
* the connection is lost, call cancelDisconnectOperations: |
||||
*/ |
||||
- (void)cancelDisconnectOperations; |
||||
|
||||
/**
|
||||
* Cancel any operations that are set to run on disconnect. If you previously |
||||
* called onDisconnectSetValue:, onDisconnectRemoveValue:, or |
||||
* onDisconnectUpdateChildValues:, and no longer want the values updated when |
||||
* the connection is lost, call cancelDisconnectOperations: |
||||
* |
||||
* @param block A block that will be triggered once the Firebase Database |
||||
* servers have acknowledged the cancel request. |
||||
*/ |
||||
- (void)cancelDisconnectOperationsWithCompletionBlock: |
||||
(nullable void (^)(NSError *__nullable error, |
||||
FIRDatabaseReference *ref))block; |
||||
|
||||
#pragma mark - Manual Connection Management |
||||
|
||||
/**
|
||||
* Manually disconnect the Firebase Database client from the server and disable |
||||
* automatic reconnection. |
||||
* |
||||
* The Firebase Database client automatically maintains a persistent connection |
||||
* to the Firebase Database server, which will remain active indefinitely and |
||||
* reconnect when disconnected. However, the goOffline( ) and goOnline( ) |
||||
* methods may be used to manually control the client connection in cases where |
||||
* a persistent connection is undesirable. |
||||
* |
||||
* While offline, the Firebase Database client will no longer receive data |
||||
* updates from the server. However, all database operations performed locally |
||||
* will continue to immediately fire events, allowing your application to |
||||
* continue behaving normally. Additionally, each operation performed locally |
||||
* will automatically be queued and retried upon reconnection to the Firebase |
||||
* Database server. |
||||
* |
||||
* To reconnect to the Firebase Database server and begin receiving remote |
||||
* events, see goOnline( ). Once the connection is reestablished, the Firebase |
||||
* Database client will transmit the appropriate data and fire the appropriate |
||||
* events so that your client "catches up" automatically. |
||||
* |
||||
* Note: Invoking this method will impact all Firebase Database connections. |
||||
*/ |
||||
+ (void)goOffline; |
||||
|
||||
/**
|
||||
* Manually reestablish a connection to the Firebase Database server and enable |
||||
* automatic reconnection. |
||||
* |
||||
* The Firebase Database client automatically maintains a persistent connection |
||||
* to the Firebase Database server, which will remain active indefinitely and |
||||
* reconnect when disconnected. However, the goOffline( ) and goOnline( ) |
||||
* methods may be used to manually control the client connection in cases where |
||||
* a persistent connection is undesirable. |
||||
* |
||||
* This method should be used after invoking goOffline( ) to disable the active |
||||
* connection. Once reconnected, the Firebase Database client will automatically |
||||
* transmit the proper data and fire the appropriate events so that your client |
||||
* "catches up" automatically. |
||||
* |
||||
* To disconnect from the Firebase Database server, see goOffline( ). |
||||
* |
||||
* Note: Invoking this method will impact all Firebase Database connections. |
||||
*/ |
||||
+ (void)goOnline; |
||||
|
||||
#pragma mark - Transactions |
||||
|
||||
/**
|
||||
* Performs an optimistic-concurrency transactional update to the data at this |
||||
* location. Your block will be called with a FIRMutableData instance that |
||||
* contains the current data at this location. Your block should update this |
||||
* data to the value you wish to write to this location, and then return an |
||||
* instance of FIRTransactionResult with the new data. |
||||
* |
||||
* If, when the operation reaches the server, it turns out that this client had |
||||
* stale data, your block will be run again with the latest data from the |
||||
* server. |
||||
* |
||||
* When your block is run, you may decide to abort the transaction by returning |
||||
* [FIRTransactionResult abort]. |
||||
* |
||||
* @param block This block receives the current data at this location and must |
||||
* return an instance of FIRTransactionResult |
||||
*/ |
||||
- (void)runTransactionBlock: |
||||
(FIRTransactionResult * (^)(FIRMutableData *currentData))block; |
||||
|
||||
/**
|
||||
* Performs an optimistic-concurrency transactional update to the data at this |
||||
* location. Your block will be called with a FIRMutableData instance that |
||||
* contains the current data at this location. Your block should update this |
||||
* data to the value you wish to write to this location, and then return an |
||||
* instance of FIRTransactionResult with the new data. |
||||
* |
||||
* If, when the operation reaches the server, it turns out that this client had |
||||
* stale data, your block will be run again with the latest data from the |
||||
* server. |
||||
* |
||||
* When your block is run, you may decide to abort the transaction by returning |
||||
* [FIRTransactionResult abort]. |
||||
* |
||||
* @param block This block receives the current data at this location and must |
||||
* return an instance of FIRTransactionResult |
||||
* @param completionBlock This block will be triggered once the transaction is |
||||
* complete, whether it was successful or not. It will indicate if there was an |
||||
* error, whether or not the data was committed, and what the current value of |
||||
* the data at this location is. |
||||
*/ |
||||
- (void)runTransactionBlock: |
||||
(FIRTransactionResult * (^)(FIRMutableData *currentData))block |
||||
andCompletionBlock: |
||||
(void (^)(NSError *__nullable error, BOOL committed, |
||||
FIRDataSnapshot *__nullable snapshot))completionBlock; |
||||
|
||||
/**
|
||||
* Performs an optimistic-concurrency transactional update to the data at this |
||||
* location. Your block will be called with a FIRMutableData instance that |
||||
* contains the current data at this location. Your block should update this |
||||
* data to the value you wish to write to this location, and then return an |
||||
* instance of FIRTransactionResult with the new data. |
||||
* |
||||
* If, when the operation reaches the server, it turns out that this client had |
||||
* stale data, your block will be run again with the latest data from the |
||||
* server. |
||||
* |
||||
* When your block is run, you may decide to abort the transaction by return |
||||
* [FIRTransactionResult abort]. |
||||
* |
||||
* Since your block may be run multiple times, this client could see several |
||||
* immediate states that don't exist on the server. You can suppress those |
||||
* immediate states until the server confirms the final state of the |
||||
* transaction. |
||||
* |
||||
* @param block This block receives the current data at this location and must |
||||
* return an instance of FIRTransactionResult |
||||
* @param completionBlock This block will be triggered once the transaction is |
||||
* complete, whether it was successful or not. It will indicate if there was an |
||||
* error, whether or not the data was committed, and what the current value of |
||||
* the data at this location is. |
||||
* @param localEvents Set this to NO to suppress events raised for intermediate |
||||
* states, and only get events based on the final state of the transaction. |
||||
*/ |
||||
- (void)runTransactionBlock: |
||||
(FIRTransactionResult * (^)(FIRMutableData *currentData))block |
||||
andCompletionBlock: |
||||
(nullable void (^)(NSError *__nullable error, BOOL committed, |
||||
FIRDataSnapshot *__nullable snapshot)) |
||||
completionBlock |
||||
withLocalEvents:(BOOL)localEvents; |
||||
|
||||
#pragma mark - Retrieving String Representation |
||||
|
||||
/**
|
||||
* Gets the absolute URL of this Firebase Database location. |
||||
* |
||||
* @return The absolute URL of the referenced Firebase Database location. |
||||
*/ |
||||
- (NSString *)description; |
||||
|
||||
#pragma mark - Properties |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the parent location. |
||||
* If this instance refers to the root of your Firebase Database, it has no |
||||
* parent, and therefore parent( ) will return null. |
||||
* |
||||
* @return A FIRDatabaseReference for the parent location. |
||||
*/ |
||||
@property(strong, readonly, nonatomic, nullable) FIRDatabaseReference *parent; |
||||
|
||||
/**
|
||||
* Gets a FIRDatabaseReference for the root location |
||||
* |
||||
* @return A new FIRDatabaseReference to root location. |
||||
*/ |
||||
@property(strong, readonly, nonatomic) FIRDatabaseReference *root; |
||||
|
||||
/**
|
||||
* Gets the last token in a Firebase Database location (e.g. 'fred' in |
||||
* https://SampleChat.firebaseIO-demo.com/users/fred)
|
||||
* |
||||
* @return The key of the location this reference points to. |
||||
*/ |
||||
@property(strong, readonly, nonatomic, nullable) NSString *key; |
||||
|
||||
/**
|
||||
* Gets the URL for the Firebase Database location referenced by this |
||||
* FIRDatabaseReference. |
||||
* |
||||
* @return The url of the location this reference points to. |
||||
*/ |
||||
@property(strong, readonly, nonatomic) NSString *URL; |
||||
|
||||
/**
|
||||
* Gets the FIRDatabase instance associated with this reference. |
||||
* |
||||
* @return The FIRDatabase object for this reference. |
||||
*/ |
||||
@property(strong, readonly, nonatomic) FIRDatabase *database; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* A FIRMutableData instance is populated with data from a Firebase Database |
||||
* location. When you are using runTransactionBlock:, you will be given an |
||||
* instance containing the current data at that location. Your block will be |
||||
* responsible for updating that instance to the data you wish to save at that |
||||
* location, and then returning using [FIRTransactionResult successWithValue:]. |
||||
* |
||||
* To modify the data, set its value property to any of the native types support |
||||
* by Firebase Database: |
||||
* |
||||
* + NSNumber (includes BOOL) |
||||
* + NSDictionary |
||||
* + NSArray |
||||
* + NSString |
||||
* + nil / NSNull to remove the data |
||||
* |
||||
* Note that changes made to a child FIRMutableData instance will be visible to |
||||
* the parent. |
||||
*/ |
||||
NS_SWIFT_NAME(MutableData) |
||||
@interface FIRMutableData : NSObject |
||||
|
||||
#pragma mark - Inspecting and navigating the data |
||||
|
||||
/**
|
||||
* Returns boolean indicating whether this mutable data has children. |
||||
* |
||||
* @return YES if this data contains child nodes. |
||||
*/ |
||||
- (BOOL)hasChildren; |
||||
|
||||
/**
|
||||
* Indicates whether this mutable data has a child at the given path. |
||||
* |
||||
* @param path A path string, consisting either of a single segment, like |
||||
* 'child', or multiple segments, 'a/deeper/child' |
||||
* @return YES if this data contains a child at the specified relative path |
||||
*/ |
||||
- (BOOL)hasChildAtPath:(NSString *)path; |
||||
|
||||
/**
|
||||
* Used to obtain a FIRMutableData instance that encapsulates the data at the |
||||
* given relative path. Note that changes made to the child will be visible to |
||||
* the parent. |
||||
* |
||||
* @param path A path string, consisting either of a single segment, like |
||||
* 'child', or multiple segments, 'a/deeper/child' |
||||
* @return A FIRMutableData instance containing the data at the given path |
||||
*/ |
||||
- (FIRMutableData *)childDataByAppendingPath:(NSString *)path; |
||||
|
||||
#pragma mark - Properties |
||||
|
||||
/**
|
||||
* To modify the data contained by this instance of FIRMutableData, set this to |
||||
* any of the native types supported by Firebase Database: |
||||
* |
||||
* + NSNumber (includes BOOL) |
||||
* + NSDictionary |
||||
* + NSArray |
||||
* + NSString |
||||
* + nil / NSNull to remove the data |
||||
* |
||||
* Note that setting this value will override the priority at this location. |
||||
* |
||||
* @return The current data at this location as a native object |
||||
*/ |
||||
@property(strong, nonatomic, nullable) id value; |
||||
|
||||
/**
|
||||
* Set this property to update the priority of the data at this location. Can be |
||||
* set to the following types: |
||||
* |
||||
* + NSNumber |
||||
* + NSString |
||||
* + nil / NSNull to remove the priority |
||||
* |
||||
* @return The priority of the data at this location |
||||
*/ |
||||
@property(strong, nonatomic, nullable) id priority; |
||||
|
||||
/**
|
||||
* @return The number of child nodes at this location |
||||
*/ |
||||
@property(readonly, nonatomic) NSUInteger childrenCount; |
||||
|
||||
/**
|
||||
* Used to iterate over the children at this location. You can use the native |
||||
* for .. in syntax: |
||||
* |
||||
* for (FIRMutableData* child in data.children) { |
||||
* ... |
||||
* } |
||||
* |
||||
* Note that this enumerator operates on an immutable copy of the child list. |
||||
* So, you can modify the instance during iteration, but the new additions will |
||||
* not be visible until you get a new enumerator. |
||||
*/ |
||||
@property(readonly, nonatomic, strong) NSEnumerator<FIRMutableData *> *children; |
||||
|
||||
/**
|
||||
* @return The key name of this node, or nil if it is the top-most location |
||||
*/ |
||||
@property(readonly, nonatomic, strong, nullable) NSString *key; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* Placeholder values you may write into Firebase Database as a value or |
||||
* priority that will automatically be populated by the Firebase Database |
||||
* server. |
||||
*/ |
||||
NS_SWIFT_NAME(ServerValue) |
||||
@interface FIRServerValue : NSObject |
||||
|
||||
/**
|
||||
* Placeholder value for the number of milliseconds since the Unix epoch |
||||
*/ |
||||
+ (NSDictionary *)timestamp; |
||||
|
||||
/**
|
||||
* Returns a placeholder value that can be used to atomically increment the |
||||
* current database value by the provided delta. |
||||
* |
||||
* The delta must be a long or double value. If the current value is not an |
||||
* integer or double, or if the data does not yet exist, the transformation will |
||||
* set the data to the delta value. If either of the delta value or the existing |
||||
* data are doubles, both values will be interpreted as doubles. Double |
||||
* arithmetic and representation of double values follow IEEE 754 semantics. If |
||||
* there is positive/negative integer overflow, the sum is calculated as a |
||||
* double. |
||||
* |
||||
* @param delta the amount to modify the current value atomically. |
||||
* @return a placeholder value for modifying data atomically server-side. |
||||
*/ |
||||
+ (NSDictionary *)increment:(NSNumber *)delta NS_SWIFT_NAME(increment(_:)); |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRMutableData.h" |
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/**
|
||||
* Used for runTransactionBlock:. An FIRTransactionResult instance is a |
||||
* container for the results of the transaction. |
||||
*/ |
||||
NS_SWIFT_NAME(TransactionResult) |
||||
@interface FIRTransactionResult : NSObject |
||||
|
||||
/**
|
||||
* Used for runTransactionBlock:. Indicates that the new value should be saved |
||||
* at this location |
||||
* |
||||
* @param value A FIRMutableData instance containing the new value to be set |
||||
* @return An FIRTransactionResult instance that can be used as a return value |
||||
* from the block given to runTransactionBlock: |
||||
*/ |
||||
+ (FIRTransactionResult *)successWithValue:(FIRMutableData *)value; |
||||
|
||||
/**
|
||||
* Used for runTransactionBlock:. Indicates that the current transaction should |
||||
* no longer proceed. |
||||
* |
||||
* @return An FIRTransactionResult instance that can be used as a return value |
||||
* from the block given to runTransactionBlock: |
||||
*/ |
||||
+ (FIRTransactionResult *)abort; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2017 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#ifndef FirebaseDatabase_h |
||||
#define FirebaseDatabase_h |
||||
|
||||
#import "FIRDataEventType.h" |
||||
#import "FIRDataSnapshot.h" |
||||
#import "FIRDatabase.h" |
||||
#import "FIRDatabaseQuery.h" |
||||
#import "FIRDatabaseReference.h" |
||||
#import "FIRMutableData.h" |
||||
#import "FIRServerValue.h" |
||||
#import "FIRTransactionResult.h" |
||||
|
||||
#endif /* FirebaseDatabase_h */ |
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleExecutable</key> |
||||
<string>FirebaseDatabase</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.firebase.Firebase-FirebaseDatabase</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>FirebaseDatabase</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>8.2.0</string> |
||||
<key>DTSDKName</key> |
||||
<string>iphonesimulator11.2</string> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,14 @@
|
||||
framework module FirebaseDatabase { |
||||
umbrella header "FirebaseDatabase.h" |
||||
export * |
||||
module * { export * } |
||||
link framework "AppKit" |
||||
link framework "CFNetwork" |
||||
link framework "CoreTelephony" |
||||
link framework "Foundation" |
||||
link framework "Security" |
||||
link framework "SystemConfiguration" |
||||
link "c++" |
||||
link "icucore" |
||||
link "z" |
||||
} |
Binary file not shown.
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright 2019 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
@class FIRApp; |
||||
@class FIRInstallationsAuthTokenResult; |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** A notification with this name is sent each time an installation is created or deleted. */ |
||||
// clang-format off
|
||||
// clang-format12 merges the next two lines.
|
||||
FOUNDATION_EXPORT const NSNotificationName FIRInstallationIDDidChangeNotification |
||||
NS_SWIFT_NAME(InstallationIDDidChange); |
||||
/** `userInfo` key for the `FirebaseApp.name` in `FIRInstallationIDDidChangeNotification`. */ |
||||
FOUNDATION_EXPORT NSString *const kFIRInstallationIDDidChangeNotificationAppNameKey |
||||
NS_SWIFT_NAME(InstallationIDDidChangeAppNameKey); |
||||
// clang-format on
|
||||
|
||||
/**
|
||||
* An installation ID handler block. |
||||
* @param identifier The installation ID string if exists or `nil` otherwise. |
||||
* @param error The error when `identifier == nil` or `nil` otherwise. |
||||
*/ |
||||
typedef void (^FIRInstallationsIDHandler)(NSString *__nullable identifier, |
||||
NSError *__nullable error) |
||||
NS_SWIFT_NAME(InstallationsIDHandler); |
||||
|
||||
/**
|
||||
* An authorization token handler block. |
||||
* @param tokenResult An instance of `InstallationsAuthTokenResult` in case of success or `nil` |
||||
* otherwise. |
||||
* @param error The error when `tokenResult == nil` or `nil` otherwise. |
||||
*/ |
||||
typedef void (^FIRInstallationsTokenHandler)( |
||||
FIRInstallationsAuthTokenResult *__nullable tokenResult, NSError *__nullable error) |
||||
NS_SWIFT_NAME(InstallationsTokenHandler); |
||||
|
||||
/**
|
||||
* The class provides API for Firebase Installations. |
||||
* Each configured `FirebaseApp` has a corresponding single instance of `Installations`. |
||||
* An instance of the class provides access to the installation info for the `FirebaseApp` as well |
||||
* as the ability to delete it. A Firebase Installation is unique by `FirebaseApp.name` and |
||||
* `FirebaseApp.options.googleAppID` . |
||||
*/ |
||||
NS_SWIFT_NAME(Installations) |
||||
@interface FIRInstallations : NSObject |
||||
|
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/**
|
||||
* Returns a default instance of `Installations`. |
||||
* @returns An instance of `Installations` for `FirebaseApp.defaultApp(). |
||||
* @throw Throws an exception if the default app is not configured yet or required `FirebaseApp` |
||||
* options are missing. |
||||
*/ |
||||
+ (FIRInstallations *)installations NS_SWIFT_NAME(installations()); |
||||
|
||||
/**
|
||||
* Returns an instance of `Installations` for an application. |
||||
* @param application A configured `FirebaseApp` instance. |
||||
* @returns An instance of `Installations` corresponding to the passed application. |
||||
* @throw Throws an exception if required `FirebaseApp` options are missing. |
||||
*/ |
||||
+ (FIRInstallations *)installationsWithApp:(FIRApp *)application |
||||
NS_SWIFT_NAME(installations(app:)); |
||||
|
||||
/**
|
||||
* The method creates or retrieves an installation ID. The installation ID is a stable identifier |
||||
* that uniquely identifies the app instance. NOTE: If the application already has an existing |
||||
* FirebaseInstanceID then the InstanceID identifier will be used. |
||||
* @param completion A completion handler which is invoked when the operation completes. See |
||||
* `InstallationsIDHandler` for additional details. |
||||
*/ |
||||
- (void)installationIDWithCompletion:(FIRInstallationsIDHandler)completion; |
||||
|
||||
/**
|
||||
* Retrieves (locally if it exists or from the server) a valid installation auth token. An existing |
||||
* token may be invalidated or expired, so it is recommended to fetch the installation auth token |
||||
* before each server request. The method does the same as `Installations.authTokenForcingRefresh(:, |
||||
* completion:)` with forcing refresh `NO`. |
||||
* @param completion A completion handler which is invoked when the operation completes. See |
||||
* `InstallationsTokenHandler` for additional details. |
||||
*/ |
||||
- (void)authTokenWithCompletion:(FIRInstallationsTokenHandler)completion; |
||||
|
||||
/**
|
||||
* Retrieves (locally or from the server depending on `forceRefresh` value) a valid installation |
||||
* auth token. An existing token may be invalidated or expire, so it is recommended to fetch the |
||||
* installation auth token before each server request. This method should be used with `forceRefresh |
||||
* == YES` when e.g. a request with the previously fetched installation auth token failed with "Not |
||||
* Authorized" error. |
||||
* @param forceRefresh If `YES` then the locally cached installation auth token will be ignored and |
||||
* a new one will be requested from the server. If `NO`, then the locally cached installation auth |
||||
* token will be returned if exists and has not expired yet. |
||||
* @param completion A completion handler which is invoked when the operation completes. See |
||||
* `InstallationsTokenHandler` for additional details. |
||||
*/ |
||||
- (void)authTokenForcingRefresh:(BOOL)forceRefresh |
||||
completion:(FIRInstallationsTokenHandler)completion; |
||||
|
||||
/**
|
||||
* Deletes all the installation data including the unique identifier, auth tokens and |
||||
* all related data on the server side. A network connection is required for the method to |
||||
* succeed. If fails, the existing installation data remains untouched. |
||||
* @param completion A completion handler which is invoked when the operation completes. `error == |
||||
* nil` indicates success. |
||||
*/ |
||||
- (void)deleteWithCompletion:(void (^)(NSError *__nullable error))completion; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2019 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** The class represents a result of the installation auth token request. */ |
||||
NS_SWIFT_NAME(InstallationsAuthTokenResult) |
||||
@interface FIRInstallationsAuthTokenResult : NSObject |
||||
|
||||
/** The installation auth token string. */ |
||||
@property(nonatomic, readonly) NSString *authToken; |
||||
|
||||
/** The installation auth token expiration date. */ |
||||
@property(nonatomic, readonly) NSDate *expirationDate; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2019 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
extern NSString *const kFirebaseInstallationsErrorDomain; |
||||
|
||||
typedef NS_ENUM(NSUInteger, FIRInstallationsErrorCode) { |
||||
/** Unknown error. See `userInfo` for details. */ |
||||
FIRInstallationsErrorCodeUnknown = 0, |
||||
|
||||
/** Keychain error. See `userInfo` for details. */ |
||||
FIRInstallationsErrorCodeKeychain = 1, |
||||
|
||||
/** Server unreachable. A network error or server is unavailable. See `userInfo` for details. */ |
||||
FIRInstallationsErrorCodeServerUnreachable = 2, |
||||
|
||||
/** FirebaseApp configuration issues e.g. invalid GMP-App-ID, etc. See `userInfo` for details. */ |
||||
FIRInstallationsErrorCodeInvalidConfiguration = 3, |
||||
|
||||
} NS_SWIFT_NAME(InstallationsErrorCode); |
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2019 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import "FIRInstallations.h" |
||||
#import "FIRInstallationsAuthTokenResult.h" |
||||
#import "FIRInstallationsErrors.h" |
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleExecutable</key> |
||||
<string>FirebaseInstallations</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>com.firebase.Firebase-FirebaseInstallations</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>FirebaseInstallations</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>FMWK</string> |
||||
<key>CFBundleVersion</key> |
||||
<string>8.2.0</string> |
||||
<key>DTSDKName</key> |
||||
<string>iphonesimulator11.2</string> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,11 @@
|
||||
framework module FirebaseInstallations { |
||||
umbrella header "FirebaseInstallations.h" |
||||
export * |
||||
module * { export * } |
||||
link framework "AppKit" |
||||
link framework "CoreTelephony" |
||||
link framework "Foundation" |
||||
link framework "Security" |
||||
link framework "SystemConfiguration" |
||||
link "z" |
||||
} |
Binary file not shown.
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2018 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** This class manages the device clock and produces snapshots of the current time. */ |
||||
@interface GDTCORClock : NSObject <NSSecureCoding> |
||||
|
||||
/** The wallclock time, UTC, in milliseconds. */ |
||||
@property(nonatomic, readonly) int64_t timeMillis; |
||||
|
||||
/** The offset from UTC in seconds. */ |
||||
@property(nonatomic, readonly) int64_t timezoneOffsetSeconds; |
||||
|
||||
/** The kernel boot time when this clock was created in nanoseconds. */ |
||||
@property(nonatomic, readonly) int64_t kernelBootTimeNanoseconds; |
||||
|
||||
/** The device uptime when this clock was created in nanoseconds. */ |
||||
@property(nonatomic, readonly) int64_t uptimeNanoseconds; |
||||
|
||||
@property(nonatomic, readonly) int64_t kernelBootTime DEPRECATED_MSG_ATTRIBUTE( |
||||
"Please use `kernelBootTimeNanoseconds` instead"); |
||||
|
||||
@property(nonatomic, readonly) |
||||
int64_t uptime DEPRECATED_MSG_ATTRIBUTE("Please use `uptimeNanoseconds` instead"); |
||||
|
||||
/** Creates a GDTCORClock object using the current time and offsets.
|
||||
* |
||||
* @return A new GDTCORClock object representing the current time state. |
||||
*/ |
||||
+ (instancetype)snapshot; |
||||
|
||||
/** Creates a GDTCORClock object representing a time in the future, relative to now.
|
||||
* |
||||
* @param millisInTheFuture The millis in the future from now this clock should represent. |
||||
* @return An instance representing a future time. |
||||
*/ |
||||
+ (instancetype)clockSnapshotInTheFuture:(uint64_t)millisInTheFuture; |
||||
|
||||
/** Compares one clock with another, returns YES if the caller is after the parameter.
|
||||
* |
||||
* @return YES if the calling clock's time is after the given clock's time. |
||||
*/ |
||||
- (BOOL)isAfter:(GDTCORClock *)otherClock; |
||||
|
||||
/** Returns value of `uptime` property in milliseconds. */ |
||||
- (int64_t)uptimeMilliseconds; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Copyright 2018 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
/** The current logging level. This value and higher will be printed. Declared as volatile to make
|
||||
* getting and setting atomic. |
||||
*/ |
||||
FOUNDATION_EXPORT volatile NSInteger GDTCORConsoleLoggerLoggingLevel; |
||||
|
||||
/** A list of logging levels that GDT supports. */ |
||||
typedef NS_ENUM(NSInteger, GDTCORLoggingLevel) { |
||||
|
||||
/** Causes all logs to be printed. */ |
||||
GDTCORLoggingLevelDebug = 1, |
||||
|
||||
/** Causes all non-debug logs to be printed. */ |
||||
GDTCORLoggingLevelVerbose = 2, |
||||
|
||||
/** Causes warnings and errors to be printed. */ |
||||
GDTCORLoggingLevelWarnings = 3, |
||||
|
||||
/** Causes errors to be printed. This is the default value. */ |
||||
GDTCORLoggingLevelErrors = 4 |
||||
}; |
||||
|
||||
/** A list of message codes to print in the logger that help to correspond printed messages with
|
||||
* code locations. |
||||
* |
||||
* Prefixes: |
||||
* - MCD => MessageCodeDebug |
||||
* - MCW => MessageCodeWarning |
||||
* - MCE => MessageCodeError |
||||
*/ |
||||
typedef NS_ENUM(NSInteger, GDTCORMessageCode) { |
||||
|
||||
/** For debug logs. */ |
||||
GDTCORMCDDebugLog = 0, |
||||
|
||||
/** For warning messages concerning transportBytes: not being implemented by a data object. */ |
||||
GDTCORMCWDataObjectMissingBytesImpl = 1, |
||||
|
||||
/** For warning messages concerning a failed event upload. */ |
||||
GDTCORMCWUploadFailed = 2, |
||||
|
||||
/** For warning messages concerning a forced event upload. */ |
||||
GDTCORMCWForcedUpload = 3, |
||||
|
||||
/** For warning messages concerning a failed reachability call. */ |
||||
GDTCORMCWReachabilityFailed = 4, |
||||
|
||||
/** For warning messages concerning a database warning. */ |
||||
GDTCORMCWDatabaseWarning = 5, |
||||
|
||||
/** For warning messages concerning the reading of a event file. */ |
||||
GDTCORMCWFileReadError = 6, |
||||
|
||||
/** For error messages concerning transformGDTEvent: not being implemented by an event
|
||||
transformer. */ |
||||
GDTCORMCETransformerDoesntImplementTransform = 1000, |
||||
|
||||
/** For error messages concerning the creation of a directory failing. */ |
||||
GDTCORMCEDirectoryCreationError = 1001, |
||||
|
||||
/** For error messages concerning the writing of a event file. */ |
||||
GDTCORMCEFileWriteError = 1002, |
||||
|
||||
/** For error messages concerning the lack of a prioritizer for a given backend. */ |
||||
GDTCORMCEPrioritizerError = 1003, |
||||
|
||||
/** For error messages concerning a package delivery API violation. */ |
||||
GDTCORMCEDeliverTwice = 1004, |
||||
|
||||
/** For error messages concerning an error in an implementation of -transportBytes. */ |
||||
GDTCORMCETransportBytesError = 1005, |
||||
|
||||
/** For general purpose error messages in a dependency. */ |
||||
GDTCORMCEGeneralError = 1006, |
||||
|
||||
/** For fatal errors. Please go to https://github.com/firebase/firebase-ios-sdk/issues and open
|
||||
* an issue if you encounter an error with this code. |
||||
*/ |
||||
GDTCORMCEFatalAssertion = 1007, |
||||
|
||||
/** For error messages concerning the reading of a event file. */ |
||||
GDTCORMCEFileReadError = 1008, |
||||
|
||||
/** For errors related to running sqlite. */ |
||||
GDTCORMCEDatabaseError = 1009, |
||||
}; |
||||
|
||||
/** Prints the given code and format string to the console.
|
||||
* |
||||
* @param code The message code describing the nature of the log. |
||||
* @param logLevel The log level of this log. |
||||
* @param format The format string. |
||||
*/ |
||||
FOUNDATION_EXPORT |
||||
void GDTCORLog(GDTCORMessageCode code, GDTCORLoggingLevel logLevel, NSString *_Nonnull format, ...) |
||||
NS_FORMAT_FUNCTION(3, 4); |
||||
|
||||
/** Prints an assert log to the console.
|
||||
* |
||||
* @param wasFatal Send YES if the assertion should be fatal, NO otherwise. |
||||
* @param file The file in which the failure occurred. |
||||
* @param line The line number of the failure. |
||||
* @param format The format string. |
||||
*/ |
||||
FOUNDATION_EXPORT void GDTCORLogAssert(BOOL wasFatal, |
||||
NSString *_Nonnull file, |
||||
NSInteger line, |
||||
NSString *_Nullable format, |
||||
...) NS_FORMAT_FUNCTION(4, 5); |
||||
|
||||
/** Returns the string that represents some message code.
|
||||
* |
||||
* @param code The code to convert to a string. |
||||
* @return The string representing the message code. |
||||
*/ |
||||
FOUNDATION_EXPORT NSString *_Nonnull GDTCORMessageCodeEnumToString(GDTCORMessageCode code); |
||||
|
||||
#define GDTCORLogDebug(MESSAGE_FORMAT, ...) \ |
||||
GDTCORLog(GDTCORMCDDebugLog, GDTCORLoggingLevelDebug, MESSAGE_FORMAT, __VA_ARGS__); |
||||
|
||||
// A define to wrap GULLogWarning with slightly more convenient usage.
|
||||
#define GDTCORLogWarning(MESSAGE_CODE, MESSAGE_FORMAT, ...) \ |
||||
GDTCORLog(MESSAGE_CODE, GDTCORLoggingLevelWarnings, MESSAGE_FORMAT, __VA_ARGS__); |
||||
|
||||
// A define to wrap GULLogError with slightly more convenient usage and a failing assert.
|
||||
#define GDTCORLogError(MESSAGE_CODE, MESSAGE_FORMAT, ...) \ |
||||
GDTCORLog(MESSAGE_CODE, GDTCORLoggingLevelErrors, MESSAGE_FORMAT, __VA_ARGS__); |
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2018 Google LLC |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
#import "GDTCORTargets.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/* Class that manages the endpoints used by Google data transport library. */ |
||||
@interface GDTCOREndpoints : NSObject |
||||
|
||||
- (instancetype)init NS_UNAVAILABLE; |
||||
|
||||
/** Returns the upload URL for a target specified. If the target is not available, returns nil.
|
||||
* |
||||
* @param target GoogleDataTransport target for which the upload URL is being looked up for. |
||||
* @return URL that will be used for uploading the events for the provided target. |
||||
*/ |
||||
+ (nullable NSURL *)uploadURLForTarget:(GDTCORTarget)target; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright 2018 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
#import "GDTCOREventDataObject.h" |
||||
#import "GDTCORTargets.h" |
||||
|
||||
@class GDTCORClock; |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** The different possible quality of service specifiers. High values indicate high priority. */ |
||||
typedef NS_ENUM(NSInteger, GDTCOREventQoS) { |
||||
/** The QoS tier wasn't set, and won't ever be sent. */ |
||||
GDTCOREventQoSUnknown = 0, |
||||
|
||||
/** This event is internal telemetry data that should not be sent on its own if possible. */ |
||||
GDTCOREventQoSTelemetry = 1, |
||||
|
||||
/** This event should be sent, but in a batch only roughly once per day. */ |
||||
GDTCOREventQoSDaily = 2, |
||||
|
||||
/** This event should be sent when requested by the uploader. */ |
||||
GDTCOREventQosDefault = 3, |
||||
|
||||
/** This event should be sent immediately along with any other data that can be batched. */ |
||||
GDTCOREventQoSFast = 4, |
||||
|
||||
/** This event should only be uploaded on wifi. */ |
||||
GDTCOREventQoSWifiOnly = 5, |
||||
}; |
||||
|
||||
@interface GDTCOREvent : NSObject <NSSecureCoding> |
||||
|
||||
/** The unique ID of the event. */ |
||||
@property(readonly, nonatomic) NSString *eventID; |
||||
|
||||
/** The mapping identifier, to allow backends to map the transport bytes to a proto. */ |
||||
@property(nullable, readonly, nonatomic) NSString *mappingID; |
||||
|
||||
/** The identifier for the backend this event will eventually be sent to. */ |
||||
@property(readonly, nonatomic) GDTCORTarget target; |
||||
|
||||
/** The data object encapsulated in the transport of your choice, as long as it implements
|
||||
* the GDTCOREventDataObject protocol. */ |
||||
@property(nullable, nonatomic) id<GDTCOREventDataObject> dataObject; |
||||
|
||||
/** The serialized bytes from calling [dataObject transportBytes]. */ |
||||
@property(nullable, readonly, nonatomic) NSData *serializedDataObjectBytes; |
||||
|
||||
/** The quality of service tier this event belongs to. */ |
||||
@property(nonatomic) GDTCOREventQoS qosTier; |
||||
|
||||
/** The clock snapshot at the time of the event. */ |
||||
@property(nonatomic) GDTCORClock *clockSnapshot; |
||||
|
||||
/** The expiration date of the event. Default is 604800 seconds (7 days) from creation. */ |
||||
@property(nonatomic) NSDate *expirationDate; |
||||
|
||||
/** Bytes that can be used by an uploader later on. */ |
||||
@property(nullable, nonatomic) NSData *customBytes; |
||||
|
||||
/** Initializes an instance using the given mappingID.
|
||||
* |
||||
* @param mappingID The mapping identifier. |
||||
* @param target The event's target identifier. |
||||
* @return An instance of this class. |
||||
*/ |
||||
- (nullable instancetype)initWithMappingID:(NSString *)mappingID target:(GDTCORTarget)target; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2018 Google |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
#import <Foundation/Foundation.h> |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
/** This protocol defines the common interface that event protos should implement regardless of the
|
||||
* underlying transport technology (protobuf, nanopb, etc). |
||||
*/ |
||||
@protocol GDTCOREventDataObject <NSObject> |
||||
|
||||
@required |
||||
|
||||
/** Returns the serialized proto bytes of the implementing event proto.
|
||||
* |
||||
* @return the serialized proto bytes of the implementing event proto. |
||||
*/ |
||||
- (NSData *)transportBytes; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue