Skip to main content

Name

msg:get_delivery_method — Return the delivery method for a message

Synopsis

msg:get_delivery_method();

Description

Return the delivery method for a message, for example "gcm".

require("msys.delivery");
require ("msys.httpclnt");

local mod = {};
function mod:http_request_eval(sess)
  -- get the message
  local msg = msys.delivery.ob_get_current_message(sess.connh)
  -- check protocol
  if( msg:get_delivery_method() == "gcm") then
    -- do something with a GCM message
  else 
    -- not our protocol get out
    return msys.delivery.DELIVERY_CONTINUE
  end
end

msys.registerModule("http_delivery", mod);

Because this function is in the msys.core namespace, an explicit require('msys.core') is not necessary.

See Also

Was this page helpful?