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

How to display side menu in left side and right side in ionic 4


Problem with deeplinks initilization

$
0
0

@franco.echevarria.ex wrote:

Hi guys, I need help with the following:
I’m receiving this error: “ReferenceError: Cannot access ‘DeeplinkingProvider’ before initialization”

I have already deeplinks implemented and working, but I’m adding a new route and the destination component is importing algo the DeeplinkingProvider and that is causing the error.
The question is why ? because the other route are using components wich are importing also the DeeplinkingProvider. So i’m doing the same but for this component is not working. Any idea ?

this.deeplinks.route({
        '/invite/:code': EnterInviteCodePage,
        '/invite': EnterInviteCodePage,
        '/sms-verification': EnterSmsCodePage, // <---- with this new component is failing (and is equal to the other component)
        '/home': HomePage
      }).subscribe((match: DeeplinkMatch) => {
        setTimeout(() => {
          if (match.$link) {
            switch (match.$link.host) {
              case '/invite':
                this._code = match.$link.queryString;
                // broadcast code to invite code page
                this._codeObservable.next(this._code);
                break;
              case '/home':
                // broadcast home observable to open home tab when clicking on link
                this._homeObservable.next();
                break;
            }
          }

        }, 100);
      }, (nomatch) => {
        console.error('nomatch:', nomatch);
      });

This is called and intilized after the platform.ready() from another … and working for the current, the problem is with new component. The new component I have tested with an empty component only importing the DeeplinkingProvider or with a copy of the current (and working), both are failing. Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Validation Error Messages not displaying for ion-textarea

$
0
0

@Sweg wrote:

In my Ionic 5 / Angular app, I am trying to display a validation message if a required field within my form is clicked into, & left without having a valid value.

Here is the HTML:

<form formGroup="form">
    <ion-grid>
      <ion-row>
        <ion-col>
          <ion-item lines="none">
            <ion-label position="floating">
              Please describe your issue
            </ion-label>
            <ion-textarea formControlName="message"></ion-textarea>
          </ion-item>
        </ion-col>
      </ion-row>
      <ion-row *ngIf="form.get('message').invalid && form.get('message').touched">
        <ion-col>
          <p>Invalid Message</p>
        </ion-col>
      </ion-row>
      <ion-row>
        <ion-col>
          <ion-button (click)="onSendMessage()">
            <ion-icon slot="end" name="send-outline"></ion-icon>
            Send
          </ion-button>
        </ion-col>
      </ion-row>
    </ion-grid>
  </form>

And here is the Typescript:

ngOnInit() {
    this.form = new FormGroup({
      message: new FormControl(null, {
        updateOn: 'blur',
        validators: [
          Validators.required,
        ]
      })
    });
  }

  onSendMessage() {
    console.log('', this.form);
  }

But if I click into the ion-textarea & leave without entering a value, the error message isn’t displaying.

Can someone please tell me why this is happening, & how it can be resolved?

Posts: 1

Participants: 1

Read full topic

How To Call Methods

$
0
0

@DevRenshaw wrote:

Hello,

I’m pretty new to React and only just starting out. I’ve tried to find the answer but not sure if I’m searching for the wrong phrase or keyword(s).

Using https://ionicframework.com/docs/api/slides as an example. I want to apply the lockSwipes method and only allow the user to continue by pressing on a button with an onClick.

However, I just cannot figure out how to call them.

I’m not expecting code to be written for me. Happy for you to point me in the right direction and ill go readup but spent the past two evenings attempting and so far failing and loosing hope.

Regards
Tom

Posts: 1

Participants: 1

Read full topic

Slow boot on android with --prod "enabled"

$
0
0

@bjernie wrote:

I made a relatively small app I built it with this command to make it an .aab at the same time ionic cordova build android --prod --release -- -- --packageType=bundle. It is 3.7 MB on Android, which also means that it shouldn’t take that long to load, and yet from cold start it takes 30 seconds to load the app. This is not a problem on iOS, only Android. Is there anything I can do to speed it up?

Posts: 1

Participants: 1

Read full topic

Ionic angular server side rendering showing to many errors

$
0
0

@YAsh0011 wrote:

My whole IONIC project uploaded on Github https://github.com/yashdabi/ionic-angular-ssr

following some tutorials like this below https://ionicframework.com/blog/ssr-with-angular-universal-and-ionic/ but to many errors are showing after “npm run serve:ssr” and I am not able to resolve these errors

  1. window is not defined
  2. self is not defined
  3. Error:NotYetImplemented
  4. Cannot redefine property: constructor
  5. win.matchmedia is not a function

ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.1.3
Node: 10.16.3
OS: win32 x64
Angular: 8.1.3
... cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.801.3
@angular-devkit/build-angular              0.801.3
@angular-devkit/build-optimizer            0.801.3
@angular-devkit/build-webpack              0.801.3
@angular-devkit/core                       8.1.3
@angular-devkit/schematics                 8.1.3
@angular/animations                        8.1.2
@ngtools/webpack                           8.1.3
@nguniversal/express-engine                8.1.1
@nguniversal/module-map-ngfactory-loader   8.1.1
@schematics/angular                        8.1.3
@schematics/update                         0.801.3
rxjs                                       6.5.2
typescript                                 3.4.5
webpack                                    4.35.2

ionic info

Ionic:

   Ionic CLI                     : 5.2.7 (C:\Users\yash\AppData\Roaming\nvm\v10.16.3\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.8.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Utility:

   cordova-res : 0.6.0
   native-run  : 0.3.0

System:

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

I am stuck in these issues from few days
Please help me to resolve these issues

Posts: 1

Participants: 1

Read full topic

Unable to whitelist square-commerce-v1:

$
0
0

@FiveJStudios wrote:

Hi,

we have an app that has been working on iOS until this week. Now we receive a message " **ERROR Internal navigation rejected - not set for url='square-commerce-v1:// … "

when calling the url scheme for Square Payments: square-commerce-v1:

I have tried to whitelist as follows:

<access origin="square-commerce-v1:*" />
<allow-navigation href="square-commerce-v1://*" />
 <allow-navigation href="square-commerce-v1://*/*" />
<allow-intent href="square-commerce-v1:*" />

Any thoughts?

Posts: 1

Participants: 1

Read full topic

Problems with ionic native and plugins when converted to iOS and Android

$
0
0

@Syaifulginanjar wrote:

I currently facing problems with ionic native and plugins when converted to iOS and Android binary applications. Here are the details:

  1. Occasionally the app menus, buttons and links cannot be clicked, and not showing any error notif. Even when I tried to “console.log()” to inspect this, these menus, buttons and links appear to be randomly working and not working (this happen everytime without I made any changes)

  2. Without updating / patching, the above point (no. 1) occurs in our other application. it happens suddenly without error / hang / crash notif.

  3. This instability also applies to native cameras, native google logins, native files. Native Google sometimes can not be used / error, Native camera & native file sometimes makes the application quit after saving photos.

Thank you

Posts: 1

Participants: 1

Read full topic


Geolocation plugin issue with android

$
0
0

@webacers wrote:

Hi,
I am a newbie with the ionic framework and just started with it’s conference app. However, I am not able to run the app on android. Please see the following use cases (My dev machine and phone both are connected with same wifi. )-

  1. npx cap open android: and then running with android studio. It opens the app with blank screen. Inspecting with chrome tells that it is pointing to http:localhost/.

  2. I tried using live-url to localhost:8100 which is also giving ERR_CONNECTION_REFUSED.

  3. npx cap run android -c -s -l --external: when debugging the app with android studio , it runs the app with 192.168.100.143:8100 and my app runs properly. Now I want to use the Geolocation plugin which gives error “Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).” I believe this is because the app is neither running on localhost nor has https connection.

Can anyone guide me how to resolve this issue ?

Thanks,

Posts: 1

Participants: 1

Read full topic

Can't generate resources

Migration from VS2017 Cordova to Ionic Studio

$
0
0

@JohnBergman wrote:

We have a non-angular app that was build using VS2017/Cordova and are looking for a place to move to. Can anyone tell me if Ionic Studio can be used with a “plain” Html5/Typescript app? Our longer term plan will be to migrate to Ionic and Angular, but we are realistically a year away from being able to do that.

Thanks,
John

Posts: 1

Participants: 1

Read full topic

Axios Error Api local

$
0
0

@Cephaz wrote:

Hello,

In my file a have this code

const data = () => {
axios.get(‘https://localhost:3000/api/events’,{
headers: {
‘Access-Control-Allow-Origin’: ‘*’,
}
})
.then(res => {
console.log(res.data);
})
.catch(function (error) {
console.log(error);
})
}
The code not working for my local api and I don’t know how to fix it.

This is the console display
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:3000/api/events. (Reason: CORS request did not succeed)

Please i need help

Posts: 2

Participants: 2

Read full topic

Ion-native Datepicker problems with Dark Mode

$
0
0

@MhmdKorhani wrote:

The datepicker plugins works just fine with light mode on.
But when it comes to dark mode, datepicker does not run as expected (numbers cannot be seen clearly).

Posts: 1

Participants: 1

Read full topic

How to Ionic web build with cordova

$
0
0

@sanskrut wrote:

Hello all,

I’m building a cross platform application, in which I want to use Native Camera functionality, ionic doc suggest that native camera is available for android, ios and browser.
I understand we can build app using
ng run app:ionic-cordova-build --platform=android | ios
but I’m not sure about browser build
as ionic build --prod will not include cordova functionality,
so can i build using this command for web
ng run app:ionic-cordova-build --platform=browser --prod

is this recommended or right way to build with cordova for production web release ?

Posts: 1

Participants: 1

Read full topic

White screen on device livereload

$
0
0

@mareksip wrote:

Hello,

For several days I am trying to make work device live reloading.

I have forked Ionic conference app and in order to use Auth0 SDK changed architect:build to use @angular-builders/custom-webpack:browser instead of @angular-devkit/build-angular:browser.

This is current angular.json and custom webpack.config.js

I enabled port 8100 in firewall (also turned off firewall completely) so when I open Chrome on the Android device and navigate to 192.168.51.28:8100 I can see the app.

Commands:

  1. ionic serve
  1. ionic cordova run android --livereload-url=http://192.168.51.28:8100 --livereload
    This deploys and runs the app, later I can see splashscreen, loading circle and then only whitescreen.
    Output of console: https://gist.github.com/mareksip/666fc0dd946420166dc7a05d039b3b1a

Coud you please help me out of the white screen? :grinning:

Posts: 1

Participants: 1

Read full topic


Directive proxies error

$
0
0

@webmaster-leafar wrote:

I am working on a new project, and when I build a form I got this error Module not found: Error: Can't resolve '@ionic/angular/directives/proxies' I try to find on stackoverflow and google but no results.

Posts: 1

Participants: 1

Read full topic

IFrame event page change

Problem with ion-datetime and ngmodel string

$
0
0

@miguelreb wrote:

Hi all,
i have a problem with an ion-datetime component, i have this code in the html:
<ion-datetime displayFormat=“DD/MM/YYYY HH:mm” [pickerOptions]=“customPickerOptionsFecCitaIni” [(ngModel)]=“Parte.CitaFechaHoraIni”>

The field citafechahoraini is a string value, with this format: 08/04/2020 23:45

The customPickerOptions is this:
this.customPickerOptionsFecCitaIni = {
buttons: [{
text: ‘Limpiar’,
handler: () => {
this.Parte.CitaFechaHoraIni = undefined
}
},{
text: ‘Cancelar’,
role:‘cancel’
}, {
text: ‘Guardar’,
handler: (data) => {
this.Parte.CitaFechaHoraIni = data.day.text+"/"+data.month.text+"/"+data.year.text+" “+data.hour.text+”:"+data.minute.text;
}
}]
};

If i open the page, in the datepicker i see this:
datepicker

and when i choose the date i see the month 8 when it will be 4. Why it occurs??
datepicker2

Any help? THANKS!

Posts: 1

Participants: 1

Read full topic

Allow certain elements to be dragged when having a refresher

$
0
0

@stplush wrote:

Currently I have a refresher on my page, a very simple one, that listens to ionRefresh. I also have a google maps on that page in which I place pins, that require updates on refresh.

My problem is that when I scroll on the google maps, the refresher is also being activated. That is not something I want.

I want to prevent the refresher from activating when my swipe starts somewhere on the map. I already tried using event.target.complete() and event.target.cancel() in a (ionStart) method. that works, but after that it completely disables the refresher.

Is there a way to ignore the refresher when I swipe on some element like a maps that has dragging features on it’s own?

Ionic:

Ionic CLI : 6.5.0 (/usr/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.0.7
@angular-devkit/build-angular : 0.901.0
@angular-devkit/schematics : 9.1.0
@angular/cli : 9.1.0
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 8 other plugins)

Utility:

cordova-res : not installed
native-run (update available: 1.0.0) : 0.3.0

System:

Android SDK Tools : 26.1.1 (/home//Android/Sdk)
NodeJS : v10.19.0 (/usr/bin/node)
npm : 6.14.4
OS : Linux 4.15
Xcode : xcbuild version 0.1 Build version 1

Posts: 1

Participants: 1

Read full topic

Ion segment scrolls both active and In-active when scroll active section?

$
0
0

@jakesully wrote:

I have two segment tabs for example A and B,
i set default value as A. So A tab will Active and B is in-active. each tab content have different list of contents. If a scroll A tab’s Content it also scroll B tab’s Content. I need separate scrolls for those sections.
This is my code:

 <ion-segment [(ngModel)]="type" mode="md">
      <ion-segment-button value="A">
        <ion-label>A</ion-label>
      </ion-segment-button>
      <ion-segment-button value="B">
        <ion-label>B</ion-label>
      </ion-segment-button>
    </ion-segment>
<ion-content [ngSwitch]="type" scroll-y='true'>
<section *ngSwitchCase="A">
<!-- Content Here -->
</section>
<section *ngSwitchCase="B">
<!-- Content Here -->
</section>
</ion-content>

Posts: 1

Participants: 1

Read full topic

Viewing all 70435 articles
Browse latest View live


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