Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70435 articles
Browse latest View live

React and defatult css variables

$
0
0

@butterfly-valley wrote:

Hi, I have started building an Ionic app with React and am having troubles with overriding the default css variables. I have set new variables and placed them in a separate css file to then import to main App.js as per below however this does not override the default ones. Am I doing something wrong?

import React, { Component } from 'react';
// Import Ionic 4 styles
import '@ionic/core/css/core.css';
import '@ionic/core/css/ionic.bundle.css';
import './theme.css';
import {
    IonApp,
} from '@ionic/react';
import Home from './pages/Home/Home'

class App extends Component {
    render() {
        return (
            <IonApp>
                <Home/>
            </IonApp>

        );
    }
}
export default App;

Posts: 1

Participants: 1

Read full topic


Ionic 4: SpeechRecognition startListening is not working in iOS

$
0
0

@dvtopiya wrote:

I am using Ionic speechRecognition plugin in Ionic 4 app. It is working fine in Android but it is giving below error in iOS when I call SpeechRecognition startListening method.

Error Domain=kAFAssistantErrorDomain Code=203 “Retry” UserInfo={NSLocalizedDescription=Retry, NSUnderlyingError=0x600003948cf0 {Error Domain=SiriSpeechErrorDomain Code=1 “(null)”}}

Can anyone please suggest me how can I solve this error in iOS ?

Posts: 1

Participants: 1

Read full topic

Issue with 'File' plugin, unable to create a file

$
0
0

@AKwire wrote:

Hey people, I am trying to check if a directory exists and then create a file into it and write data to it. Pretty straight forward. So I followed the cordova docs for File and wrote this:

This is my .ts snippet:

this.platform.ready().then((readySource)=>{
                console.log('Platform ready from', readySource);
                (<any>window).resolveLocalFileSystemURL('cdvfile://localhost/temporary/',function(dirEntry){
                    console.log('File system was resolved!');
                    let fileEntry=this.createFile(dirEntry,message.filename);
                    this.writeFile(fileEntry,filedata.data);
                });
});

And this is the createFile() code in question:

createFile(dirEntry,fileName){
        console.log('Creating file...');
        let fileEntry=null;
        dirEntry.getFile(fileName, {create: true, exclusive: false}, function(fileEntry) {
            this.fileEntry=fileEntry;
        });
        return fileEntry;
}

However when I run it natively on my Android device (Pixel 3, Pie). I get this in the logcat:

06-14 13:27:32.480  6104  6104 I chromium: [INFO:CONSOLE(9968)] "This is the clicked dir: endpoint.js", source: http://192.168.43.41:8100/home-home-module.js (9968)
06-14 13:27:32.672  6104  6104 D SystemWebChromeClient: http://192.168.43.41:8100/home-home-module.js: Line 10195 : Platform ready from
06-14 13:27:32.672  6104  6104 I chromium: [INFO:CONSOLE(10195)] "Platform ready from", source: http://192.168.43.41:8100/home-home-module.js (10195)
06-14 13:27:32.699  6104  6202 W AssetFilesystem: Asset manifest not found. Recursive copies and directory listing will be slow.
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient: http://192.168.43.41:8100/home-home-module.js: Line 10197 : File system was resolved!
06-14 13:27:32.732  6104  6104 I chromium: [INFO:CONSOLE(10197)] "File system was resolved!", source: http://192.168.43.41:8100/home-home-module.js (10197)
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient: http://192.168.43.41:8100/cordova.js: Line 309 : Error in Success callbackId: File596949976 : TypeError: Cannot read property 'createFile' of undefined
06-14 13:27:32.732  6104  6104 I chromium: [INFO:CONSOLE(309)] "Error in Success callbackId: File596949976 : TypeError: Cannot read property 'createFile' of undefined", source: http://192.168.43.41:8100/cordova.js (309)
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient: http://192.168.43.41:8100/cordova.js: Line 310 : TypeError: Cannot read property 'createFile' of undefined
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient:     at http://192.168.43.41:8100/home-home-module.js:10198:42
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient:     at http://192.168.43.41:8100/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js:76:25
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient:     at success (http://192.168.43.41:8100/plugins/cordova-plugin-file/www/fileSystems-roots.js:37:9)
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient:     at Object.callbackFromNative (http://192.168.43.41:8100/cordova.js:291:58)
06-14 13:27:32.732  6104  6104 D SystemWebChromeClient:     at <anonymous>:1:9
06-14 13:27:32.732  6104  6104 I chromium: [INFO:CONSOLE(310)] "TypeError: Cannot read property 'createFile' of undefined
06-14 13:27:32.732  6104  6104 I chromium:     at http://192.168.43.41:8100/home-home-module.js:10198:42
06-14 13:27:32.732  6104  6104 I chromium:     at http://192.168.43.41:8100/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js:76:25
06-14 13:27:32.732  6104  6104 I chromium:     at success (http://192.168.43.41:8100/plugins/cordova-plugin-file/www/fileSystems-roots.js:37:9)
06-14 13:27:32.732  6104  6104 I chromium:     at Object.callbackFromNative (http://192.168.43.41:8100/cordova.js:291:58)
06-14 13:27:32.732  6104  6104 I chromium:     at <anonymous>:1:9", source: http://192.168.43.41:8100/cordova.js (310)
06-14 13:27:32.733  6104  6104 D SystemWebChromeClient: http://192.168.43.41:8100/cordova.js: Line 312 : Uncaught TypeError: Cannot read property 'createFile' of undefined
06-14 13:27:32.733  6104  6104 I chromium: [INFO:CONSOLE(312)] "Uncaught TypeError: Cannot read property 'createFile' of undefined", source: http://192.168.43.41:8100/cordova.js (312)

The logcat clearly states that, for some reason cordova isn’t able to access the createFile(), but I am unable to understand what I am doing wrong. I tried removing and readding the platform as suggested by a stackoverflow question asked by another user. Tried running it on different devices (with Android 7 & 8) and also tried other ways to pass the fileEntry value since I thought that it might be an issue with, allocating the value to the variable (since the logs show typeerror). But no dice!

Environment info:

Ionic:

  • ionic (Ionic CLI) : 4.10.0 (/usr/local/lib/node_modules/ionic)
  • Ionic Framework : @ionic/angular 4.0.0-rc.1
  • @angular-devkit/build-angular : 0.11.4
  • @angular-devkit/schematics : 7.1.4
  • @angular/cli : 7.1.4
  • @ionic/angular-toolkit : 1.4.0

Cordova:

  • cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
  • Cordova Platforms : android 7.1.4, browser 5.0.4
  • Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.3, (and 5 other plugins)

System:

  • NodeJS : v10.15.0 (/usr/local/bin/node)
  • npm : 6.7.0
  • OS : OS X El Capitan
  • Xcode : Xcode 7.3.1 Build version 7D1014

Device:

  • Google Pixel 3
  • Android Version: 9
  • Security Patch Level: 5th June 2019

Any pointers/guidance is greatly appreciated! Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Detect page transition end only once

$
0
0

@Corbis wrote:

Hello, I need to detect when page transition animation ended. I know there is lifecycle event IonViewDidEnter, but it fires every time page is entered. I need to detect page end transition only once, so if a page is cached and later opened I don’t need to detect page end transition. Any ideas? :slight_smile:

Posts: 1

Participants: 1

Read full topic

How to check network speed in ionic 3

If I navigate right after starting the app, the hardware back button does not navigate back

$
0
0

@maciejkoch-vattenfal wrote:

Hi all,

If I navigate right after starting the app, the hardware back button does not navigate back. Navigation back by back button in left top corner works as expected but hardware button doesn’t

this.platform.ready().then(() => {
   this.router.navigate(['disruptions', '71880']);
});

Posts: 1

Participants: 1

Read full topic

getIds() big delay

$
0
0

@mathm3 wrote:

Hi!
I need to get the player id. For this, I used the method getIds() - Ionic 4 Angular, but it takes 30 seconds to 3 minutes to return the data.
It takes the same amount of time to register the device in the OneSignal dashboard.

Ionic:

ionic (Ionic CLI) : 4.12.0 (/Users/matheus/npm-global/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0

Cordova:

cordova (Cordova CLI) : 9.0.0
Cordova Platforms : android 8.0.0, browser 6.0.0, ios 5.0.1

System:

Android SDK Tools : 26.1.1
NodeJS : v11.9.0
npm : 6.8.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001

Steps to Reproduce:

1. Create Ionic 4 Angular project;
2. Install the OneSignal via npm and the OneSignal Cordova plugin;
3. Perform the initial configuration of OneSignal with the id and sender id (firebase);
4. Add the OneSignal to the constructor (angular) and call the function to get ids (this.oneSignal.getIds().then((ids) =>{});

Thank you!

Posts: 1

Participants: 1

Read full topic

Appflow Deploy with monorepo

$
0
0

@timclicker wrote:

My repository is set up to where my ionic app is in a subdirectory (mobile/app). I am trying to do a web build through AppFlow and it is obviously failing because my ionic app is not at the root on my project.

I have tried putting an ionic.config.json with a defaultApp pointing to mobile/app but that fails in just the same way. Any ideas for getting this to work? I would rather not have to blow up my monorepo structure as it has been working great for me.

Posts: 1

Participants: 1

Read full topic


Ion-router-oulet inside ion-grid

$
0
0

@BenjaminR wrote:

Hi,

I try to wrap my ion-router-outlet into a ion-grid so it is not too big on a computer but it doesnt work.
Anyone has a solution?

This is what I tried to do






Posts: 1

Participants: 1

Read full topic

Touble to get contacts from the device

$
0
0

@CAHOCA wrote:

I have a development of an app using the Ionic4 Framework in which I must import the native contacts book of the device using the plugin @ionic-native/contacts . What happens is that the values corresponding to the displayName and phoneNumbers parameters are not properly returned; in fact, they return null values. For demonstration purposes I put an alert() that receives the parameters to show my problem:

I also share the code fragment where I make the call of the plugin and use it:

import { Contacts, Contact, ContactField, ContactName  } from '@ionic-native/contacts/ngx';
...

export class ImportarContactosPage {

   listaContactos: any;

  constructor(public contacts: Contacts) {
    this.listarContactos();
   }

...

 listarContactos(){
    this.contacts.find(["*"])
    .then(res => {
// Alert
      alert(JSON.stringify(res));
//
      let datosMostar:any[]=[];
      res.map((item) =>{
        if(item.displayName != null && item.photos != null && item.phoneNumbers != null){
          datosMostar.push({displayName:item.displayName,photos:[{value:this.avatar}],phoneNumbers:item.phoneNumbers})
        }        
      })
      console.log(datosMostar);
      this.listaContactos = datosMostar;
    },error => {
      console.log({error:error});
    })
  }
...
}

my ionic-info :

Ionic CLI                     : 5.0.0 (C:\Users\Carlos\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.2
   @angular/cli                  : 7.1.0
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.0.0

Utility:

   cordova-res :  0.3.0
   native-run  :  0.2.5

System:

   Android SDK Tools : 26.1.1 (C:\Users\Carlos\AppData\Local\Android\Sdk)
   NodeJS            : v10.16.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 7

I have been “googling” and reviewing forums for several days and I have tried in many ways to import contacts, but I have not been able to correct the problem.

Any fellow idea, have I done something wrong? Any suggestion is welcome. Thank you.

Posts: 1

Participants: 1

Read full topic

Hardware Back Button not returning to previous app

$
0
0

@tokuhara wrote:

I got a share function that post on facebook timeline a deeplink to open the app.
When you click the link on facebook it will open my app, but when pressing the hardware back button it will not return to facebook, it minimize the app and it is against facebook policies.

Does anyone know or had this problem?

Posts: 1

Participants: 1

Read full topic

Disable Phone Back Button (Physical Back Button)

$
0
0

@egaldamez wrote:

Hello guys, hope you all are having a great day im having a issue.
I currently have a Login form to show at the first time the user opens the app, and if everything is ok and a successful login has been done it redirects the user to the Home Screen using:

this.router.navigateByUrl(’/menu’);

And all works great BUT when im on the Home page, if the user clicks the physical back button on the device it takes him to the login page again, how can i disable the physical button to stop this?.

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Welcome Translators!

$
0
0

@perry wrote:

Hello, こんにちは, Hola, 你好, Bonjour, Olá,

Thank you for your interest in translating the Ionic Docs!:partying_face: This will be the main place we share information about how to translate the Ionic Docs and where you can ask questions you may have.

Current Status:
The Japanese docs are live! :jp:
The Ionic Japan group self-organized and translated the docs on their own. Working with them, we were able to make it the official Japanese Ionic Docs, and bring it in as a subdirectory of our website and link to it.

We have chosen to add 4 new languages based on the success of the Japanese docs: Chinese, French, Spanish, and Portuguese. We chose these languages based on our analytics and where we believe language is the greatest barrier to people trying Ionic.

Lars, is working on modifying the main Ionic Docs repository so it can support multiple languages directly. We’re planning on using Crowdin as the interface translators use to translate content. Is anyone familiar with it?

My task for each language group right now is for you to introduce yourselves to each other. Talk about differences in dialect and find agreement on which you plan to use. Are some of you in the same city? Maybe attend an Ionic or related Meetup and see if you can recruit even more people to help. This is a volunteer effort, so the more people who can help and make the job easier, the better.

On behalf of all of us at Ionic,
Thank you again for your interest and help with this effort!

Posts: 2

Participants: 1

Read full topic

中文介绍 - Chinese Introductions

$
0
0

@perry wrote:

Greetings,
This is a place for the Chinese language translators to introduce themselves and discuss which dialect will be used.

Google Translated Chinese:
问候,
这是一个让中文翻译自我介绍并讨论将使用哪种方言的地方。

Posts: 1

Participants: 1

Read full topic

Introductions en français - French Introductions

$
0
0

@perry wrote:

Greetings,
This is a place for the French language translators to introduce themselves and discuss which dialect will be used.

Google Translated French:
Salutations,
C’est un endroit où les traducteurs de langue française se présentent et discutent du dialecte utilisé.

Posts: 1

Participants: 1

Read full topic


Introducciones en español - Spanish Introductions

$
0
0

@perry wrote:

Saludos,
Este es un lugar para que los traductores de español se presenten y discutan qué dialecto se utilizará.

Original English:
Greetings,
This is a place for the Spanish language translators to introduce themselves and discuss which dialect will be used.

Posts: 1

Participants: 1

Read full topic

Introduções portuguesas - Portuguese introductions

$
0
0

@perry wrote:

Saudações,
Este é um lugar para os tradutores de português se apresentarem e discutirem qual dialeto será usado.

Original English:
Greetings,
This is a place for the Portuguese language translators to introduce themselves and discuss which dialect will be used.

Posts: 1

Participants: 1

Read full topic

日本語の紹介 - Japanese introductions

$
0
0

@perry wrote:

ご挨拶、
これは日本語翻訳者が自己紹介をする場所です。 マサヒコは、ほとんどの日本語の翻訳会話が存在するところに日本語スラックを作成しました。

https://ionic-jp.herokuapp.com

Original English:
Greetings,
This is a place for the Japanese language translators to introduce themselves. Note, Masahiko has created a Japanese Slack where most Japanese translation conversations exist.

https://ionic-jp.herokuapp.com

Posts: 1

Participants: 1

Read full topic

Ionic capacitor device api

$
0
0

@billnye123 wrote:

Hi, I have the following code below in an old build of my app and I am trying to port this over to a new build using just capacitor because Im really interested to know how it works.

So the code below gives me the device id. It is really simple and easy to understand and works.

export class HomePage {

  deviceID: any;

  constructor(public device: Device) {
    platform.ready().then(() => {
      this.deviceID = this.device.uuid;      
      }
    }
}

However, I don’t understand what I am supposed to do with the new capacitor API. The example given told me to use the code below but it does not seem to work. I get

’await’ expression is only allowed within an async function.

Also, is the is the platform.ready stuff still needed?

 import { Plugins } from '@capacitor/core';
 
 const { Device } = Plugins;
 
 const info = await Device.getInfo();

 console.log(info);

Thanks.

Posts: 1

Participants: 1

Read full topic

Using Ionic Framework Web Components

$
0
0

@abusharaf wrote:

I’ve built a website using the classical way, and then when ionic v4 introduced I thought adding some material design components and as Ionic is now shipped as web components as well I said why not add their components instead, so I did add the ionic script and style tags as illustrated in the Ionic framework docs, but when I ran the page my page scrolling was disabled, and then I found that it’s done cause of the scroll overflow style, so I did add this to my HTML index page to solve it

<app-root>
        <ion-app>
        <ion-content overflow-scroll="true">
        .
        .
        .
<Rest OF my HtML goes here>
</ion-content>
</ion-app>
</app-root>

but the issue is some of my page containers styles are ruined due to ionic CSS

<link href="https://unpkg.com/@ionic/core@latest/css/ionic.bundle.css" rel="stylesheet">

So is there a way to load ionic in a way that it won’t conflict with already used and loaded CSS styles, or Should I convert my page to my ionic PWA setup to fix it?

Any tips would be appreciated…

Thanks.

Posts: 1

Participants: 1

Read full topic

Viewing all 70435 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>