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

Why grid rows are not selectable?

$
0
0

@ioclaudio wrote:

Hi,
I have this grid on an Ionic4 app:

<ion-grid>

<!-- header -->
  <ion-row>
	<ion-col size="4">
	  {{ 'Time' | translate }}
	</ion-col>
	<ion-col size="8">
	  {{ 'Info' | translate }}
	</ion-col>
  </ion-row>

<!-- other rows not selectable -->
  <ion-row *ngFor="let data of filteredData; let i = index;">
	<ion-col size="2">
	  <ion-icon name="pin" ...></ion-icon>
	</ion-col>
	<ion-col size="2">
	  {{data['time'] | date: 'dd/MM/yyyy HH:mm:ss'}}
	</ion-col>
	<ion-col size="8" *ngIf="data['data_type'] === 'Position'">
	  <b>{{ 'Latitude' | translate}}:</b> {{data['latitude'] }} ; <b>{{ 'Longitude' | translate}}:</b> {{data['longitude'] }} ; <b>{{ 'Speed' | translate}}:</b> {{data['speed'] }}
	</ion-col>
  </ion-row>

</ion-grid>

I’m able to select with the mouse only the header of the grid, while the other rows are not selectable.
Why?
How does is it possible?
It could be a CSS issue, but there aren’t custom classes defined on the other rows.

Thank you

cld

Posts: 1

Participants: 1

Read full topic


Background location using capacitor

$
0
0

@abhibly wrote:

Hello, I am using capacitor background-task in my android app. I want to get the location of the user every 15min and send it to the server even when the device is locked or app is in background. I am unable to send the location to the server. Can somebody please let me know, how to capture user locations in regular intervals and send to server if app is in background or device is locked using capacitor background-task ?

Posts: 1

Participants: 1

Read full topic

[ionic4] - no such file - ios/platform_www/cordova.js

$
0
0

@JohnCressman wrote:

When I run ionic cordova prepare ios on my Macbook Air, I get the following error:

ENOENT: no such file or directory, open '/Users/…/Ionic/EMSProv4/platforms/ios/platform_www/cordova.js

I was previously able to run this command but after moving my latest code over (from Windows machine), now suddenly there is an issue.

Any ideas on where to troublshoot this?

Posts: 1

Participants: 1

Read full topic

Config.xml android-targetSdkVersion value="28" being built value="27"

$
0
0

@BrentAshWilliams wrote:

Hello,

I am currently trying to release an update to Google Play. I am using Ionic 3.

My config.xml has the following property:

<preference name="android-targetSdkVersion" value="28" />

package.json:

cordova-android": "^8.0.0"

I build from the command line with the following command:

ionic cordova build android --prod --release

If I look in platforms\android\app\src\main\AndroidManifest.xml I see the following:

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />

I then open up Android Studio (using 3.4.2) to generate the signed apk - Note in the SDK Manager under SDK Platforms Android 9 (Pie) API 28 is installed - and generate the .apk.

When I try to create a new release in the app store I get the following:

#### Warnings

Your app currently targets API level 27 and must target at least API level 28 to ensure it is built on the latest APIs optimized for security and performance.

I then searched the Android Project in Android Studio and see the following in platform\app\build.gradle:

Android {
    defaultConfig {
        versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
        applicationId privateHelpers.extractStringFromManifest("package")
        minSdkVersion 19
        **targetSdkVersion 27**

        if (cdvMinSdkVersion != null) {
            minSdkVersion cdvMinSdkVersion
        }
    }

Why is this 27?

I changed it in my project and reopened Android Studios and was able to generate an .apk with a target SDK version of 28.

Thanks for any insight.

Posts: 1

Participants: 1

Read full topic

Harware Volume buttons in background mode

$
0
0

@Fersup wrote:

I need help, how can i access the hardware volume buttons in ionic 4 when the application is closed or in the background… i tests background mode plugin but is trash. anyone have a solution.?

thanks

Posts: 1

Participants: 1

Read full topic

Refresh HomePage After Modal Is Closed

$
0
0

@jefredallan wrote:

I have a homepage and a comment page. When I close the modal (comment page) , I want the homepage to refresh so that It can update the Comment Counts. I can refresh the homepage by calling ionViewWillEnter() function.

My code:
homepage

    async openModal() {
      const modal = await this.modalController.create({
        component: CommentsPage,
        componentProps: {
          postId: this.postID
        }
      });

      modal.onDidDismiss(() => { this.ionViewWillEnter(); }); //Error: Expected 0 arguments, but got 1.ts(2554)

      return await modal.present();
    }

Comment Page:

  async closeModal() {
  this.modalController.dismiss();
  }

Posts: 2

Participants: 2

Read full topic

Ionic-4 Nav pop event?

$
0
0

@reedglawrence wrote:

I’m finding success with nav.pop() in my modals that are nested within my app. I want to note that I don’t use the nav elements for actual routing and navigation. Only for sub-menus within sub-menus like modals. Objects that I don’t want to assign an actual route to.

However, with a modal I can wait for the promise from onWillDismiss for example so that I can handle all of the back events, whether they are generated from buttons or gestures.

With routed components I can subscribe to the angular Router.

However, with Navs, I haven’t found a clean way to await/subscribe to a nav.pop() event? Closest thing I have been able to do is add an ngOnDestroy() to the pushed component. But that has a noticeable delay as it only fires after the component is completely offloaded.

I can add a service with an event emitter to handle buttons that go back or dismiss the nav. But it doesn’t account for the swipe to go back gesture then.

Any clean solutions?

Posts: 1

Participants: 1

Read full topic

How to send a push notification to a specific device with Firebase and Capacitor

$
0
0

@pdiffley wrote:

There is a helpful guide for sending push notifications with Capacitor and Firebase, but it only describes how to send global notifications to an app. Is there a way to get a device id with Capacitor, so that you can send a notification to that device with the Firebase Server SDK?

Posts: 1

Participants: 1

Read full topic


Var not defined

$
0
0

@Tshepang01 wrote:

Hi how do I get my variable to be defined?

This is payment platform integration with my app.

I don’t seem to understand the concept be this.
Eg

var (https) = require (‘https’)

Posts: 1

Participants: 1

Read full topic

Not able to Publish Ionic 1 app to Google Play store with new 64-bit support requirement

$
0
0

@aartigumate wrote:

3

I have developed an APp in Ionic 1 Cordova Android platform and have been successfully publishing to Play store till 15 days back. But now with the new requirement of Google to mandate 64 bit support for all apps, I am not able to publish the same to play store.

1, I tried removing and adding android platform again. 2. added cordova-res : 0.6.0 native-run : 0.2.8 as required by Ionic platform 3. The new APK generated in Path ~\platforms\android\app\build\outputs\apk\debug\app-debug.apk Earlier the build used to show here ~\platforms\android\build Is this the right path? 4. The new APK file opens on the device or emulator and displays a blank screen. Is there any error in the Android and Cordova configuration

My Ionic Config as as below Ionic:

Ionic CLI : 5.2.4 (C:\Users\Kriskross\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic1 1.3.1 @ionic/v1-toolkit : 2.0.7

Cordova:

Cordova CLI : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 8.0.0 Cordova Plugins : no whitelisted plugins (39 plugins total)

Utility:

cordova-res : 0.6.0 native-run : 0.2.8

System:

Android SDK Tools : 26.1.1 (C:\Program Files\Android) NodeJS : v10.16.1 (C:\Program Files\nodejs\node.exe) npm : 6.10.3 OS : Windows 7

and build.gradle : /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath 'com.android.tools.build:gradle:3.3.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }

    //This replaces project.properties w.r.t. build settings
    project.ext {
      defaultBuildToolsVersion="28.0.3" //String
      defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
      defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
      defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Posts: 1

Participants: 1

Read full topic

White screen of death after upgrading ionic

$
0
0

@APrince wrote:

Hi,
I have this problem that is driving me nuts for several weeks already and I just can’t seem to find any solution.

I have updated ionic and my app which was building just fine for more then a year is now broken. I mean I can run ionic serve and it works but when I do a cordova build for android I always only see the dreaded white screen of death. If I connect to the device with chrome dev tools, I get the following output:


Viewport argument key "viewport-fit" not recognized and ignored. [index.html:9](file:///android_asset/www/index.html)

Uncaught Error: Cannot find module "." [vendor.js:1](file:///android_asset/www/build/vendor.js)

Ionic Native: deviceready event fired after 441 ms [vendor.js:1](file:///android_asset/www/build/vendor.js)

Well, since then I have tried everything… Updating the packages, downgrading packages, trying out all sorts of typescript versions, removing all of the cordova plugins and platform and recreating them again with ionic cordova prepare. I also went back in my git history and tried to get the exact state of the packages by reconstructing the versions from the package-lock… I updated node.js. I did everything I could think of. Nothing seems to help.

If I create a new app from any of the templates, it works.

The only thing I didn’t try out is going back to the ionic-cli version I was using before messing up with all the versions. But the problem is that I don’t remember the version I used at the point when I created the project, and ionic is installed globally so I have no package.json history for that one…

Any help is really appreciated. I am at my wits end…

//edit: current ionic version:

Ionic:

   Ionic CLI          : 5.2.3 (C:\Users\Aros\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.5
   @ionic/app-scripts : 3.2.2

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 7.1.4, browser 5.0.3, windows 5.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 4 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.8

System:

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

Posts: 1

Participants: 1

Read full topic

Property 'push' does not exist on type 'NavController'

$
0
0

@bayes wrote:

import { Component } from ‘@angular/core’;
import { NavController } from ‘@ionic/angular’;
import { DetailsPage } from ‘…/details/details.page’;

@Component({
selector: ‘app-home’,
templateUrl: ‘home.page.html’,
styleUrls: [‘home.page.scss’],
})
export class HomePage {
Articles : any;
constructor(public navCtrl : NavController) {
this.Articles =[
{nom :‘Boubou Homme’, prix : 10000, details :‘details Boubou Homme’ },
{nom :‘Robe Femme’, prix : 8500, details :‘details Robe Femme’},
{nom :‘Robe simple’, prix : 5000, details :‘details Robe simple’},
{nom :‘Chemise Homme’, prix : 3500, details :‘details Chemise Homme’},
{nom :‘Chemise Femme’, prix : 3500, details :‘details Chemise Femme’},
{nom :‘Pantalon simple Homme’, prix : 3500, details :‘Pantalon simple Homme’},

]

}
DetailsPage() : void {
this.navCtrl.push(DetailsPage);
}

}

Posts: 1

Participants: 1

Read full topic

Fragment shader canvas

$
0
0

@SDA wrote:

Hi,
I would like to have a canvas in my ionic app to display a fragment shader.
Passing uniform variables too.
I’m using ionic 4 with react, but I’m willing to switch to angular in that case.
Thank you,
Bruce

Posts: 1

Participants: 1

Read full topic

Can't hide splash screen

$
0
0

@Kestrel-1 wrote:

i have app build with vue.js.
my main.js file look like this:

import Vue from ‘vue’
import App from ‘./App’
import { Plugins } from ‘@capacitor/core’
const { SplashScreen } = Plugins;

SplashScreen.hide();

new Vue({
render: h => h(App)
}).$mount(’#app’)

no effect. I tried to use mounted and created hooks, doesn’t work either.

Posts: 1

Participants: 1

Read full topic

File Transfer doesn't work on browser

$
0
0

@masaldana2 wrote:

How do you download a file to your desktop downloads directory thru the browser?
the docs say that file transfer is compatible with the browser

Posts: 1

Participants: 1

Read full topic


Ionic 4 binding not working on tab change

Unknown URL error on user registration on android 9. All other android versions works well

$
0
0

@bii254 wrote:

So i have this error whereby only android phones running on android 9 cannot register user via REST api. I build app debug using prod and console error i am getting is unknown url. The most confusing part is it sometimes works fine. Is this an issue with my server or it is an issue to do with api leve 28?

Posts: 1

Participants: 1

Read full topic

Loading login page after user logged

Ionic 4 Reactive Form Validation mobile app different to web

$
0
0

@wekas wrote:

I have Reactive Form Validation working in an angular application. I have replicated this code as similarly as possible in my ionic app and it works fine when running in the browser (ionic serve).

However when I run the same code on as a mobile app (Android or iOS) it does not update the validation messages. How can I get the messages showing once the user leaves the input (touched) or after submitting the form and failing validation.

It knows the form is not valid once I submit it just just not show the messages. It is also not a styling issue as they display if I remove all the conditional logic.

Code (works in browser):

<form [formGroup]="loginForm" (ngSubmit)="onSubmit()" #formCtrl="ngForm">
      <ion-grid>
        <ion-row class="row-padding-one"></ion-row>
        <ion-row>
          <ion-col size-sm="6" offset-sm="3" class="input-col">
            <ion-item class="custom-item" lines="none">
              <ion-input 
                class="login-input"
                formControlName="email"
                placeholder="E-Mail"
                required>
              </ion-input>
              <div *ngFor="let validation of loginValidationMessages.email">
                <div class="error-message"
                 *ngIf="loginForm.get('email').hasError(validation.type) && ((loginForm.get('email').dirty || loginForm.get('email').touched) || formCtrl.submitted)">
                  {{validation.message}}</div>
              </div>
            </ion-item>
...
           <ion-button
              class="btn-login"
              type="submit"
              color="primary"
              expand="block">Login
            </ion-button>
...
 </form>

Full question here:

Posts: 1

Participants: 1

Read full topic

Migrating from filtered collection-repeat in ionic v1 to filtered VirtualScroll in ionic-v4 based on Search input

$
0
0

@stib wrote:

Hi,

I posted this on StackOverflow here but since I didn’t get any response there I am hoping this forum may provide me a response.

I am starting to migrate an ionic-v1 app to ionic-v4.

I have an associative array of country objects as below

var countries = {
        af: {
            name: 'Afghanistan (‫افغانستان‬‎)',
            countryCode: 'af',
            intlPrefix: '93'
        },
        al: {
            name: 'Albania (Shqipëri)',
            countryCode: 'al',
            intlPrefix: '355'
        },
        dz: {
            name: 'Algeria (‫الجزائر‬‎)',
            countryCode: 'dz',
            intlPrefix: '213'
        },
        ... more countries
}

I have this simple code in ionic-v1 that lets the user type in the country name and filter the displayed list to select the country.

  <ion-content>
    <div class="list list-inset">
      <label class="item item-input">
        <i class="icon ion-search placeholder-icon"></i>
        <input type="text" placeholder="Search" ng-model="search" maxlength="20"/>
      </label>
    </div>
    <div class="list">
      <div class="item item-country" collection-repeat="country in countries | filter:{'name': search}" ng-click="updateSelectedCountry(country);">
        <h2>{{country.name}}</h2>
        <p>+{{country.intlPrefix}}</p>
      </div>
    </div>
  </ion-content>

I understand that collection-repeat from ionic-v1 has been replaced by VirtualScroll in ionic-v4 and was thinking that ionic-v4 would have something simple to achieve this. However, after a lot of reading and searching I haven’t found a simple elegant mechanism to accomplish what the code above does. In particular I am looking to translate this piece of code

<div class="item item-country" collection-repeat="country in countries | filter:{'name': search}"

I am trying something like this

      <div class="list list-inset">
        <label class="item item-input">
          <i class="icon ion-search placeholder-icon"></i>
          <input type="text" placeholder="Search" [(ngModel)]="search" maxlength="20"/>
        </label>
      </div>
      <ion-virtual-scroll [items]="countries">
        <ion-item *virtualItem="let country" *ngIf="country.name == search">
          <h2>{{country.name}}</h2>
          <p>+{{country.intlPrefix}}</p>
        </ion-item>
      </ion-virtual-scroll>

but apparently I can’t have both *virtualItem and *ngIf on the the same line as it complains that I can’t have multiple template bindings on the same element.

Looking for help from ionic-v4 experts to help solve this problem in the best way possible.

Thanks,
Sanjay.

Posts: 1

Participants: 1

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>