ionic4

Ionic 4 native plugin not working

我的梦境 提交于 2020-01-01 06:48:24
问题 I am facing a problem with Ionic 4 native plugins. I have installed ionic 4 Cordova native plugin "Geolocation" but when I run the app into my iOS or Android device it's showing to me a blank white screen and nothing happening. app.module.ts code: import { Geolocation } from '@ionic-native/geolocation'; @NgModule({ declarations: [AppComponent], entryComponents: [], imports: [ BrowserModule, IonicModule.forRoot(), AppRoutingModule, ComponentsModule ], providers: [ StatusBar, SplashScreen, **

How do I install new fonts in Ionic 4?

吃可爱长大的小学妹 提交于 2019-12-31 21:31:42
问题 Does anyone know how to update the font for Ionic 4? I tried adding the aileron.woff to assets/fonts and putting this in the variables.scss to no avail. src: url('../assets/fonts/aileron.woff') format('woff'); 回答1: This is how I managed to add a custom font to my Ionic application Add a directory that contains the font files to the project under the folder src\assets\fonts src\assets\fonts\myCustomFont | +-- MyCustomFontBold.ttf +-- MyCustomFontBoldItalic.ttf +-- MyCustomFontItalic.ttf +--

How do I install new fonts in Ionic 4?

三世轮回 提交于 2019-12-31 21:31:14
问题 Does anyone know how to update the font for Ionic 4? I tried adding the aileron.woff to assets/fonts and putting this in the variables.scss to no avail. src: url('../assets/fonts/aileron.woff') format('woff'); 回答1: This is how I managed to add a custom font to my Ionic application Add a directory that contains the font files to the project under the folder src\assets\fonts src\assets\fonts\myCustomFont | +-- MyCustomFontBold.ttf +-- MyCustomFontBoldItalic.ttf +-- MyCustomFontItalic.ttf +--

Ionic 4 Angular Back Button to previous page instead of root?

老子叫甜甜 提交于 2019-12-30 08:58:04
问题 I have a little Ionic 4 App with 2 Tabs and 1 Detail Page. The Problem I'm facing here is that if I go from Tab2 into Detail Page and from there with ion-back-button back it always redirect me to Tab1 instead of Tab2 where I was before. Here is my example: Tab2 Html: Here I have a simple ion-item with a click event: <ion-item class="chat-item" (click)='openChat()' > It calls the openChat funtion which works like this: openChat() { this.router.navigateByUrl('/chatdetail/:uid'); } Now it opens

Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTED

社会主义新天地 提交于 2019-12-29 09:41:38
问题 I have gone through this question link, and I have made subsequent changes but still can't solve the problem. Still giving me the same error. Can someone please help me out. Thanks in advance Here is my piece of code from config.xml <widget id="com.farm.fork" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <platform name="android"> <edit-config file="app/src/main/AndroidManifest.xml"

Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTED

一世执手 提交于 2019-12-29 09:41:29
问题 I have gone through this question link, and I have made subsequent changes but still can't solve the problem. Still giving me the same error. Can someone please help me out. Thanks in advance Here is my piece of code from config.xml <widget id="com.farm.fork" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <platform name="android"> <edit-config file="app/src/main/AndroidManifest.xml"

NavController doesn't work in Ionic 4

删除回忆录丶 提交于 2019-12-28 11:13:07
问题 I'm injecting NavController in my constructor as I want to push a page. But, below code doesn't work in Ionic 4. It was totally okay in Ionic 3. Constructor constructor(public menuCtrl: MenuController, public navCtrl: NavController) { this.menuCtrl.enable(true); } Method goToSecondPage() { this.navCtrl.push(list); } 回答1: Now, to complete the final step and implement those routes in our app-routing.module.ts file, they would look like this: const routes: Routes = [ { path: '', redirectTo: '

NavController doesn't work in Ionic 4

南笙酒味 提交于 2019-12-28 11:12:09
问题 I'm injecting NavController in my constructor as I want to push a page. But, below code doesn't work in Ionic 4. It was totally okay in Ionic 3. Constructor constructor(public menuCtrl: MenuController, public navCtrl: NavController) { this.menuCtrl.enable(true); } Method goToSecondPage() { this.navCtrl.push(list); } 回答1: Now, to complete the final step and implement those routes in our app-routing.module.ts file, they would look like this: const routes: Routes = [ { path: '', redirectTo: '

Cordova/Ionic Android app can't receive response when default cordova onReceivedSslError is called

∥☆過路亽.° 提交于 2019-12-25 01:47:12
问题 I have a issue when using release build android app calling an api to an invalid ssl certificate server. From what i know. in release build, if the api server's ssl certificate is invalid, Cordova will call below method. org.apache.cordova.engine.SystemWebViewClient.onReceivedSslError() /** * Notify the host application that an SSL error occurred while loading a resource. * The host application must call either handler.cancel() or handler.proceed(). * Note that the decision may be retained

How to redirect the user from the route defined with Id when the user is not login In Ionic 4

蓝咒 提交于 2019-12-25 01:36:14
问题 I am working in my Ionic 4 app and I am working in my login/register system. I have defined the route with the id and when the user is not login and try to visit that route, it will redirect to login page and when the user is login then he can visit that route but the problem is that when the user is trying to visit that route with the id, it is showing the error. This is my tabs.router.module.ts : import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router