How to get OS type? (SOLVED)

i have developed an FB instance game, now I need to build android version.to share function i hope to use https://github.com/britzl/defold-sharing extension

so i need to choose share lib according to the platform, now i am using the following code.but i think it needs to have a better way to do this.please help me

if self.instanceGame ==true then
			local args = data				
			if type(args) == "table" then 
				args = rxijson.encode(args)
			end
			fbinstant.share(args,function(self, success)		
				print("Shared mesaage successfully")		
			end)
		else
			share.text("Monkey shooter")
		end	
end

If I understand you right you need this method:

local info = sys.get_sys_info()
-- The system OS name: "Darwin", "Linux", "Windows", "HTML5", "Android" or "iPhone OS"
if info.system_name == "HTML5" then
  -- We are running in a browser.
else
-- other platforms
end
1 Like

Thank you very much