Skip to content

Instantly share code, notes, and snippets.

@lotterfriends
Created September 21, 2016 12:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lotterfriends/53395722b063caafa5c2e34031c6a25c to your computer and use it in GitHub Desktop.
Save lotterfriends/53395722b063caafa5c2e34031c6a25c to your computer and use it in GitHub Desktop.
ionic view issue 29
'use strict';
(function() {
angular.module('app.services').service('platformService', [
function() {
var IONIC_APP_ID = 'xxx00xxx';
this.isIonicWebView = function() {
return window.location.href.indexOf('com.ionic.viewapp') > -1 || window.location.href.indexOf(IONIC_APP_ID) > -1;
};
this.isWeb = function() {
return angular.equals({}, ionic.Platform.device()) && !ionic.Platform.isWebView();
};
}
]);
})();
@lotterfriends
Copy link
Author

replace IONIC_APP_ID with your own app id

@asdrubalivan
Copy link

Thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment