Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 48986 articles
Browse latest View live

IONIC 4 - Can't resolve all parameters for NavParams

$
0
0

@mosheinf wrote:

When i add the line (private navParams: NavParams,) to constructor() of any new page i receive this error: Can’t resolve all parameters for NavParams

I’m running Ionic 4.5.0
I tried a new clean project. Same error.

I tried to import NavParams at app.module.ts or at my page.module.ts but others erros occurs.

This error happens even if no use of NavParams is done.
Only type “private navParams: NavParams” to the page construct() is enough to the error appears.

Thanks

Posts: 1

Participants: 1

Read full topic


Ionic Dev app connection issue

$
0
0

@anildhiman wrote:

Dev App giving me issue while connecting with localhost with the database.
I am using Mysql and PHP API’s for ionic but when I am trying to use in browser its working fine at a same time when I try to load it in dev app then it not connecting with localhost server. what should I need to do?

I even tried to enter URL manually like 192.168.1.100 but with this error occurred “correct reset” and app gets close.

Posts: 1

Participants: 1

Read full topic

How to translate ionic app in multiple languages?

$
0
0

@demokumar wrote:

I want to translate the ionic android app into multiple languages which user select but I can not found any way to translate it anyone knows please help

Posts: 1

Participants: 1

Read full topic

Application Serial data manipulation

$
0
0

@Juanu78 wrote:

Hello everyone,
I´m developing an app in ionic which connects with a scale (via Ethernet) and I need to display each 2 secs the weight of the scale.
I´m using cz.blocshop.socketsforcordova to connect with the scale and everything is working.

The problem is that I´m using setinterval to display the new scales and I´m facing one issue:

Sometimes the buttons doesn´t work as expected and It seems to be blocked by a process (maybe the setinterval wich is global to the app) and I need to press several times to make it work.
Is there any chance to create the setinterval without this button behavior???

Thanks in advance!
Juan Luis

Posts: 1

Participants: 1

Read full topic

Implement TCP Client

$
0
0

@Josef87 wrote:

Hello,
i wrote an easy TCP/IP Server in Python and a client in Javascript. if i start it in cmd on two computers it works perfect.
now i wanted to implement it in my Application. It should connect when i start the application. But I just get a white screen. I read already, it´s not possible to implement a net.Socket on websites, but how is it in ionic?

I just kept it easy now, but at the end i want to send some values from the server to the Application. So just backend stuff.

here is my code:

client:

var net = require('net');
var wert;

var client = new net.Socket();
client.connect(65432, '192.168.131.224', function() {
	console.log('Connected');
});

client.on('data', function(data) {
	console.log('Received: ' + data);
	wert = data;
	client.destroy(); // kill client after server's response
});

app.components.ts

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { ScreenOrientation } from '@ionic-native/screen-orientation';
import * as client from '../assets/data/client';


@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:string = 'HomePage';

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public screenOrientation: ScreenOrientation) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
      this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
      client.connect();
      client.on();
    });
  }
}

Posts: 1

Participants: 1

Read full topic

How to use musicControls

$
0
0

@salomon022 wrote:


* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
[ERROR] An error occurred while running subprocess cordova.

        cordova run android exited with exit code 1.

Posts: 1

Participants: 1

Read full topic

Error installing ionic on mac

$
0
0

@jslamba0811 wrote:

I am getting error while installing ionic on my mac machine.
I have installed all the softwares required for ionic, but still ionic is not getting isntalled:
node js : v10.14.1
npm : 6.4.1
cordova : 8.1.2
java : 11.0.1

Command : sudo npm install -g ionic

I have also attached the log file for the same :

Log error :
0 info it worked if it ends with ok

1 verbose cli [ ‘/usr/local/bin/node’,

1 verbose cli ‘/usr/local/bin/npm’,

1 verbose cli ‘install’,

1 verbose cli ‘-g’,

1 verbose cli ‘ionic’ ]

2 info using npm@6.4.1

3 info using node@v10.14.1

4 verbose npm-session 92be60f19856acf3

5 silly install loadCurrentTree

6 silly install readGlobalPackageData

7 http fetch GET 304 https://registry.npmjs.org/ionic 345ms (from cache)

8 silly fetchPackageMetaData error for ionic@latest Unexpected end of JSON input while parsing near ‘…f00c4eb79e76fee51497a’

9 timing stage:rollbackFailedOptional Completed in 0ms

10 timing stage:runTopLevelLifecycles Completed in 503ms

11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near ‘…f00c4eb79e76fee51497a’

11 verbose stack at JSON.parse (<anonymous>)

11 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)

11 verbose stack at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50)

11 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)

12 verbose cwd /Users/jaspreet

13 verbose Darwin 17.7.0

14 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “ionic”

15 verbose node v10.14.1

16 verbose npm v6.4.1

17 error Unexpected end of JSON input while parsing near ‘…f00c4eb79e76fee51497a’

18 verbose exit [ 1, true ]

Posts: 2

Participants: 2

Read full topic

Ionic 3 cors issue .....laravel 5.7 with ionic 3

$
0
0

@alimuhnad wrote:

hi
i have problem and i can not find slotion for it now
help ?
what can i do to fix this !!!

my code in
“name”: “appname”,
“integrations”: {
“cordova”: {}
},
“type”: “ionic-angular”,

“proxies”: [
{
“path”: “/api”,
“proxyUrl”: “http://xxxxxxxxxxx.ipage.com/g/public/
}
],
“pro_id”: “id”
}

in laravel i am using cors plugin

Posts: 1

Participants: 1

Read full topic


Popover page not loading

$
0
0

@Jesse-H wrote:

Hey guys,

My problem is as follows. I added a popover page and added the PopoverController to the page where it should be opened. When I click the button that should open the popover only the arrow of the popover is shown. The content is not loading. Also in the log it won’t show “ionViewDidLoad RaidUsersModalPage”.
I inspected the element in browser and the popover-content div is empty, like below.

<div class="popover-wrapper" style="opacity: 1;">
    <div class="popover-arrow" style="top: 209.1px; left: 88.25px;"></div>
    <div class="popover-content" style="top: 218.1px; left: 2px; transform-origin: left top 0px;">
        <div class="popover-viewport">
            <div nav-viewport=""></div>
        </div>
    </div>
</div>

The function I’m using is as follows:

presentRaidusersPopover(myEvent) {
    let popover = this.popoverCtrl.create(this.raidUsersModalPage);
    popover.present({
      ev: myEvent
    });
}

In the page HTML I’m opening function as follows:

<ion-col col-6>	    		
    <button ion-button icon-start small color="light" (click)="presentRaidusersPopover($event)">
        <ion-icon name="people"></ion-icon>
	{{ qOptedIn }}
    </button>
</ion-col>

Am I missing something?

Posts: 1

Participants: 1

Read full topic

Solve the build error

$
0
0

@jsriganesh wrote:

hi all …i have a ionic build error for …(could not determine java version 10.0.2)
but i salve this error …so any one want my help pls contact …

Posts: 1

Participants: 1

Read full topic

PDF file not downloading from inappbrowser

$
0
0

@amit_a5a wrote:

<a href="url to pdf">Download</a>
this tag is displaying the pdf file with download option in both android and ios.
but if i have open a webpage(having same tag) in inappbrowser

  1. nothing happening in android
  2. pdf is opened in view mode but no option to download in ios

anyone please tell me how to resolve this issue??thanks

Posts: 1

Participants: 1

Read full topic

Ionic 4 Sorting data from api call

$
0
0

@TrulsLoug wrote:

I’m trying to sort the data I get from my api call into two seperate lists, but I’m struggling to pipe the data from the call.

rest-api.service.ts


getVessels(): Observable<string[]> {
  let response = this.http.get(apiUrl+'/api/orders/GetVesselOrders?VesselID=5055');
  return this.http.get('https://navfleet.azurewebsites.net/api/orders/GetVesselOrders?VesselID=5055', {headers : new HttpHeaders({'Authorization':'Bearer ' + localStorage.getItem('userToken')})})
  .pipe(
    map(this.extractData),
    catchError(this.handleError)
  );
  
  }

private extractData(res: Response) {
  let body = res;
  return body || {};
}

private handleError (error: Response | any) {
  let errMsg: string;
  if (error instanceof Response) {
    const err = error || '';
    errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
  } else {
    errMsg = error.message ? error.message : error.toString();
  }
  console.error(errMsg);
  return Observable.throw(errMsg);
}

Type ‘Observable<{}>’ is not assignable to type ‘Observable<string>’. Type ‘{}’ is missing the following properties from type ‘string’: length, pop, push, concat, and 26 more.ts(2322)
(property) RestApiService.http: HttpClient

Is the error I’m receiving on the return line of the function getVessels()

List.ts

  
import { Component, ViewEncapsulation } from '@angular/core';
import { Router } from '@angular/router';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActionSheetController, ModalController } from '@ionic/angular';
import { NotificationPage } from '../notification/notification.page';
import { LoadingController } from '@ionic/angular';
import { RestApiService, Vessel } from '../../services/API/rest-api.service';
import { a, b } from '@angular/core/src/render3';

@Component({
  selector: 'page-order-list',
  templateUrl: 'order-list.html',
  styleUrls: ['./order-list.scss'],
  encapsulation: ViewEncapsulation.None
})
export class OrderListPage {
  excludeTracks: any = [];
  searchTerm: string = '';
  Vessel: any;
  data1: any;
  filter: any;
  vessels: string[];
  errorMessage: string;

  constructor(
    public router: Router,
    public modalCtrl: ModalController,
    public api: RestApiService,
    public loadingController: LoadingController,
    public restApiService: RestApiService
    

  ) { }
  
  ngOnInit() {
    this.getData();
    console.log(this.api.getVessels);

  }

  async getData() {
    const loading = await this.loadingController.create({
      message: 'Loading'
    });
    await loading.present();
    this.api.getVessels()
      .subscribe(vessel => {
        console.log(vessel);
        this.Vessel = vessel;
        this.filter = vessel;
        error =>  this.errorMessage = <any>error;
        loading.dismiss();
      }, err => {
        console.log(err);
        loading.dismiss();
      
      });
  }

If i change Observable in the getVessels() function where i call the api data to “Observable” I get no syntax errors but my data won’t load.

HTML

 <ion-item style="color:#595b60; font-weight: bold;" *ngFor="let vessels of vessel">
  
          <ion-label class="order">{{vessels.VesselName}}</ion-label>
          <ion-label class="dateTime"><p class="p">{{vessels.Date}}</p></ion-label> 
          <ion-label class="product"><p class="p">{{vessels.NumberOfProduct}} Products</p></ion-label>
          <ion-label class="cost"><p class="p">{{vessels.TotalAmount}} USD</p></ion-label>  
          <ion-img class="icon" src="../../assets/img/filled-circle.png"></ion-img>
          <ion-img class="icon1" src="../../assets/img/filled-circle.png"></ion-img>

          <ion-icon slot="end" name="ios-arrow-forward"></ion-icon>
      </ion-item>        
    </ion-item-group>

Any idea what I’m doing wrong?

Posts: 2

Participants: 1

Read full topic

Add GitLab Cloud, CE and EE to connected services

$
0
0

@muuvmuuv wrote:

I really love to create apps with Ionic and play around with it, but it makes it really hard to work with AppFlow when it just supports Ionic Git and GitHub. We use an EE of GitLab in our company and would like to keep all of our stuff there and not deploy it neither on GitHub (private) or Ionic Git.

Posts: 1

Participants: 1

Read full topic

Best approach to store http tasks when device offline and call then when goes online?

$
0
0

@franzisk4sis wrote:

Hi guys,

I need to have in my app the option of when user tries something (like updating his contact list) and the device has no internet connection I store that action as a task and then when the devices goes online those tasks must be executed (call web service).

I thought about something like this:

  • store the type of method (post/get), the endpoint and the payload (Ionic Store)
  • on my Network Service when goes online walk throughout that list and call those actions.

Any better ideas? How to avoid repeated tasks supposing the user tries several times the same action? Or something like that.

Did anybody ever do such thing?

Here is my (just as an example) my sendPost in my Rest Service:

  public sendPost(action: string, payload: any, showLoading: boolean = true) {
    if (this.isConnected) {
      this.loadingStatus(showLoading);
      return ( < Observable < any >> this.http.post(this.setEndPoint(action), payload, this.requestHeaders()))
        .pipe(
          retryWhen(genericRetryStrategy()),
          tap(() => {
            this.loadingStatus(false);
          }),
          catchError(err => {
            this.loadingStatus(false);
            return throwError(err);
          })
        );
    } else { // OFFLINE
      // This is the task I want to store to be executed later
      let task: ServerTask = new ServerTask('post', action, payload);
      this.help.showToast('You are offline, once you get online this taks will be executed.')
      return this.error$;
    }
  }

Posts: 1

Participants: 1

Read full topic

Ionic-audio v3 - Playing downloaded tracks

$
0
0

@88Designs wrote:

Im having a problem with ionic-audio .
On my app, I download a song onto the device documentsDirectory or externalRootDirectory. The problem comes when the downloaded mp3 track is to be played. It gives me an error:

  • Audio error => track : file:///Users/…(path to .mp3 file)
    with an error: {“isTrusted”:true}
    What could be the problem. :frowning:

Posts: 1

Participants: 1

Read full topic


Adding/Removing platforms with ios frameworks

$
0
0

@sshipsey wrote:

When I remove/add my iOS platform with my ionic app, the remove deletes all my iOS framework/SDK files inside platforms/ios/Frameworks but re-adding the platform obviously doesn’t restore them. Is this intentional? I believe I should be able to non-destructively remove and add a platform with Ionic. I end up in a situation where if I want to remove and add the iOS platform I have to restore my frameworks from source control.

Thanks,

Posts: 1

Participants: 1

Read full topic

Firebase .key

$
0
0

@gruposietigt wrote:

Hi all,

I really need your help. I’m trying to get the “Key” value of my data from firebase.

i’m using this code in my constructor to link my data, the problem is when I use “valueChanges()” I can read the data but when I change it to " SnapshotChanges()" I only can read the Key value.

this.fbd.list("programacion/" + this.device.uuid + this.idBusqueda).valueChanges().subscribe(_data =>{
this.programacion = _data;
  console.log(this.programacion)
});

I need to read the data to show in an alarm, but also need to read the key value to delete it from a list.

In the delete fuction I use this, to try to find the key value, but I will be honest, I’m just copying code to try what I get cause I don’t know how to do it.

delete(i){
this.values = this.fbd.list(“programacion/” + “null” + this.idBusqueda).snapshotChanges().pipe(map(actions => actions.map(this.programacion[i])));
// .pipe((actions => (this.programacion[i].key)));
console.log(this.values.key);

Please help me.
Best regards and happy christmas season.

Posts: 1

Participants: 1

Read full topic

[Ionic v4] Customize ion-toggle

$
0
0

@ambrzz wrote:

Hi,

I’m trying to customize ion-toggle styles. How can I make bigger the ion-toggle? I injected with ‘shadow-dom-inject-styles’ all new styles, but seems that is not perfect, because ‘.toggle-inner’ set a translate3d.

Thanks

Posts: 1

Participants: 1

Read full topic

Air watch VPN support Ionic 3

$
0
0

@akashpal wrote:

Hi Team,

Ionic 3 by default supports the wkwebview which hosts on http://localhost:8080/ .
The Air Watch tunnels block http://localhost:8080/ .
The issue has been well documented, however, there has been no significant workaround to this.

The app launches on VPN tunnel with a blank screen.

Max Lynch has also mentioned this issue here -

Please find the reference below:

Posts: 1

Participants: 1

Read full topic

Firebase Plugin - plugin_not_installed

$
0
0

@rodrigomarineli wrote:

Hi, when i run the app in the device or in emulate i have an error and the blank page, the error is “ERROR Error: Uncaught (in promise): Error: plugin_not_installed”

This plugin is Firebase, because when i uninstall the app is run.

My app info is

Ionic:

ionic (Ionic CLI) : 4.5.0 (C:\Users\rmoreira\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic 5.2.7, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 10 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Android\android-sdk)
NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

And the plugins installed are

cordova-plugin-camera 4.0.3 “Camera”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-file-transfer 1.7.1 “File Transfer”
cordova-plugin-firebase 2.0.5 “Google Firebase Plugin”
cordova-plugin-ionic 5.2.7 “cordova-plugin-ionic”
cordova-plugin-ionic-keyboard 2.1.3 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 2.2.0 “cordova-plugin-ionic-webview”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-sqlite-storage 2.5.1 “Cordova sqlite storage plugin”
mx.ferreyra.callnumber 0.0.2 “Cordova Call Number Plugin”

Posts: 1

Participants: 1

Read full topic

Viewing all 48986 articles
Browse latest View live