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

Storage plugin is not removing as should

$
0
0

@ctfrancia wrote:

I have a chat app. I decide to delete the conversation, I have this implementation:

  public async deleteConversation(user: Contact): Promise<void> {
    this.conversationStorage.remove(user.id).then((status: any): void => {
      console.log('status after delete', status); //<--undefined
    });
    const status = await this.conversationStorage.get(user.id);
    console.log('this should be null', status); //<--null
  }

but if I find that person again and open up a chat with them then the previous messages are loaded. If I decide to close the chat message then open it up, then and only then is the messages deleted. Essentially I have delete, close the chat window, open up the chat window again (with that person) then it is finally deleted.

Posts: 1

Participants: 1

Read full topic


Ionic serve error: angular.json could not be found

$
0
0

@altergothen wrote:

Hi there

ionic serve was working, then got the following errror:

$ ionic serve
> ng.cmd run app:serve --host=localhost --port=8100
[ng] Local workspace file ('angular.json') could not be found.
[ng] Error: Local workspace file ('angular.json') could not be found.

The previous command i ran (failed) - may have something to do with it?

ionic cordova build android

Please can you advise on the next steps to take in order to restore my project so that I can at least run an ionic serve again.

Thanks.

Posts: 1

Participants: 1

Read full topic

How to use Youtube player API with ionic 4 and capacitor for Android and iOS app

$
0
0

@MadhuCodes wrote:

Hi,

The documentation is not proving to be enough to implement Capacitor Youtube API in my app using Ionic 4.
Can we have a demo app or some more detail on how to play video in the app using this api

Posts: 1

Participants: 1

Read full topic

Using Ionic/Vue with Cordova/Capacitor and Appflow?

$
0
0

@OnnoG wrote:

Does anyone have experience with publishing an Ionic/Vue app using Cordova/Capacitor through Ionic Appflow?

I know Ionic/Vue is still in beta, but there are running examples of at least some combinations: e.g. Ionic/Vue + Cordova or Capacitor is possible. But not Ionic/Vue + Appflow and also not Capacitor + Appflow.

I wonder, if anyone has tried this stack and has maybe some hack until Ionic/Vue is reaching a final state. And is there any news about the road map? When will Ionic/Vue be possible with Appflow?

Posts: 1

Participants: 1

Read full topic

Ionic 4 child route component pushed off screen by .ion-page class of parent

$
0
0

@daddywoodland wrote:

My app (Ionic 4, Angular) is split into lazy loaded features. A number of features have common data shared by each page, for example all pages in the ‘vehicle’ feature need the current selected vehicle, which is retrieved by the ‘id’ in the url.

I have a parent route for the feature that gets the common data and child routes below that actually drive the pages -

Feature Module Route Config sample:

const routes: Routes = [
  {
    path: ':id',
    component: VehiclePage,
    children: [
      {
        path: 'set-info',
        component: SetInfoPage
      },
      {
        path: 'success',
        component: SuccessPage
      },
      {
        path: '',
        component: DashboardPage
      }
    ]
  }

VehiclePage sample:

@Component({
  selector: 'app-vehicles',
  template: '<router-outlet></router-outlet>'
})
export class VehiclePage implements OnInit {
  constructor(
    private route: ActivatedRoute,
    private store: Store<fromRoot.AppState>
  ) {}

  ngOnInit() {
    this.route.params.subscribe(params => {
      this.store.dispatch(new vehicleActions.Get(params['id']))
    })
  }
}

Aaaaaaanyway. The setup is working fine, the child page loads, data is available, everyone’s happy, except…

The parent page, in this case ‘VehiclePage’ has the ion-page class applied, which pushes the child page content off screen. When I remove the ion-page class it looks ok but I’m wary about removing that class from across the app.

With ion-page class, content is pushed off screen:

Without ion-page class it’s fine:

I haven’t seen any examples of this routing config for Ionic though it’s common in Angular.

If there’s any advice on -

  • Anything I’m doing wrong
  • The impact of removing the ion-page class (and how to do it cleanly)
  • Working examples of a similar solution
  • Anything else that might help

it’s greatly appreciated!

Cheers,
Andrew

Posts: 1

Participants: 1

Read full topic

Android App rejected

$
0
0

@rvtech wrote:

Android App Rejected due to sms permission.how we can allow from google to allow permission.is there any replacement of work.I am using @ionic-native/sms package .

Posts: 1

Participants: 1

Read full topic

Ionic HTTPS

$
0
0

@ITTL wrote:

Hi.

I`m using a javascript package that needs HTTPS to comunicate with the server and there’s no way to use HTTP with this package. so my questions are. ¿is it posible to use HTTPS on Android/IOs apps? and ¿How can I change my oringin from http://localhost to https://localhost on Android and IOs?

Posts: 1

Participants: 1

Read full topic

Upload image to database using file_uri

$
0
0

@premktr wrote:

I have post(upload) image to given database using file URI not data_url because it takes too much memory but I don’t know how to upload please help me with the code.
.ts

 getPic(){
     const options: CameraOptions = {
	   quality: 100,
	   sourceType: this.camera.PictureSourceType.SAVEDPHOTOALBUM,
	   destinationType: this.camera.DestinationType.FILE_URI
      }

     this.camera.getPicture(options).then((imageData) => {
	 this.success = 'getting image is successful';
	 this.Image = imageData;
     }, (err) => {
	  this.err = err;
    });
   }

Posts: 1

Participants: 1

Read full topic


Problem with

$
0
0

@JEricaM wrote:

Hi to everyone, these are my stencil and ionic version

"dependencies": {
    "@ionic/core": "one"
  },
  "devDependencies": {
    "@stencil/core": "1.0.0-beta.8"
  }

I’m trying to use the <ion-menu> inside a <ion-split-pane> like in a ionic app, this is my code (this is the original repo of this code https://github.com/modemlooper/stencil-pwa-sidemenu ):

app-root.tsx

[...]
render() {
    return (
      <ion-app>
        <ion-router useHash={false}>
          <ion-route url="/" component="app-home" />
          <ion-route url="/profile/:name" component="app-profile" />
        </ion-router>

        <ion-split-pane when="lg">
          <ion-menu side="start">
            <ion-header>
              <ion-toolbar color="primary" />
            </ion-header>

            <ion-content forceOverscroll={false}>
              <ion-list>
                <ion-menu-toggle autoHide={false}>
                  <ion-item href="/">
                    <ion-icon slot="start" name="home" />
                    <ion-label>Home</ion-label>
                  </ion-item>
                </ion-menu-toggle>

                <ion-menu-toggle autoHide={false}>
                  <ion-item href="/profile/piero">
                    <ion-icon slot="start" name="person" />
                    <ion-label>Profile</ion-label>
                  </ion-item>
                </ion-menu-toggle>
              </ion-list>
            </ion-content>
          </ion-menu>
          <ion-nav main />
        </ion-split-pane>
      </ion-app>
    );
  }
[...]

The problem is that <ion-nav main /> gives me this error:


And without “main” the split pane don’t work properly

This is the expected behaviour

How is it possible to fix this? I don’t get how to use properly the ion menu inside a split pane…
Thank you so much

Posts: 1

Participants: 1

Read full topic

Using Appium to test Ionic

$
0
0

@helpmelearn wrote:

QA is trying to get some automation set up for our Ionic apps using Appium (http://appium.io/)
We realized adding in ids to everything seems to work better.

The problem is for an AlertController trying to click a button on these screens seems to have problems.
I can’t see a way to add an ID to these buttons either.

Any idea?

Posts: 1

Participants: 1

Read full topic

Radio button label is not showing up

$
0
0

@peela wrote:

Hi,

I am new to ionic and facing one weird issue. I am trying to display alter popup with radio button input type. Everything working as expected but for in one scenario i need to call API and get the response and then add those responses on the alter popup as radio buttons. There i am getting response values properly and popup opens and radio buttons are also displaying as expected but didnt see any label for that. Not sure why labels or value are not showing for that radio button. Here is my code and issue screen shot.

Ionic version details:

Error:
image

Code :

if(options[i].indexOf('-')>0){  //THIS BELOW CONDITION IS NOT WORKING. 
          var arrayString=options[i];
          console.log("arrayString:"+arrayString)
            var country = this.restProvider.details.COUNTRY;
            this.restProvider.getResponseOptionsTranslations(arrayString,country).then(res => {
              let transResponses: any =[];
              transResponses = res['value'] as string[];
              for(var i=0;i<transResponses.length;i++){
                if(transResponses[i]["TRANSLATION_VALUE"]!= undefined){
                  var transRes=transResponses[i]["TRANSLATION_VALUE"];
                  alert.addInput({
                    type: 'radio',
                    label:transRes,
                    value:transRes,
                  });
                  console.log("transRes2:"+transRes)
                }
              }
              
            });

Any inputs are highly appreciated.

Posts: 1

Participants: 1

Read full topic

Cordova-plugin-ionic-webview and Capacitor use different 'origins' by default

$
0
0

@schngrg wrote:

For apps currently using cordova-plugin-ionic-webview (v4) and planning to migrate to Capacitor, the saved local storage data will get lost due to different default origins.

From cordova-plugin-ionic-webview documentation:

The default origin for requests from the Android WebView is http://localhost .

The default origin for requests from the iOS WebView is ionic://localhost

From Capacitor documentation:

For example, apps running in Capacitor have capacitor://localhost (iOS) or http://localhost (Android) as their origin.

What is the best way to handle this migration? Can we change the origin for Capacitor to match what we have in cordova plugin, or is it better to configure the cordova plugin ‘now’ to use whatever Capacitor will want to use ‘later’ (at least apps not in production yet)?

cordova-plugin-ionic-webview documentation allows configuring origin, but couldn’t find something similar in Capacitor docs. It will also help if a section is added to Migration guide at https://capacitor.ionicframework.com/docs/cordova/migrating-from-cordova-to-capacitor

Best would be to have default origins same for Capacitor and cordova-plugin-ionic-webview, but that will break existing apps.

Posts: 1

Participants: 1

Read full topic

Moved code from PC to Mac - Won't compile

$
0
0

@JohnCressman wrote:

I began developing on my Windows 10 PC and my app is working well on the PC and I can even sideload it onto my Android device.

I installed ionic on my macbook air (latest version) and moved the code over but it fails to compile - at least, using ionic lab. No real error messages… just the fail to compile.

Is there something I need to do to make the same code work on a macbook?

Posts: 1

Participants: 1

Read full topic

Reading image file into Image()

$
0
0

@mex wrote:

Hello,

I try to select image from camera roll and use it as .src to Image() instance but unfortunately it doesn’t read the file and Image().onerror triggers.

With cordova-plugin-ionic-webview 1.2.x, I could read file with normalizeUrl() function but couldn’t read it on Android. So I updated to cordova-plugin-ionic-webview 4.1.1 and now couldn’t read it on IOS (tried to use window.Ionic.WebView.convertFileSrc() too, it turns ionic:/// link and error occurs again)

How can I achive this?

Posts: 1

Participants: 1

Read full topic

Ionic 4: create reusable alert controller component with data submit

$
0
0

@jordanblaketold wrote:

Hello everyone, i need a little help to build a alert controller reusable component where i want to use handler to submit data, i have 2 functions for insert and edit data, and im using the alert controller handler to archieve this process but i dont know how to pass objects to reuse same code for all my cruds, here are the 2 functions i want to use as service for all my others pages:

Insert data:

async insertarData() {
const alert = await this.uiService.alertController.create({
header: ‘Agregar nueva actividad’,
inputs: [
{
name: ‘nombreActividad’,
type: ‘text’,
placeholder: ‘Ingrese actividad’
}
],
buttons: [
{
text: ‘Cancel’,
role: ‘cancel’,
cssClass: ‘secondary’
}, {
text: ‘Crear’,
handler: data => {
this.actividad.nombreActividad = data[‘nombreActividad’];
this.crearActividad();
}
}
]
});

await alert.present();

}

Edit data:

async editarActividad(){

  const alert = await this.uiService.alertController.create({
    header: 'Agregar nueva actividad',
    inputs: [
      {
        name: 'nombreActividad',
        value: this.actividad.nombreActividad ,
        type: 'text',
        placeholder: 'Ingrese actividad'
      }
    ],
    buttons: [
      {
        text: 'Cancel',
        role: 'cancel',
        cssClass: 'secondary'
      }, {
        text: 'Crear',
        handler: data => {
          this.actividad.nombreActividad = data['nombreActividad'];
           this.actividadService.actualizarPorId(this.actividad.id, this.actividad.nombreActividad).subscribe(
           res => this.uiService.presentToast(res['message']),
           error => this.uiService.alertaInformativa(error)
           );        
        }
      }
    ]
  });

  await alert.present();
}

every comment and advice are totally welcome.

thanks in advance.

Posts: 1

Participants: 1

Read full topic


Having a nightmare with button taps

$
0
0

@simonkincaidkintroni wrote:

Hi All,

I’ve been having a nightmare implementing a PIN entry UI. The nightmare is that button clicks/presses/taps/tapables dont always register, especially if you are trying to type in your PIN really quickly. I’ve even got rid of all the buttons and replaced them with tappable divs.

Has anyone had any problems with multiple buttons on one page, and with quick button presses you miss button actions on some of them?

Posts: 1

Participants: 1

Read full topic

Capacitor plugin for MongoDB Mobile

$
0
0

@taxilian wrote:

Hey all,

Just wanted to let people know I’ve created a capacitor plugin for MongoDB mobile; it should have all the features of mongodb except for server-side javascript (map/reduce, $where queries) and things related to replicasets, etc, which aren’t really relevant to mobile use.

The plugin itself is at https://www.npmjs.com/package/@hamstudy/capacitor-mongodb-mobile and I’ve created a wrapper at https://www.npmjs.com/package/@hamstudy/mongodb-mobile-client which works with the plugin and gives you the same API (promise-based only, no callbacks) as the 3.x node driver.

I’d call this still beta quality as I haven’t had time to write tests for all of the APIs yet but I have written a simple project with tests which pass on both ios and android, so I think anything else not working should be fixable when I find out what the issues are and get some repro cases written for it.

The tests are in this project: https://github.com/HamStudy/capacitor-mongodb-mobile-testApp

Posts: 1

Participants: 1

Read full topic

Ionic CSS Parameter

Inoic support on couchbaselite plugin

$
0
0

@shashike wrote:

Hi,

In couchbase-lite native plugin documentation noticed a notification saying “This plugin is no longer supported by Couchbase. Please see our Couchbase Lite Integration”. Is this means couchbase lite plugin is no longer supported in community edition?

Posts: 1

Participants: 1

Read full topic

ERR_SDK_NOT_FOUND: No valid Android SKD root found

$
0
0

@deizadave wrote:

Hello people.
I’m working on a project with Ionic V4 for the first time. I want to run my app on an emulator and it keeps giving this error:
ERR_SDK_NOT_FOUND: No valid Android SDK root found.

I’ve tried running with various commands: native-run android, ionic cordova run android, ionic cordova run android --no-native-run, ionic run android but they all give the same error.

I ran ionic cordova requirements and I have all requirements (JDK, SDK, gradle) installed.
I need help with this and will appreciate any/all suggestions as this is quite urgent.

Posts: 1

Participants: 1

Read full topic

Viewing all 70434 articles
Browse latest View live


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