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

Ion-datetime Does not use local Timezone

$
0
0

@dominic-ks wrote:

Howdy folks,

According to the docs - https://ionicframework.com/docs/api/datetime - “Important: ion-datetime will always display values relative to the user’s timezone”

Just trying to see this work as expected with a mega basic example:

<ion-datetime displayFormat="DD/MM/YYYY HH:mm" value="2019-07-15T18:00:00+00:00"></ion-datetime>

This will display “15/07/2019 18:00”.

I am currently in BST, i.e. GMT / UTC +01:00, so I would be expecting the first example to show “15/07/2019 19:00”, i.e. identifying that I am in fact an hour ahead.

NB. if I add this using the angular date pipe:

<div [innerHtml]="'2019-07-15T18:00:00+00:00' | date:'medium'"></div>

Then I get “Jul 15, 2019, 7:00:00 PM”, which is what I’d expect.

In the meantime I think I will need to change the date before giving it to the input and then change it back before processing it, but I’d really rather not!

Any pointers?

Posts: 1

Participants: 1

Read full topic


Cordova Android 8.0 change app name

$
0
0

@helpmelearn wrote:

Was on Cordova Android 6.4 trying to upgrade to Android 8.0.
I had a build-extras.gradle to change the app name from app-debug.apk to the pass name plus a version.
This does not work anymore.
I tried moving he build-extra.gradle to the app-name/app folder but still not using it.
How to change the build app name with cordova android 8.0?
Thanks

Posts: 1

Participants: 1

Read full topic

LoadingController issue

$
0
0

@pankajjain15 wrote:

Well, this issue is about ionic 4 . I am unable to create an issue on ionic 4 forum that’s why putting here.

I have created a loader component

import { Component, OnInit } from '@angular/core';
import { LoadingController } from '@ionic/angular';
import { Injectable } from '@angular/core';


@Injectable()
export class LoaderComponent {

  isLoading = false;
  loading: any;

  constructor(public loadingController: LoadingController) {
    console.log("loader component init");
  }

  async presentLoading() {
    if (this.isLoading) {
      return;
    }
    console.log("I am here");
    this.isLoading = true;
    this.loading = await this.loadingController.create({
      message: 'Please wait....'
    });
    return await this.loading.present();
  }

  dismiss() {
    if (this.isLoading && this.loading) {
      this.loading.dismiss();
      this.isLoading = false;
    }
  }

}

and following is the HttpInterceptor I am using

import { Injectable } from '@angular/core';
import {
  HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
} from '@angular/common/http';

import { Observable, from } from 'rxjs';
import { LoaderComponent } from 'src/app/components/loader/loader.component';
import { LoadingController } from '@ionic/angular';
import { finalize } from 'rxjs/internal/operators/finalize';
import { catchError } from 'rxjs/internal/operators/catchError';
import { HttpResponse, HttpErrorResponse } from '@angular/common/http/src/response';

export class ShowLoaderInterceptor implements HttpInterceptor{
  loading;
   constructor(private loaderComponent:LoaderComponent,public loadingController:LoadingController){}
  
  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
    console.log("interceptor");
    //let clone=req.clone();

    this.loaderComponent.presentLoading();
    return next.handle(req).pipe(
      finalize(()=>{
        this.loaderComponent.dismiss();
      })
    );
    
  }
   
}

Well, when I am calling simple get request , the request is get almost completed and then loader appears due to it’s asynchornous behaviour. I don’t how to solve this issue.Kindly help me out.
Thanks

Posts: 1

Participants: 1

Read full topic

How to solve Execution failed for task ':app:processDebugResources'

$
0
0

@lobaton wrote:

Hello everyone, I have problems to build android.

I have tried many proposals but I have not had success, I do not use Facebook login.

someone who has had the same problem and tells me how to solve it, I would appreciate it very much

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:processDebugResources’.
    Failed to execute aapt

cli packages: (/Users/user/Desktop/home-made-repo/node_modules)

@ionic/cli-utils  : 1.19.3
ionic (Ionic CLI) : 3.20.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.2.4
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.15.0
npm               : 6.4.1
OS                : macOS
Xcode             : Xcode 10.2.1 Build version 10E1001

Environment Variables:

ANDROID_HOME : /Users/user/Library/Android/sdk

Misc:

backend : pro

– >package.json

build": “ionic-app-scripts build”,
“lint”: “ionic-app-scripts lint”,
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
@angular/common”: “5.0.3”,
@angular/compiler”: “5.2.11”,
@angular/compiler-cli”: “5.2.1”,
@angular/core”: “5.0.3”,
@angular/forms”: “5.0.3”,
@angular/http”: “5.0.3”,
@angular/platform-browser”: “5.0.3”,
@angular/platform-browser-dynamic”: “5.0.3”,
@ionic-native/app-version”: “^4.5.3”,
@ionic-native/call-number”: “^4.5.3”,
@ionic-native/camera”: “^4.5.3”,
@ionic-native/card-io”: “^4.5.3”,
@ionic-native/clipboard”: “^4.5.3”,
@ionic-native/core”: “4.11.0”,
@ionic-native/crop”: “^4.5.3”,
@ionic-native/file”: “^4.5.3”,
@ionic-native/file-transfer”: “^4.5.3”,
@ionic-native/firebase”: “^4.20.0”,
@ionic-native/in-app-browser”: “^4.5.3”,
@ionic-native/keyboard”: “^4.5.3”,
@ionic-native/local-notifications”: “^4.11.0”,
@ionic-native/native-audio”: “^4.5.3”,
@ionic-native/native-storage”: “^4.5.3”,
@ionic-native/social-sharing”: “^4.5.3”,
@ionic-native/splash-screen”: “4.4.0”,
@ionic-native/status-bar”: “4.4.0”,
@ionic-native/transfer”: “^3.14.0”,
@ionic/storage”: “2.1.3”,
“call-number”: “^1.0.1”,
“card.io.cordova.mobilesdk”: “^2.1.0”,
“cordova-android”: “7.0.0”,
“cordova-android-support-gradle-release”: “^3.0.1”,
“cordova-browser”: “^6.0.0”,
“cordova-ios”: “4.5.5”,
“cordova-plugin-app-version”: “^0.1.9”,
“cordova-plugin-badge”: “^0.8.8”,
“cordova-plugin-camera”: “^4.1.0”,
“cordova-plugin-crop”: “^0.4.0”,
“cordova-plugin-device”: “^2.0.3”,
“cordova-plugin-file”: “^6.0.2”,
“cordova-plugin-file-transfer”: “^1.7.1”,
“cordova-plugin-firebase”: “^0.1.25”,
“cordova-plugin-inappbrowser”: “^2.0.2”,
“cordova-plugin-ionic-webview”: “^4.1.1”,
“cordova-plugin-local-notification”: “^0.9.0-beta.2”,
“cordova-plugin-nativeaudio”: “^3.0.9”,
“cordova-plugin-nativestorage”: “^2.3.2”,
“cordova-plugin-splashscreen”: “^5.0.3”,
“cordova-plugin-statusbar”: “^2.4.3”,
“cordova-plugin-whitelist”: “^1.3.4”,
“cordova-plugin-x-socialsharing”: “^5.4.7”,
“css-animator”: “^2.3.0”,
“enhanced-resolve”: “^3.3.0”,
“es6-promise-plugin”: “^4.2.2”,
“ionic”: “^3.20.0”,
“ionic-angular”: “3.9.2”,
“ionic-image-loader”: “^5.0.0”,
“ionic-plugin-keyboard”: “^2.2.1”,
“ionicons”: “3.0.0”,
“moment”: “^2.22.1”,
“rxjs”: “5.5.11”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.18”
},
“devDependencies”: {
@ionic/app-scripts”: “^3.2.4”,
“typescript”: “2.4.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“ionic-plugin-keyboard”: {},
“cordova-plugin-firebase”: {},
“cordova-plugin-local-notification”: {},
“cordova-plugin-inappbrowser”: {},
“cordova-plugin-nativeaudio”: {},
“cordova-plugin-app-version”: {},
“card.io.cordova.mobilesdk”: {},
“cordova-plugin-x-socialsharing”: {
“ANDROID_SUPPORT_V4_VERSION”: “24.1.1+”
},
“cordova-plugin-camera”: {
“CAMERA_USAGE_DESCRIPTION”: “Tomar fotografia de perfil o escanear una tarjeta de credito”,
“PHOTOLIBRARY_USAGE_DESCRIPTION”: “Seleccionar fotografia de perfil”,
“ANDROID_SUPPORT_V4_VERSION”: “27.+”
},
“cordova-plugin-crop”: {},
“cordova-plugin-file”: {},
“cordova-plugin-file-transfer”: {},
“cordova-plugin-nativestorage”: {},
“cordova-plugin-device”: {},
“cordova-plugin-ionic-webview”: {
“ANDROID_SUPPORT_ANNOTATIONS_VERSION”: “27.+”
},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-whitelist”: {},
“cordova-plugin-statusbar”: {},
“cordova-android-support-gradle-release”: {
“ANDROID_SUPPORT_VERSION”: “24.+”
},
“call-number”: {}
},
“platforms”: [
“ios”,
“browser”,
“android”
]
}
}

Posts: 1

Participants: 1

Read full topic

Disable ssl Http Request using angular's HttpClient

$
0
0

@ricardoaveledo wrote:

Greetings!

I’m developing a small app to connect to a poorly developed API that requires Http requests without SSL verification. How can I make a Post request disabling SSL in Ionic?

The app will be deployed using ionic 3 build, publishing the www folder in a IIS server, its meant to be accessed only through the company’s intranet using chrome.

I have tested the API using Postman, manually disabling the SSL and it works.

Posts: 1

Participants: 1

Read full topic

Storage Lost when Updating from Ionic 3 to Ionic 4

$
0
0

@chrisjdev wrote:

I found that Ionic 3 serves applications from file:// and Ionic 4 serves applications from http:// for iOS and Android. This means that the WebView for each platform has databases IndexedDB and WebSQL stored for different hosts. So if you upgrade your application from Ionic 3 to Ionic 4 and you’re using the default IndexedDB for Storage, then the persistent storage will be lost. I realized recently that those weren’t reliable ways of saving data anyway, so I was planning to migrate to Cordova SQLite based storage, but I was finding now that I also need to migrate the old raw files before the WebView can use them. And use a different directory structure for the WKWebView vs UIWebView change on iOS. I wasn’t able to find many people talking about this issue. Are most projects using Cordova SQLite based storage, so this isn’t an issue? Or is there a database migration plan that I’m missing?

Posts: 1

Participants: 1

Read full topic

Ionic 4 - Programatically show X in searchbar

Ion-content has default vertical scroll bar

$
0
0

@groe3433 wrote:

Hi,

I am using ionic 5.2.2, and I have an ion-content which has a vertical scroll bar.
I am a little lost as to how to make this scroll bar go away.

I have tried inserting the following to hide the overflow, but this doesnt work.
.no-scroll {
.scroll-content {
overflow: hidden !important;
}
}

it simply seems like the content just doesnt fit on the device screen. is there a way to force content to fit on the device screen?

thank you,

Posts: 2

Participants: 2

Read full topic


Can't create app after fresh install

$
0
0

@aminemarref wrote:

Hello,

I am new to using Ionic. I have followed the installation guide and when it comes to running the command ionic start myApp tabs, I get the dreadful error Unexpected end of JSON input while parsing near '...2V0TZa5V7QsgtnZhG25kB'. I have tried running again multiple times with no success even after forcing cleaning the cache.

The last few lines of the log file look like:

2846 silly saveTree +-- typescript@3.1.6
2846 silly saveTree `-- zone.js@0.8.29
2847 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...2V0TZa5V7QsgtnZhG25kB'
2847 verbose stack     at JSON.parse (<anonymous>)
2847 verbose stack     at parseJson (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
2847 verbose stack     at consumeBody.call.then.buffer (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
2847 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)
2848 verbose cwd C:\Users\Amine Marref\Workspace\iconic\myApp
2849 verbose Windows_NT 10.0.17763
2850 verbose argv "C:\\ProgramFiles\\nodejs\\node.exe" "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
2851 verbose node v10.16.0
2852 verbose npm  v6.9.0
2853 error Unexpected end of JSON input while parsing near '...2V0TZa5V7QsgtnZhG25kB'
2854 verbose exit [ 1, true ]

The complete log file: Log File

Any ideas?

Amine.

Posts: 1

Participants: 1

Read full topic

Ionic build android app error

$
0
0

@dcngibosn wrote:

Hello all,
I am having error building my app, I have tried all I know. Please I need help

cordova.cmd build android
[Gradle Properties] Detected Gradle property “org.gradle.jvmargs” with the value of “-Xmx1536m to org.gradle.jvmargs=-Xmx1024m”, Cordova’s recommended value is “-Xmx2048m”
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\name\AppData\Local\Android\Sdk (DEPRECATED)
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the user guide chapter on the daemon at https://docs.gradle.org/5.1.1/userguide/gradle_daemon.html
    Please read the following process output to find out more:

Error: Could not find or load main class to

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org
    C:\Program Files\Android\Android Studio\gradle\gradle-5.1.1\bin\gradle: Command failed with exit code 1
    [ERROR] An error occurred while running subprocess cordova.

      cordova.cmd build android exited with exit code 1.
    
      Re-running this command with the --verbose flag may provide more information.
    

See my ionic info below

C:\Users\name>ionic info
[ERROR] Error loading @ionic/angular package.json: Error: Cannot find module ‘@ionic/angular/package’
[ERROR] Error loading @ionic/angular-toolkit package.json: Error: Cannot find module ‘@ionic/angular-toolkit/package’
[ERROR] Error loading @angular-devkit/build-angular package.json: Error: Cannot find module
@angular-devkit/build-angular/package’

Ionic:

Ionic CLI : 5.2.2
Ionic Framework : not installed
@angular-devkit/build-angular : not installed
@angular-devkit/schematics : 8.1.1
@angular/cli : 8.1.1
@ionic/angular-toolkit : not installed

Cordova:

Cordova CLI : not installed
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

Utility:

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

System:

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

Posts: 1

Participants: 1

Read full topic

Background geolocation Crash App only android 9

$
0
0

@developerdpointweb wrote:

i’m using the plugin Background-Geolocation https://github.com/mauron85/cordova-plugin-background-geolocation, https://ionicframework.com/docs/native/background-geolocation,
it worked correctly, but in operating systems android version 9 no, when using the app with android 9 devices the app is closed and indicates the following error “invalid channel for service notification startForeground”
how can I solve that?
I need help urgently please :slight_smile:

Posts: 1

Participants: 1

Read full topic

Auto refresh / update http request

$
0
0

@Skiman1104 wrote:

I am new to ionic and have built an app which is in beta testing on both platforms - as it to do with live football scores the users have heavily asked for an auto update is this possible and how to implement it

Jordan

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Change user name

Ionic 3 Push Notification : Cant send image

$
0
0

@Nirmalya-S wrote:

I have created a demo app with Ionic 3 push notifications. The app is also registered at FCM. Its working fine. But I could not send an image. Also the notification icon is grayed out at android 9. Any solution??

Thanks in advance…!

Posts: 1

Participants: 1

Read full topic

Service vs Model file access

$
0
0

@breinsnet wrote:

So I have a model and a serviceModel… The model is a simple exported class with a few attributes and a couple of methods. The serviceModel is an ionic service

The model has many images, through a second model. I can access the images via model.images

The images are stored on the mobile filesystem. This is a must as the app has to work offline

The model can be uploaded and downloaded from an API. The modelService takes care of that.

Now the question is… how do I manage the images stored in the filesystem. I can see two options:

  • The modelService downloading the images, updating the image path and src attribute, also create directories. Basically taking care of everything related to manage the file and webview actions.

  • The modelService downloads the file to a temporary directory and send the path the the model. The model then copy the file to the correct location and creates the webview url.

The main difference is that I’ll be using cordova file and webview within the model or not.

I’m more prone for the second option, but would like your feedback before writing bunch of code.

Thanks

Posts: 1

Participants: 1

Read full topic


Make compare between today and another date

$
0
0

@Tubiss wrote:

private eventDate: Date = new Date('July 16, 2019 12:24:00');//this is another date

private today : Date=new Date();

if(this.today==this.eventDate{
console.log(hello)

}

its not working as this like but when ı make below hello is displayed

 if(this.today!=this.evetDate){
console.log(hello)

          
}

ı mean private today : Date=new Date(); that is not getting today date please help me how can ı get current date

Posts: 1

Participants: 1

Read full topic

Loader in InAppBrowser

$
0
0

@pksquare wrote:

How i use loader in Inappbrower. I want to give a loader until the page os open in InAppBrowser in ionic 3

Posts: 2

Participants: 2

Read full topic

No Java files found that extend CordovaActivity

$
0
0

@ajeshbc wrote:

No Java files found that extend CordovaActivity.
[ERROR] An error occurred while running subprocess cordova.

IONIC CLI 5.2.3
NPM 6.9.2
Angular CLI: 7.3.9
Node: 8.12.0
OS: win32 x64
Angular: 7.2.15

Last installed module:
ionic cordova plugin add phonegap-plugin-push
npm install @ionic-native/push

Posts: 1

Participants: 1

Read full topic

Run application service when push notification received

$
0
0

@saxovic wrote:

Hello,

Is it possible to run some application service in the background when push notification is received (no matter what is the state of the app [foreground, background, closed]).

I use Firebase push notifications.

Thanks for any help.

Posts: 1

Participants: 1

Read full topic

Ionic 4 segment not displaying properly (as in docs)

$
0
0

@danielcombain wrote:

Hey!

I’m using <ion-segment> and I don’t know if I’m missing something. The docs Segment docs displays something different for the default layout. I just get text and a border that highlights the selected. Doesn’t matter if I run in browser or on phone or changing between modes. Is this how it’s supposed to be or what am I doing wrong?
Also tried updating my project.
Also tried putting the segment in app.component.html if it was something wrong with my component. But that wasn’t the case either.
Also inspected the source code for the docs preview but there isn’t anything special in there.

Thanks in advance!

<ion-content>
  <ion-list-header>Map Type</ion-list-header>
  <ion-segment>
    <ion-segment-button value='gmap'>
      <ion-label>Standard</ion-label>
    </ion-segment-button>
    <ion-segment-button value='osm'>
      <ion-label>OSM</ion-label>
    </ion-segment-button>
    <ion-segment-button value='gsmap'>
      <ion-label>Satellite</ion-label>
    </ion-segment-button>
  </ion-segment>
</ion-content>

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.2 (C:\Users\Daniel Karlsson\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.6.2
   @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   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 15 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.7

System:

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

Posts: 1

Participants: 1

Read full topic

Viewing all 49288 articles
Browse latest View live


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