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

Network events not working

$
0
0

Using the above packages I get nothing.


Ionic 4 FileTransfer on HTTPS Error code 3

$
0
0

FileTransfer error code 3
java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

when with http url file is going to server but when i am trying to do same with https i am getting java.security error

Network events not working

$
0
0

In my case below versions i having it

@ionic-native/network”: “^5.8.0”,
“cordova-plugin-network-information”: “2.0.1”,

Can you tell how you are testing in browser or real device ??

Network events not working

$
0
0

real device,

Galaxy S10 and a One Plus.

Threejs and Ionic4

$
0
0

I am trying to implement threejs in Ionic app and somehow it only renders the object for a split second, and then gives up and returns to a blank white screen. Could I get some help on this please?

Tab icons not showing

$
0
0

same issue for me in ios ,still there is no workaround for that .

Toast Yes/No buttons?

$
0
0

You can add more than one button using ionic 4

 async presentToastWithOptions() {
    const toast = await this.toastController.create({
      header: 'Toast header',
      message: 'Click to Close',
      position: 'top',
      buttons: [
        {
          side: 'start',
          icon: 'star',
          text: 'Favorite',
          handler: () => {
            console.log('Favorite clicked');
          }
        }, {
          text: 'Done',
          role: 'cancel',
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });
    toast.present();
  }

Navigation Inside Tab Ionic 4

$
0
0

This is My Tabs routing.module.ts File Code.

const routes: Routes = [
{
path: ‘tabs’,
component: TabsPage,
children: [
{
path: ‘tab1’,
children: [
{
path: ‘’,
loadChildren: ‘…/tab1/tab1.module#Tab1PageModule’
}
]
},
{
path: ‘tab2’,
children: [
{
path: ‘’,
loadChildren: ‘…/tab2/tab2.module#Tab2PageModule’
}
]
},
{
path: ‘tab3’,
children: [
{
path: ‘’,
loadChildren: ‘…/tab3/tab3.module#Tab3PageModule’
}
]
},
{
path: ‘’,
redirectTo: ‘/tabs/tab1’,
pathMatch: ‘full’
}
]
},
{
path: ‘’,
redirectTo: ‘/tabs/tabs/tab1’,
pathMatch: ‘full’
}
];

And I Have One Button In Tab3 When i click The Button Move To Tab1.

Public nav:NavController Add it in the Constructor.

this.nav.navigateRoot(’/tabs/tab1’);

Using This code In Button Click Listener.

But Can’t Navigate Or Move To Tab1. What Will Do?


Legal documents

$
0
0

Hey folks,

Ok so im about to start developing my first mobile app, but few sticky parts, mainly legal.
as a software developer, my company owns everything I create, so how to I get the application in my name?
Also, for other legal documents, how does everyone handle this? do it yourself, or a private solicitor, or some online business??

Any help here would be great as I’m lost

Xhr works in cordova app but not in ionic application

$
0
0

I am trying to send formData using xmlHttpRequest. In a cordova based application, I am able to succesfully establish connection and send data. But the same xhr fails to establish connection when used in ionic application.
Why is it so?
Here is my basic xhr code without any data:

var xhr = new XMLHttpRequest();
xhr.open('POST', '/fdchandler/');
xhr.onload = function() {
  if (xhr.status != 200) { 
	alert(`Error ${xhr.status}: ${xhr.statusText}`); 
  } else { // show the result
	alert(`Done, got ${xhr.response.length} bytes`);
  }
};

xhr.onerror = function(e) {
 alert(JSON.stringify(e));
};
xhr.send();

/fdchandler/ points to the server url. I have configured it through proxy in my ionic.config.json file

Network events not working

Network events not working

$
0
0

Have you Imported Network in app.module and added in provider?

And also call this function inside platform.ready in app.component

initializeApp() {
this.platform.ready().then(() => {
  this.statusBar.styleDefault();
  this.splashScreen.hide();
  const connectSubscription = this.network.onConnect().subscribe(() => {
  console.log('network connected!');
  // We just got a connection but we need to wait briefly
  // before we determine the connection type. Might need to wait.
  // prior to doing any api requests as well.
  console.log(this.network.type);
  setTimeout(() => {
    console.log(this.network.type);
    if (this.network.type === 'wifi' ||
      this.network.type === '4g' 
    ) {
      console.log('we got a connection, woohoo!');
    }
  }, 2500);
});
    
});
}

Network events not working

Ionic and ACF Repeater field

$
0
0

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

Best way to handle UK date strings when 2-way binding to ion-datetime?

$
0
0

I am trying to do 2-way binding with an ion-datetime. However, my date is stored as a string like this: “dd/mm/yyyy”, but the ion-datetime is expecting “mm/dd/yyyy”. I tried binding to a getter and setter as follows:

HTML:

<ion-datetime name="dt_dob" [(ngModel)]="user.getDOB()" (ionChange)="user.setDOB($event)" placeholder="Enter date of birth" display-format="DD MMM YYYY" pickerFormat="DD/MM/YYYY"></ion-datetime>

user class getter/setter:

public getDOB(): string {
  const dateParts: string[] = this.dob.split("/");
  const result = dateParts[1] + "/" + dateParts[0] + "/" + dateParts[2];
  return result;
}

public setDOB($event) {
  const date = $event.target.value;
  const dateParts: string[] = this.dob.split("/");
  const dob: string = dateParts[0] + "/" + dateParts[1] + "/" + dateParts[2];
  this.dob = dob;
}

However, this causes the following error:

Parser Error: Unexpected token '=' at column 17 in 
[user.getDOB()=$event] in ng:///UserPageModule/UserPage.html@32:32 ("
<ion-item>
<ion-label>Date of Birth</ion-label>
<ion-datetime name="dt_dob" [ERROR ->][(ngModel)]="user.getDOB()" (ionChange)="user.setDOB($event)" placeholder="Enter date of birth""): ng:///UserPageModule/UserPage.html@32:32

Can anyone spot what I might be doing wrong here?


Navigation Inside Tab Ionic 4

$
0
0

I think you have to set this.nav.navigateRoot(’/tabs’); as root if you are in different page and Not the child of the tab page.

If you already in the tab page then you just have to set child tab to active mode

Navigation Inside Tab Ionic 4

$
0
0

Thank You for your response ,but i can’t understand. Give Any code example

Set the active tab in Ionic 4

$
0
0

It Cannot Work.What Will Do friend

Android build error: Could not resolve project :CordovaLib

$
0
0

The related problem is described on this Github Issue on the Cordova-Android plugin entitled Cordova generates build.gradle with deprecated “compile” dependencies.

How to fix

  1. Open package.json on your ionic application’s root project folder
  2. Update your cordova-android to 8.0.0.
  3. run npm install to resolve the dependencies.

That should contain the patch to fix that problem.

Network state not getting in Ionic 4

$
0
0

Hi All
For checking internet in app I implemented below code but nothing is triggering

Plugin Installation:
ionic cordova plugin add cordova-plugin-network-information
npm install @ionic-native/network
Testing Enviornment : ios simulator iphone xs 12.1 . (cant test on real device to unavailability )
Internet connection to simulator : WIFI connection in MacBook

Code:

        this.platform.ready().then(() => {
          if (this.platform.is('ios')) {

             // watch network for a disconnection
          let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
            alert('network was disconnected :-(');
          });
          
          // stop disconnect watch
          disconnectSubscription.unsubscribe();
          
  
                // watch network for a connection
          let connectSubscription = this.network.onConnect().subscribe(() => {
            alert('network connected!');
            // We just got a connection but we need to wait briefly
             // before we determine the connection type. Might need to wait.
            // prior to doing any api requests as well.
            setTimeout(() => {
              if (this.network.type === 'wifi') {
                alert('we got a wifi connection, woohoo!');
              }
            }, 3000);
          });
          
          // stop connect watch
          connectSubscription.unsubscribe();
     
          }
    });

Can somebody tell me my mistake?.
Thanks

Viewing all 228535 articles
Browse latest View live


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