If the device has the feature, it should work, provided you get the permissions right.
Most browsers will require a user to make some interaction with the page first as a security measure.
Keep in mind a large number of devices may not have the feature.