ionic-framework

Why is HTML5 geolocation slower than native on Android?

半城伤御伤魂 提交于 2019-12-22 18:26:12
问题 I've been dabbling with hybrid app development using Cordova (an extendable web view wrapper for those who haven't used it). One thing that I've noticed is that whenever I request the user's location with window.geolocation , the location fix almost always takes longer compared to a native app. For instance, it will take 5 or 6 seconds to get a suitable fix with window.geolocation from a "cold start", but the Google Maps app will pan to my location within 2 seconds or less. The same seems to

Android target : not installed

大城市里の小女人 提交于 2019-12-22 18:05:14
问题 I am unable to run ionic run android . After I checked with cordova requirements , it shows Android target: Not installed Android SDK not found. How should I solve the problem ? I have my SDK in D drive where I have set ANDROID_HOME and path correctly, I suppose Also, I do android list target, it shown as below. How should I intsall it if it is needed to fix teh error? Attached the cordova android version 回答1: You can follow this link set ANDROID_HOME which I got help from or follow below

Cannot find namespace 'google' in ionic 3 app

血红的双手。 提交于 2019-12-22 17:57:11
问题 can anyone help me with this error im getting in my ionic 3 application after my attempt to use google variable in my project, npm install --save @types/google-maps which added the following to my package.json: "@types/google-maps": "^3.2.0", i also did declare declare var google; and did typings install dt~google.maps --global then i seen this soultion and tried it but that did not work either (notice i generated an ios key and android key) tried this Cannot find namespace 'google' ionic

Ionic get Active Page

ぃ、小莉子 提交于 2019-12-22 14:59:08
问题 I am using Ionic 3 and want to get the name of the active page in order to identify which page I am on in an event subscription. When I am on a page, the following works: this.nav.getActive().name However, if my root is tabs and I want to identify the page loaded in a tab, the above code just returns the tab page name and not the active page. Question How do I get the active page name or identifier if it is loaded in a tab? 回答1: You can get the component of the page. Like this this.nav

Hiding the Ionic Framework Header based on screen orientation

拟墨画扇 提交于 2019-12-22 14:15:35
问题 I would like to ask if there is a way to hide a nav bar of the ionic framework on a particular view upon changing in the screen orientation from portrait to landscape. 回答1: Yes you can, it's very easy. This is a function you need to trigger to hide a navbar: $ionicNavBarDelegate.showBar(false); Of course, do it inside an appropriate Controller. The second part of this formula is Cordova Orientation plugin, click here. So when combined you would want something like this: if(screen.orientation

Ionic 4 Delete Page from History (Android)

本秂侑毒 提交于 2019-12-22 12:42:19
问题 Android devices has back button on menu toolbar. I want to disable the possibility when i login to my app and click on that back button to route on login page. I want if user click on back button after login then i close the app. Here is my initial code for routing below. if (token) { this.router.navigate(['/main-tabs/tabs/dashboard']) } else { this.router.navigate(['/login']).then(); } 回答1: I've tried many other answers but none of them really works for me. But this one works : To disallow

Ionic 4 Delete Page from History (Android)

孤人 提交于 2019-12-22 12:42:13
问题 Android devices has back button on menu toolbar. I want to disable the possibility when i login to my app and click on that back button to route on login page. I want if user click on back button after login then i close the app. Here is my initial code for routing below. if (token) { this.router.navigate(['/main-tabs/tabs/dashboard']) } else { this.router.navigate(['/login']).then(); } 回答1: I've tried many other answers but none of them really works for me. But this one works : To disallow

Ionic refresher not working properly

荒凉一梦 提交于 2019-12-22 12:33:30
问题 I am developing android app using Ionic framework. I used a <ion-refresher> tag to load the contents dynamically when the user pulls down the page. But it didn't work. <ion-refresher pulling-text="Pull to refresh..." on-refresh="doRefresh"> </ion-refresher> My controller code is blow: $scope.doRefresh = function() { $http.get('http://localhost/test/gksfapp_backend.php?action=an').then(function(msg){ //never executed. $scope.items=msg.data; }) .finally(function() { // Stop the ion-refresher

Ionic refresher not working properly

匆匆过客 提交于 2019-12-22 12:31:16
问题 I am developing android app using Ionic framework. I used a <ion-refresher> tag to load the contents dynamically when the user pulls down the page. But it didn't work. <ion-refresher pulling-text="Pull to refresh..." on-refresh="doRefresh"> </ion-refresher> My controller code is blow: $scope.doRefresh = function() { $http.get('http://localhost/test/gksfapp_backend.php?action=an').then(function(msg){ //never executed. $scope.items=msg.data; }) .finally(function() { // Stop the ion-refresher

How to pass results from POST request to another page in Ionic and Angular

非 Y 不嫁゛ 提交于 2019-12-22 12:07:31
问题 I'm using ionic to build a mobile app and I'm implementing very lightweight authentication (no security) into the app. Basically when a users hits the login button after submitting their email and password, their information is checked against a database using a POST request. Now my question is, once I have confirmed that the user's information is in the database, I'd like to pass that response object from the POST to a profile page that can then show the user's profile information. How can I