Catalysis of the oxidation of alkanes (up to C8) to alcohols and alkenes (up to C5) to epoxides and alcohols in the presence of ammonium ions.