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

Ionic Profile Page

$
0
0

Hi,

I am creating an app that is going to have the Profile page, can anyone help me with the design. I have created something but I am not happy with the look.

//sirsbusiso

1 post - 1 participant

Read full topic


ActionSheet - Email composer - Ionic 5 - All Available Mails - Ios

@zxing/ngx-scanner Can't get user media, this is not supported

$
0
0

Hello, I have a problem when using zxing ngx scanner in iOS and Android
On browsers it works but not in iOS and android applications, I have an error:
" @zxing/ngx-scanner Can’t get user media, this is not supported."

I tried to generate a certificate and I added those lines in my config.xml:

<resource-file src="ssl/server.crt" target="app/src/main//assets/server.crt" />

in platform android and:

<resource-file src="ssl/server.crt" />

in platform iOS.

Can you help me?

(sorry for my English, I’m French)

1 post - 1 participant

Read full topic

In Ionic 5 + Capacitor event.preventDefault() doesn't prevent blur on div contenteditable="true" on iOS device

$
0
0

Hey there,

In my Ionic 5 + Capacitor project I need in my app to have an ability to put cursor on div contenteditable=“true” and then tap some tool on the toolbar without losing focus from this div.
For testing purposes I’ve got the following simple code for home page:

html:

<ion-header>
  <ion-toolbar>
    <ion-title>
      Blank
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>

  <input class="inp" value="input text">

  <div
    class="dv"
    contenteditable="true"
    autocomplete="on"
    autocorrect="on"
  >div contenteditable text</div>

</ion-content>

<ion-footer>
  <div id="toolbar" (mousedown)="preventBlur($event)" (touchstart)="preventBlur($event)">
    toolbar
  </div>
</ion-footer>

css:

.inp {
  width: 100%;
  border: 5px solid green;
}

.dv {
  user-select: auto;
  height: 100px;
  border: 5px solid blue;
}

ion-footer {
  div {
    height: 100px;
    border: 5px solid red;
  }
}

js:

import { Component } from '@angular/core';

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

  constructor() { }

  preventBlur(event) {

    console.log('event: ', event);

    event.preventDefault();

    event.stopPropagation();
  }
}

In desktop browser it works fine. Neither input nor div contenteditable=“true” lose their focuses when clicking toolbar div.
BUT on a real iOS device or emulator putting cursor on input and tapping toolbar still keeps focus as need but div contenteditable=“true” loses its focus.
What’s also interesting is that the same code for Ionic 3 + cordova works the opposite way: input loses focus but div doesn’t!

Does anyone have ideas why it happens?

BTW you can download Ionic 5 / 3 projects to replicate the issue from here:

Thanks,
Andrew.

1 post - 1 participant

Read full topic

IOS issue in ionic

$
0
0

Hi Team,

In forgot password, we are sending the verification code for forgot password in mobile this functionality is not working in IOS. Do we need to add any permission for IOS. In IOS when we click forgot password link the page is not appearing. the same forgot password working fine in Android device.

Thanks in Advance. kindly reply me.

2 posts - 2 participants

Read full topic

How to check if the device runs Capacitor?

$
0
0

Hi,
I have an app done with Ionic5 and Capacitor, I need to have different code if the app runs on a browser or on a real device.

However, using the Platform the command:

this.plaform.is(‘capacitor’))

always returns false.

How can I understand if I’m on a real device?
Thank you very much

cld

1 post - 1 participant

Read full topic

Align horizontally two elements

$
0
0

Hi
I have a problem aligning 2 elements horizontally w ionic

The select at left have to use just 2 cols, and the input have to use the rest (10 cols)
(I tried using col=“2” and col=“10” respectively, but didn’t work)

They look like this now:

Captura de pantalla 2020-06-30 a la(s) 14.15.42

How can I resolve this?

My code

ID Opt1 Opt2
          <ion-label position="stacked">ID</ion-label>
          <ion-input required type="text" oninput=""></ion-input>
        </ion-row>
        </div>
    </ion-item>

1 post - 1 participant

Read full topic

Change ion grid structure dinamically

$
0
0

Hi im using ion-grid to organize my application content, i need to move elements while application is running because i need to show different templates between users.
Someone can view a logo in right bottom corner and another one can view this logo in the center of the screen.

is there any way to change grid structure?

i had an idea and tried it, with pure html and css like this


<ion-content>
    <div class="grid-content">
        <ion-item class="item-logo">
            item one
        </ion-item>

        <ion-item class="item-name">
            item two
        </ion-item>

    </div>
</ion-content>
.....

and Css


.grid-content{
  display: grid;
  grid-gap: 10px; 
}
 
.item-name{
  grid-column: var(--col-name) ;
  grid-row: var(--row-name);
}

.item-logo{
  grid-column: var(--col-logo);
  grid-row: var(--row-logo);
}

And later change the variables with elementRef, but application show blank page.

1 post - 1 participant

Read full topic


Ionic 5 - Disable swipe to previous page

$
0
0

I’m unable to disable the swipe to go back in my app.

I have my auth page, and after the user log in with credentials, the user is able to swipe back to the log in page, I don’t want this behavior but I can’t find how to stop this with the new Ionic documentation

I was thinking of cleaning the stack of pages after the user gets logged or disabling the swipe action only in the page after the auth process.

Which one is a better practice? Could anyone provide the code or documentation to achieve any of both process?

Thanks in advance!

1 post - 1 participant

Read full topic

How i can use history or push to new url in while it's placed outside ?

$
0
0
<IonApp>
      <IonReactRouter>
        <MenuSide />
        <IonRouterOutlet>
          <Route
            path="/home"
            render={(props) => {
              return <HomePage {...props} />
            }}
          />
       </IonReactRouter>
</IonApp>

1 post - 1 participant

Read full topic

Google plus login not working after updating to ionic 5

NullInjectorError: No provider for IonRouterOutlet!

$
0
0

Hi guys, I really need your help. I’m about to rage quit!

I’m trying to create a simple modal component but keep getting this error and I don’t know what to do :sob:

Discover Page” is a tab of my “Index Page

discover.module.ts

import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";
import { IonicModule } from "@ionic/angular";
import { DiscoverPageRoutingModule } from "./discover-routing.module";
import { DiscoverPage } from "./discover.page";

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule.forRoot(),
    DiscoverPageRoutingModule,
  ],
  declarations: [DiscoverPage],
})
export class DiscoverPageModule {}

discover.page.ts

...
import { StoreProfileModalComponent } from "../../components/store-profile-modal/store-profile-modal.component";
import { ModalController, IonRouterOutlet } from "@ionic/angular";
...
constructor(
    private routerOutlet: IonRouterOutlet,
    private modalController: ModalController
  ) {}

async openStoreProfileModal(storeID: number) {
    const storeProfileModal = await this.modalController.create({
      component: StoreProfileModalComponent,
      presentingElement: this.routerOutlet.nativeEl,
      swipeToClose: true,
      componentProps: {
        storeID: storeID,
      },
    });
    return await storeProfileModal.present();
  }

Please help

1 post - 1 participant

Read full topic

[ionic5] cordova-res not working

$
0
0

Hey, im trying to change my app icon using cordova-res.

I installed cordova-res by:

npm install cordova-res@latest -g

When im using cordova-res I get this:

Error: Unmatched closing tag: widget
Line: 15
Column: 9
Char: >
at error (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/sax/lib/sax.js:666:10)
at strictFail (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/sax/lib/sax.js:692:7)
at closeTag (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/sax/lib/sax.js:893:7)
at SAXParser.write (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/sax/lib/sax.js:1436:13)
at XMLParser.feed (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/elementtree/lib/parsers/sax.js:48:15)
at ElementTree.parse (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/elementtree/lib/elementtree.js:271:10)
at Object.parse (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/node_modules/elementtree/lib/elementtree.js:584:8)
at Object.read (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/dist/cordova/config.js:151:39)
at async AsyncFunction.CordovaRes [as run] (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/dist/index.js:24:22)
at async AsyncFunction.runCommandLine (/Users/company/.nvm/versions/node/v14.4.0/lib/node_modules/cordova-res/dist/index.js:92:28)

1 post - 1 participant

Read full topic

Fonts selection for hybrid apps from Accessibility stand point

$
0
0

hello All, In a Hybrid mobile app, is it best to stick with default fonts that are coming from OS, for example, Roboto for Android and San Francisco for iOS, or should we overwrite and use a different one from accessibility standpoint? for example, Muli which is from google fonts? is there any resource that I can look into? Thanks in advance.

1 post - 1 participant

Read full topic

Pinch Image in Ionic 5

$
0
0

Good day! Has anyone managed to get an image pinch working in Ionic 5 ? Could anyone suggest please.

1 post - 1 participant

Read full topic


Can iOS Block my app for Limit Funcionality?

$
0
0

Hi all

I have a question about how iOS works, I have an application in the App Store, I need to block functionality if the user does not have the latest version installed.

Does anybody know if there is a problem when it comes to blocking / banning the application due to this issue?

From already thank you very much
Regards

1 post - 1 participant

Read full topic

Is there an Apollo client example?

$
0
0

Hi,
my Angular app built with Ionic is not working on Android. Apollo client is not responding. On PC everything is fine. Is there any example I could try? My generated build.gradle files do not contain any reference to Apollo, is it correct?
Thanks

1 post - 1 participant

Read full topic

Ionic5 app problems on Android 5.1

$
0
0

I am creating an app with latest version of Ionic, that would run on a device with Android 5.1. The problem is that the app doesn’t look correctly once deployed to the actual device:

Left side is how it looks on the browse; right side is how it actually looks on the device (BTW, the Server # input on the device HAS a value, but its not visible for some reason). Any ideas of what the problem may be ?

Regards

Victor Espina

PD-1: Just tried with Capacitor: same problem.
PD-2: The problem is specific to Android 5.1. Just installed the exact same APK on an Android 6 and it runs perfectly.

1 post - 1 participant

Read full topic

Angular Routing Issue, "Can't resolve all parameters for NavParams: (?)"

$
0
0

Currently, I have been working on upgrading my current Ionic Cordova application from Ionic 3 to Ionic 5. In the process, the Angular routing has been throwing many errors and I was able to resolve most of them but when I try to change the root page for the application I always end up with a blank screen. I tried many online solutions but they did not work for me. Originally I tried the lazy loading method for all my pages but I found that it is a poor method so I changed it with direct imports. Currently, this is my app module:

@NgModule({
    declarations: [MyAppPage,
    ],
    entryComponents: [MyAppPage],
    imports: [BrowserModule,
        AppRoutingModule,
        HttpClientModule,
        IonicSignaturePadModule,
        IonicModule.forRoot()],
    providers: [
        StatusBar,
        SplashScreen,
        { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
        ApiService,
        Device,
        Camera,
        InAppBrowser,
        FingerprintAIO,
        LocalNotifications,
        Contacts,
        BackgroundMode,
        Keyboard,
        Firebase,
        Badge,
        HttpClient,
        IonicsignaturepadProvider,
        NavParams,
    ],
    bootstrap: [MyAppPage],
    schemas: [CUSTOM_ELEMENTS_SCHEMA]

})
export class AppModule {}

This is my app routing file:

import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import {APP_BASE_HREF} from '@angular/common';
import {AuthPageModule} from './auth/auth.module';
import {CareTeamPageModule} from './care-team/care-team.module';
import {CommunitiesPageModule} from './communities/communities.module';
import {DashboardPageModule} from './dashboard/dashboard.module';
import {FaqPageModule} from './faq/faq.module';
import {ForgotPasswordPageModule} from './forgot-password/forgot-password.module';
import {ForgotUsernamePageModule} from './forgot-username/forgot-username.module';
import {FriendsPageModule} from './friends/friends.module';
import {HcsPageModule} from './hcs/hcs.module';
import {HistoryPageModule} from './history/history.module';
import {LoginPageModule} from './login/login.module';
import {MedicineDetailPageModule} from './medicine-detail/medicine-detail.module';
import {MedicinesPageModule} from './medicines/medicines.module';
import {NotificationsPageModule} from './notifications/notifications.module';
import {PrivacyPageModule} from './privacy/privacy.module';
import {ProfilePageModule} from './profile/profile.module';
import {SettingsPageModule} from './settings/settings.module';
import {SignupPageModule} from './signup/signup.module';
import {TermsPageModule} from './terms/terms.module';
import {WearablesPageModule} from './wearables/wearables.module';

const routes: Routes = [
  { path: '', redirectTo: 'login', pathMatch: 'full' },
  {
    path: 'login',
    component: LoginPageModule
  },
  {
    path: 'auth',
    component: AuthPageModule,
  },
  {
    path: 'care-team',
    component: CareTeamPageModule
  },
  {
    path: 'communities',
    component: CommunitiesPageModule
  },
  {
    path: 'dashboard',
    component: DashboardPageModule
  },
  {
    path: 'faq',
    component: FaqPageModule
  },
  {
    path: 'forgot-password',
    component: ForgotPasswordPageModule
  },
  {
    path: 'forgot-username',
    component: ForgotUsernamePageModule
  },
  {
    path: 'friends',
    component: FriendsPageModule
  },
  {
    path: 'hcs',
    component: HcsPageModule
  },
  {
    path: 'history',
    component: HistoryPageModule
  },
  {
    path: 'medicine-detail',
    component: MedicineDetailPageModule
  },
  {
    path: 'medicines',
    component: MedicinesPageModule
  },
  {
    path: 'notifications',
    component: NotificationsPageModule
  },
  {
    path: 'privacy',
    component: PrivacyPageModule
  },
  {
    path: 'profile',
    component: ProfilePageModule
  },
  {
    path: 'settings',
    component: SettingsPageModule
  },
  {
    path: 'signup',
    component: SignupPageModule
  },
  {
    path: 'terms',
    component: TermsPageModule
  },
  {
    path: 'wearables',
    component: WearablesPageModule
  },
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules, enableTracing: true, useHash: true }),
    AuthPageModule,
    CareTeamPageModule,
    CommunitiesPageModule,
    DashboardPageModule,
    FaqPageModule,
    ForgotPasswordPageModule,
    ForgotUsernamePageModule,
    FriendsPageModule,
    HcsPageModule,
    HistoryPageModule,
    LoginPageModule,
    MedicineDetailPageModule,
    MedicinesPageModule,
    NotificationsPageModule,
    PrivacyPageModule,
    ProfilePageModule,
    SettingsPageModule,
    SignupPageModule,
    TermsPageModule,
    WearablesPageModule,
  ],
  providers: [{ provide: APP_BASE_HREF, useValue: '/' }, ],
  exports: [RouterModule]
})
export class AppRoutingModule { }

This is the app component:

import {Component, ViewChild} from '@angular/core';
import { NavController, Platform, ToastController, MenuController} from '@ionic/angular';
import { Router } from '@angular/router';
import {DashboardPage} from './dashboard/dashboard.page';
import {MedicinesPage} from './medicines/medicines.page';
import {CareTeamPage} from './care-team/care-team.page';
import {HcsPage} from './hcs/hcs.page';
import {SettingsPage} from './settings/settings.page';
import {CommunitiesPage} from './communities/communities.page';
import {FaqPage} from './faq/faq.page';
import {WearablesPage} from './wearables/wearables.page';

import {NotificationsPage} from './notifications/notifications.page';

import {FriendsPage} from './friends/friends.page';

import {Keyboard} from '@ionic-native/keyboard/ngx';

import {ApiService} from './services/app.services';
import {BackgroundMode} from '@ionic-native/background-mode/ngx';

import {Firebase} from '@ionic-native/firebase/ngx';

import {Badge} from '@ionic-native/badge/ngx';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';

@Component({
    templateUrl: 'app.component.html',
    selector: 'app-root',
})
export class MyAppPage {
    @ViewChild(NavController) nav: NavController;

    backButtonPressedOnceToExit: any;
    menu: any;
    document: any;
    pages: Array<{ title: string, component: any, icon: string }>;
    hideWaves: boolean;
    bgInterval: any;
    config: {
        scrollAssist: false,
        autoFocusAssist: false
    };

    constructor(public platform: Platform,
                public splashScreen: SplashScreen,
                private toastCtrl: ToastController,
                private route: Router,
                // tslint:disable-next-line:no-shadowed-variable
                private ApiService: ApiService,
                public menuCtrl: MenuController,
                private keyboard: Keyboard,
                private backgroundMode: BackgroundMode,
                private fcm: Firebase,
                private badge: Badge
    ) {
        this.initializeApp();

        this.hideWaves = false;

        // used for an example of ngFor and navigation
        this.pages = [
            {title: 'Today\'s Meds', component: DashboardPage, icon: 'assets/imgs/menu-today-med.png'},
            {title: 'Medicines', component: MedicinesPage, icon: 'assets/imgs/menu-medicine.png'},
            {title: 'Healthcare Providers', component: CareTeamPage, icon: 'assets/imgs/menu-care-team.png'},
            {title: 'Invite Friends', component: FriendsPage, icon: 'assets/imgs/menu-friends.png'},
            {title: 'Communities', component: CommunitiesPage, icon: 'assets/imgs/menu-communities.png'},
            {title: 'Connect to healthcare systems', component: HcsPage, icon: 'assets/imgs/menu-hcs.png'},
            {title: 'Devices / Wearables', component: WearablesPage, icon: 'assets/imgs/menu-wearables.png'},
            {title: 'Notifications', component: NotificationsPage, icon: 'assets/imgs/menu-notification.png'},
            {title: 'Settings', component: SettingsPage, icon: 'assets/imgs/menu-setting.png'},
            {title: 'Help & Support', component: FaqPage, icon: 'assets/imgs/menu-help.png'}
        ];

        if (localStorage.getItem('userToken')) {
            this.route.navigate(['auth']);
        }else{
            this.route.navigate(['login']);
        }

    }

    initializeApp() {
        this.platform.ready().then(() => {

            // Clear badge
            this.badge.clear();
            // Okay, so the platform is ready and our plugins are available.
            // Here you can do any higher level native things you might need.
            // this.statusBar.styleDefault();
            this.splashScreen.hide();
            // this.backgroundMode.enable();
            // this.keyboard.onKeyboardShow().subscribe( (value)=>{
            //   this.hideWaves = true;
            // });

            // this.keyboard.onKeyboardHide().subscribe( (value)=>{
            //   this.hideWaves = false;
            // });

            // this.platform.registerBackButtonAction(() => {
            //   if (this.backButtonPressedOnceToExit) {
            //     this.platform.exitApp();
            //   } else if (this.nav.canGoBack()) {
            //     this.nav.pop({});
            //   } else {
            //     this.menu.close(); //Close menu if open
            //     this.showToast();
            //     this.backButtonPressedOnceToExit = true;
            //     setTimeout(() => {
            //       this.backButtonPressedOnceToExit = false;
            //     },2000)
            //   }
            // });
        });
    }

    logout() {
        this.menuCtrl.close();
        this.menuCtrl.get().then((menu: HTMLIonMenuElement) => {
          menu.swipeGesture = false;
        });
        this.ApiService.showToast('Logged Out');
        localStorage.removeItem('userId');
        localStorage.removeItem('userToken');
        localStorage.removeItem('userDetails');
        localStorage.removeItem('userNotifications');
    }

    profile() {
        this.menuCtrl.close();
        this.route.navigateByUrl('/profile');
    }

  async showToast() {
        const toast = await this.toastCtrl.create({
            message: 'Press Back Again To Exit The App',
            duration: 3000,
            position: 'bottom'
        });
        toast.present();
    }

    openPage(page) {
        // Reset the content nav to have just this page
        // we wouldn't want the back button to show in this scenario
        this.nav.navigateRoot(page.component);
    }
}

app.component.html:

<ion-menu [attr.content]="content" type="overlay" contentId="main">
<!--   <ion-header>
    <ion-toolbar>
      <ion-title>Menu</ion-title>
    </ion-toolbar>
  </ion-header>
 -->
  <ion-content>
    <div class = "menu-header">
    </div>
    <div class="ion-text-center center-content relative" (click) = "profile()">
      <img id = "userPicture" alt = "" src = "assets/imgs/user-default.png" />
      <div class = "profile-edit">
        <div class="ion-text-center">
          <img alt = "" src = "assets/imgs/camera_green.png" />
        </div>
      </div>
    </div>
    <ion-list class = "menu-list">
      <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
        <img [src] = "p.icon" item-left />
        {{p.title}}
      </button>
    </ion-list>
    <div class="ion-text-right logout" (click) = "logout()">
      Logout
    </div>
  </ion-content>

</ion-menu>

<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-app>
<router-outlet></router-outlet>
</ion-app>

login page routing module:

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { LoginPage } from './login.page';

const routes: Routes = [
  {
    path: '',
    component: LoginPage
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes),
            IonicModule,
            CommonModule,
            FormsModule],
  exports: [RouterModule],
})
export class LoginPageRoutingModule {}

login.page.ts:

import { Component, OnInit } from '@angular/core';
import { NavController, Platform, NavParams, MenuController } from '@ionic/angular';
import {Routes, RouterModule, Router, ActivatedRoute} from '@angular/router';

import { ApiService } from '../services/app.services';
import { LoadingController } from '@ionic/angular';
import {NavigationExtras} from '@angular/router';
import { StatusBar } from '@ionic-native/status-bar/ngx';

@Component({
  selector: 'app-login',
  templateUrl: './login.page.html',
  styleUrls: ['./login.page.scss'],
  providers: [NavParams]
})
export class LoginPage implements OnInit {
  public navParams: NavParams;
  loginState: string;
  user: any;
  loading: any;
  hideWaves: boolean;
  origCode: number;
  showForgotPassword: boolean;
  userMobile: number;
  passwordType = 'password';
  passwordIcon = 'eye-off';
  constructor(private route: Router,
              public navCtrl: NavController,
              public statusBar: StatusBar,
              private loadingCtrl: LoadingController,
              private ApiService: ApiService,
              public menuCtrl: MenuController,
              public platform: Platform,
              private actRoute: ActivatedRoute,
  ) {
      this.loginState = 'init';
      this.showForgotPassword = false;
      this.user = {};
      this.actRoute.queryParams.subscribe(params => {
        if (route.getCurrentNavigation().extras.state) {
          this.loginState = route.getCurrentNavigation().extras.state.item;
        }
      });
      this.menuCtrl.get().then((menu: HTMLIonMenuElement) => {
        menu.swipeGesture = false;
      });
      this.statusBar.backgroundColorByHexString('#000000');
      this.statusBar.styleLightContent();
    }


  ngOnInit() {
    this.platform.ready().then(() => {
      // let video = this.mVideoPlayer.nativeElement;
      // video.src = "assets/video/clinakos_video.mp4";
      // video.load();
    });
  }

  ionViewWillLeave() {
    // the .nativeElement property of the ViewChild is the reference to the tag <video>
    // this.mVideoPlayer.nativeElement.src = '';
    // this.mVideoPlayer.nativeElement.load();
  }

  signUp() {
    this.navCtrl.navigateRoot('/signup');
  }

  signIn() {

    if ( (this.user.username) && (this.user.password) ) {

      this.loading = this.loadingCtrl.create({
        message: 'Please wait...'
      });
      this.loading.present();

      this.ApiService.login(this.user)
      .then(r => {
        localStorage.setItem('userToken', r.token);
        localStorage.setItem('userId', r.userId);

        // Check if user has reminders.
        this.ApiService.getReminders()
        .then(r => {
          this.loading.dismiss();
          this.navCtrl.navigateRoot('/dashboard');
          this.ApiService.showToast('Logged In');
        })
        .catch(e => {
          this.navCtrl.navigateRoot('/medicines');
          this.loading.dismiss();
          this.ApiService.showToast('Logged In');
        });



        this.menuCtrl.enable(true);
        this.menuCtrl.get().then((menu: HTMLIonMenuElement) => {
          menu.swipeGesture = true;
        });

        if (localStorage.getItem('userNotifications') === null) {
          localStorage.setItem('userNotifications', JSON.stringify([]));
        }

      })
      .catch(e => {
        console.log (e);
        if (e.status == '404') {
          this.ApiService.showToast('User does not exist');
        }
        if (e.status == '400') {
          this.ApiService.showToast('Invalid credentials');
          this.showForgotPassword = true;
        }
        this.loading.dismiss();
      });
    } else {
      this.ApiService.showToast('Please enter username and password');
    }

  }

  terms() {
    this.navCtrl.navigateForward('/terms');
  }

  privacy() {
    this.navCtrl.navigateForward('/privacy');
  }

  navigateForgotPasswd() {
    const navigationExtras: NavigationExtras = { state: { user: this.user } };
    this.navCtrl.navigateForward('/forgot-password', navigationExtras);
  }

  navigateForgotUserName() {
    const navigationExtras: NavigationExtras = { state: { user: this.user } };
    this.navCtrl.navigateForward('/forgot-username', navigationExtras);
  }

  hideShowPassword() {
    this.passwordType = this.passwordType === 'text' ? 'password' : 'text';
    this.passwordIcon = this.passwordIcon === 'eye-off' ? 'eye' : 'eye-off';
  }

}

This is the error I am receiving when the app tries to startup and move to the login page:

"Uncaught Error: Can't resolve all parameters for NavParams: (?)."

1 post - 1 participant

Read full topic

App reject from app store due to blank screen

$
0
0

My app was reject from the app store with the following message.

We discovered one or more bugs in your app when reviewed on iPad running iOS 13.5.1 on Wi-Fi.

Specifically, the app displayed a blank screen upon launch and we were unable to proceed.

Everything on my app works fine while my device is connected to wifi and running ionic cap run ios -l --external

I was able to reproduce this error a few ways.

  1. Turning off wifi and trying to run app on cellular network
  2. Putting my device in airplane mode
  3. Building and running the app without ionic serve ionic cap run ios --release --prod

xcode is giving me the following error:

:zap: WebView failed provisional navigation :zap: Error: Could not connect to the server.

can anyone point me in the right direction to a solution to this issue?

I am using ionic/react/capacitor to build the app

1 post - 1 participant

Read full topic

Viewing all 49526 articles
Browse latest View live


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