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

Capacitor Keyboard "resize": "none" only working for iOS

$
0
0

Unsure if this is a new feature added or I just discovered it, but you can inside of capacitor.config.json set the following:

{
	"appId": "com.foo.bar",
	"appName": "Foo Bar",
	"webDir": "www",
	"bundledWebRuntime": false,
	"plugins": {
		"Keyboard": {
			"resize": "none"
		}
	}
}

Which essentially allows the keyboard to cross over the footer or page elements and also not resize the webview, such as a list. It is super nice and I like it. Sadly I only have been able to get it to work in iOS. I am unsure if something special on Android or Gradle that needs to be done in order to get it to work there.

Has anyone else experienced this?

I did notice the “resizeOnFullScreen: boolean → There is an Android bug that prevents the keyboard from resizing the WebView when the app is in full screen (i.e. if StatusBar plugin is used to overlay the status bar)”, but unsure of its relation to my issues described.

Capacitor Keyboard Docs

1 post - 1 participant

Read full topic


Angular PWA tab router limitation? android back button can not go back previous page?

$
0
0

Hi

We are developing a PWA with Ioinc 5 + Angular + capacitor, and there is a page with 3 tabs. the current design allows each tab url to be share and reload without any issue.

However, when I open the pwa homepage, then click to open the tab page, and change tab1 to tab2 to tab3, the android back button (at the bottom in all android devices) can only move back to tab 1 from tab3, can not move back to homepage.

Is this a limitation of Angular tab routing? any way I can fix this?

thanks

1 post - 1 participant

Read full topic

Tab Bar and Side Menu

$
0
0

Hi, I have one doubt about the tab bar and side menu, can we use both but not at the same time.
I mean for the browser I need to use the side menu and for mobile, I need to use the tab bar, so can we do that if yes can you suggest any solution for that…

1 post - 1 participant

Read full topic

Ionic 6 navigateroot not working

$
0
0

I’m using ionic 6 angular. when I used navCtrl.navigateroot(‘page’) it’s goes that page. After that press the android hardware back button it goes to the previous page. how to fix that issue

1 post - 1 participant

Read full topic

Ionic Select Popover does not include options

$
0
0

I have copied and pasted an example straight from the docs:

<ion-select interface="popover" placeholder="Select One">
      <ion-select-option value="brown">Brown</ion-select-option>
      <ion-select-option value="blonde">Blonde</ion-select-option>
      <ion-select-option value="black">Black</ion-select-option>
      <ion-select-option value="red">Red</ion-select-option>
</ion-select>

However, my popover does not actually include any of those options. You can see that the popover viewport is empty:
image

If I set it’s height, I can see that there is a popover appearing in the right spot, but it has a height of zero by default since none of my options are in it.

image

I’ve literally taken the example from the docs. Why is just having a working select box hard.

Using Vue. In vue for whatever reaosn you have to import like every single component which is very annoying, am i missing some import or something i have no idea.

1 post - 1 participant

Read full topic

*ngIf not working in ng-container element

$
0
0

Hello,

I’m starting a new project and am having a problem. I’ve added a new page and in the html template I want to use ng-container element with ngIf. To test this, I’ve listening to the ActiveRoute’s paramMap observable. I log to the console if a route parameter ( :id ) exists or not, then set a property to true or false.

Within the development environment, the console.log is correctly pointing out whether or not a route parameter returns true or false, however the next error is 'Can’t bind to ‘ngIf’ since it isn’t a known property of ‘ng-container’ and nothing is rendered to the browser.

I’ve searched online if anyone had this issue with Ionic. Which I did not find one.

Bit of history:
In my environment, Ionic installed angular@13, which I thought was weird that the cli is supported to angular 12. To be totally sure, I use nvm to install node 14.18.0 and installed the angular/cli/@12 globally and then ionic. Ionic again, installed angular@13 into the project. Isn’t this weird?

I decided to test ng-container within the default app.component.html and it worked. I looked at the differences between the default module and the new page’s module and only the browsermodule was lacking in the new page. I added it and it made no difference in the error, while it continued to work in app.component.html module.

Next I created a component and added to the new page’s module and put the into the page.html thinking its a regular angular component and it still doesn’t work.

I’m at a lost as to what else to do here. Why is it not working? Has anyone run into this?

Thanks,
Andre

1 post - 1 participant

Read full topic

How to add event listener on month change event in an ion-datetime?

$
0
0

Hi,

On ion-datetime, if I change the month using the arrows < or > or if I slide the page to change the month, how can I trigger an event with the month value and the year value that is displayed after month change ?

Many thanks to anyone who can help me.

1 post - 1 participant

Read full topic

How to resize image?

$
0
0

Hi all,

I am doing a diary app, which just let user take a photo or choose an image and then, I will resize the image, so that I can show the image as a thumbnail.

How can I do that with capacitor? (I found a package react-image-file-resizer, but it only works for web…)

Thanks in advance

1 post - 1 participant

Read full topic


dd/mm/yyyy format for datepipe.transform method in .ts file

$
0
0

I need to parse a csv file which has a date column in dd/mm/yyyy format. And i need to change this date to yyyy-mm-dd format to save it in database. So I use datepipe.transform method for this as below

this.datePipe.transform(x[this.csvcolumns.colDOB], 'yyyy-MM-dd','de')

By default the datepipe only accepts mm/dd/yyyy. So for a date like 18/02/2000,the datepipe throws an error as below.

InvalidPipeArgument: 'Unable to convert "13/02/2012" into a date' for pipe 'DatePipe'

I’ve added the following configuration in app.module.ts, so the datepipe in an html page gives me a date in dd.mm.yyyy format.

import { registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/de'; registerLocaleData(localeDe);

Today is {{todayDate | date:'shortDate'}}

So why is it not working for datepipe.transform method in a ts file? Do i need to make any changes in the constructor for that? My constructor looks like below

providers: [DatePipe] })

export class BulkuploadPage implements OnInit { constructor(private datePipe: DatePipe) { } ngOnInit() {}

1 post - 1 participant

Read full topic

Ionic v1 android 11 does not show images

$
0
0

After updating the android api version to 30, when I take a photo on the camera the image is not displayed on the screen, the same happens when I use external images, the problem started when I updated the android api version to 30.
Has anyone experienced this and how did you resolve it?
I’ve tried to update the camera version but without success.

1 post - 1 participant

Read full topic

Ion-select: How can I make a text dependent on a variable?

$
0
0

Hello, I have already created the following code. Now I would like to display a different text block under the selection field for each individual value. How does this work?

  <ion-item>
    <ion-label>Organisation:</ion-label>
    <ion-select value="B" [(ngModel)]="selected_organisation">
      <ion-select-option value="B">First</ion-select-option>
      <ion-select-option value="U">Secound</ion-select-option>
      <ion-select-option value="W">Third</ion-select-option>
    </ion-select>
  </ion-item>

1 post - 1 participant

Read full topic

Select component with options populated via api search

$
0
0

I’m wondering if there’s a solution for a selector with a search bar that populates options via an api request.

I’m looking for something like vue-select package, unfortunately that package doesnt work on vue 3 on ionic for some reason. When I put it in a view it throws “e.createElementVNode is not a function”.

Thanks for suggestions.

1 post - 1 participant

Read full topic

How to save file on new android

$
0
0

Hi all,

I want to save a image locally, maybe in Documents or Gallery. But How can I do that?

Here is my code:

  const canvas = await html2canvas(
    document.querySelector("#beautifulImage") as any
  )

 const res = await Filesystem.writeFile({
    path: `myImage.png`,
    data: canvas.toDataURL(),
    directory: Directory.Documents,
  })

However, it comes error and say: directory is not created!!!

Finally, I found this works: addandroid:requestLegacyExternalStorage="true" in the application tag in the AndroidManifest.xml, however, the document said, it won’t work on android 11 or newer???

How can I do it correctly?

1 post - 1 participant

Read full topic

Named views when using IonRouterOutlet?

$
0
0

The RouterView component allows for the use of “Named Views”. Is it possible to get this same functionality when using Ion-RouterOutlet?

1 post - 1 participant

Read full topic

In app browser loadstop is not triggered untill click on the done button in ios

$
0
0

I am using InAppBrowser on my ionic4 ios app

in app browser version : 5.36.0
cordova-inappbrowser : 5.0.0
ios deployment : ios 14

The objective is to close the in app browser after success payment in the in-appbrowser

But my issue is the loadstop event which is not triggered even if the page finishes loading. The event is triggered when i click on the done button in the footer. This is working perfectly in the android app but not closing in the ios app.

I am testing it directly on iOS 14 device

Thanks a lot for your help in advance

My code :

import { InAppBrowser} from ‘@ionic-native/in-app-browser/ngx’;
const browser = this.inAppBrowser.create(paymentString, “_blank”, {
location: ‘no’,
clearcache: “yes”,
hardwareback: ‘no’,
closebuttoncaption: ‘Done’,
enableViewportScale: ‘yes’
});

    browser.on('loadstop').subscribe((event: InAppBrowserEvent) => {
         browser.close();
    })

1 post - 1 participant

Read full topic


Medical Malpractice Attorneys Florida

$
0
0

One of the Medical Malpractice Attorneys in Florida to contact for redressal of your grievances is your Scott The Lawyer. It is one of the highly renowned firms that has helped thousands of people receive compensation. Insurance companies in Florida are given six months of the two years to evaluate your claim. After they have completed their evaluation process, only then your malpractice lawyers can file your lawsuit. So as soon you have found out any case of negligence, reach out to your lawyer at once, who will start investigating and working on your case.**

1 post - 1 participant

Read full topic

Ionic-vue scrollToTop not working

$
0
0

I have a problem where I’ve added a scrollToTop button in my app and it works on the first page that I’m on for that app after a refresh. If I go to any other link in my app and click the button, it doesn’t scroll back to the top. Let’s say I refresh it on that different link then try again, it’ll work but only on that page.

This is my TabLayout.vue that I use across all pages on my app:

<template>
    <ion-page>
    <ion-header>
      <ion-toolbar>
        <ion-buttons slot="start">
          <slot name="actions-start"></slot>
          <ion-back-button :default-href="pageDefaultBackLink" v-if="pageDefaultBackLink !== ''"></ion-back-button>
        </ion-buttons>
        <ion-title>
          <div class="ion-text-wrap pageTitle">
            {{title}}
          </div>
          </ion-title>
        <ion-buttons slot="end">
            <slot name="actions-end"></slot>
            <ScrollToTopButton/>
        </ion-buttons>
      </ion-toolbar>
    </ion-header>
    <ion-content :fullscreen="false" class="bindingScrollContent" :scroll-events="true">
        <slot/>
    </ion-content>
  </ion-page>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButtons, IonBackButton} from '@ionic/vue';
import ScrollToTopButton from '@/components/usables/ScrollToTopButton.vue';

export default defineComponent({
    components: { IonHeader, IonToolbar, IonTitle, IonContent, IonPage, IonButtons, IonBackButton, ScrollToTopButton },
    props: {
        title: {
            type: String,
            required: true
        },
        pageDefaultBackLink: {
            type: String,
            required: false
            // default: '/tabs/quran'
        },
    },
    setup() {
        return {};
    }
})
</script>

This is the ScrollToTopButton.vue:

<template>
    <div id="myBtn">
        <ion-button @click="scrollToTop">
            <ion-icon :icon="arrowUpCircleOutline" color="success"></ion-icon>
        </ion-button>
    </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { IonButton, IonIcon } from '@ionic/vue'
import { arrowUpCircleOutline } from 'ionicons/icons';

export default defineComponent({
    components: {
        IonButton,
        IonIcon,
    },
    setup() {
        const content = ref();


        const scrollToTop = () => {
            let scrollContent = document.querySelector('ion-content.bindingScrollContent')!;
            scrollContent.scrollToTop(700);
            console.log('scrolled up')
            //content.value.scrollToTop(700);
            
        }

        return { arrowUpCircleOutline, scrollToTop };
    }
})
</script>

<style>

#myBtn {
  /* display: hidden; */
  cursor: pointer; /* Add a mouse pointer on hover */
  border-radius: 10px; /* Rounded corners */
  zoom: 1.1;
}
</style>

I’ve tried many things to no avail, if any help is appreciated, thanks.

1 post - 1 participant

Read full topic

No such module '..Kit' when using Capacitor Plugin

$
0
0

I’m building an Capacitor Plugin. To autenticate a user using WebAuthn (since this is not yet suported in WKWebView-based browsers)

Within this plugin I’m using WebAuthnKit I added it to my Podfile of my plugin. Like so:

...
use_frameworks!
pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios'
pod 'WebAuthnKit', '~> 0.9.5'
...

After running pod install it works great! Also when I build only my plugin using xcode it builds successfully

But then when I use my plugin in my ionic capacitor app (installed locally via npm) xcode spits out the error
No such module 'WebAuthnKit' on the line in the plugin code where I do import WebAuthnKit to use it.

I can fix it by hand but after running ionic cap sync ios all my changes are gone!
What I do to fix it:

  1. Also add pod 'WebAuthnKit', '~> 0.9.5'to my ionic app podfile
  2. Also run pod install in the ios/App folder of my ionic app
  3. Select Pods project from xcode
  4. Select CapacitorMyPlugin from the targets panel to select my plugin
  5. Add WebAuthnKit to the list of Link Binary With Libraries under Build Phases
  6. Add "${PODS_CONFIGURATION_BUILD_DIR}/WebAuthnKit" in the Framework Search Paths (debug and release) under Build Settings

After this is done the error is gone but I have to repeat these steps after every ionic cap sync ios.

Has anyone used external Kits in a Capacitor Plugin?
How do you link the correct pods from xcode workspace?

(opening .xcodeproj or .xcworkspace makes no difference only when opening .xcodeproj it sais No such module ‘Capacitor’)

1 post - 1 participant

Read full topic

Check fake gps / mock location

$
0
0

Hello i am using capacitor 3, is there any way to check if the device using fake gps application?

1 post - 1 participant

Read full topic

WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed in version 7.0 of the Android Gradle plugin

$
0
0

i’m trying to upgrade classpath com.google.gms:google-services to classpath ‘com.google.gms:google-services:4.3.10’
i’ve added it in build.gradle Project like picture shown, but still get the information of Adding classpath: com.google.gms:google-services:4.3.8 in terminal


any helps ?

1 post - 1 participant

Read full topic

Viewing all 70612 articles
Browse latest View live


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