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

Background Geolocation documentation missing /ngx

$
0
0

@jacky-gds wrote:

example misses

import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';

/ngx

and causing a lot of issues on mauron85 github too.

Posts: 2

Participants: 2

Read full topic


Ion-datetime default

$
0
0

@Bonsaiko wrote:

Hello,

I have a datetime object and I’d like to setup a default value when the user chooses the date.
But I don’t want this value to get displayed.
Let me explain why :

I have a max value defined to prevent under 18 people to subscribe.
Which means if I subscribe today the max value is 27/03/2002.
So when I try to setup my date of birth it’s set by default on 27/03/2002.

Now Im’ trying to setup my date which is let’s say 30/10/1974 : I’m not able to choose 30 as the day (because the year being set on 2002 I can’t choose 30/03/2002).

Same thing for the month, I won’t be able to choose october.

That’s why I decided to setup the default value of “today - 20 years” so when you arrive today, the default value is 27/03/2000.

It’s ok because when the user clicks to setup his date of birth, he can choose whatever he wants.

However, I think it’s strange because when you open the subscriuption form, you don’t really undertstand why the date of birth is defined on 27/03/2000…

Do you understand my issue ?

Actually I’d like to keep this default date that I setup but I’d like to know if it’s possible not to display this value when the form first opens ?

Thanks for your help.

Posts: 1

Participants: 1

Read full topic

[ng] ERROR in Cannot read property 'map' of undefined

$
0
0

@TheGuy573 wrote:

Hello.
I am a university student writing a dissertation about Ionic framework. I currently in the process of producing my final application but while generating the production release I encountered this error:
[ng] ERROR in Cannot read property ‘map’ of undefined

This error is preventing me from moving forward with my application and I would appreciate any help or suggestions.

Thanks in advance.

Full code can be seen here:
https://drive.google.com/drive/folders/1Mrw4r28IANGFRL_QYGpldq7YMOekBt2B?usp=sharing

Posts: 1

Participants: 1

Read full topic

How to get device orientation correctly

$
0
0

@leonardofmed wrote:

I need to get the device orientation to make some kind of compass. I saw that the old plugin | [2] used for this is now deprecated and that is suggested to use the W3C Device Orientation API now.

I tried to use it this way:

this.window.addEventListener("deviceorientation", function(event) {
    console.log(event);
}, true);

but the main orientation values (alpha, beta and gamma) are always null. I tried to turn on the GPS, but does not change anything.

I tried other events related to changes of orientation, but these don’t even fire, I belive this is because the orientation values are always null.

this.window.addEventListener("orientationchange", (event) => {
    console.log(event, screen.orientation.angle);      				    
}, true);

this.window.onorientationchange = (event) => { 
    console.log(event, screen.orientation.angle);
};

Am I doing something wrong? Is there other easier or correct way to get these informations?

Posts: 1

Participants: 1

Read full topic

Error: Type PdfViewerComponent is part of the declarations of 2 modules

$
0
0

@ashok12 wrote:

i have a lazy loading components ionic project. i have import

import { PdfViewerComponent } from ‘ng2-pdf-viewer’;
@NgModule({
declarations: [
PdfViewerComponent
]

})
export class Page1Module {}
in page1.module.ts and page2.module.ts.
i have received this error Error: Type PdfViewerComponent is part of the declarations of 2 modules

i don’t know how to fix it! any suggestions PLease!

Posts: 7

Participants: 2

Read full topic

Pass data from TabsPage to ChildTab

$
0
0

@Ibernato93 wrote:

Hello to all.
I am developing an app that has a 4 tabs
This is the html page

<ion-tabs>

  <ion-tab-bar slot="bottom">

    <ion-tab-button tab="profilo">
      <ion-icon name="person-sharp"></ion-icon>
      <ion-label>Profilo</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="chat">
      <ion-icon name="chatbubble-sharp"></ion-icon>
      <ion-label>Chat</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="random">
      <ion-icon name="search-sharp"></ion-icon>
      <ion-label>Trova</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="dintorni">
      <ion-icon name="compass"></ion-icon>
      <ion-label>Scopri</ion-label>
    </ion-tab-button>
  </ion-tab-bar>

</ion-tabs>

I need to send a request to the server every 5 seconds to get data.
I want to put this call in the main tab (TabsPage) and then pass the data obtained in the TabChat.
Is it possible to do this or do I have to insert the call to the server in each tab?

So the question is this: how do I pass a data from the tabPage to the tabChat?

Posts: 5

Participants: 2

Read full topic

Ionic v3 display not filling iPad

Recommendations for the site

$
0
0

@TotalHobbies wrote:

First of all I want to introduce myself.

My name is Luis Saúl and I am a Computer Engineer and in the company where I work developing mobile applications. My company works on mobile applications in Android, at the time of joining this company I made the decision to leave Android aside to start developing in hybrid environments. What ionic has seemed to me one of the best Frameworks. The only drawback is that the forums for help are English-speaking, which many Spanish-speaking people who interact with this framework would like to ask for help, but due to the language, some may be more complicated than others. So I don’t know if a category could be created for Spanish-speaking people to better contribute to this wonderful framework.

Posts: 1

Participants: 1

Read full topic


Self is not defined in ionic angular server side rendering

$
0
0

@YAsh0011 wrote:

I am following https://ionicframework.com/blog/ssr-with-angular-universal-and-ionic this tutorial everything setup is successfully done and also these command run sucessfully npm run build:ssr and npm run serve:ssr then they give me port for run website in browser Node Express server listening on http://localhost:4000 , but when open this port in chrome I got the error ERROR ReferenceError: self is not defined

ReferenceError: self is not defined
    at Object.607 (F:\ionic4-project\app\dist\2.js:44:9)
    at __webpack_require__ (F:\ionic4-project\app\dist\server.js:26:30)
    at __webpack_require__.t (F:\ionic4-project\app\dist\server.js:83:33)
    at ZoneDelegate.invoke (F:\ionic4-project\app\dist\server.js:585:26)
    at Object.onInvoke (F:\ionic4-project\app\dist\server.js:20315:33)
    at ZoneDelegate.invoke (F:\ionic4-project\app\dist\server.js:584:52)
    at Zone.run (F:\ionic4-project\app\dist\server.js:344:43)
    at F:\ionic4-project\app\dist\server.js:1083:34
    at ZoneDelegate.invokeTask (F:\ionic4-project\app\dist\server.js:617:31)
    at Object.onInvokeTask (F:\ionic4-project\app\dist\server.js:20306:33)

my project package.json

{
  "name": "app",
  "version": "1.0.1",
  "author": "hello",
  "homepage": "http://app.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "serve": "ionic serve --no-livereload --lab",
    "pwa": "ng build --prod --base-href /demo/app-pwa/ --deploy-url /demo/app-pwa/",
    "compile:server": "webpack --config webpack.server.config.js --progress --colors",
    "serve:ssr": "node dist/server",
    "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server",
    "build:client-and-server-bundles": "ng build --prod && ng run app:server:production"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.15",
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/fire": "^5.2.1",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/platform-server": "^7.2.2",
    "@angular/pwa": "^0.900.7",
    "@angular/router": "^7.2.2",
    "@angular/service-worker": "^8.2.14",
    "@ionic-native/admob-free": "^5.12.0",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/file": "^5.12.0",
    "@ionic-native/file-transfer": "^5.8.0",
    "@ionic-native/firebase-dynamic-links": "^5.14.0",
    "@ionic-native/firebase-messaging": "^5.13.0",
    "@ionic-native/ionic-webview": "^5.12.0",
    "@ionic-native/media": "^5.9.0",
    "@ionic-native/music-controls": "^5.12.0",
    "@ionic-native/native-audio": "^5.8.0",
    "@ionic-native/social-sharing": "^5.12.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.1.0",
    "@ionic/angular-server": "^5.0.7",
    "@ionic/storage": "^2.2.0",
    "@nguniversal/express-engine": "^7.1.1",
    "@nguniversal/module-map-ngfactory-loader": "0.0.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "cordova": "^9.0.0",
    "cordova-admob-sdk": "^0.24.1",
    "cordova-android": "8.1.0",
    "cordova-ios": "^5.0.1",
    "cordova-plugin-admob-free": "0.27.0",
    "cordova-plugin-androidx": "1.0.2",
    "cordova-plugin-androidx-adapter": "1.1.0",
    "cordova-plugin-device": "2.0.2",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-firebase-dynamiclinks": "3.0.0",
    "cordova-plugin-firebase-messaging": "^3.0.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-media": "^5.0.3",
    "cordova-plugin-music-controls": "git+https://github.com/amitkhare/cordova-music-controls-plugin.git",
    "cordova-plugin-nativeaudio": "^3.0.9",
    "cordova-plugin-splashscreen": "5.0.2",
    "cordova-plugin-statusbar": "2.4.2",
    "cordova-plugin-whitelist": "1.3.3",
    "cordova-plugin-x-socialsharing": "5.4.7",
    "cordova-promise-polyfill": "0.0.2",
    "cordova-sqlite-storage": "^3.2.1",
    "cordova-support-android-plugin": "^1.0.1",
    "cordova-support-google-services": "^1.3.1",
    "core-js": "^2.5.4",
    "es6-promise-plugin": "4.2.2",
    "express": "^4.15.2",
    "firebase": "^6.3.1",
    "moment": "^2.24.0",
    "phonegap-plugin-push": "2.2.3",
    "rxjs": "~6.5.1",
    "tslib": "^1.9.0",
    "typescript": "^3.2.4",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "~0.13.8",
    "@angular-devkit/core": "~7.3.8",
    "@angular-devkit/schematics": "~7.3.8",
    "@angular/cli": "~7.3.8",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@ionic/angular-toolkit": "~1.5.1",
    "@ionic/lab": "2.0.6",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~12.0.0",
    "codelyzer": "~4.5.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-loader": "^5.2.0",
    "ts-node": "~8.1.0",
    "tslint": "~5.17.0",
    "webpack-cli": "^3.1.0"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-file": {},
      "cordova-plugin-media": {
        "KEEP_AVAUDIOSESSION_ALWAYS_ACTIVE": "NO"
      },
      "cordova-plugin-music-controls": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-x-socialsharing": {
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
        "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
      },
      "cordova-plugin-androidx": {},
      "cordova-plugin-androidx-adapter": {},
      "cordova-plugin-admob-free": {
        "ADMOB_APP_ID": "ca-app-pub-~xxx"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.0.1"
      },
      "cordova-admob-sdk": {
        "PLAY_SERVICES_VERSION": "+"
      },
      "cordova-plugin-firebase-messaging": {},
      "cordova-plugin-firebase-dynamiclinks": {
        "APP_DOMAIN": "app.com",
        "PAGE_LINK_DOMAIN": "app.page.link",
        "FIREBASE_CORE_VERSION": "17.0.+",
        "FIREBASE_DYNAMIC_LINKS_VERSION": "18.0.+"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

Ionic Info

Ionic:

   Ionic CLI                     : 5.2.7 (C:\Users\xxx\AppData\Roaming\nvm\v10.16.3\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

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

Utility:

   cordova-res : 0.6.0
   native-run  : 0.3.0

System:

   Android SDK Tools : 26.1.1 (C:\Users\xxx\AppData\Local\Android\sdk)
   NodeJS            : v10.16.3 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

Please help

Posts: 1

Participants: 1

Read full topic

Is it possible to use your Ionic app as a sat-nav?

Image not displaying from server ionic 4

$
0
0

@UnnatiPatadia wrote:

I want to show list of categories.

Image is not shown on android version 9 and above.
when I try to put static image it shows perfectly but image from server is not shown.

tab1.html

<ion-grid>
  <ion-row  class="margin" *ngFor="let row of grid">
    <ion-col size="3" class="ion-text-center" *ngFor="let item of row" (click)="quizInfo(item.categoryId,item.name)">
      <img class="logo" [src]='item.image'> <br>
      <!-- <img src="../../assets/icon/bio.png" class="logo"> <br> -->
      <p class="margin title">{{item.name}}</p>
    </ion-col>
  </ion-row>
</ion-grid>

This is my html for displaying list.

Image is not shown

1st image is of android version 9 and is android version 7

Screenshot_20200328-160748_Knowledge Up Screenshot_2020-03-28-16-26-17-538_com.cipher.knowledgeup

Posts: 1

Participants: 1

Read full topic

How to exit app in Ionic5

Ionic 4 problem when adding content before ion-virtual-scroll

$
0
0

@alnassreit wrote:

I have this code and it’s working totally fine using ionic 4 and angular 8

<ion-content>
<ion-virtual-scroll>
...
...
...
</ion-virtual-scroll>
</ion-content>

after added some content before ion-virtual-scroll it cost to this problem. the items not showing in the right time [see Gif]

<ion-content>
<div class="content-header">...</div>
<ion-virtual-scroll>
...
...
...
</ion-virtual-scroll>
</ion-content>

when I display:none the class .content-header it work fine again.

Q:

is there a way to make ion-virtual-scroll load more content on the screen?

is there a way to hide the .content-header after scrolling down (may it work)?

Posts: 1

Participants: 1

Read full topic

Auth Guards with observables for 2 routes not working when i use route.navigate

$
0
0

@jesuscardenas wrote:

Hi Guys, I hope you’re doing very well.

I’m here 'cause I have been coding an app with Ionic 5
Angular CLI: 8.3.25
Node: 12.16.1
OS: win32 x64
Angular: 8.2.14

But i have added 2 route guards to 2 routes which should redirect to a different route when the user is not logged in, however it’s not working since when the auth guard it’s called, the app renders nothing, the screen become blank. When i delete the canActivate property from 1 route, the other one works perfectly. I dont know what can i do, i have been stuck in this issue for a long time.

I’m working with aws amplify for the auth system. I attached my github repo for you reference. Please work with the branch dev.

swapp\src\app\app-routing.module.ts in this file i have the routes.
swapp\src\app\auth.guard.ts this is one auth guard
swapp\src\app\auth1.guard.ts this is the other one

i have 2 routes
http://localhost:8100/home working well
http://localhost:8100/auth not workin

user for login: jacc_2008@hotmail.com
password: Asdf123*

Please help guys! thanks in advance.

Posts: 1

Participants: 1

Read full topic

How to shrink the view with the keyboard on Android dynamicly?


app.getActiveNav().getActive() is undefined

$
0
0

@pdj wrote:

when it comes to last page(HomePage), I want to exit app.

but the problem is that weirdly,
app.getActiveNav().getActive() is undefined.
and

I took a look closer on app.getActiveNav()
(I checked Log and saw undefined on root)

my code is located in app.components.ts

   platform.registerBackButtonAction(() => {
        let nav = this.app.getActiveNav().getActive()
        let activeView = nav.getActive();
      
      console.log("back pressed");
      console.log(nav)
      console.log(activeView)
           nav.pop();
          });

weirdly , I came to second page from homepage,
when I press back button on hardware,
it says no views in the stack to be removed
(I came to second page by using navCtrl.push())

Posts: 1

Participants: 1

Read full topic

Ionic build error#2

Stop ionic cap sync overwriting customer changes

$
0
0

@Tanakasan1734 wrote:

I have had to make some changes to the NativeAudio plugin to get it working how I want in my app. How do I stop these changes getting removed when I add new plugins and have to run ionic cap sync?

Posts: 1

Participants: 1

Read full topic

[cordova-tools] error processing "launch":Error running android

$
0
0

@akfe wrote:

when i run app on device i have get some error “[cordova-tools] error processing “launch”:Error running android” anyone know how can i solve it my launch.json setting is

{
“name”: “Run android on device”,
“type”: “cordova”,
“request”: “launch”,
“platform”: “android”,
“target”: “device”,
“sourceMaps”: true,
“cwd”: “${workspaceFolder}”
}

Posts: 1

Participants: 1

Read full topic

Using Ionic Gesture to improve touch and reactions

$
0
0

@scotchegg wrote:

We are using Ionic 5 and I have noticed if the user does not make a clean tap/click, instead perhaps moving their finger slightly the touch is recognised, however the event to click / router link is not firing. Instead a flash colour shows a touch but does not trigger the touch / routerlink.

   <ion-card [routerLink]="['./'+void.void_id]">

Is there any clear guidelines on using the Gesture API to improve this particular issue beyond the weak offical documentation page?

Thank you for anyone’s input or suggestions.

Posts: 1

Participants: 1

Read full topic

Viewing all 70434 articles
Browse latest View live


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