README.md in ue-ruby-sdk-1.1.9 vs README.md in ue-ruby-sdk-1.1.12

- old
+ new

@@ -8,17 +8,25 @@ ``` ## Usage ```ruby -var app = UEApp.new("APP_KEY","APP_SECRET"); +app = UEApp.new("APP_KEY","APP_SECRET"); ``` #### Creating User ```ruby +#Creating a new user user = app.create_user -#user is an instance of UEUser + +#Using existing user using key and secret +user = UEUser.new "USER_KEY","USER_SECRET" + +#Using existing user using it's uri +user = UEUser.new "user://USER_KEY:USER_SECRET@" + + ``` #### Listing Users ```ruby users = app.list_users @@ -31,11 +39,11 @@ app.delete_user(user) #true ``` #### Adding a connection to a user ```ruby -connection = user.add_connection "myconnectionname", "facebook", "facebook_access_token") +connection = user.add_connection "myconnectionname", "facebook", "facebook_access_token" #connection is an instance of UEConnection ``` - `connection_name` must be unique per connection. - `access_token` has to be valid and working from the provider side @@ -57,18 +65,22 @@ user.test_connection(service_url) #eg: facebook://accesstoken@facebook.com ``` ### Sending a message using a connection ```ruby +require 'ue-ruby-sdk' + +app = UEApp.new("UE_APP_ID","UE_APP_SECRET") + options = { receivers:[ { - name:"me" + name:"Page", + id:"283031198486599" }, { - name:"Page", - id:"122" + name: "Me" } ], message:{ subject:"test", body: "ABC", @@ -79,8 +91,23 @@ title:"link title" } } } -#uris will hold the uris for the sent messages -uris = app.list_connections[0].send_message options + + +#Create a new user +user = app.create_user + + +facebook_connection = user.add_connection "fb", "facebook","FACEBOOK_ACCESS_TOKEN" +# | | +# Connection Name ------------------------+ | +# Connector Scheme ---------------------------------+ + + + + +facebook_connection.send_message options + + ```