motion-firebase 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60e59da0ad361fda56da106ad5b317dff1413fd5
4
- data.tar.gz: d46db22cead3e0f4455a59507d3c1812a5465963
3
+ metadata.gz: a836267803940dab7d7fa449384c26ca16fea8b9
4
+ data.tar.gz: 3a4bac7a7dd5e711d29225d9103cf94f3b654ca1
5
5
  SHA512:
6
- metadata.gz: 4ab1a76883b13ed95f00d53986f644626a045bd8b657a2e162202c665a66973777a106ab4a5aefa3f9937e85524704385561145db9badea931765c2b7bb71a8c
7
- data.tar.gz: 283046efed7b4599fd7d21a681b13b6adc88874098001a754d217108689135bdb4c21f19560719fa88b30d77dfdb1906cd081861ada08de28756e3a6f6c53edd
6
+ metadata.gz: ba5dd0c2868c7d2a924e64e1e18f71beb90032682f9a4f75c49a730d6a3a9b41ead8dc8b788db77cbac46586aa9d3b469631fe64612d3c0befdf6fd1180c59f1
7
+ data.tar.gz: c80a81067f533f510182c246e7f77b8bc620662f255bd11d025e007a4df672798dff27dc4c7b56c39bf8a18f62cd5c428af66b0b1a0a3d3356b8ffb258533dee
@@ -1,6 +1,6 @@
1
1
  module Motion
2
2
  module Firebase
3
- Version = '3.1.1' # motion-firebase gem version
3
+ Version = '3.1.2' # motion-firebase gem version
4
4
  SdkVersion = '1.2.2' # firebase framework version
5
5
  end
6
6
  end
@@ -0,0 +1,55 @@
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
@@ -0,0 +1,41 @@
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
@@ -0,0 +1,146 @@
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 name (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
+ /** @name Data export */
77
+
78
+ /**
79
+ * Returns the raw value at this location, coupled with any metadata, such as priority.
80
+ *
81
+ * Priorities, where they exist, are accessible under the ".priority" key in instances of NSDictionary.
82
+ * For leaf locations with priorities, the value will be under the ".value" key.
83
+ */
84
+ - (id) valueInExportFormat;
85
+
86
+
87
+ /** @name Properties */
88
+
89
+ /**
90
+ * Returns the contents of this data snapshot as native types.
91
+ *
92
+ * Data types returned:
93
+ * * NSDictionary
94
+ * * NSArray
95
+ * * NSNumber (also includes booleans)
96
+ * * NSString
97
+ *
98
+ * @return The data as a native object.
99
+ */
100
+ @property (strong, readonly, nonatomic) id value;
101
+
102
+
103
+ /**
104
+ * Get the number of children for this DataSnapshot.
105
+ *
106
+ * @return An integer indicating the number of children.
107
+ */
108
+ @property (readonly, nonatomic) NSUInteger childrenCount;
109
+
110
+
111
+ /**
112
+ * Get a Firebase reference for the location that this data came from
113
+ *
114
+ * @return A Firebase instance for the location of this data
115
+ */
116
+ @property (nonatomic, readonly, strong) Firebase* ref;
117
+
118
+
119
+ /**
120
+ * The name of the location that generated this FDataSnapshot.
121
+ *
122
+ * @return An NSString containing the name for the location of this FDataSnapshot.
123
+ */
124
+ @property (strong, readonly, nonatomic) NSString* key;
125
+
126
+
127
+ /**
128
+ * An iterator for snapshots of the child nodes in this snapshot.
129
+ * You can use the native for..in syntax:
130
+ *
131
+ * for (FDataSnapshot* child in snapshot.children) {
132
+ * ...
133
+ * }
134
+ *
135
+ * @return An NSEnumerator of the children
136
+ */
137
+ @property (strong, readonly, nonatomic) NSEnumerator* children;
138
+
139
+ /**
140
+ * The priority of the data in this FDataSnapshot.
141
+ *
142
+ * @return The priority as a string, or nil if no priority was set.
143
+ */
144
+ @property (strong, readonly, nonatomic) id priority;
145
+
146
+ @end
@@ -0,0 +1,43 @@
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
+ #ifndef Firebase_FEventType_h
30
+ #define Firebase_FEventType_h
31
+
32
+ /**
33
+ * This enum is the set of events that you can observe at a Firebase location.
34
+ */
35
+ typedef NS_ENUM(NSInteger, FEventType) {
36
+ FEventTypeChildAdded, // 0, fired when a new child node is added to a location
37
+ FEventTypeChildRemoved, // 1, fired when a child node is removed from a location
38
+ FEventTypeChildChanged, // 2, fired when a child node at a location changes
39
+ FEventTypeChildMoved, // 3, fired when a child node moves relative to the other child nodes at a location
40
+ FEventTypeValue // 4, fired when any data changes at a location and, recursively, any children
41
+ };
42
+
43
+ #endif
@@ -0,0 +1,139 @@
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
+ /**
32
+ * An FMutableData instance is populated with data from a Firebase location.
33
+ * When you are using runTransactionBlock:, you will be given an instance containing the current
34
+ * data at that location. Your block will be responsible for updating that instance to the data
35
+ * you wish to save at that location, and then returning using [FTransactionResult successWithValue:].
36
+ *
37
+ * To modify the data, set its value property to any of the native types support by Firebase:
38
+ * * NSNumber (includes BOOL)
39
+ * * NSDictionary
40
+ * * NSArray
41
+ * * NSString
42
+ * * nil / NSNull to remove the data
43
+ *
44
+ * Note that changes made to a child FMutableData instance will be visible to the parent.
45
+ */
46
+ @interface FMutableData : NSObject
47
+
48
+
49
+ /** @name Inspecting and navigating the data */
50
+
51
+
52
+ /**
53
+ * Returns boolean indicating whether this mutable data has children.
54
+ *
55
+ * @return YES if this data contains child nodes.
56
+ */
57
+ - (BOOL) hasChildren;
58
+
59
+
60
+ /**
61
+ * Indicates whether this mutable data has a child at the given path.
62
+ *
63
+ * @param path A path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child'
64
+ * @return YES if this data contains a child at the specified relative path
65
+ */
66
+ - (BOOL) hasChildAtPath:(NSString *)path;
67
+
68
+
69
+ /**
70
+ * Used to obtain an FMutableData instance that encapsulates the data at the given relative path.
71
+ * Note that changes made to the child will be visible to the parent.
72
+ *
73
+ * @param path A path string, consisting either of a single segment, like 'child', or multiple segments, 'a/deeper/child'
74
+ * @return An FMutableData instance containing the data at the given path
75
+ */
76
+ - (FMutableData *) childDataByAppendingPath:(NSString *)path;
77
+
78
+
79
+ /** @name Properties */
80
+
81
+
82
+ /**
83
+ * @return An FMutableData instance containing the data at the parent location, or nil if this is the top-most location
84
+ */
85
+ @property (strong, readonly, nonatomic) FMutableData* parent;
86
+
87
+
88
+ /**
89
+ * To modify the data contained by this instance of FMutableData, set this to any of the native types support by Firebase:
90
+ * * NSNumber (includes BOOL)
91
+ * * NSDictionary
92
+ * * NSArray
93
+ * * NSString
94
+ * * nil / NSNull to remove the data
95
+ *
96
+ * Note that setting the value will override the priority at this location.
97
+ *
98
+ * @return The current data at this location as a native object
99
+ */
100
+ @property (strong, nonatomic) id value;
101
+
102
+
103
+ /**
104
+ * Set this property to update the priority of the data at this location. Can be set to the following types:
105
+ * * NSNumber
106
+ * * NSString
107
+ * * nil / NSNull to remove the priority
108
+ *
109
+ * @return The priority of the data at this location
110
+ */
111
+ @property (strong, nonatomic) id priority;
112
+
113
+
114
+ /**
115
+ * @return The number of child nodes at this location
116
+ */
117
+ @property (readonly, nonatomic) NSUInteger childrenCount;
118
+
119
+
120
+ /**
121
+ * Used to iterate over the children at this location. You can use the native for .. in syntax:
122
+ *
123
+ * for (FMutableData* child in data.children) {
124
+ * ...
125
+ * }
126
+ *
127
+ * Note that this enumerator operates on an immutable copy of the child list. So, you can modify the instance
128
+ * during iteration, but the new additions will not be visible until you get a new enumerator.
129
+ */
130
+ @property (readonly, nonatomic, strong) NSEnumerator* children;
131
+
132
+
133
+ /**
134
+ * @return The key name of this node, or nil if it is the top-most location
135
+ */
136
+ @property (readonly, nonatomic, strong) NSString* key;
137
+
138
+
139
+ @end