Abhishek Banthia
9 years ago
27 changed files with 2170 additions and 87 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,54 @@
|
||||
//
|
||||
// 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 |
@ -0,0 +1,41 @@
|
||||
//
|
||||
// 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 |
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 |
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* 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. |
||||
*/ |
||||
- (BOOL) hasChildren; |
||||
|
||||
|
||||
/**
|
||||
* Return YES if the DataSnapshot contains a non-null value. |
||||
* |
||||
* @return YES if this snapshot contains a non-null value, otherwise NO. |
||||
*/ |
||||
- (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. |
||||
*/ |
||||
- (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 |
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 |
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* 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. |
||||
*/ |
||||
- (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 |
@ -0,0 +1,412 @@
|
||||
/*
|
||||
* 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. |
||||
*/ |
||||
- (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. |
||||
*/ |
||||
- (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. |
||||
*/ |
||||
- (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 |
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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
@ -0,0 +1,34 @@
|
||||
#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 |
@ -0,0 +1,5 @@
|
||||
@interface FirebaseServerValue : NSObject |
||||
|
||||
+ (NSDictionary *) timestamp; |
||||
|
||||
@end |
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
framework module Firebase { |
||||
umbrella header "Firebase.h" |
||||
|
||||
export * |
||||
module * { export * } |
||||
} |
@ -0,0 +1,47 @@
|
||||
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. |
Loading…
Reference in new issue