motion-firebase 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +32 -9
- data/lib/firebase/firebase.rb +10 -1
- data/lib/firebase/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 462cf224fbc812e69ec3498d851a16bbaae89bdb
|
4
|
+
data.tar.gz: f130d9fb2a5c7305a12667d2b888bdf6a9b6ead5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f768c0dc015ff1c31a8d0791a68dddf160f29777dc973a19e82811da234c9b1f519251343de644010b49b080fef99cab61f6f31584029f3a515effe6f6ada0a
|
7
|
+
data.tar.gz: 04593e1ab7fbfa2c0f786047fb6c6cb4d79a5478f15bc9127a530836b180a478e4a6f2625aa5565840914ee4915eb00f7bc2f088923889012c0e517c5d6d3845
|
data/README.md
CHANGED
@@ -138,9 +138,9 @@ SDK
|
|
138
138
|
##### Authenticating
|
139
139
|
|
140
140
|
```ruby
|
141
|
-
firebase.auth(
|
142
|
-
firebase.auth(
|
143
|
-
firebase.auth(
|
141
|
+
firebase.auth(secret_key)
|
142
|
+
firebase.auth(secret_key) { |error, data| 'completion block' }
|
143
|
+
firebase.auth(secret_key,
|
144
144
|
completion: proc { |error, data| 'completion block' },
|
145
145
|
disconnect: proc { |error| 'completion block', },
|
146
146
|
)
|
@@ -162,22 +162,34 @@ SDK
|
|
162
162
|
##### Transactions
|
163
163
|
|
164
164
|
```ruby
|
165
|
-
firebase.
|
166
|
-
|
167
|
-
|
165
|
+
firebase.transaction do |data|
|
166
|
+
current_value = data.value
|
167
|
+
current_value += 1
|
168
|
+
FTransactionResult.successWithValue(current_value)
|
169
|
+
end
|
170
|
+
firebase.transaction(local: false) do |data|
|
171
|
+
#...
|
172
|
+
end
|
173
|
+
firebase.transaction(
|
168
174
|
completion: proc { |error, committed, snapshot| }
|
169
|
-
)
|
170
|
-
|
175
|
+
) do |data|
|
176
|
+
current_value = data.value
|
177
|
+
current_value += 1
|
178
|
+
FTransactionResult.successWithValue(current_value)
|
179
|
+
end
|
180
|
+
firebase.transaction(
|
171
181
|
transaction: proc { |data| 'transaction block' },
|
172
182
|
completion: proc { |error, committed, snapshot| }
|
173
183
|
local: true || false,
|
174
184
|
)
|
185
|
+
```
|
175
186
|
|
176
187
|
##### Retrieving String Representation
|
177
188
|
|
178
189
|
```ruby
|
179
190
|
firebase.to_s
|
180
191
|
firebase.inspect
|
192
|
+
```
|
181
193
|
|
182
194
|
##### Properties
|
183
195
|
|
@@ -185,31 +197,37 @@ SDK
|
|
185
197
|
firebase.parent
|
186
198
|
firebase.root
|
187
199
|
firebase.name
|
200
|
+
```
|
188
201
|
|
189
202
|
##### Global configuration and settings
|
190
203
|
|
191
204
|
```ruby
|
192
205
|
Firebase.dispatch_queue=(queue)
|
193
206
|
Firebase.sdkVersion
|
194
|
-
|
207
|
+
```
|
195
208
|
|
196
209
|
# FirebaseSimpleLogin Class Reference
|
197
210
|
|
211
|
+
require 'motion-firebase-auth'
|
212
|
+
|
198
213
|
##### Initializing a FirebaseSimpleLogin instance
|
199
214
|
|
200
215
|
```ruby
|
201
216
|
ref = Firebase.new(url)
|
202
217
|
auth = FirebaseSimpleLogin.new(ref)
|
218
|
+
```
|
203
219
|
|
204
220
|
##### Checking current authentication status
|
205
221
|
|
206
222
|
```ruby
|
207
223
|
auth.check { |error, user| }
|
224
|
+
```
|
208
225
|
|
209
226
|
##### Removing any existing authentication
|
210
227
|
|
211
228
|
```ruby
|
212
229
|
auth.logout
|
230
|
+
```
|
213
231
|
|
214
232
|
##### Email/password authentication methods
|
215
233
|
|
@@ -222,6 +240,7 @@ For `update`, `credentials` should include `:email`, `:old_password` and
|
|
222
240
|
auth.remove(email: 'hello@example.com', password: '12345') { |error, user| }
|
223
241
|
auth.login(email: 'hello@example.com', password: '12345') { |error, user| }
|
224
242
|
auth.update(email: 'hello@example.com', old_password: '12345', new_password: '54321') { |error, success| }
|
243
|
+
```
|
225
244
|
|
226
245
|
##### Facebook authentication methods
|
227
246
|
|
@@ -229,6 +248,7 @@ For `update`, `credentials` should include `:email`, `:old_password` and
|
|
229
248
|
|
230
249
|
```ruby
|
231
250
|
auth.login_to_facebook(app_id: '123abc', permissions: ['email']) { |error, user| }
|
251
|
+
```
|
232
252
|
|
233
253
|
##### Twitter authentication methods
|
234
254
|
|
@@ -238,14 +258,17 @@ passed an array of usernames and should return an index or `NSNotFound`.
|
|
238
258
|
|
239
259
|
```ruby
|
240
260
|
auth.login_to_twitter(app_id: '123abc', on_multiple: ->(usernames) { return 0 }) { |error, user| }
|
261
|
+
```
|
241
262
|
|
242
263
|
##### Global configuration and settings
|
243
264
|
|
244
265
|
```ruby
|
245
266
|
FirebaseSimpleLogin.sdkVersion
|
267
|
+
```
|
246
268
|
|
247
269
|
##### Retrieving String Representation
|
248
270
|
|
249
271
|
```ruby
|
250
272
|
firebase.to_s
|
251
273
|
firebase.inspect
|
274
|
+
```
|
data/lib/firebase/firebase.rb
CHANGED
@@ -69,6 +69,11 @@ class Firebase
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def run(options={}, &transaction)
|
72
|
+
NSLog('The method ‘Firebase#run’ has been deprecated in favor of ‘Firebase#transaction’')
|
73
|
+
self.transaction(options, &transaction)
|
74
|
+
end
|
75
|
+
|
76
|
+
def transaction(options={}, &transaction)
|
72
77
|
transaction = transaction || options[:transaction]
|
73
78
|
completion_block = options[:completion]
|
74
79
|
with_local_events = options[:local]
|
@@ -79,7 +84,11 @@ class Firebase
|
|
79
84
|
runTransactionBlock(transaction)
|
80
85
|
end
|
81
86
|
else
|
82
|
-
|
87
|
+
if completion_block
|
88
|
+
runTransactionBlock(transaction, andCompletionBlock: completion_block, withLocalEvents: with_local_events)
|
89
|
+
else
|
90
|
+
runTransactionBlock(transaction, withLocalEvents: with_local_events)
|
91
|
+
end
|
83
92
|
end
|
84
93
|
end
|
85
94
|
|
data/lib/firebase/version.rb
CHANGED