Open vogloblinsky opened 6 years ago
I think this approach is better. You don't have to change it every time you build your app:
const isBrowser = document.URL.includes(‘https://’) || document.URL.includes(‘http://’);/*document.URL.startsWith(‘http’);
and then a bit lower in the provides :
(isBrowser ? {provide : Camera, useClass : CameraMock} : Camera),
(isBrowser ? {provide : ImagePicker, useClass : ImagePickerMock} : ImagePicker),
(isBrowser ? {provide : Geolocation, useClass : GeolocationMock} : Geolocation),
Thanks. I will add this to the Read Me shortly.
const isBrowser = document.URL.includes(‘https://’) || document.URL.includes(‘http://’);/*document.URL.startsWith(‘http’);
Your approach doesnt work i logged this and it always returned true . and ionic seems to be running in the localhost in a mobile device
Hi,
Thanks for these useful mocks.
Could you add in the main README an explanation about how we can disable mock in production mode ?