ionic-framework

Ionic app back button causes previous state screens to overlap

时光怂恿深爱的人放手 提交于 2021-02-08 10:23:00
问题 I am working on an ionic project and am encountering a strange bug where pressing the back button causes the last two views to display at the same time. I've been attempting to fix this for a few weeks now with no luck so I'm hoping one of you have encountered this and can help! The app defaults to the state "Initialize" which just checks if the user is logged in already or not. If they are already logged in it throws them to the "Home" state. If they are not logged in it puts them at the

How to connect bluetooth printer using ionic 3?

牧云@^-^@ 提交于 2021-02-08 10:21:21
问题 I am unable to connect with bluetooth printer using below plugin $ ionic cordova plugin add de.appplant.cordova.plugin.printer $ npm install --save @ionic-native/printer Is there any way to connect bluetooth printer using ionic 3? 回答1: Here's an example of printing to bluetooth receipt printer with ionic 2+. I wrote this because I was having the same problem. So I tried using ionic native bluetooth serial connection to 'write' to print and it worked. It should work on ionic 3 as well: https:/

Create custom Popup in Ionic App

二次信任 提交于 2021-02-08 10:11:02
问题 I try to create custom Popup in my Ionic App, I try to modify using Ionic CSS in to full fill my requirement but don't get success. Please help me or suggest me if any third party CSS available which i can edit and full fill my requirement. Proposed Design 回答1: Have a look at ionic ModalController it can be used to create custom popup along with custom template rather customizing Alert Controller . All you have to do is create a normal ionic page using ionic generate page <pageName> then

Ionic 3 long white screen after splash

与世无争的帅哥 提交于 2021-02-08 09:42:28
问题 Is there a way to get it as soon as i start my application and after that i get the login screen, and get ride of the SplashScreen. Or a way to modify something so my animation become my SplashScreen ? Thank you. 回答1: Put a longer timeout in your config.xml and disable it yourself when your home screen is loaded. config.xml <preference name="SplashScreenDelay" value="30000" /> app.component.ts platform.ready().then(() => { splashScreen.hide(); }); 回答2: Ionic hides the splash screen as default

Ionic network security config

前提是你 提交于 2021-02-08 09:14:43
问题 Hello i am working on ionic application. with executing this command ionic cordova build android --prod --release . it does generate the unasigned apk file,but it also show error in network_security_config file. Error app\src\main\res\xml\network_security_config.xml:4: Error: Missing includeSubdomains attribute [NetworkSecurityConfig] <domain>localhost</domain> i tried multiple solutions, but doesn't work for me. Reference How to allow all Network connection types HTTP and HTTPS in Android (9

Ionic network security config

寵の児 提交于 2021-02-08 09:11:05
问题 Hello i am working on ionic application. with executing this command ionic cordova build android --prod --release . it does generate the unasigned apk file,but it also show error in network_security_config file. Error app\src\main\res\xml\network_security_config.xml:4: Error: Missing includeSubdomains attribute [NetworkSecurityConfig] <domain>localhost</domain> i tried multiple solutions, but doesn't work for me. Reference How to allow all Network connection types HTTP and HTTPS in Android (9

Release configuration for Ionic project, similar to flavours in Android studio

為{幸葍}努か 提交于 2021-02-08 08:37:20
问题 Been looking into this without any luck. I understand that we can pass configuration to Ionic projects via the config.xml file. But I want to have different configuration for development and release builds. Does anyone know about how this can be done? 回答1: This is one approach that using the hooks to update a configuration file based on the specific environment you are building for. You use a configuration variable when executing the cmd as the indicator of the environment. config_target=qa

Convert Input File to Base64 in Angular 2 without using FileReader In Ionic V2

﹥>﹥吖頭↗ 提交于 2021-02-08 08:32:39
问题 I am having an issue converting the input file object into Base64 in my ionic v2 app . The issue occurs specifically when using the onload/onloadend reader as it gets called only occasionally (rarest of rarest to be very specific). I am able to get the file name, size and object when the user clicks on a image file which triggers the attachFile function, but after that when i convert the file object to Base64 using FileReader - onload or onloadend the callback function rarely gets called and

How to select all users data, Ionic Firebase

假装没事ソ 提交于 2021-02-08 06:46:33
问题 I have usersProfile table, where save data by uid How to select all users uid and data? I can select only Authorized users data. getUsersData(token: string) { const userId = this.authService.getActiveUser().uid; return this.http.get('https://mainapp.firebaseio.com/usersProfile/' + userId + '.json?auth=' + token) .map((response: Response) => { const usersData: UsersData[] = response.json() ? response.json(): []; return usersData; }) .do((userData : UsersData[]) => { if (userData) { this

Ionic long press event on cards

戏子无情 提交于 2021-02-08 04:36:20
问题 How can I set a long press event to a card in Ionic to fire up action sheet for the specific card. Just help me in binding this long press event in ionic 回答1: You can use the following npm package: https://www.npmjs.com/package/ionic-long-press This plugin should be compatible with Ionic and Angular 7+ Import the module: import { LongPressModule } from 'ionic-long-press'; @NgModule({ imports: [ ... LongPressModule ... ] }) And use in your template: <button ion-button ion-long-press [interval]