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

Only showing white screen, provider for NavController not found

$
0
0

So what I’m trying to do is simulate a logout from my HomePage

Here’s the error:

My sidebar is in my app.html Here’s the code:

<ion-menu [content]="sidebar">
<ion-content>
  <ion-list padding>
    <button menuClose ion-item (click)="logout()"><ion-icon name='exit'></ion-icon> Logout</button>
  </ion-list>
</ion-content>

I created the function logout in my app.component.ts Here’s how it looks like:

@Component({
    templateUrl: 'app.html'
})
export class MyApp {

rootPage:any = LoginPage;

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private navCtrl:NavController) {
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();
});
}

logout():void {
    localStorage.removeItem('token');
    localStorage.removeItem('public_id');
    localStorage.removeItem('role_id');
    this.navCtrl.setRoot(LoginPage);
}

}

What am I missing here? Am I supposed to create and export a new class and create a new constructor?


Ionic v1 app appstore rejection because iOS 11.3 on Wi-Fi connected to an IPv6 network

$
0
0

hello guys , i have made an ionic v1 app and inside the app i used tag to show my website content.


<ion-view  view-title="<img src='img/ionic2.png' style='width:80px;margin:7px auto;display:block;position:absolute;left:50% !important;'/><a href='https://sbeiy.krd/' ><img src='img/ionic.png' style='width:80px;margin:7px auto;display:block;position:absolute;left:0px !important;'/></a>">
  <ion-content id="con1" style="overflow:scroll; position:absolute; -webkit-overflow-scrolling: touch; width:100%;height:100%;">
    <object id="iframe1" onload="document.getElementById('con1').scrollTop = 0;"  data="https://www.aleshraq.tv/default.aspx?smartphone=yes"  style="width:100%;border:none;height:100%;padding-top:40px;" scrolling="no"></object>

  </ion-content>
</ion-view>

and my website also support IPv6 and this is the 4th time Apple reject my app for the same reason

Thank you for your resubmission. We continue to find the following:

Guideline 2.1 - Performance - App Completeness

We discovered one or more bugs in your app when reviewed on iPhone and iPad running iOS 11.3 on Wi-Fi connected to an IPv6 network.

Specifically, the content does not load inside your app.

Please see attached screenshots for details.

and also i tested my app according to apple’s web test for IPv6 documentation
Apple IPv6 documentation
and my app works fine

and i used these plugins in my app:

<allow-navigation href="http://localhost:8080/*" />
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
    <engine name="android" spec="6.3.0" />
    <engine name="ios" spec="^4.5.4" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
    <plugin name="cordova-plugin-device" spec="^1.1.4" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-azure-notification-hubs" spec="^1.0.3" />

but every time i get a reject please help its so urgent, thank you.

Changing the css class of Button on Alert

$
0
0

This is old but this can help someone.

You can add specific classes in alert button using cssClass as mentioned in Ionic AlertController -

const alert = this.alertCtrl.create({
  title: 'Alert title',
  subTitle: 'Alert body content.',
  buttons: [
    { text: 'Later', handler: data => { }, cssClass: 'failure-button' },
    { text: 'Submit', handler: data => { }, cssClass: 'success-button' },
  ]
});

Submenu for sidemenu in ionic 3

$
0
0

Array names are different… i assure it.

The content are displayed from array…but both menus are expanding while clicking one menu.that is the problem.

I kindly request your Help

Convert ionic native mediaobject audio to blob

$
0
0

Hay folks. I need some really quick solution. I hope you can help me solve this.

I am using ionic native media object : https://ionicframework.com/docs/native/media/
I record sound on android or ios, then i want to upload it to node.js server. The thing is node.js server must get base64 encoded audio. so I have to get base64 of audio in ionic. I don’t know how to do that. I tried to use plugin : https://ionicframework.com/docs/native/base64/ but it’s in beta , not a good one also because many people say doesn’t work for ios. so I tried Javascript FileReader.

var reader = new FileReader();
reader.readAsDataURL(blob);

// but there it only accepts blob, not a filepath or audiomedia object. so I figured I have to transfer my audio to blob.

I tried

1) var blob = new Blob([this.audio], {type:‘audio/mp3’});
2) var blob = new Blob([this.filePath], {type:‘audio/mp3’});
and than reader.readAsDataURL(blob).

Thing is it gives me base64 encoded, but it’s so little length. i send it to server but in server it doesn’t play.
I guess it goes in a bad base64 form from ionic. (because it’s too little) . on pc i am using react , i send base64 and it’s too big . that’s why i think i am making a terrible mistake. could you point me out to the right direction?

Thanks

getRootNav() deprecated, use getRootNavById(): what's the value of the root nav id?

$
0
0

Oh actually that’s a post a originally created :wink:

So well then here the current status and why I gonna mark this thread as solved:

Go on with getRootNav() if you use Ionic v3

In any case, as far as I understand, the all routing will be different with v4

Only showing white screen, provider for NavController not found

$
0
0

Where do you call the logout() function?
Also how do you import NavController?

try this:

export class MyApp {
@ViewChild('myNav') nav: NavController // <--- Reference to the Nav

rootPage:any = LoginPage;

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private navCtrl:NavController) {
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();
});
}

logout():void {
    localStorage.removeItem('token');
    localStorage.removeItem('public_id');
    localStorage.removeItem('role_id');
    this.nav.setRoot(LoginPage);
}
}

and in your app.html:
<ion-nav #myNav [root]="rootPage"></ion-nav>

Also dont forgett to import “ViewChild” to get it to work.

Ionic PWA, setRoot()

$
0
0

Sadly no improvements… Will keep looking for a solution. Its wierd because it worked fine earlier, and we havent touched the login part since…


Submenu for sidemenu in ionic 3

$
0
0

I’ll help you tomorrow. Office timing is over. Ping me in the morning.

Only showing white screen, provider for NavController not found

$
0
0

yes I just discovered what ViewChild is. It’s working properly now thanks :slight_smile:

On another note though, I want to put a custom alert here in my app.component.ts. Should I put it in my app.scss file?

Submenu for sidemenu in ionic 3

$
0
0

Thanks for your concern…will ping in the morning

Ionic PWA, setRoot()

$
0
0

:frowning:

well I’m a bit out idea too, good luck, keep posted with the solution when you will find it

How to create a project in Ionic v4

$
0
0

I have the latest CLI and using start does not give a v4 project. What am I missing here. Can you give it a try and let me know. Thanks.

How to create a project in Ionic v4

$
0
0

Unfortunally I will not have the time :frowning: Hope someone could help you

In anycase, you could start the project, then update manually package.json and then remove package-lock.json and node_modules and then npm install and that should do it too

navPush does not work

$
0
0

thanks, it works very well for me


Ionic v1 app appstore rejection because iOS 11.3 on Wi-Fi connected to an IPv6 network

$
0
0

What does the screenshot show?

Search submit button text: Search or Go

$
0
0

Thanks, that works!

I guess it even makes sense too, but it’s odd that it wasn’t documented or even found in other forum posts. Oh well, it’s here now. Cheers.

Windows Universal app blocked by firewall

Ionic v1 app appstore rejection because iOS 11.3 on Wi-Fi connected to an IPv6 network

$
0
0

Just a guess really, but I presume that Apple is not fond of using iframe/object/embed to display external websites inside apps (and in my opinion, it’s not a good look either way). Whatever data you’re trying to expose there, you might want to either find a way to display it natively (e.g. via API) or you might want to use cordova-plugin-inappbrowser, which is probably going to eliminate whatever problem they’re flagging here.

My Ionic2 is Geolocation Map is loaded only for the first time, after that it shows blank screen

$
0
0

Try something like this to reset the map container on each view enter event.

  initialMapLoad: boolean = true;

  //...

  resetMapContainer(div:string,visible:boolean){
    setTimeout(()=>{
      if(this.map){
        this.map.setDiv(div);
        this.map.setVisible(visible);
      }
    },600) // timeout is a bit of a hack but it helps here
  }

  ionViewWillEnter(){
    if (!this.initialMapLoad) {
      // subsequent loads...
      this.resetMapContainer('map',true); // assumes div has id of map
    } else {
      // first load...
      this.initialMapLoad = false;
    }
  }
Viewing all 228500 articles
Browse latest View live


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