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

Variables.scss Being Overridden

$
0
0

I’m having a problem with a newly created app using Ionic 5. I’m simply trying to use my own custom colors in the variables.scss file, but the colors I add are always overriden by core.scss. core.scss uses the !important attribute and is included last on the rendered page so my styles always get overridden. Am I not understanding something or might this be a bug?

1 post - 1 participant

Read full topic


Parameter with params

Adding dynamic variable

Plugins for MQTT Protocol

$
0
0

please provide the plugin for MQTT with latest ionic framework .
anyone knwos any npm or plugin that I can use

1 post - 1 participant

Read full topic

Global Capacitor variable not accessible in Android after first run

$
0
0

I’m using the server.url parameter in capacitor.config.json to load a PWA into Capacitor.

On Android, the PWA side can only access the global Capacitor variable on the first run… after deleting the app and doing a fresh install from Android Studio. On subsequent runs window.Capacitor just isn’t there!

Working fine on iOS. Any ideas? Thanks

1 post - 1 participant

Read full topic

Utiliser un theme ionic

$
0
0

salut comment je peut utiliser un theme que j’ai acheter pour creer un application svp
je suis qu’un debutant

1 post - 1 participant

Read full topic

Fcm notification sound not working in ionic 3

$
0
0

I am using fcm plugin for ionic app notifications.but not able to get sound on notifications received. I am using PHP APIs for fcm push notifications.please help me asap.

1 post - 1 participant

Read full topic

Handling CORS issue when WAF(Web Application Firewall) blocks the request

$
0
0

We have added custom rules in Azure WAF using geocoding to block API requests from certain countries. The custom error code and message are set in WAF. But when the requests are being blocked we are receiving CORS error. We have handled CORS in server side, but in this case the request is getting bounced back from WAF, before reaching the server. Is there a way to add custom response header in WAF, when the request is being blocked or can we handle this from Ionic by bypassing the preflight request?

1 post - 1 participant

Read full topic


Ion-refresh doesn't refresh content from mysql

$
0
0

I have this piece of code:

  loadmwfuthtft(){
  	let body = {
  		keyword : 'mwfuthtft'
  	};
  	this.postPvdr.postData(body, 'http:/siteaddress').subscribe(data => {
  		for(let mwfuthtftres of data.result){
  			this.mwfuthtftresed.push(mwfuthtftres);
  		}
  	});
  }

  doRefresh(refresher) {
  	let body = {
  		keyword : 'mwfuthtft'
  	};
  	this.postPvdr.postData(body, 'http://www.siteaddress').subscribe(data => {
  		for(let mwfuthtftres of data.result){
  			this.mwfuthtftresed.push(mwfuthtftres);
  		}
  		refresher.complete();
  	});
  }

i can get data in loadmwfuthtft function successfully but when i use same code for ion-refresh page content doesn’t update. What is the correct way to refresh page content?

1 post - 1 participant

Read full topic

Advice on capturing lots of photos and minimising crashes

$
0
0

I’m currently working on a project (Ionic / Angular) that involves a custom camera interface and capturing lots of photos. We’re mainly using it in the browser (e.g. Safari on iOS / Chrome on Android) rather than the compiled app if that makes any difference.

We generally are seeing lots of issues with crashes and memory, especially after capturing 50+ photos (not uncommon in our use case).

Does anyone have any general advice on handling lots of photos and camera usage?
Is this possible / recommended for Ionic or are we fighting a losing battle? Switching to
Are there any other Ionic apps out there doing lots of image capturing that we should take a look at?

Thanks!

1 post - 1 participant

Read full topic

Ionic 4 Angular 9 how to bypass particular route in the guard?

$
0
0

I have a guard that redirects the user to tabs page if user has been authenticated else redirects to home (login) page.

Now on a particular operation, my backend express server redirects the user to order-success page. But logic in the guard doesn’t allow the user to be redirected to order-success page instead user gets redirected to tabs page

So how to bypass this url in the guard so that user will go to order-success page

Thank you in advance

auth.guard.ts

export class AuthGuard implements CanActivate   {
  
  constructor(public auth: AuthenticationService, public router : Router,) {}

  async canActivate(): Promise<boolean> {

    let auth = await this.auth.isAuthenticated() // returns true if user is authenticated else false
    if(auth) {
      return true;
    }
    else {
      this.router.navigate(['home'])
      return false;
    }
  }
}

app-routing.module.ts

{ path: '', redirectTo: 'tabs', pathMatch: 'full' },

{
    path: 'tabs', canActivate: [AuthGuard],
    loadChildren: () => import('./pages/tabbar/tabbar.module').then( m => m.TabbarPageModule)
  },

  {
    path: 'order-success',
    loadChildren: () => import('./pages/order-success/order-success.module').then(m => m.OrderSuccessPageModule)
  },

1 post - 1 participant

Read full topic

Tooltip doesn't disappear

$
0
0

Hi,

I’m trying to use the Angular Material Tooltip ( https://v9.material.angular.io/components/tooltip/overview ) on an Ionic 5 app.

The problem is that when I use it on a button leading to a second page, the tooltip doesn’t disappear.

<ion-button 
        matTooltip="Tooltip text" 
        [routerLink]="['/about']">About
</ion-button>

Does some one know how to solve this issue ?
Thanks,

Ionic CLI : 6.10.1
Ionic Framework : @ionic/angular 5.2.2
@angular-devkit/build-angular : 0.901.9
@angular-devkit/schematics : 9.1.9
@angular/cli : 9.1.9
@ionic/angular-toolkit : 2.2.0

1 post - 1 participant

Read full topic

Switch display

$
0
0

Hello,
I am new to JS, I have set up a switch for a crosstab but when I make a choice I have 3 displays in my console.
How to just have the choice ask.

Thank you in advance.

calcul.ts

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

@Component({
  selector: 'app-calcul',
  templateUrl: './calcul.page.html',
  styleUrls: ['./calcul.page.scss'],
})
export class CalculPage implements OnInit {

  intensity: any;
  poid: number;

  constructor() {
  }

  ngOnInit() {
  }
  calculTaux() {
    switch (this.intensity === "faible") {
      case (this.poid <= 11):
        console.log("faible 1")
        break;
      case (this.poid > 11 && this.poid <= 20):
        console.log("faible 2")
        break;
      case (this.poid > 21 && this.poid <= 40):
        console.log("faible 3")
        break;
      case (this.poid > 41 && this.poid <= 70):
        console.log("faible 4")
        break;
      case (this.poid > 71 && this.poid <= 110):
        console.log("faible 5")
        break;
      case (this.poid > 110):
        console.log("faible 6")
        break;
      default:
        console.log("Nous consulter")
        break;
    }
    switch (this.intensity === "moyen") {
      case (this.poid <= 11):
        console.log("moyen 1")
        break;
      case (this.poid > 11 && this.poid <= 20):
        console.log("moyen 2")
        break;
      case (this.poid > 21 && this.poid <= 40):
        console.log("moyen 3")
        break;
      case (this.poid > 41 && this.poid <= 70):
        console.log("moyen 4")
        break;
      case (this.poid > 71 && this.poid <= 110):
        console.log("moyen 5")
        break;
      case (this.poid > 110):
        console.log("moyen 6")
        break;
      default:
        console.log("Nous consulter")
        break;
    }
    switch (this.intensity === "forte") {
      case (this.poid <= 11):
        console.log("forte 1")
        break;
      case (this.poid > 11 && this.poid <= 20):
        console.log("forte 2")
        break;
      case (this.poid > 21 && this.poid <= 40):
        console.log("forte 3")
        break;
      case (this.poid > 41 && this.poid <= 70):
        console.log("forte 4")
        break;
      case (this.poid > 71 && this.poid <= 110):
        console.log("forte 5")
        break;
      case (this.poid > 110):
        console.log("forte 6")
        break;
      default:
        console.log("Nous consulter")
        break;
    }
  }
}

calcul.html

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button></ion-back-button>
    </ion-buttons>
    <ion-title>calcul</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <div>
    <h1>Calculer mon besoin personnel</h1>
    <p>Nous allons éstimer un dosage moyen quotidien</p>
    <ion-label position="floating">Quel est votre poids?</ion-label>
    <ion-input [(ngModel)]="poid" type="number" placeholder="Saisir ici"></ion-input>
    <ion-list>
      <ion-radio-group [(ngModel)]="intensity">
        <ion-list-header>
          <ion-label>Quel est l'intensité de vos douleurs?</ion-label>
        </ion-list-header>

        <ion-item>
          <ion-label>Faibles</ion-label>
          <ion-radio slot="start" value="faible"></ion-radio>
        </ion-item>

        <ion-item>
          <ion-label>Moyennes</ion-label>
          <ion-radio slot="start" value="moyen"></ion-radio>
        </ion-item>

        <ion-item>
          <ion-label>Fortes</ion-label>
          <ion-radio slot="start" value="forte"></ion-radio>
        </ion-item>
      </ion-radio-group>
    </ion-list>
    <ion-button (click)="calculTaux()" expand="block" fill="clear" shape="round">
      Calculer mon taux
    </ion-button>
  </div>

</ion-content>

1 post - 1 participant

Read full topic

Capacitor Camera always creates an image on internal device storage (Android)

$
0
0

When using the Capacitor Camera Plugin it seems that every picture is also saved as jpeg on Android’s internal storage.

For example using the camera plugin showcase app (https://github.com/ionic-team/photo-gallery-capacitor-ng) will create a .jpeg file under ./Android/data/io.ionic.pg.ng.cap/files/Pictures event if the returned image from Camera.getPhoto is discarded immediately and no additional processing is done. In the regular showcase app mentioned above the file still exists, after you ‘delete’ an image from within the application.

Is it possible to prevent this behavior? I’ve tried different settings and camera options but haven’t found a solution for this problem yet.

Thanks for any advice,
Andreas

1 post - 1 participant

Read full topic

Ionic capacitor single code base ionic and android

$
0
0

Is it possible to make ionic with ios capacitor and android single code base. If possible what is best way to implement. please suggest me.

2 posts - 2 participants

Read full topic


Right approach to embed third party web application into ionic mobile app

$
0
0

I have a ionic app. I want to embed a third party application which is developed by our known vendor. I need to retain my application header and footer which is very important. I did a initial research on below options but it has some limitations

  1. in-app browser - Not able to retain my app header and footer and it occupies entire webview or opens in seperate window
  2. iframe - Able to achieve what I needed, but I am not sure if it is the right approach. Heard that there is possibility that ios does not allow app in app store if app uses iframe
  3. webview - Ionic app already run on a webview, but there is no option provided to have a child webview / nested view to load external url (am i missing something?)

Is there any other right/clean approach, which i can use to embed a third party webpage in my mobile application. Or can i proceed with iframe without any issues?. Please advise.

Screenshot 2020-07-02 at 12.29.39 PM

1 post - 1 participant

Read full topic

İonic-v5 Events in @ionic/angular Alternative

$
0
0

Which method can I use instead of the event used in ionic-v3 ?

// send
image

//receive
image

3 posts - 3 participants

Read full topic

Ios build failing Undefined symbol: _OBJC_CLASS_$_GSDK_GTMLogger

$
0
0

ios build is failing with below error

** BUILD FAILED **

The following build commands failed:
CompileC /Users/niteshpundra/Library/Developer/Xcode/DerivedData/Business_QuSe-foxneltminojniayetveeacnjnof/Build/Intermediates.noindex/Business\ QuSe.build/Debug-iphonesimulator/Business\ QuSe.build/Objects-normal/x86_64/CDVFileTransfer.o /Users/niteshpundra/Documents/ionic/phonegap/platforms/ios/Business\ QuSe/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.

    cordova build ios exited with exit code 65.

    Re-running this command with the --verbose flag may provide more information.

Undefined symbol: OBJC_CLASS$_GSDK_GTMLogger

Ionic:

ionic (Ionic CLI) : 4.6.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.10
@ionic/app-scripts : 3.2.3

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 9.0.0, ios 6.2.0-nightly.2020.7.2.e6e90e07
Cordova Plugins : cordova-plugin-ionic-webview 5.0.0, (and 32 other plugins)

System:

ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v10.16.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS
Xcode : Xcode 11.5 Build version 11E608c

1 post - 1 participant

Read full topic

ANDROID_SDK_ROOT=undefined (recommended setting)

$
0
0

Ionic:

Ionic CLI : 6.10.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.0.0
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.25
@ionic/angular-toolkit : 2.1.2

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

Utility:

cordova-res : 0.15.1
native-run : 1.0.0

System:

ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v12.18.1 (/usr/local/bin/node)
npm : 6.14.5
OS : macOS Catalina
Xcode : Xcode 11.5 Build version 11E608c

While l am try to build android , l have following error :

ANDROID_SDK_ROOT=undefined (recommended setting)

ANDROID_HOME=/Users/macbook/Library/Android/sdk (DEPRECATED)

Requirements check failed for JDK 8 (‘1.8.*’)! Detected version: 14.0.1

Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

.bash_profile

export ANDROID_SDK_ROOT=/Library/Android/sdk/platform-tools
export ANDROID_HOME=/Library/Android/sdk/
export JAVA_HOME=$(/usr/libexec/java_home)

Any idea please ?

1 post - 1 participant

Read full topic

Square columns inside grid

$
0
0

I’m trying to make square columns, the problem is that I don’t know how to set the height of the column equal to the width of it.

This is the html:

How can I set the scss values of the column to make it square?

ion-col{
height: ?;
}

1 post - 1 participant

Read full topic

Viewing all 71531 articles
Browse latest View live


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