Method: SelfSDK::MessagingClient#send_custom
- Defined in:
- lib/messaging.rb
permalink #send_custom(recipient, request_body) ⇒ Object
Send custom mmessage
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/messaging.rb', line 96 def send_custom(recipient, request_body) @to_device = @client.devices(recipient).first msg = Msgproto::Message.new( type: Msgproto::MsgType::MSG, id: SecureRandom.uuid, sender: "#{@jwt.id}:#{@device_id}", recipient: "#{recipient}:#{@to_device}", ciphertext: @jwt.prepare(request_body), ) end |