Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228598 articles
Browse latest View live

Ionic Native Image Picker is not working it is asking permissions after that app is crashing

$
0
0

Hi, you can use <input type="file" /> instead of image picker plugin. .
It works for both in mobile and browser. Here is small example:
html:

   <ion-button (click)="uploadFile()"> Upload & Preview </ion-button>
 <img [src]="imageURL ? imageURL : 'assets/dummy-profile-pic.png'" class="rounded mx-auto d-block img-thumbnail" alt="HA">
            <input type="file" *ngIf="!imageURL" (change)="fileChanged($event)" accept="image/*" class="filebtn" #fileButton  />

ts:

imageURL: any;
 @ViewChild('fileButton', { static: false }) fileButton;
constructor() {...}
 uploadFile() {
    this.fileButton.nativeElement.click();
  }
  fileChanged(event) {
    const files = event.target.files;
    console.log(files);
    const reader = new FileReader();
    reader.onload = () => {
      this.imageURL = reader.result;
    };
    reader.readAsDataURL(event.target.files[0]);
  }

Ionic 5 React - ionic serve fails

$
0
0

Try uninstalling the ionic and node and then reinstall.

Error: Cannot find module 'xcode', but I'm building for Andorid

Ionic 5 React - ionic serve fails

$
0
0

I tried on another MacBook and I get the same error.

2 second long gray loading screen

$
0
0

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

How to get the data from alert-prompt

$
0
0

thank you so much is really help me

Ionic5 prod build fails

Ionic5 prod build fails

$
0
0

Thanks @rapropos for clarifying this. Indeed It seems much better to update the dependencies than to use --aot (which is not even part of the help).


sendKeys not working using Appium automation for Hybrid app

$
0
0

Hi, Actually the xpath was wrongly written by me. Have written it correctly and it worked.
Thanks

Printing on bluetooth printers

Err_cleartext_not_permitted

$
0
0

When i run the ionic project using
‘ionic serve --l --devapp’
it works fine but when i run app using
‘ionic cordova run android’
or by creating app using command
‘ionic cordova build android’
It gives api call error “ERR_CLEARTEXT_NOT_PERMITTED”

IONIC INFO
Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\Dilee\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.0.0
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.25
@ionic/angular-toolkit : 2.1.2

Cordova:

cordova (Cordova CLI) : 7.1.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 5 other plugins)

System:

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

POST http://213.239.197.27:9092/sooperexchange/v1/login net::ERR_CLEARTEXT_NOT_PERMITTED

I did all config.xml and security xml changes but unable to resolve it

App doesnt open when clicking notification when app is closed/killed/coldboot

Ionic 5 upgrade issue

Ionic 5 React - ionic serve fails

$
0
0

I’m having the same issue. I tested all 4 @ionic/cli 6.0.0+ versions. The weird thing I found is that this error is present only when choosing a template where the Capacitor prompt pops up:
Integrate your new app with Capacitor to target native iOS and Android?

So the my-first-app and conference starter templates work fine for me.

Ionic 5 upgrade issue

$
0
0

Yes, that will work once you deploy it as app. The AOT flag was earlier used to comes into action only when you build the app with --prod flag in for production build but since Angular 9 , it is now also enabled for development mode.

This helps catching the code errors sooner in development mode only. But someone Ionic 5 is having some issue with that flag for development. So that is fine. Check my other comment for solutions.


Ion-tab icon with custom img

$
0
0

Thanks for sharing, this works great, I had to move the style to app.scss

New ways to debug components in Angular 9 or Ionic 5

Events not worked in ionic 6.1.0

$
0
0

Out of curiosity, when did Ionic 6.1.0 released?

A few days back, Ionic 5 was released. Can you please double-check the version and update your topic.

And by the way, Events are removed in Ionic 5. Please check in the breaking changes https://github.com/ionic-team/ionic/blob/45d03baf981d0e10eb1fe689908532adef2ba31d/BREAKING.md#events-1

You can use observables. For example, create a global service:

import {Injectable} from '@angular/core';
import {Subject} from 'rxjs';

@Injectable({
    providedIn: 'root'
})
export class GlobalFooService {

    private fooSubject = new Subject<any>();

    publishSomeData(data: any) {
        this.fooSubject.next(data);
    }

    getObservable(): Subject<any> {
        return this.fooSubject;
    }
}

Now, for example, you are subscribing to it in app.component.ts:

@Component({
    selector: 'app-root',
    templateUrl: 'app.component.html',
    styleUrls: ['app.component.scss']
})
export class AppComponent {

    constructor(private globalFooService: GlobalFooService) {
        this.initializeApp();
    }

    initializeApp() {
        // other code

        this.globalFooService.getObservable().subscribe((data) => {
            console.log('Data received', data);
        });
    }
}

Now, you just have to emit the event from some other component:

@Component({
    selector: 'app-home',
    templateUrl: 'home.page.html',
    styleUrls: ['home.page.scss']
})
export class HomePage {

    constructor(private globalFooService: GlobalFooService) {
    }

    onSomeButtonClick() {
        this.globalFooService.publishSomeData({
            foo: 'bar'
        });
    }
}

The similar you can do for namespaced events.
Cheers!

Install Ionic Fork locally

$
0
0

Thanks for your Answer! I didn’t make it work yet… Not even with the last one. The @ionic/angular Package has a dependency to @ionic/core. Even when i change this dependency to use the local, build the ionic angular and install the result from dist folder, it doesn’t work.

Ionic doc- no installation information

Viewing all 228598 articles
Browse latest View live