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

Autofocus works only first time

$
0
0

@RehanHassan wrote:

Hi,

i’m facing an issue while using autofocus in IonInput. autofocus only works when i open the page for the first time, but when i go back & reopen the page, autofocus doesn’t work. Following is the code !!!

<ion-card>

          <ion-card-content>

               <form [formGroup]="formAddEdit">

                    <!-- app-name -->
                    <ion-item>
                         <ion-label position="floating">App Name</ion-label>
                         <ion-input formControlName="name" autofocus></ion-input>
                    </ion-item>


                    <!-- app-id -->
                    <ion-item>
                         <ion-label position="floating">App Id</ion-label>
                         <ion-input formControlName="id"></ion-input>
                    </ion-item>

               </form>

          </ion-card-content>

     </ion-card>

     

export class HostAppPage implements OnInit
{
        public formAddEdit:FormGroup;





        constructor(public formBuilder:FormBuilder)
	{
	}





	ngOnInit()
	{
		this.formAddEdit = this.formBuilder.group({
			name : [''],
			id   : ['']
		});
	}
}

Posts: 1

Participants: 1

Read full topic


Ionic 4 - Cordova Task :app:processDebugManifest FAILED after combine plugins

$
0
0

@IgorSamer wrote:

I’m trying to use Firebase Analytics and Music Controls plugins in my app, but without success.

If I start a new app and install only Firebase Analytics, when I run ionic cordova run android all works fine. The same occurs if I install only Music Controls and run the app. The only difference is that when I install the Music Controls plugin, I need to add too implementation 'com.android.support:support-v4:28.0.0' to my dependencies on build.gradle, and then all works fine too.

But, when I install Firebase Analytics and Music Controls together, and run ionic cordova run android, it returns the following error:

Task :app:processDebugManifest FAILED

See http://g.co/androidstudio/manifest-merger for more information
about the manifest merger.

/Users/Igor/Desktop/Ionic/MyApp/platforms/android/app/src/main/AndroidManifest.xml:22:18-91
Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from
[com.android.support:support-compat:28.0.0]
AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:5:5-13:19 to override.

FAILURE: Build failed with an exception.

How can I fix it and get these plugins working together properly?

Ionic info:

Ionic:
Ionic CLI: 5.2.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework: @ionic/angular 4.7.4
@angular-devkit/build-angular: 0.801.3
@angular-devkit/schematics: 8.1.3
@angular/cli: 8.1.3
@ionic/angular-toolkit: 2.0.0

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

Utility:
cordova-res: 0.6.0 
native-run: 0.2.7 (update available: 0.2.8)

System:
NodeJS: v10.16.2 (/Users/Igor/.nvm/versions/node/v10.16.2/bin/node)
npm: 6.9.0
OS: macOS Mojave
Xcode: Xcode 10.2.1 Build version 10E1001

Plugins installed:

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebase-analytics 3.0.0 "FirebaseAnalyticsPlugin"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview"
cordova-plugin-music-controls 2.2.0 "MusicControls"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-support-android-plugin 1.0.1 "cordova-support-android-plugin" (automatically installed when I installed Firebase Analytics)
cordova-support-google-services 1.3.1 "cordova-support-google-services" (automatically installed when I installed Firebase Analytics)

Posts: 1

Participants: 1

Read full topic

--background-hover on help please

$
0
0

@pixelflips wrote:

Is anyone else having trouble with --background-hover on an <ion-button>? Seems other CSS custom properties work fine, but cannot seem to change the --background-hover.

My second question is should the --background-hover be changed on the button or on hover (see below)?

.button {--background-hover: blue}
.button:hover {--background-hover: blue}

Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Clean-ish way to prevent content scrolling when sliding

$
0
0

@reedglawrence wrote:

Perhaps there is a better way to address this directly through the ionic APIs provided, however in my searches I wasn’t able to find much.

My issue is that when you slide the range slider, if you move vertically it will also scroll the page with your thumb.

My solution prevents the page from scrolling, allowing only the slider to move horizontally, while the page remains still.

HTML:
<ion-range (touchstart)="preventScroll()" (touchend)="allowScroll()"></ion-range>

Component:

  preventScroll() {
    const content = document.querySelector('ion-content');
    if (content) {
      content.style.setProperty('--overflow', 'hidden');
    }
  }

  allowScroll() {
    const content = document.querySelector('ion-content');
    if (content) {
      content.style.setProperty('--overflow', 'inherit');
    }
  }

Just figured I would contribute the solution since I found sparse answers online directly related to this functionality. I had also attempted to bind to the touchmove event and use the event.preventDefault() method to stop the page. This worked, but was less reliable than touchstart and touchend.

Posts: 1

Participants: 1

Read full topic

Programmatically accessing slotted elements

$
0
0

@johns209 wrote:

Hello! I am building an image gallery component. The images are provided via slotted img elements. Does stencil provide any means for programmatically accessing slotted elements? This is necessary so the gallery component can know how many images it contains and the alt text for each image. Thank you for your assistance.

Posts: 1

Participants: 1

Read full topic

Post image to backendless in ionic 4

Ionic database sqlite

$
0
0

@dbarett wrote:

Goodnight,

I have been instructing but still without any result, where ionic saves the database on the device that is created using sqlite, since I am working with ionic but I need to know where the information that is contained in the database is saved.

Thank you

Posts: 1

Participants: 1

Read full topic

Using Stellar-SDK ionic serve works, cordova build doesnt

$
0
0

@rafucisneros wrote:

Hello! Im trying to build an app using Ionic 4 that connects to Stellar blockchain network. In order to do so I import js-stellar-sdk into my Ionic app.

I can use “ionic serve” and everything works fine, but when I try to test the app with an android emulator using “ionic cordova run android” or “ionic cordova build android” I get the error:

Error

ERROR in ./node_modules/eventsource/lib/eventsource.js
Module not found: Error: Can't resolve 'http' in 'C:\Users\Rafael Cisneros\Desktop\Work\Ionic\StellarTest\node_modules\eventsource\lib'                                                                                                         ERROR in ./node_modules/eventsource/lib/eventsource.js
Module not found: Error: Can't resolve 'https' in 'C:\Users\Rafael Cisneros\Desktop\Work\Ionic\StellarTest\node_modules\eventsource\lib'
[ERROR] An error occurred while running subprocess ng.

If I comment the line where I use stellar, build runs successfully:

this.server = new Server('https://horizon-testnet.stellar.org');

I pushed it into a repo:

Ionic info

These are the versions im using:

Ionic:

  • Ionic CLI : 5.2.3 (C:\Users\Rafael Cisneros\AppData\Roaming\npm\node_modules\ionic)
  • Ionic Framework : @ionic/angular 4.7.4
  • @angular-devkit/build-angular : 0.802.0
  • @angular-devkit/schematics : 8.2.0
  • @angular/cli : 8.2.0
  • @ionic/angular-toolkit : 2.0.0

Cordova:

  • Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
  • Cordova Platforms : not available
  • Cordova Plugins : not available

Utility:

  • cordova-res : not installed
  • native-run : 0.2.8

System:

  • Android SDK Tools : 26.1.1 (C:\Users\Rafael Cisneros\AppData\Local\Android\Sdk)
  • NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
  • npm : 6.9.0
  • OS : Windows 10

Thanks for the help!

Posts: 1

Participants: 1

Read full topic


How to use ion-loading events “ionLoadingWillPresent”?

$
0
0

@kanlidy wrote:

I want to know how to use Events “ionLoadingWillPresent” in Ionic V4 of ion-loading.

I know the IonLoading is a Interface, here’s source code:

interface IonLoading extends JSXBase.HTMLAttributes<HTMLIonLoadingElement> {
//...
   'onIonLoadingWillPresent'?: (event: CustomEvent<void>) => void;
//...
}

But, there’s no element for IonLoading from ‘@ionic/angular’, neither for the HTML tag.

Such events like:

ionLoadingDidDismiss , ionLoadingDidPresent , ionLoadingWillDismiss , ionLoadingWillPresent .

On page: ion-loading Api

Thanks a lot.

Here’s stackoverflow

Posts: 1

Participants: 1

Read full topic

[Ionic v4] WHY cannot navigate (push) inside modal?!

$
0
0

@dearboy wrote:

I worked on some project with ionic v3 before and I have no problem with navigation inside modal anymore.

Now I am working on another project that use ionic v4 and I spent 2-3 days to find how to navigate inside modal. But seem like I cannot do that on ionic v4.

So I would like to know Why we cannot do that on ionic v4 ?

I am also working on iOS native application and navigation inside modal is also standard transition in iOS native application.

I am wondering why you cut this feature out, even if iOS native still have it.

Thank you.

Posts: 1

Participants: 1

Read full topic

Fingerprint Ionic

$
0
0

@hanafiqp wrote:

Hello everybody , can anyone help me ?? I want to make a appliaction , there will be can register my fingerprint to my phone .

example , I will input my fingerprint , then save it to my phone fingerprint .

Thankfull for your help !

Posts: 1

Participants: 1

Read full topic

Help change the page orientation - ionic v4

Ionic 4 + Vue js + cordova

$
0
0

@ravibhoite22 wrote:

We have some customer requirement to build mobile app

Summary : Customer don’t want develop mobile from scratch using any hybrid framework. They have their web site (web app) ready which can render as per different device size ( responsive ).

Points to be noted :

  1. They want us to open that web url in mobile app using in-app-browser.
  2. For login they want us to create login page where user can login and redirect to dashboard page using in-app-browser URL.(i.e after login user will redirected to in app browser )
  3. They don’t want to use angular / react for this development.

Questions

  1. Can we use vue js + cordova combination to achieve in-app-browser functionality ?
  2. is it feasible to develop such type of app ?
  3. after redirect to in-app-browser we don’t have any control on code / functionality ?
  4. also they want to change some style of html page by injecting css. which will change some UI in that page

Thanks

Posts: 1

Participants: 1

Read full topic

Scrolling horizontally little fast and clicking on item is opening other item in IOS

$
0
0

@SultanWork77 wrote:

Hi All,

Horizontally scrolling and clicking on item is opening other item in IOS. [ionic cli 3.20]

Here is the sample code

<ion-scroll delegate-handle="itemWidgetScroll" class="item" id="itemWidgetSection" scrollX="true" scrollY="false" scrollbar-x="false">
          <dashboard-items [dataList]="widgetsData.items" [caller]="'DASHBOARD'"></dashboard-items>
</ion-scroll>

Posts: 1

Participants: 1

Read full topic

Ionic 4 @ionic-native/native-page-transitions not working

$
0
0

@Manohar007 wrote:

@ionic-native/native-page-transitions

Hello, I am using ionic 4 and i am using above library for transitions but its not working. I tried on browser as well as device also. but still not working without any error.

"@angular/animations": "^8.1.2",
"@angular/cdk": "^8.1.1",
"@angular/common": "^8.1.2",
"@angular/core": "^8.1.2",
"@angular/forms": "^8.1.2",
"@angular/http": "^7.2.15",
"@ionic/angular": "^4.6.2",
"@ionic-native/native-page-transitions": "^5.11.0",
"com.telerik.plugins.nativepagetransitions": "0.6.5",

Please help me to solve.

Posts: 1

Participants: 1

Read full topic


CNCopyCurrentNetworkInfo API is being deprecated by Apple. Is there any impact on Ionic 1 Angular 1.5 apps?

onResume in angular2

$
0
0

@Harikag wrote:

Hi, I need to handle resume state of the app in angular 2+. So please help me with an example. thanks.

Posts: 1

Participants: 1

Read full topic

[IONIC 4][Android] Keyboard overlaps input in form

$
0
0

@mruta94 wrote:

In every form of my Android application, the keyboard overlaps the whole screen without making it scroll.
If I try to scroll the entire view manually, nothing changes.
Even adding 300px of fake height to ion-conten, through a div with a fixed height the scroll is locked.
I tried to change AndroidManifest adding the property , but nothing. Also I tried to pass config object to IonicModule.forRoot with the property scrollAssist setted true.

I dont’t understand why I have this bug only in Android app. In iOS everything works fine.
I noticed that the ion-content has --keyboard-offset setted to 0px by :host style.
The code of my view is below:

<ion-content color="primary" padding>

    <ion-row>
        <ion-col>
            <ion-icon (click)="back()" size="large" class="top-custom-navigation" name="arrow-back"></ion-icon>
        </ion-col>
    </ion-row>


    <ion-row>
        <ion-col size="12" padding-horizontal>

            <h1>{{'REGISTRATION.WHAT_EMAIL' | translate}}</h1>
            <form #form="ngForm" padding-vertical>

                <ion-label class="small bold uppercase">{{'COMMON.EMAIL' | translate}}</ion-label>
                <ion-input [(ngModel)]="mailExist" #mail="ngModel" name="mailExist" email required
                           mailExist></ion-input>
                <div *ngIf="mail.getError('mail') && (mail.dirty || mail.touched)">
                    <ion-label class="error-txt">Mail già presente</ion-label>
                </div>
                <br/>
                <ion-label class="small bold uppercase">{{'COMMON.USERNAME' | translate}}</ion-label>
                <ion-input [(ngModel)]="username" #userName="ngModel" usernameExist name="username"
                           required></ion-input>
                <div *ngIf="userName.getError('username') && (userName.dirty || userName.touched)">
                    <ion-label class="error-txt">Username già presente</ion-label>
                </div>

                <ion-row>
                    <ion-col size="9">
                        <p class="small" [innerHTML]="'REGISTRATION.NEWSLETTER_FLAG' | translate"></p>
                    </ion-col>
                    <ion-col size="3" padding-vertical>
                        <app-switch (change)="onChangeNewsletterFlag($event)" style="margin-top:10px;"></app-switch>
                    </ion-col>
                </ion-row>


            </form>

        </ion-col>
    </ion-row>


    <app-fab-button class="fixed-bottom-right"
                    type="white"
                    [active]="form.valid"
                    (onClick)="next()"></app-fab-button>

</ion-content>

Posts: 1

Participants: 1

Read full topic

How to get data from an Web API hosted in iis with ionic

$
0
0

@Mlifonza wrote:

Hi guys,

I have been trying to make web API requests to my ASP.Net core 2.2 web API that is hosted in IIS. I can get back results when I use ‘example.com:50056/api/Vehicle/GetCarpaint’ from my browser. However, I get ‘Host could not be resolved: java.net.UnknownHostException: Unable to resolve host “drsmashservices.com”: No address associated with hostname’ when I make the same request from my app. My PC and phone are both on the same network. After testing with different domains, :

Is there something from my url, am I not following the correct syntax? here’s other peices of my code:

In my AndroidManifest.xml
“xml”: “<uses-permission android:name=“android.permission.INTERNET” />”

this.nativeHttp.setHeader(‘localhost’,‘content-type’, ‘application/json’);

  await this.nativeHttp.post('http://192.168.8.X/api/Vehicle/GetCarpaint', JSON.stringify(payload), {})
  .then( res => { 
    let parsed = JSON.parse(res.data)
    return parsed.result })
  .catch(err => { console.log(err) })

Posts: 1

Participants: 1

Read full topic

[ionic 4] Getting access to slot content through @HostListener

$
0
0

@piotrpotera wrote:

Hi,
I got following structure:
ion-card -> ion-item -> slot -> some user-generated content with text and links (wyswig editor).

Is there any way to get access to that (especially to A -> HREF attribute) through @HostListener? I need to handle click event there.

Posts: 2

Participants: 2

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>