@@ -112,14 +112,14 @@ operations = [
112112]
113113
114114conv.update(operations)
115- # => nil
115+ # => true
116116```
117117#### Deleting Conversations ####
118118
119119``` ruby
120120conv = platform.conversations.find(" conversation_id" )
121121conv.destroy
122- # => nil
122+ # => true
123123
124124```
125125
@@ -209,7 +209,7 @@ messages = conv.messages.find("message_id")
209209``` ruby
210210conv = platform.conversations.find(" conversation_id" )
211211conv.messages.find(" message_id" ).destroy
212- # => nil
212+ # => true
213213```
214214
215215#### Sending Announcements ####
@@ -248,7 +248,7 @@ operations = [
248248]
249249
250250user.update(operations)
251- # => nil
251+ # => true
252252```
253253
254254#### Retrieving A Users Block List
@@ -283,16 +283,89 @@ owner.blocks.create(blocked)
283283# using the blocked users id
284284owner = platform.users.find(" owner" )
285285owner.blocks.find(" blocked_user" ).destroy
286- # => nil
286+ # => true
287287
288288# using a User object
289289owner = platform.users.find(" owner" )
290290blocked = platform.users.find(" blocked" )
291291
292292owner.blocks.find(blocked).destroy
293- # => nil
293+ # => true
294294```
295295
296+ #### Creating a User Identity
297+
298+ ``` ruby
299+ identity = {
300+ display_name: " Frodo the Dodo" ,
301+ avatar_url: " http://sillylordoftheringspictures.com/frodo-riding-a-dodo.png" ,
302+ first_name: " Frodo" ,
303+ last_name: " Baggins" ,
304+ phone_number: " 13791379137" ,
305+ email_address: " frodo@sillylordoftheringspictures.com" ,
306+ metadata: {
307+ level: " 35" ,
308+ race: " Dodo"
309+ }
310+ }
311+
312+ user = platform.users.find(" user_id" )
313+ user.create_identity(identity)
314+ # => true
315+
316+ ```
317+
318+ #### Retrieving a User's Identity
319+
320+ ``` ruby
321+ user = platform.users.find(" user_id" )
322+ user.identity
323+ # => {"first_name"=>"Frodo", "phone_number"=>"13791379137", "email_address"=>"frodo@sillylordoftheringspictures.com", "display_name"=>"Frodo the Dodo", "user_id"=>"jake", "last_name"=>"Baggins", "metadata"=>{"race"=>"Dodo", "level"=>"35"}, "avatar_url"=>"http://sillylordoftheringspictures.com/frodo-riding-a-dodo.png"}
324+ ```
325+
326+ #### Updating an Identity
327+
328+ ``` ruby
329+ operations = [
330+ { operation: " set" , property: " last_name" , value: " Dodo" },
331+ { operation: " set" , property: " phone_number" , value: " " },
332+ { operation: " set" , property: " metadata.level" , value: " 2" }
333+ ]
334+
335+ user.update_identity(operations)
336+ # => true
337+ ```
338+
339+ #### Replacing an identity
340+
341+ ``` ruby
342+ identity = {
343+ display_name: " Frodo the Dodo" ,
344+ avatar_url: " http://sillylordoftheringspictures.com/frodo-riding-a-dodo.png" ,
345+ first_name: " Frodo" ,
346+ last_name: " Baggins" ,
347+ phone_number: " 13791379137" ,
348+ email_address: " frodo@sillylordoftheringspictures.com" ,
349+ metadata: {
350+ level: " 35" ,
351+ race: " Dodo"
352+ }
353+ }
354+
355+ user.replace_identity(identity)
356+ # => true
357+
358+ ```
359+
360+ #### Deleting a User's Identity
361+
362+ ``` ruby
363+ user = platform.users.find(" user_id" )
364+ user.destroy_identity
365+ # => true
366+ ```
367+
368+
296369#### Generating Identity Tokens ####
297370See: [ the official authentication guide] ( https://developer.layer.com/docs/android/guides#authentication )
298371
0 commit comments