motion-firebase 3.3.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -6
- data/lib/firebase/version.rb +2 -2
- data/lib/geofire/geofire.rb +7 -0
- data/lib/geofire/version.rb +6 -0
- data/lib/motion-firebase.rb +0 -6
- data/lib/motion-geofire.rb +15 -0
- metadata +9 -23
- data/lib/firebase-auth/firebase_simple_login.rb +0 -25
- data/lib/motion-firebase-auth.rb +0 -10
- data/lib/vendor/Firebase.framework/Firebase +0 -0
- data/lib/vendor/Firebase.framework/Headers/FAuthData.h +0 -55
- data/lib/vendor/Firebase.framework/Headers/FAuthType.h +0 -41
- data/lib/vendor/Firebase.framework/Headers/FConfig.h +0 -69
- data/lib/vendor/Firebase.framework/Headers/FDataSnapshot.h +0 -154
- data/lib/vendor/Firebase.framework/Headers/FEventType.h +0 -43
- data/lib/vendor/Firebase.framework/Headers/FMutableData.h +0 -143
- data/lib/vendor/Firebase.framework/Headers/FQuery.h +0 -412
- data/lib/vendor/Firebase.framework/Headers/FTransactionResult.h +0 -53
- data/lib/vendor/Firebase.framework/Headers/Firebase.h +0 -1055
- data/lib/vendor/Firebase.framework/Headers/FirebaseApp.h +0 -34
- data/lib/vendor/Firebase.framework/Headers/FirebaseServerValue.h +0 -5
- data/lib/vendor/Firebase.framework/Info.plist +0 -0
- data/lib/vendor/Firebase.framework/Modules/module.modulemap +0 -6
- data/lib/vendor/Firebase.framework/NOTICE +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ff9e2c5dd3235b33e120a1f8be46069865f3f8b
|
4
|
+
data.tar.gz: 1420f420787074de3146bfc87271bab728a45dc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d766a5d89086a62ae8e97cd5602957442137c8af6aed0c5c39ff7cc36495cbb81a74c27284c9e2adecfaddd43ccf925b91408ee2527809bddc70706a5e2e74c3
|
7
|
+
data.tar.gz: c63387a9fa0db8fdf031ea8a3c594b9ceb22d7fc6b2c9e9e446dc697999a7d752c5ab114cbd72df4cb07dd8df68a64b93ba828cc187e0ad71dac3b341e11d4b0
|
data/README.md
CHANGED
@@ -10,13 +10,31 @@ For a Ruby (MRI) Firebase wrapper, check out <https://github.com/derailed/bigber
|
|
10
10
|
Installation
|
11
11
|
============
|
12
12
|
|
13
|
-
|
14
|
-
framework.
|
15
|
-
|
16
|
-
|
13
|
+
As of version 4.0, **motion-firebase** no longer ships with the Firebase
|
14
|
+
framework. It became impossible to ship with support for GeoFire *and*
|
15
|
+
Firebase, and CocoaPods is the preferred way to handle the dependencies between
|
16
|
+
these two frameworks. Plus, removing the frameworks from the gem makes it that
|
17
|
+
much smaller!
|
18
|
+
|
19
|
+
motion-firebase 4.0
|
20
|
+
========
|
21
|
+
|
22
|
+
Removed the "freeze-dried" Firebase.framework. Use CocoaPods to install the
|
23
|
+
framework (see the demo app's [Rakefile](Rakefile) and [Gemfile](Gemfile) to see
|
24
|
+
an example cocoapods setup). Or, TL;DR:
|
25
|
+
|
26
|
+
###### Gemfile
|
27
|
+
|
28
|
+
gem 'cocoapods'
|
29
|
+
gem 'motion-cocoapods'
|
30
|
+
|
31
|
+
###### Rakefile
|
32
|
+
|
33
|
+
app.pods do
|
34
|
+
pod 'Firebase'
|
35
|
+
pod 'GeoFire'
|
36
|
+
end
|
17
37
|
|
18
|
-
Also, it means that installation is easy! When you compile your RubyMotion
|
19
|
-
project, the Firebase SDK gets included automatically.
|
20
38
|
|
21
39
|
motion-firebase 3.0
|
22
40
|
========
|
data/lib/firebase/version.rb
CHANGED
data/lib/motion-firebase.rb
CHANGED
@@ -12,10 +12,4 @@ Motion::Project::App.setup do |app|
|
|
12
12
|
Dir.glob(File.join(File.dirname(__FILE__), 'firebase/**/*.rb')).reverse.each do |file|
|
13
13
|
app.files.insert(insert_point, file)
|
14
14
|
end
|
15
|
-
|
16
|
-
app.libs += ['/usr/lib/libicucore.dylib', '/usr/lib/libc++.dylib']
|
17
|
-
app.frameworks += ['CFNetwork', 'Security', 'SystemConfiguration']
|
18
|
-
# for twitter or facebook
|
19
|
-
app.weak_frameworks += ['Accounts', 'Social']
|
20
|
-
app.vendor_project(File.join(File.dirname(__FILE__), 'vendor/Firebase.framework'), :static, headers_dir: 'Headers', products: ['Firebase'], force_load: false)
|
21
15
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
unless defined?(Motion::Project::Config)
|
2
|
+
raise "The motion-geofire gem must be required within a RubyMotion project Rakefile."
|
3
|
+
end
|
4
|
+
|
5
|
+
|
6
|
+
Motion::Project::App.setup do |app|
|
7
|
+
# scans app.files until it finds app/ (the default)
|
8
|
+
# if found, it inserts just before those files, otherwise it will insert to
|
9
|
+
# the end of the list
|
10
|
+
insert_point = app.files.find_index { |file| file =~ /^(?:\.\/)?app\// } || 0
|
11
|
+
|
12
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'geofire/**/*.rb')).reverse.each do |file|
|
13
|
+
app.files.insert(insert_point, file)
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-firebase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin T.A. Gray
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Adds more rubyesque methods to the built-in classes.
|
@@ -18,6 +18,7 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
+
- README.md
|
21
22
|
- lib/firebase/fdata_snapshot.rb
|
22
23
|
- lib/firebase/firebase.rb
|
23
24
|
- lib/firebase/firebase_auth.rb
|
@@ -26,25 +27,10 @@ files:
|
|
26
27
|
- lib/firebase/firebase_twitter_helper.rb
|
27
28
|
- lib/firebase/fquery.rb
|
28
29
|
- lib/firebase/version.rb
|
29
|
-
- lib/
|
30
|
-
- lib/
|
30
|
+
- lib/geofire/geofire.rb
|
31
|
+
- lib/geofire/version.rb
|
31
32
|
- lib/motion-firebase.rb
|
32
|
-
- lib/
|
33
|
-
- lib/vendor/Firebase.framework/Headers/FAuthData.h
|
34
|
-
- lib/vendor/Firebase.framework/Headers/FAuthType.h
|
35
|
-
- lib/vendor/Firebase.framework/Headers/FConfig.h
|
36
|
-
- lib/vendor/Firebase.framework/Headers/FDataSnapshot.h
|
37
|
-
- lib/vendor/Firebase.framework/Headers/FEventType.h
|
38
|
-
- lib/vendor/Firebase.framework/Headers/Firebase.h
|
39
|
-
- lib/vendor/Firebase.framework/Headers/FirebaseApp.h
|
40
|
-
- lib/vendor/Firebase.framework/Headers/FirebaseServerValue.h
|
41
|
-
- lib/vendor/Firebase.framework/Headers/FMutableData.h
|
42
|
-
- lib/vendor/Firebase.framework/Headers/FQuery.h
|
43
|
-
- lib/vendor/Firebase.framework/Headers/FTransactionResult.h
|
44
|
-
- lib/vendor/Firebase.framework/Info.plist
|
45
|
-
- lib/vendor/Firebase.framework/Modules/module.modulemap
|
46
|
-
- lib/vendor/Firebase.framework/NOTICE
|
47
|
-
- README.md
|
33
|
+
- lib/motion-geofire.rb
|
48
34
|
homepage: https://github.com/colinta/motion-firebase
|
49
35
|
licenses:
|
50
36
|
- BSD
|
@@ -55,17 +41,17 @@ require_paths:
|
|
55
41
|
- lib
|
56
42
|
required_ruby_version: !ruby/object:Gem::Requirement
|
57
43
|
requirements:
|
58
|
-
- -
|
44
|
+
- - ">="
|
59
45
|
- !ruby/object:Gem::Version
|
60
46
|
version: '0'
|
61
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
48
|
requirements:
|
63
|
-
- -
|
49
|
+
- - ">="
|
64
50
|
- !ruby/object:Gem::Version
|
65
51
|
version: '0'
|
66
52
|
requirements: []
|
67
53
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.
|
54
|
+
rubygems_version: 2.4.5.1
|
69
55
|
signing_key:
|
70
56
|
specification_version: 4
|
71
57
|
summary: A RubyMotion wrapper for the Firebase iOS SDK
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class FirebaseSimpleLogin
|
2
|
-
|
3
|
-
def self.new(ref, options=nil)
|
4
|
-
if options
|
5
|
-
alloc.initWithRef(ref, options: options)
|
6
|
-
else
|
7
|
-
alloc.initWithRef(ref)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def check(&and_then)
|
12
|
-
checkAuthStatusWithBlock(and_then)
|
13
|
-
end
|
14
|
-
|
15
|
-
def update(credentials, &block)
|
16
|
-
raise "email is required in #{__method__}" unless credentials.key?(:email)
|
17
|
-
raise "old_password is required in #{__method__}" unless credentials.key?(:old_password)
|
18
|
-
raise "new_password is required in #{__method__}" unless credentials.key?(:new_password)
|
19
|
-
email = credentials[:email]
|
20
|
-
old_password = credentials[:old_password]
|
21
|
-
new_password = credentials[:new_password]
|
22
|
-
changePasswordForEmail(email, oldPassword: old_password, newPassword: new_password, completionBlock: block)
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
data/lib/motion-firebase-auth.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
unless defined?(Motion::Project::Config)
|
2
|
-
raise "The motion-firebase-auth gem must be required within a RubyMotion project Rakefile."
|
3
|
-
end
|
4
|
-
|
5
|
-
|
6
|
-
Motion::Project::App.setup do |app|
|
7
|
-
app.warn 'Firebase', 'As of version 1.2.2 of Firebase (motion-firebase version 3.0.0), you no'
|
8
|
-
app.warn '', 'longer need to include motion-firebase-auth, because FirebaseSimpleLogin'
|
9
|
-
app.warn '', 'is part of the core Firebase SDK.'
|
10
|
-
end
|
Binary file
|
@@ -1,55 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// FAuthData.h
|
3
|
-
// Firebase
|
4
|
-
//
|
5
|
-
// Created by Katherine Fang on 7/30/14.
|
6
|
-
//
|
7
|
-
|
8
|
-
#import <Accounts/Accounts.h>
|
9
|
-
#import "FAuthType.h"
|
10
|
-
|
11
|
-
|
12
|
-
/**
|
13
|
-
* The FAuthData class is a wrapper around the user metadata returned from the Firebase auth server.
|
14
|
-
* It includes the provider authenticated against, a uid (with the possible exception of authenticating against a custom
|
15
|
-
* backend), and a token used to authenticate with Firebase.
|
16
|
-
*
|
17
|
-
* It may include other metadata about the user, depending on the provider used to do the authentication.
|
18
|
-
*/
|
19
|
-
@interface FAuthData : NSObject
|
20
|
-
|
21
|
-
/**
|
22
|
-
* @return Raw authentication token payload returned by the server
|
23
|
-
*/
|
24
|
-
@property (nonatomic, strong, readonly) NSDictionary *auth;
|
25
|
-
|
26
|
-
/**
|
27
|
-
* @return Authentication token expiration timestamp (seconds since epoch) returned by the server
|
28
|
-
*/
|
29
|
-
@property (nonatomic, strong, readonly) NSNumber *expires;
|
30
|
-
|
31
|
-
/**
|
32
|
-
* @return A uid for this user. It is unique across all auth providers.
|
33
|
-
*/
|
34
|
-
@property (nonatomic, strong, readonly) NSString *uid;
|
35
|
-
|
36
|
-
|
37
|
-
/**
|
38
|
-
* @return The provider that authenticated this user
|
39
|
-
*/
|
40
|
-
@property (nonatomic, readonly) NSString *provider;
|
41
|
-
|
42
|
-
|
43
|
-
/**
|
44
|
-
* @return The token that was used to authenticate this user with Firebase
|
45
|
-
*/
|
46
|
-
@property (nonatomic, strong, readonly) NSString *token;
|
47
|
-
|
48
|
-
|
49
|
-
/**
|
50
|
-
* @return Provider data keyed by provider. Includes cached data from third-party providers
|
51
|
-
*/
|
52
|
-
@property (nonatomic, strong, readonly) NSDictionary *providerData;
|
53
|
-
|
54
|
-
|
55
|
-
@end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// FAuthType.h
|
3
|
-
// Firebase
|
4
|
-
//
|
5
|
-
// Created by Katherine Fang on 7/30/14.
|
6
|
-
//
|
7
|
-
// All public-facing auth enums.
|
8
|
-
//
|
9
|
-
|
10
|
-
#ifndef Firebase_FAuthenticationTypes_h
|
11
|
-
#define Firebase_FAuthenticationTypes_h
|
12
|
-
|
13
|
-
typedef NS_ENUM(NSInteger, FAuthenticationError) {
|
14
|
-
// Developer / Config Errors
|
15
|
-
FAuthenticationErrorProviderDisabled = -1,
|
16
|
-
FAuthenticationErrorInvalidConfiguration = -2,
|
17
|
-
FAuthenticationErrorInvalidOrigin = -3,
|
18
|
-
FAuthenticationErrorInvalidProvider = -4,
|
19
|
-
|
20
|
-
// User Errors (Email / Password)
|
21
|
-
FAuthenticationErrorInvalidEmail = -5,
|
22
|
-
FAuthenticationErrorInvalidPassword = -6,
|
23
|
-
FAuthenticationErrorInvalidToken = -7,
|
24
|
-
FAuthenticationErrorUserDoesNotExist = -8,
|
25
|
-
FAuthenticationErrorEmailTaken = -9,
|
26
|
-
|
27
|
-
// User Errors (Facebook / Twitter / Github / Google)
|
28
|
-
FAuthenticationErrorDeniedByUser = -10,
|
29
|
-
FAuthenticationErrorInvalidCredentials = -11,
|
30
|
-
FAuthenticationErrorInvalidArguments = -12,
|
31
|
-
FAuthenticationErrorProviderError = -13,
|
32
|
-
FAuthenticationErrorLimitsExceeded = -14,
|
33
|
-
|
34
|
-
// Client side errors
|
35
|
-
FAuthenticationErrorNetworkError = -15,
|
36
|
-
FAuthenticationErrorPreempted = -16,
|
37
|
-
|
38
|
-
FAuthenticationErrorUnknown = -9999
|
39
|
-
};
|
40
|
-
|
41
|
-
#endif
|
@@ -1,69 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Firebase iOS Client Library
|
3
|
-
*
|
4
|
-
* Copyright © 2015 Firebase - All Rights Reserved
|
5
|
-
* https://www.firebase.com
|
6
|
-
*
|
7
|
-
* Redistribution and use in source and binary forms, with or without
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
9
|
-
*
|
10
|
-
* 1. Redistributions of source code must retain the above copyright notice, this
|
11
|
-
* list of conditions and the following disclaimer.
|
12
|
-
*
|
13
|
-
* 2. Redistributions in binaryform must reproduce the above copyright notice,
|
14
|
-
* this list of conditions and the following disclaimer in the documentation
|
15
|
-
* and/or other materials provided with the distribution.
|
16
|
-
*
|
17
|
-
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR
|
18
|
-
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
19
|
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
20
|
-
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT,
|
21
|
-
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
22
|
-
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
25
|
-
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
-
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
*/
|
28
|
-
|
29
|
-
#import <Foundation/Foundation.h>
|
30
|
-
|
31
|
-
/**
|
32
|
-
* Configuration object for Firebase. You can get the default FConfig object via
|
33
|
-
* `[Firebase defaultConfig]` and modify it. You must make all changes to it before
|
34
|
-
* you create your first Firebase instance.
|
35
|
-
*/
|
36
|
-
@interface FConfig : NSObject
|
37
|
-
|
38
|
-
/**
|
39
|
-
* By default the Firebase client will keep data in memory while your application is running, but not
|
40
|
-
* when it is restarted. By setting this value to YES, the data will be persisted to on-device (disk)
|
41
|
-
* storage and will thus be available again when the app is restarted (even when there is no network
|
42
|
-
* connectivity at that time). Note that this property must be set before creating your first Firebase
|
43
|
-
* reference and only needs to be called once per application.
|
44
|
-
*
|
45
|
-
* If your app uses Firebase Authentication, the client will automatically persist the user's authentication
|
46
|
-
* token across restarts, even without persistence enabled. But if the auth token expired while offline and
|
47
|
-
* you've enabled persistence, the client will pause write operations until you successfully re-authenticate
|
48
|
-
* (or explicitly unauthenticate) to prevent your writes from being sent unauthenticated and failing due to
|
49
|
-
* security rules.
|
50
|
-
*/
|
51
|
-
@property (nonatomic) BOOL persistenceEnabled;
|
52
|
-
|
53
|
-
/**
|
54
|
-
* By default Firebase will use up to 10MB of disk space to cache data. If the cache grows beyond this size,
|
55
|
-
* Firebase will start removing data that hasn't been recently used. If you find that your application caches too
|
56
|
-
* little or too much data, call this method to change the cache size. This property must be set before creating
|
57
|
-
* your first Firebase reference and only needs to be called once per application.
|
58
|
-
*
|
59
|
-
* Note that the specified cache size is only an approximation and the size on disk may temporarily exceed it
|
60
|
-
* at times.
|
61
|
-
*/
|
62
|
-
@property (nonatomic) NSUInteger persistenceCacheSizeBytes;
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Sets the dispatch queue on which all events are raised. The default queue is the main queue.
|
66
|
-
*/
|
67
|
-
@property (nonatomic, strong) dispatch_queue_t callbackQueue;
|
68
|
-
|
69
|
-
@end
|
@@ -1,154 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Firebase iOS Client Library
|
3
|
-
*
|
4
|
-
* Copyright © 2013 Firebase - All Rights Reserved
|
5
|
-
* https://www.firebase.com
|
6
|
-
*
|
7
|
-
* Redistribution and use in source and binary forms, with or without
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
9
|
-
*
|
10
|
-
* 1. Redistributions of source code must retain the above copyright notice, this
|
11
|
-
* list of conditions and the following disclaimer.
|
12
|
-
*
|
13
|
-
* 2. Redistributions in binaryform must reproduce the above copyright notice,
|
14
|
-
* this list of conditions and the following disclaimer in the documentation
|
15
|
-
* and/or other materials provided with the distribution.
|
16
|
-
*
|
17
|
-
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR
|
18
|
-
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
19
|
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
20
|
-
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT,
|
21
|
-
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
22
|
-
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
25
|
-
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
26
|
-
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
|
-
*/
|
28
|
-
|
29
|
-
#import <Foundation/Foundation.h>
|
30
|
-
|
31
|
-
@class Firebase;
|
32
|
-
|
33
|
-
/**
|
34
|
-
* An FDataSnapshot contains data from a Firebase location. Any time you read
|
35
|
-
* Firebase data, you receive the data as an FDataSnapshot.
|
36
|
-
*
|
37
|
-
* FDataSnapshots are passed to the blocks you attach with observeEventType:withBlock: or observeSingleEvent:withBlock:.
|
38
|
-
* They are efficiently-generated immutable copies of the data at a Firebase location.
|
39
|
-
* They can't be modified and will never change. To modify data at a location,
|
40
|
-
* use a Firebase reference (e.g. with setValue:).
|
41
|
-
*/
|
42
|
-
@interface FDataSnapshot : NSObject
|
43
|
-
|
44
|
-
|
45
|
-
/** @name Navigating and inspecting a snapshot */
|
46
|
-
|
47
|
-
/**
|
48
|
-
* Get an FDataSnapshot for the location at the specified relative path.
|
49
|
-
* The relative path can either be a simple child key (e.g. 'fred')
|
50
|
-
* or a deeper slash-separated path (e.g. 'fred/name/first'). If the child
|
51
|
-
* location has no data, an empty FDataSnapshot is returned.
|
52
|
-
*
|
53
|
-
* @param childPathString A relative path to the location of child data.
|
54
|
-
* @return The FDataSnapshot for the child location.
|
55
|
-
*/
|
56
|
-
- (FDataSnapshot *) childSnapshotForPath:(NSString *)childPathString;
|
57
|
-
|
58
|
-
|
59
|
-
/**
|
60
|
-
* Return YES if the specified child exists.
|
61
|
-
*
|
62
|
-
* @param childPathString A relative path to the location of a potential child.
|
63
|
-
* @return YES if data exists at the specified childPathString, else false.
|
64
|
-
*/
|
65
|
-
- (BOOL) hasChild:(NSString *)childPathString;
|
66
|
-
|
67
|
-
|
68
|
-
/**
|
69
|
-
* Return YES if the DataSnapshot has any children.
|
70
|
-
*
|
71
|
-
* @return YES if this snapshot has any children, else NO.
|
72
|
-
*/
|
73
|
-
- (BOOL) hasChildren;
|
74
|
-
|
75
|
-
|
76
|
-
/**
|
77
|
-
* Return YES if the DataSnapshot contains a non-null value.
|
78
|
-
*
|
79
|
-
* @return YES if this snapshot contains a non-null value, otherwise NO.
|
80
|
-
*/
|
81
|
-
- (BOOL) exists;
|
82
|
-
|
83
|
-
|
84
|
-
/** @name Data export */
|
85
|
-
|
86
|
-
/**
|
87
|
-
* Returns the raw value at this location, coupled with any metadata, such as priority.
|
88
|
-
*
|
89
|
-
* Priorities, where they exist, are accessible under the ".priority" key in instances of NSDictionary.
|
90
|
-
* For leaf locations with priorities, the value will be under the ".value" key.
|
91
|
-
*/
|
92
|
-
- (id) valueInExportFormat;
|
93
|
-
|
94
|
-
|
95
|
-
/** @name Properties */
|
96
|
-
|
97
|
-
/**
|
98
|
-
* Returns the contents of this data snapshot as native types.
|
99
|
-
*
|
100
|
-
* Data types returned:
|
101
|
-
* * NSDictionary
|
102
|
-
* * NSArray
|
103
|
-
* * NSNumber (also includes booleans)
|
104
|
-
* * NSString
|
105
|
-
*
|
106
|
-
* @return The data as a native object.
|
107
|
-
*/
|
108
|
-
@property (strong, readonly, nonatomic) id value;
|
109
|
-
|
110
|
-
|
111
|
-
/**
|
112
|
-
* Get the number of children for this DataSnapshot.
|
113
|
-
*
|
114
|
-
* @return An integer indicating the number of children.
|
115
|
-
*/
|
116
|
-
@property (readonly, nonatomic) NSUInteger childrenCount;
|
117
|
-
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Get a Firebase reference for the location that this data came from
|
121
|
-
*
|
122
|
-
* @return A Firebase instance for the location of this data
|
123
|
-
*/
|
124
|
-
@property (nonatomic, readonly, strong) Firebase* ref;
|
125
|
-
|
126
|
-
|
127
|
-
/**
|
128
|
-
* The key of the location that generated this FDataSnapshot.
|
129
|
-
*
|
130
|
-
* @return An NSString containing the key for the location of this FDataSnapshot.
|
131
|
-
*/
|
132
|
-
@property (strong, readonly, nonatomic) NSString* key;
|
133
|
-
|
134
|
-
|
135
|
-
/**
|
136
|
-
* An iterator for snapshots of the child nodes in this snapshot.
|
137
|
-
* You can use the native for..in syntax:
|
138
|
-
*
|
139
|
-
* for (FDataSnapshot* child in snapshot.children) {
|
140
|
-
* ...
|
141
|
-
* }
|
142
|
-
*
|
143
|
-
* @return An NSEnumerator of the children
|
144
|
-
*/
|
145
|
-
@property (strong, readonly, nonatomic) NSEnumerator* children;
|
146
|
-
|
147
|
-
/**
|
148
|
-
* The priority of the data in this FDataSnapshot.
|
149
|
-
*
|
150
|
-
* @return The priority as a string, or nil if no priority was set.
|
151
|
-
*/
|
152
|
-
@property (strong, readonly, nonatomic) id priority;
|
153
|
-
|
154
|
-
@end
|