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

Run app without ionic serve

$
0
0

@B3nvo wrote:

Hi,

while testing the app i came across the problem that i can only run the app if ionic serve is running.
The case is that i wanted to make the app so that it runs without ionic serve or any serve for that matter.

are there perhaps any wrongs in my config.xml?

i thought that after building, you can run it without the use of ionic serve.

if i run the app without ionic serve turned on i get the error net::ERR_CONNECTION_REFUSED (http://localhost/)

Posts: 1

Participants: 1

Read full topic


Error generating component in Ionic 4

$
0
0

@mrlooper wrote:

Hello,

I am new to Ionic 4 and I am having problems generating my first component.

I use the following command to generate it:

ionic generate component bp-toolbar

It genrerate following files:

bp-toolbar.component.html
bp-toolbar.component.scss
bp-toolbar.component.spec.ts
bp-toolbar.component.ts

I can see inside spec file:

import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { BpToolbarPage } from './bp-toolbar.page';

describe('BpToolbarPage', () => {
  let component: BpToolbarPage;
  let fixture: ComponentFixture<BpToolbarPage>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ BpToolbarPage ],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(BpToolbarPage);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});

but it tries to import bp-toolbar.page which doesn’t exist.

ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.5.0 (/usr/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.2
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (3 plugins total)

System:

   Android SDK Tools : 26.1.1 (/root/Android/Sdk)
   NodeJS            : v11.3.0 (/usr/bin/node)
   npm               : 6.4.1
   OS                : Linux 4.9

May it be a bug?

Regards

Posts: 1

Participants: 1

Read full topic

Regarding linkedin Plugin integration

$
0
0

@Lakshmareddy wrote:

When using Ionic native linkedin plugin integration after successful auth always it returning empty result in android and ios.

Posts: 1

Participants: 1

Read full topic

Regarding ionic native Google and Linkedin plugin conflict in IOS

$
0
0

@Lakshmareddy wrote:

After integrating the ionic native google plugin and linkedin plugin in ios both are getting conflict. Without linkedin plugin google works fine and getting back to app after successful auth. If linkedin plugin is present after successful auth google+ plugin redirecting to the google.com. How can do. Please help me. I need both google plus login and linkedin login.

Posts: 1

Participants: 1

Read full topic

Custom selector component css not working outside global.css

$
0
0

@christianpugliese wrote:

Ionic 4, I’ve got a few custom components, I can’t get the styles to work on the selector if I add them to the component scss file

on “phone-input.component.scss” does not work:

phone-input{
  background: red;
}

if I add to “global.scss” it does work

phone-input{
  background: red;
}

Posts: 1

Participants: 1

Read full topic

Working with tabs

$
0
0

@Triumworks wrote:

I am struggling with working with tabs as it presents a unique problem. If I try to navigate from the tabs page to another (both tabs or regular page) the header remains.

Sorry for directing you to another site but see more details here.

Posts: 3

Participants: 2

Read full topic

Local Notifications not showing in specific time

$
0
0

@aligassan wrote:

l am using ionic 4 , l use Native plugin local notifications to show up notifications in specific time .

l use this code to show me notification in 5 pm in local time of device but he doesn’t show !

this.localNotifications.schedule({
   text: 'Hi ',
   trigger: {at: new Date(new Date().getTime(),5 *1000)},
   led: 'FF0000',
   sound: null
});

l follow up this doc of plugin here but it is same problem not showing any notification .

he is working only if l delete ,5 *1000 from trigger and he is showing notification in repeating way .

any idea please ?

Posts: 1

Participants: 1

Read full topic

Google translate like web for ionic

$
0
0

@skp wrote:

Hello,

i want use google translate like website(below image) for my ionic app. i dont want to use google translate api because i have to translate each word for my entire app.

image

its working while devloping the app but in apk it is not working.

Anyone can help me.
Thanks

Posts: 1

Participants: 1

Read full topic


Failed to load resource: Request header field 'fmyCustomField' is not allowed by Access-Control-Allow-Headers

$
0
0

@lsantaniello wrote:

I receive error during server http call.

Failed to load resource: Request header field lang is not allowed by Access-Control-Allow-Headers.

In my request I need to add a custom header field.

This is my request header.

httpHeaders = {
      headers: new HttpHeaders({
        'Content-Type':  'application/json',
        'Access-Control-Allow-Headers': 'lang',
        'lang': this.session.language
      })
    };

Server side (.htaccess):

Header Set Access-Control-Allow-Origin "*"
Header Set Access-Control-Allow-Headers "*"

Support me please

Posts: 1

Participants: 1

Read full topic

Error http request CORS implementation

$
0
0

@jisaballo wrote:

Hi

I have an error with an http request.

We have implemented CORS on the server and all our transactions respond correctly except one.

This transaction sometimes responds well and sometimes does not. When it does not show up correctly, we get the message:

{“headers”:{“normalizedNames”:{},“lazyUpdate”:null,“headers”:{}},“status”:0,“statusText”:“Unknown Error”,“url”:null,“ok”:false,“name”:“HttpErrorResponse”,“message”:“Http failure response for (unknown url): 0 Unknown Error”,“error”:{“isTrusted”:true}}

The only difference I’ve noticed is that the times it responds well is when takes less time to respond.My question is.

Is there any configuration parameter in the CORS or in the http request that controls the time that is expected by the endpoint response?

Endpoint Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS
Access-Control-Max-Age: 1000
Access-Control-Allow-Headers: Content-Type, X-Auth-Token , Authorization, Accept
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Content-Length: 86
Content-Type: application/json

Posts: 1

Participants: 1

Read full topic

ngIf doesn't reflect the changes trough events

$
0
0

@akil27 wrote:

I am subscribing to an event in my home page in which I am changing the one of the objects in my array in the callback function and the view needs to change accordingly. When I publish the event in another page callback function works and object changes but when I come back to the home page I don’t see the visual changes. Is this normal behavior of angular or what should I do to see the changes?

Posts: 1

Participants: 1

Read full topic

(ionic-v3) Preventing ion-menu from closing on click

$
0
0

@caio1985 wrote:

Hi,

I’m using intro.js to help users understand the app menu.

Right now, when the menu is opened, I fire the library to guide the user on how to use the menu. However, when that happens, ion-menu is hidden automatically.

Intro.js shows sort of a popup which you can hit next and it will highlight the component you select, showing a brief description of it. But I believe for some reason ion-menu is capturing those click events and hiding itself.

How can I keep the menu opened while presenting the user with this onboarding experience provided by Intro.js?

This is how the menu is declared on the page:
<ion-menu #myMenu (ionOpen)=“menuOpened()” *ngIf=“releaseVersion” type=“overlay” [content]=“myContent”>

Thanks!
Caio

Posts: 1

Participants: 1

Read full topic

Style is not applied to ion-button

$
0
0

@brianmackey wrote:

<ion-button shape="round" fill="outline">Outline + Round</ion-button>

This button is displayed as just white text. It doesn’t even look like a button. This is how the Ionic 4 documentation says things should work. However, the existing code works fine:

<button ion-button shape="round" fill="outline" class="card-button" (click)="onCancelClicked()" align="right">Cancel</button>

I reproduced this in stackblitz.

The package json says:

"@ionic-native/core": "4.3.0",
"@ionic/app-scripts": "3.0.0",

So why does the app not work? I inherited this app from another developer. So it’s possible they were on Ionic 3 or older at some point…I have no idea. What can I check?

Ionic:

ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.7.1
@ionic/app-scripts : 3.0.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic 1.1.9, (and 9 other plugins)

System:

ios-deploy : 1.9.4
NodeJS : v8.15.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic

For loop an HTTP request logical error

$
0
0

@dmlkl wrote:

Hello,

Can anyone guide me on this? Below is the sample code. I tried to call an HTTP request inside the for loop, but the loop doesn’t wait for HTTP request finish already enter the next loop.

  • requestService.GetTelemetryData is the HTTP request.
GetGeneralInfo(){

for (let i = 0; i < deviceData.length; i++) {
conso.log("Loop Start")
            this.requestService.GetTelemetryData(loginAcc['token'], deviceData[i]["id"]["id"]).then((telemetryData) => {

              console.log("After GetTelemetryData()");
              let status = JSON.parse(telemetryData['status']);

              if (status == 401) {
                console.log("Token Expired...")

                this.requestService.RefreshToken(loginAcc['token'], loginAcc['refreshToken']).then(refreshTokenResponse => {

                 //i need to terminated the for loop and recall this method with new token
                  this.GetGeneralInfo();
                });

              }
              else if (status == 200) {
                console.log("Token is valid and data is given....")
                let data = JSON.parse(telemetryData['data']);
              }
            })
          }
}


The codes will continue for loop without waiting for the HTTP request finish. Let say the device data length is 2, for loop will print “Loop start” twice then only print "After GetTelemetryData()"

Currently

“Loop Start”
“Loop Start”
“After GetTelemetryData()”
“After GetTelemetryData()”

Expectation

“Loop Start”
“After GetTelemetryData()”
“Loop Start”
“After GetTelemetryData()”

Can guide me on this? Thanks.

Posts: 1

Participants: 1

Read full topic

How to start ionic3 app?

$
0
0

@basti wrote:

I want to start an ionic3 app, because I want a similar environment like another app which I created.

ionic start myApp sidemenu

creates an ionic4 app. For an ionic1 app

ionic start myApp sidemenu --type ionic1

is designated.

So, is there still an opportunity to start an ionic3 app?

Posts: 1

Participants: 1

Read full topic


How To Output in Event From Popover in Ionic 4?

$
0
0

@kalimulhaq wrote:

I would like to @Output an Event from from Popover component to Parent component.
My Popover Component is

import { Component, OnInit, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'app-order',
  templateUrl: './order.component.html',
  styleUrls: ['./order.component.scss']
})
export class OrderComponent implements OnInit {
  @Output()
  onSelection = new EventEmitter<any>();

  constructor() {}

  ngOnInit() {}

  public selected() {
    this.onSelection.emit();
  }
}

Parent Component is

async sortPopover(ev: any) {
    const popover = await this.popoverController.create({
      component: OrderComponent,
      event: ev,
      translucent: true
    });
    return await popover.present();
  }

I what to receive the onSelection event from Popover component into Parent component.

Dose any body how to do that?

Posts: 1

Participants: 1

Read full topic

How do i save the selected item in cart

$
0
0

@harshm90 wrote:

Hello,
Im really stuck at the place where I am unable to search what should i search :frowning:
I am doing a school project on restaurant app and i am stuck at the cart page where i add a single item i am able to see that item when i go back to menu page to add another the item disappears :open_mouth: how do i make him stay there unless & untill the user removes it from cart. please help badly stuck here :frowning:

Posts: 1

Participants: 1

Read full topic

#someForm="ngForm" | The someForm.submitted flag is not working. Ionic 4

$
0
0

@murilocardoso wrote:

Hi,

My first problem is about submitting a form.

<form #someForm="ngForm" [formGroup]="myForm" (submit)="doSomething()">
<ion-fab-button type="submit"> </ion-fab-button>
</form>

The code above never triggers the doSomething() function.

Trying to solve my first problem I got another one:

<form #someForm="ngForm" [formGroup]="myForm" (ngSubmit)="doSomething()">
<ion-fab-button type="submit" (click)="someForm.ngSubmit.emit()" > </ion-fab-button>
</form>

The code above triggers doSomething() function but I have some validations that check if someForm.submitted is true but its never get true.

Thanks!

Posts: 1

Participants: 1

Read full topic

Fixed on desktop, relative to toolbar on mobile

$
0
0

@reedrichards wrote:

I’ve got an element’s position which should be fixed on desktop but relative to the ion-footer > ion-toolbar on mobile

I tried to assign a fixed position to the element but it seems blocked by the toolbar (the element is then displayed outside the page)

Any idea how I could achieve that?

Posts: 1

Participants: 1

Read full topic

Ionic 3 doesn't send session cookies on iOS build

$
0
0

@guddu211 wrote:

I have a problem with iOS only, after user login on the next http request Ionic doesn’t send session cookies. My all platform are based on session cookies authentication. When I build android everything works just fine but I have a problems with iOS.
I am searching for solution from last 2 month please help me out…

Posts: 1

Participants: 1

Read full topic

Viewing all 48983 articles
Browse latest View live


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