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

Two tabs selected after router.navigate()

$
0
0

@marcinni2 wrote:

Hello,

I have a problem with navigating user in my App, when he clicks “Back” on his device. I want to let him exit the app from the first tab and it works. From other tabs, I want to redirect him to the first tab.

It works, but two tabs on the tab-bar are selected/active. I was trying maaany things all day and nothing worked.

I found exactly the same issue on StackOverflow and commented on it there to don’t double the topic.

If You would like to respond there or here -> I would really appreciate!

Cheers!

Posts: 1

Participants: 1

Read full topic


Promise returning Subscription, how to wait for data before proceding

$
0
0

@leonardofmed wrote:

I have a function that get some data from DB, store in localStorage and then do something with it. To get the data I’m using the Angular’s HttpClient, which uses Observables in its methods. Here is how I’m doing the coding so far:

mainFunction(): Promise<void> {
	return this.getData().then(() => {
  		return this.processData().then(() => {
  			...
  		})
  	})
}

// Get data from DB and then store in localStorage
getData(): Promise<Subscription> {
	// Declare some data to send
	...

	return this.http.post(myLink, myArray, httpOptions)
	.subscribe(res => {
		// Store retrieved data in localStorage
		return this.storeData(res);
	});
}

I can’t just get the data from getData() and pass to processData, for some other reasons I need to update the localStorage before proced. I believe this situation is happening because I’m returning a Subscription to processData() and not the updated localStorage data, which is my objective. I tried to do this in some ways, as stated here using map(), but this generate some other errors. Is there other method that I can use to acomplish what I want?

Posts: 1

Participants: 1

Read full topic

[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1)

$
0
0

@Adarsh-Bellary wrote:

After clicking on running “ionic serve” on node command getting below error

[WARN] Detected locally installed Ionic CLI, but it’s too old–using global CLI.

ionic-app-scripts.cmd serve --address localhost --port 8101 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] internal/modules/cjs/loader.js:628
[app-scripts] throw err;
[app-scripts] ^
[app-scripts] Error: Cannot find module ‘C:\Users\lenovo\ionic-location-sharing-master\node_modules@ionic\app-scripts\bin\ionic-app-scripts.js’
[app-scripts] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
[app-scripts] at Function.Module._load (internal/modules/cjs/loader.js:527:27)
[app-scripts] at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
[app-scripts] at internal/main/run_main_module.js:17:11 {
[app-scripts] code: ‘MODULE_NOT_FOUND’,
[app-scripts] requireStack:
[app-scripts] }

[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).

    The Ionic CLI will exit. Please check any output above for error details.

I am using ionic 3.20.1

Posts: 1

Participants: 1

Read full topic

Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

$
0
0

@mgandra wrote:

Hi,

I need help with ionic 4 android build with cordova. App is building successfully but in emulator or device app is displaying white page.

I checked the build and see cordova.js is missing in the generated index.html page. In inspect below warning messsage being displayed. This seems to be the root cause for issue. Any help is appreciated.

vendor-es2015.js:106398 Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordovaWarn @ vendor-es2015.js:106398
vendor-es2015.js:106398 Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordovaWarn @ vendor-es2015.js:106398

Here is the ionic information.

Ionic:

Ionic CLI : 5.4.16 (C:\Users\12146\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.11.10
@angular-devkit/build-angular : 0.803.24
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 4 other plugins)

Utility:

cordova-res : 0.9.0
native-run : 0.3.0

System:

Android SDK Tools : 26.1.1 (C:\Android\sdk)
NodeJS : v12.13.1 (C:\Program Files\nodejs\node.exe)
npm : 6.13.1
OS : Windows 10

Posts: 1

Participants: 1

Read full topic

Ionic 5 --prod build error

$
0
0

@wekas wrote:

I created a new Ionic 5 project. It doesn’t have a lot in it.
It works fine in development but when I run “ionic build --prod” or “ionic build --prod --release”
I get the following error:

ERROR in ./node_modules/@ionic/angular/fesm2015/ionic-angular.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
    at isAngularDecoratorMetadataExpression (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:265:35)    at checkNodeForDecorators (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:77:21)
    at visitNodes (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16514:30)
    at Object.forEachChild (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16740:24)
    at checkNodeForDecorators (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16635:21)
    at checkNodeForDecorators (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16703:24)
    at checkNodeForDecorators (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16692:24)
    at checkNodeForDecorators (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (R:\WekaDevelopment\Client Prototypes\Blueprint\node_modules\typescript\lib\typescript.js:16599:21)
[ERROR] An error occurred while running subprocess ng.

$ ionic info

Ionic:

Ionic CLI : 5.4.16
Ionic Framework : @ionic/angular 5.0.4
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.1.2

Utility:

cordova-res : 0.9.0
native-run : not installed

System:

NodeJS : v10.17.0 (C:\Program Files\nodejs\node.exe)
npm : 6.11.3
OS : Windows 10

Posts: 2

Participants: 1

Read full topic

Capacitor Keyboard hide/show

$
0
0

@peter_gallagher wrote:

I have an Andoid “phone/tablet” PDA with Android 8.1.0 that has built-in barcode scanner(2D)
It works like any Android device, and installing an APK file/app onto it works like any android tablet or phone etc - This PDA has it’s own numeric keyboard - very important feature. Data input will come from scanning barcodes and then tapping a quantity on the numeric buttons

My issue is that I want to control when the keyboard is displayed. That is, toggle if I want it visible for or
The code below is the solution I have at the moment. I can “listen” for when the keyboard is being displayed and then make it hide. BUT the keyboard wants to display everytime the element gets focus and when I enter a character into these input elements or . It looks strange seeing this keyboard start it’s display then suddenly hide (over and over with each character)

What do I want? to control when the keyboard is visible, not have it displaying and then hiding with each character

The code below is my test page. Unfortunately the test process involves loading the app into Android Studio and running the simulator.

import { Component, OnInit } from ‘@angular/core’;
import { HttpApiService } from ‘src/app/services/http-api.service’;
import { ToastController } from ‘@ionic/angular’;

import { Plugins } from ‘@capacitor/core’;

const { Keyboard } = Plugins;

@Component({
selector: ‘app-transfer’,
templateUrl: ‘./transfer.page.html’,
styleUrls: [’./transfer.page.scss’],
})
export class TransferPage implements OnInit {

activeTransfers: any;
selectedTransfers: any;

constructor(private api: HttpApiService, public toast:ToastController) {
this.getAllObjects(‘activetransfers’);

Plugins.Keyboard.addListener('keyboardWillShow', (info: any) => {
  this.presentToast('keyboard about to load');
  Keyboard.hide();
});

}

show() {
Keyboard.show();
}
hide() {
Keyboard.hide();
}

Ionic CLI : 5.4.14 (/Users/Peter/.nvm/versions/node/v10.12.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 5.0.1
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.25
@ionic/angular-toolkit : 2.1.2

Capacitor:
Capacitor CLI : 1.5.0
@capacitor/core : 1.5.0

Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

Utility:
cordova-res : not installed
native-run : not installed

System:

NodeJS : v10.12.0 (/Users/Peter/.nvm/versions/node/v10.12.0/bin/node)
npm : 6.13.7
OS : macOS Catalina
Xcode : Xcode 11.3.1 Build version 11C504

Posts: 2

Participants: 1

Read full topic

Cordova music control No longer maintained BUT there is a forked

$
0
0

@ebeliejinfren wrote:

This Plugin ( Music Controls ) in ionic No longer maintained BUT there is a forked for it as Cordova Music Controls Plugin 2 by ghenry22

but @ionic-native/music-controls not worked with it. So How change ionic-native/music-controls to work with cordova-plugin-music-controls2 ?
or @ionic-native/music-controls will be updated by ionic team ?

Thanks

Posts: 1

Participants: 1

Read full topic

Ember + Capacitor NPM Package

$
0
0

@MatthewPringle wrote:

I have written an NPM package called ember-cap which automates using Ember in Capacitor.

It configures live reload and updates the platforms for building and serving correctly.

Install

npm install -g ember-cap

Create a new Ember application & initialise Capacitor

ember-cap new <example-app> <com.example.app>

This will create a new Ember application and then initialise Capacitor. This is equivalent to running the following commands.

ember new <example-app>
cd <example-app>
npm install --save @capacitor/core @capacitor/cli
npx cap init --web-dir dist <example-app> <com.example.app>

Or initialise Capacitor in an existing Ember application

ember-cap init <example-app> <com.example.app>

Add the platform/s you require

ember-cap platform add ios
ember-cap platform add android

Serve the Ember application to a simulator / device on a local network. You will need to run the app using Xcode / Android Studio

ember-cap serve ios
ember-cap serve android

Build the Ember application and add to the platform ready for build and deployment using Xcode / Android Studio

ember-cap build ios
ember-cap build android

Posts: 1

Participants: 1

Read full topic


How display successfully message in HTML file

$
0
0

@Mdweyal wrote:

Hi guys,
I use native http for post request
How display successfully message in HTML file And pop the window

Posts: 1

Participants: 1

Read full topic

Service worker not found IONIC 4

$
0
0

@roxannelighting wrote:

Hi everyone,

I deployed a pwa version of my ionic 4 app. It works great but there is a problem with my app.
If I add my app to my android home screen there is a small browser icon for example Chrome icon in the bottom right of my app icon.
I saw this link:

And then checked my application tab on google developers tools and I saw in the Manifest section the instability has a warning icon that show me this message:
“No matching service worker detected. You may need to reload the page or check that the service worker for the current page also controls the start url from the manifest”

Even though there is my service worker in the folder, It seems that service worker not found by application!

Could you please help me to over come this issue?

Thanks

Posts: 1

Participants: 1

Read full topic

Firebase phone authentication doesn't work on release

$
0
0

@florea_g wrote:

Hello,

I have made a ionic v4 project and i have integrated firebase phone authentication.
When i run the project on a device everithing works fine but if i build the project and i upload the apk on play console for testing the authentication doesn’t work any more. Aparently firebase can’t find the signature. i have the google-service.json on android folder and i even signed the app with the same cert before put it on the store.
Can someone help me please?

Thanks

Posts: 1

Participants: 1

Read full topic

Send variable value to another device

$
0
0

@MarcinDl wrote:

Hello,

On my device I have an app with some variable values and now I want to use these values on another variable. But…there is no internet connection so I can not use database and send and read these values.

Is any solution for my problem?

Posts: 1

Participants: 1

Read full topic

Http get request hangle

$
0
0

@VigneshBalakrishnan wrote:

Hi all,
I have facing one issue regarding the API. I will get details of media file in database then with that details i ll get id for the media file with that id I’ll get a media file from s3. And that path is directly given in html. In that case if the media file is not there the media ll not load there.
I want to handle error for that HTTP get request so that if the media file is not there i can load a new screen to give a better user experience.
My doubt is whether i can handle it in the normal way of error handling method or there is any other better solution for this.

Can anyone help me out, Thanks.

HTML

<img [src]=“getContentURL(Profilecontents.id)” id=“imag{{Profilecontents.id}}” class=“image” alt="">

TS
contentID is media file id.
this.contentURL will have the http link
ex: http://www.example.com/contentID

getContentURL(contentID: string) {
return this.contentURL + contentID;
}

Posts: 1

Participants: 1

Read full topic

Ionic 4 PWA cordova plugin contact is not working

Alan button dowsn't work

$
0
0

@HedgehogA19 wrote:

Hi guys,
I have a little problem with alan-app plugin.
I’m using cordova plugin showed in this guide.
In true, i follow guide step by step but i cant see my alan button.
I dont know if shuld i active my alan code or what else.
Following the guide, button doesn’t showed.
I readed in the faq this advices but theay aren’t my case

I do not see my Alan Button on my webpage

  • Check if you run the Alan Button in the browser that supports an Audio API.
  • If you use “http” run the page on the localhost (otherwise use “https”).
  • Make sure that the Alan Button wasn’t disabled in the Alan Studio Button Settings for your project.

Someone has any idea? :pray:
thanks :smiley:

Posts: 1

Participants: 1

Read full topic


I open ionic 4 api news app yesterday when open today not refreshing

$
0
0

@Mdweyal wrote:

Hi,
I am new with ionic; i opened my ionic app tow days ago, when i open it today my api data are not refreshing
Can anyone help please?

Posts: 1

Participants: 1

Read full topic

How to display green dot on top of ion2-calenders date

Scale image height based on screen size ionic

Shrinking header with image and text

$
0
0

@harika511 wrote:

Hi, Is anybody seen WhatsApp group members list, It have a header with image and group name, on scroll up image and text will move upward with reducing size, the Same format need to develop in ionic v3, Soo can anyone help me please.

Posts: 1

Participants: 1

Read full topic

Unable to access ionicframework.com

$
0
0

@SrinivasK wrote:

while accessing ionic website in india location.
“Your requested URL has been blocked as per the directions received from Department of Telecommunications, Government of India.”

Posts: 1

Participants: 1

Read full topic

Viewing all 70621 articles
Browse latest View live


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