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

Ion select change Cancel/OK Button color

$
0
0

@ArinaAmir wrote:

Hello everybody,

after spending so much hours I am so confused now.
I need to change the colors if ion-select for Cancel and OK.
In ionic 3 I have reached this via [selectOption] property, however this is not working in Ionic 4 anymore.
I have tried via [interfaceOptions] but no success as well.
Please if anybody has any idea how I can reach this… let me know.
Thanks in advance and be healthy!

<ion-select placeholder=“Text” cancelText=“Abbrechen” [interfaceOptions]=“customAlertOptions” (ionChange)=“fileSelected($event)”>

        <ion-select-option  *ngFor="let item of uploadedFiles" value={{item.id}}>{{item.displayName}}

        </ion-select-option>

      </ion-select>
customAlertOptions: any = {   

    cssClass: 'alertCustomCss',

  };

.alertCustomCss {

ion-button {

    color:#58a618 !important; // button text color

}

}

Posts: 2

Participants: 2

Read full topic


Open app on click a link

$
0
0

@ndblackandblue wrote:

Hi guys i’m try to use deeplink plugin to make when user click open the app in his phone:

<h1><a id="mobile"href="myapp:myapp.com/canal?-LCUgAc-MzkmQBEP_2Fa">-LCUgAc-MzkmQBEP_2Fa</a></h1>

but at ios, for some reason, he dont open the app, i’m already set that link like associated domain, but nothing change.

Posts: 1

Participants: 1

Read full topic

iPad display is shrunken

Back button disappearing

$
0
0

@tkclark wrote:

Sorry if this has already been addressed. I have an Ionic/Vue project with a back button:
<ion-back-button defaultHref="/more"></ion-back-button>

Sometimes the back button will not appear as expected. I have a defaultHref route, so why does it randomly not appear? It basically traps the user on a screen that they cannot get out of.

Posts: 1

Participants: 1

Read full topic

Ion-loading right from the start

$
0
0

@dinaflies wrote:

I was wondering if it is possible to start a page with ion-loading element loading right from the start. I’ve tried to create the component at ngOnInit the after an if check and navigateByUrl method provided by router, dismiss the loading element, but not only the ion-loading delay to be shown but also it doesn’t dismiss when navigation is completed. I also tried to make ngOnInit an async function to no avail.

ngOnInit() { 
      this.loadingCtrl.create({
        message: 'Aguarde...',
        translucent: true,
      }).then(el => {
        el.present();
      });

      const userData = new AuthResponseData(
        this.route.snapshot.queryParamMap.get('localId'),
        parseInt(this.route.snapshot.queryParamMap.get('expiresIn')),
        this.route.snapshot.queryParamMap.get('accessToken'),
        this.route.snapshot.queryParamMap.get('refreshToken')
      );
      this.authService.setUserData(userData);
      this.router.navigateByUrl('/usuario/painel').then(
        result => {
          this.loadingCtrl.dismiss();
        }
      );

Any insights on this matter?

Posts: 1

Participants: 1

Read full topic

ITMS-90424: Invalid Swift Support

$
0
0

@sagar1412 wrote:

how to solve problem
ITMS-90424: Invalid Swift Support - The SwiftSupport folder is empty. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

Best regards,

The App Store Team

Posts: 1

Participants: 1

Read full topic

Ionic 4 Cordova - cordova-plugin-firebase-dynamiclinks Error Android build

$
0
0

@nishamane wrote:

I am creating iOS app using ionic4 and Cordova version 9.0.0. Whenever I am trying to install cordova-plugin-firebase-dynamiclinks plugin in my project and try to create Android build, it gives me following error :
Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
> In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0.
0]", but isn’t being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.firebase:firebase-messaging:18.0.0 -> com.google.firebase:firebase-iid@[18.0.0], but fire
base-iid version was 20.0.2.

If I try to change version in project.properties and build.gradle file, it gives me another error :
Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
[6:39 PM] Could not resolve all task dependencies for configuration ‘:app:debugCompileClasspath’.

Could not find com.google.firebase:firebase-messaging:20.0.2.
Required by:project :app

Any ideas how to resolve this…?

Posts: 1

Participants: 1

Read full topic

How to save the photo in local folder

$
0
0

@fawad0301 wrote:

I am working on ionic app with Capacitor plugin, the other related data is locally stored in json file, now i want to save the captured photo in a folder for later use. How it will done?

Posts: 1

Participants: 1

Read full topic


Dark mode vs status bar style iOS

$
0
0

@tkclark wrote:

I’ve added support for dark mode in my app. It simply toggles the class dark on the <body> tag. Looks great until I view it on my iPhone 11 Pro Max and the black text on a white background becomes back text on a black background. Looks like I might need to hook into the native part of the phone to tell it what’s up. Anybody know how to do this?

I am using Ionic/Vue/Vuex if that matters. Thanks!

Before:

After:

Posts: 1

Participants: 1

Read full topic

Implement Advanced Search on Ionic App

$
0
0

@ZombieBest wrote:

Hello everyone!
I start saying I’m pretty new to the framework and pretty new in web development in general.
On my App I have a JSON array updated from API with more than 100 question objects, a question object is made like this:

{
 "question": "How do you do that?",
 "short_answer": "You should press the red button",
 "full_answer": "After you press the red button a white window will appear",
 "tags": "#red #button #tutorial"
}

I’m trying to implement a search bar where users can search a specific question or issue they may have, so I did it this way:

On the HTML file:
<ion-searchbar *ngIf="data_loaded" placeholder="{{ 'SEARCH_PLACEHOLDER' | translate }}" showCancelButton="never" (ionChange)="searchChange($event)" (ionClear)="searchChange($event)" (ionInput)="onSearchInput()" animated="true" debounce="500" inputmode="search" spellcheck="true" ></ion-searchbar>

On the .ts file:

  searchChange($event){
    this.noResults = false;
    if($event.detail!=null && $event.detail.value!="") {
      //TODO: filter questions here
      let searchVal = $event.detail.value;

      this.filtered_questions = this.filterItems(searchVal);

      if(this.filtered_questions.length == 0) {
        this.noResults = true;
      }

    }else{
      this.filtered_questions = this.globals.all_questions;
    }
    this.showSpinner = false;
  }

  filterItems(searchTerm) {
    return this.globals.all_questions.filter(question => {
      return (question.question.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1 || 
            question.short_answer.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1 ||
            question.full_answer.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1 || 
            question.tags.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1
      );
    });
  }

The filterItems function apply a simple filter to all the questions, returning those that contains the word entered by the user.
This of course does not work well for my particular use-case. I could split the single word out of the phrase entered by the user, but still I think the result would be poor.

I know this is surely more an Angular issue than a Ionic issue, but I wanted to give it a try and ask here if someone has some advice regarding this, maybe using external libraries to improve the search.

Thanks!

Posts: 1

Participants: 1

Read full topic

All native plugins store locally

$
0
0

@ManOnMission wrote:

Can we store all the native plugins repo locally inside the project rather than installing them from a GitHub repo?

Will it affect the specific platform build size or performance?

Posts: 2

Participants: 2

Read full topic

Can’t build apk

$
0
0

@dunghoang69 wrote:

I don’t know why. The last time it worked. Now i can’t build anymore.
ionic-app-scripts build --aot --minifyjs --minifycss --target cordova --platform android
[17:43:06] ionic-app-scripts 3.1.11
[17:43:06] build dev started …
[17:43:06] clean started …
[17:43:06] clean finished in 1 ms
[17:43:06] copy started …
[17:43:06] deeplinks started …
[17:43:07] deeplinks finished in 1.10 s
[17:43:07] ngc started …
[17:43:16] ionic-app-script task: “build”
[17:43:16] TypeError: Cannot read property ‘kind’ of undefined
TypeError: Cannot read property ‘kind’ of undefined
at Object.isAmbientModule (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:9099:59)
at collectModuleReferences (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79472:28)
at collectExternalModuleReferences (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79449:17)
at processImportedModules (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79799:13)
at findSourceFile (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79696:17)
at processImportedModules (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79840:25)
at findSourceFile (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79696:17)
at /home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79567:85
at getSourceFileFromReferenceWorker (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79534:34)
at processSourceFile (/home/hoangdung/Project/HIT/Ionic/ionic-hit-foundation/node_modules/typescript/lib/typescript.js:79567:13)
[ERROR] An error occurred while running subprocess ionic-app-scripts.

    ionic-app-scripts build --aot --minifyjs --minifycss --target cordova --platform... exited with exit code 1.
    
    Re-running this command with the --verbose flag may provide more information.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hit-foundation@0.0.1 build-android-prod: ionic cordova build android --aot --minifyjs --minifycss --release
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hit-foundation@0.0.1 build-android-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/hoangdung/.npm/_logs/2020-04-03T10_43_16_602Z-debug.log
========================== The package.json

Posts: 2

Participants: 1

Read full topic

How to get ion-header height in Angular (the right way)?

$
0
0

@Arkthur wrote:

In my app I need to get the height of an ion-header element. I’ve tried with:

<!-- TEMPLATE -->
<ion-header #header>
  <!-- ... -->
<ion-header>
<!-- ... -->
// COMPONENT
ViewChild('header') header: IonHeader;
// ...
getHeaderHeight() {
  return this.header.el.offsetHeight;
}

This only works if header's type is any. If it is IonHeader it throws this error:

Property 'el' is protected and only accessible within class 'IonHeader' and its subclasses.

The error is pretty clear. What bugs me is the fact that there should be a non-hacky way to do this. Using any just feels like cheating.

Posts: 1

Participants: 1

Read full topic

Content not scrolling with long data IONIC5?Why

Ionic 5 Animation issue with gesture

$
0
0

@Jinfreeks wrote:

I have a problem with an animation, I want to display a div on slide up, and I use gesture to give the impression that the user have to drag it.

But when we release the div (on end of touch event), the animation event seems to start at an different point than the one I indicated.

I’m unable right now to recreate my issue with a JSFiddle, but I’ve create a short video (Just the first 3sec, I recommend to read it at x0.25) : https://youtu.be/z50BDjhKDh4

This is my code :

ionViewDidEnter() {
   this.gesture = this.gestureCtrl.create({
     el: this.source.nativeElement,
     threshold:10,
     gestureName: 'show-profile',
     gesturePriority:100,
     disableScroll:true,
     direction:'y',
     onStart: (detail) => { 
       this.onStart(detail); 
     },
     onMove: (detail) => { 
       this.onMove(detail); 
     },
     onEnd: (detail) => {
       this.onEnd(detail);
     }
   })

   this.profileGest = this.gestureCtrl.create({
     el: this.description.nativeElement,
     threshold:10,
     gestureName: 'hide-profile',
     gesturePriority:10,
     disableScroll:true,
     direction:'y',
     onStart: (detail) => { 
       this.onStartProfile(detail); 
     },
     onMove: (detail) => { 
       this.onMoveProfile(detail); 
     },
     onEnd: (detail) => {
       this.onEndProfile(detail);
     }
   })

   this.gesture.enable();

   this.bounceInUp = this.animationCtrl.create()
   .addElement(this.description.nativeElement)
   .duration(400)
   .keyframes([
     { offset: 0, transform: 'translateY(' + this.profilePeak + 'px)' },
     { offset: 0.6, transform: 'translateY(-300px)' },
     { offset: 0.7, transform: 'translateY(-270px)' },
     { offset: 0.9, transform: 'translateY(-285px)' },
     { offset: 1, transform: 'translateY(-280px)' }
   ])
   .beforeStyles({'transform':'translateY(' + this.profilePeak + 'px)'})
   .afterStyles({'transform':'translateY(-280px)'})

   this.headerDown = this.animationCtrl.create()
   .addElement(this.header.nativeElement)
   .duration(400)
   .keyframes([
     { offset: 0, transform: 'translateY(' + this.headerPeak + 'px)' },
     { offset: 0.6, transform: 'translateY(20px)' },
     { offset: 0.7, transform: 'translateY(-10px)' },
     { offset: 0.9, transform: 'translateY(5px)' },
     { offset: 1, transform: 'translateY(0px)' }
   ])
   .beforeStyles({'transform':'translateY(' + this.headerPeak + 'px)'})
   .afterStyles({'transform':'translateY(0px)'})

   this.fallDown = this.animationCtrl.create()
   .addElement(this.description.nativeElement)
   .duration(400)
   .fromTo('transform', 'translateY(' + this.profilePeak + 'px)', 'translateY(0px)')
   .afterStyles({'transform':'translateY(0px)'})

   this.headerUp = this.animationCtrl.create()
   .addElement(this.header.nativeElement)
   .duration(400)
   .fromTo('transform', 'translateY(' + this.headerPeak + 'px)', 'translateY(-80px)')
   .afterStyles({'transform':'translateY(-80px)'})

   this.minimizeImg = this.animationCtrl.create()
   .addElement(this.source.nativeElement)
   .duration(400)
   .fromTo('height', 'translateY(' + this.headerPeak + 'px)', 'translateY(-80px)')
   .afterStyles({'transform':'translateY(-80px)'})

   this.maximizeImg = this.animationCtrl.create()
   .addElement(this.source.nativeElement)
   .duration(400)
   .fromTo('transform', 'translateY(' + this.headerPeak + 'px)', 'translateY(-80px)')
   .afterStyles({'transform':'translateY(-80px)'})

 }

onStart(detail:any){
   console.log(detail.deltaY);
   this.profilePeak = detail.deltaY;
   this.headerPeak = (-80) + (Math.abs(detail.deltaY) / 3);
 }

 onMove(detail:any) {
   console.log(this.fullProfile, detail.deltaY);
   var headerPosi = (-80) + (Math.abs(detail.deltaY) / 3);
   this.profilePeak = detail.deltaY;
   console.log('ici',this.profilePeak);
   this.renderer.setStyle(this.description.nativeElement,'transform','translateY(' + detail.deltaY + 'px)');
   this.renderer.setStyle(this.header.nativeElement,'transform','translateY(' + headerPosi + 'px)');
 }

 onEnd(detail:any){
   this.renderer.setStyle(this.description.nativeElement,'transition','0,4s ease-out');
   this.renderer.setStyle(this.header.nativeElement,'transition','0,4s ease-out');
   if(detail.deltaY > (-100)){
     console.log("OnEnd");
     this.renderer.setStyle(this.description.nativeElement,'transform','translateY(0px)');
     this.renderer.setStyle(this.header.nativeElement,'transform','translateY(-80px)');
   } else if(detail.deltaY <= (-100)){
     this.headerPeak = (-80) + (Math.abs(detail.deltaY) / 3);
     console.log("goUPPPPP",this.profilePeak);
     this.gesture.enable(false);
     this.valuePassed();
     this.bounceInUp.play();
     this.headerDown.play();
     setTimeout (() => {
       this.bounceInUp.stop();
       this.headerDown.stop();
       this.profileGest.enable();
     }, 600);
   }
 }

 onStartProfile(detail:any){
   this.profilePeak = detail.deltaY;
   this.headerPeak = 80 - (detail.deltaY / 3);
 }

 onMoveProfile(detail:any){
   if(detail.deltaY >= 0){
     var headerPosi = 0 - (detail.deltaY / 3);
     var descriptionPosi = -280 + detail.deltaY;
     this.renderer.setStyle(this.description.nativeElement,'transform','translateY(' + descriptionPosi + 'px)');
     this.renderer.setStyle(this.header.nativeElement,'transform','translateY(' + headerPosi + 'px)');
   } else if(detail.deltaY < 0){
     var descriptionPosi = -280 + detail.deltaY;
     this.renderer.setStyle(this.description.nativeElement,'transform','translateY(' + descriptionPosi + 'px)');
   }
 }

 onEndProfile(detail:any){
   this.renderer.setStyle(this.description.nativeElement,'transition','0,4s ease-out');
   this.renderer.setStyle(this.header.nativeElement,'transition','0,4s ease-out');
   if(detail.deltaY > 50){
     this.profilePeak = -280 + detail.deltaY;
     this.headerPeak = 80 - (detail.deltaY / 3);
     console.log("FallDown Values", this.profilePeak, this.headerPeak);
     this.profileGest.enable(false);
     this.fallDown.play();
     this.headerUp.play();
     setTimeout (() => {
       this.fallDown.stop();
       this.headerUp.stop();
       this.gesture.enable();
    }, 500);
   } else if(detail.deltaY <= 50){
     console.log("OnEnd");
     this.renderer.setStyle(this.description.nativeElement,'transform','translateY(-280px)');
     this.renderer.setStyle(this.header.nativeElement,'transform','translateY(0px)');
   }
 }

I’m pretty sure that I’ve done a ridiculous error, but I’m newbie at create animation so I need your help !

Thank you all folks !

PS : I’ve already post it in StackOverFlow, it’s useless to mention it. :slight_smile:

Posts: 1

Participants: 1

Read full topic


Simulator cannot connect to backend in HTTPS: Unknown Error

$
0
0

@kdefombelle wrote:

App works fine (@ionic/angular 5.0.7; cf. ionic info attached)

  • in chrome http or https
  • postman api call http or https
  • iOS simulator using ionic cordova prepare ios then executing in XCode in http but not in https

It does not reach the backend at all.
XCode Simulator error message is 2020-04-03 20:24:07.719639+0800 MyApp[23261:938958] ERROR: {"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":"https://localhost:443/api/v1/appname/signin","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://localhost:443/api/v1/appname/signin: 0 Unknown Error","error":{"isTrusted":true}}
any idea of what can be wrong in https from the simulator?

Posts: 1

Participants: 1

Read full topic

Clear memory / remove canvas

$
0
0

@keber wrote:

Hi all,

I’m creating an application where I’m cutting an image into pieces by creating a canvas.
The problem is that if I’m doing it multiple times, the devices memory cache is full because the canvas (and especially the pieces I have created) never gets deleted, I’m getting the error message in the Safari console (while running via iOS simulator):

Total canvas memory use exceeds the maximum limit (224 MB)

Therefore I’m looking for a solution on how to clear the memory, maybe if possible the canvas elements only.

I’ve found a plugin but I’m not sure how to use that.

Does anybody know how to do that?
Thank you so much in advance!

Posts: 1

Participants: 1

Read full topic

Ionic Studio does not open on Mac

$
0
0

@hebsd wrote:

I have created a new user on my Mac OS High Sierra on a SSD and installed ionic studio on it.
it worked fine for a few days but it won’t open now. The icon appears in dock but it does not open. I reinstalled npm but it did not work. I can open my project in safari using terminal with sudo ionic serve when I cd to my project directory. Screen Shot 2020-04-03 at 5.44.05 PM

Posts: 2

Participants: 2

Read full topic

Get Swiper Instance from Slides component

$
0
0

@OrganGrindingMonkey wrote:

I’ve read through the documentation and it says that you can get an instance of the Swiper using getSwiper() => Promise.

I’m currently importing the Slider
import { (removed other imports...), IonSlides } from "@ionic/react";

and then using it in a React.FC.

return (
    <IonPage>
      <IonHeader>
        <IonToolbar>
          <IonTitle>Survey Name</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent>
        <IonSlides pager={true}>{questions}</IonSlides>
      </IonContent>
    </IonPage>
  );

I’m not sure where or how to get the instance to be able to control it programmatically?

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

How do I add a custom component to every single page's ion-content?

$
0
0

@Simbaclaw wrote:

Hi there,

I have a question regarding whether it is possible to make something like a global component that is present on all of my pages inside the ion-content area of my app.

My idea is the following: Create a scroll indicator arrow that is either on the top of the screen or on the bottom of the screen depending on whether the user has scrolled up or down the screen entirely.

So whenever the user is at the top of the page and the user is capable of scrolling down I want to display a down arrow at the bottom of ion-content displaying that the user can still scroll down.

Whenever someone clicks that button the user should jump down to the bottom of the page, same goes for scrolling to the top of the page.

I figured I could write my own custom component and then add it to all and every single page inside my ionic app’s ion-content. But this seems counter intuitive since I’d have to do this for every single page.

Is there perhaps a way to create a custom component that is added to each page’s ion-content element globally so that I won’t have to add it manually to each html page?

Also, I would need to access the ion-content’s scrollTop property and scrollBottom property of whichever page this component is added.

Please let me know your thoughts on this.

Posts: 1

Participants: 1

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>