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

Ionic v3 toggle between light and dark theme at runtime (dynamically)

$
0
0

@Dovel wrote:

In Ionic v3 there is import of the theme in the file variable.scss.

@import 'ionic.theme.default';

and can be replaced by the dark theme to use the dark theme instead of the default light theme.

@import 'ionic.theme.dark';

Works great. But how to toggle between both themes at runtime? And how to know what theme is currently active to style custom components.

I have already searched the internet, including here. But I found nothing helpful. So I think this is not a duplicate. Maybe I missed something. But there should be a way to import the default AND dark theme and enable toggle between at runtime.

I could write my own themes by css “hacking”. But I prefer to use the Ionic preset official way.

Posts: 1

Participants: 1

Read full topic


Items get messy when keyboard is activated

$
0
0

@jmartinezb wrote:

First of all, I wanted to say that I am new and I don’t know if this topic goes here. In that case, have the corresponding administrator move it, please

According to my console, I am using version 5.2.3 of Ionic (if you need any more information, ask me for it), and I encounter the following problem:

When I find myself developing the app, using the Chrome inspector, everything works without problem. Also, even when I build the Android APK and test it on my Xiaomi Redmi Note 7, everything works fine. Here is a screenshot:

But as soon as I activate the keyboard, all the elements of the screen get messy (except the tabs buttons, which are kept underneath I guess):

I’ve been looking for solutions, but I can’t find anything to solve this.

Has something similar happened to someone else? Or am I the only one?
Here is the HTML code:

<ion-content>
    <ion-grid style="height: 100%">
        <ion-row justify-content-center align-items-center style="height: 100%; flex-direction: column">
            <div class="imagenPublicar">
                <img src="assets/icons/camara.svg"/>
            </div>
            <ion-chip class="inputPublicar">
                <ion-input class="ion-text-center" placeholder="Nombre del restaurante"></ion-input>
            </ion-chip>
            <ion-chip class="inputPublicar">
                <ion-input class="ion-text-center" placeholder="Precio del menú"></ion-input>
            </ion-chip>
            <ion-chip class="ubicacionPublicar">
                <ion-icon name="pin"></ion-icon>
                <ion-label>¿Dónde está?</ion-label>
            </ion-chip>
            <ion-chip class="hechoPublicar">
                <ion-label>¡Hecho!</ion-label>
            </ion-chip>
        </ion-row>
    </ion-grid>
</ion-content>

Thank you very much to all!

Posts: 1

Participants: 1

Read full topic

Google play store app review launch and rating

$
0
0

@cancertropica wrote:

Hi ,
I am using capacitor in ionic 4. I want to know that how i can launch google play store to review my app. As i am not able to find anything related to capacitor .

Thanks in advance.
Pankaj

Posts: 1

Participants: 1

Read full topic

Ion Storage with React Ionic 4?

$
0
0

@MosesOng wrote:

Is it possible to use Ion Storage with Ionic 4 for React? All the examples I have searched seems to only for Angular. Thanks!

Posts: 1

Participants: 1

Read full topic

Ion-list full border at top and bottom with inset lines

$
0
0

@reedglawrence wrote:

Hello,

I am aware that the ion-list has the options for lines to be inset or full or none. However I’d like to still have the inset lines, but to remove the border on the bottom from the last item, and add a border at the top to the first.

So far this is what I have that works for the full-width top and bottom border

global.scss:

.outer-content ion-list {
  border-bottom: solid 1px rgb(200, 199, 204, 1) !important;
}
.outer-content ion-list ion-item:first-of-type {
  border-top: solid 1px rgb(200, 199, 204, 1) !important;
}

However the bottom border CSS does not work, although I can style the element in the same way via chrome inspector.

This is what I am using to attempt to target the bottom border:

.outer-content ion-list ion-item .item-inner:last-of-type {
  border-bottom: none !important;
}

Posts: 1

Participants: 1

Read full topic

How to get the data of subcollection and show them in the page?

$
0
0

@AndrewSuen wrote:

I want to show the “task” from firebase on my HTML page.

I used ionic4, here is my firebase:

userProfile(Collection)
|
user(document)
  |
 list(Collection)
  |
 list1(document),list2(document)......
     |                  |
   task1(collection)  task2(collection)

When I add tasks into firebase, I want to show it on my page.

Here is my add task method:

import { Component, OnInit } from '@angular/core';
import { ListService } from '../../services/list/list.service';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-list-detail',
  templateUrl: './list-detail.page.html',
  styleUrls: ['./list-detail.page.scss'],
})
export class ListDetailPage implements OnInit {
  public listId :string;
  public currentList: any = {}; 
  public taskName = '';
  public taskDate = '';
  public taskNote ='';

  constructor(
    private listService:ListService,
    private route:ActivatedRoute,
    ) { }

  ngOnInit() {

    this.listId = this.route.snapshot.paramMap.get('id');

    this.listService
    .getlistDetail(this.listId)
    .get()
    .then(listSnapshot => {
      this.currentList = listSnapshot.data();
      this.currentList.id = listSnapshot.id;
  });
}

 addTask(
  taskName:string,
  taskDate:string,
  taskNote:string,
 ):void{
   this.listService.addTask(
     taskName,
     taskDate,
     taskNote,
     this.currentList.id
   )
   .then(() => this.taskName='')
   .then(() => this.taskDate='')
   .then(() => this.taskNote='')
 }
}

The method in my service.ts:

...
addTask( 
    taskName:string,
    taskDate:string,
    taskNote:string,
    listId:string,):Promise<firebase.firestore.DocumentReference>{
      return this.listRef
      .doc(listId)
      .collection("task").add({taskName,taskDate,taskNote})
  }
}
...

My html page of creating a new task into the list:

...
  <ion-card>
      <ion-card-header>Add Task</ion-card-header>
      <ion-card-content>
        <ion-item>
          <ion-label position="stacked">Task Name</ion-label>
          <ion-input
          [(ngModel)] = "taskName"
          type="text"
          placeholder="Please enter your task">
          </ion-input>
        </ion-item>

        <ion-item>
          <ion-label position="stacked">Task Date</ion-label>
          <ion-datetime
          [(ngModel)] = "taskDate"
          displayFormate = "mm hh a,D MMM, YY"
          pickerFormat = "mm hh a DD MMM YYYY"
          ></ion-datetime>
        </ion-item>

        <ion-item>
          <ion-label position="stacked">Task Note</ion-label>
          <ion-input
          [(ngModel)] = "taskNote"
          type="text"
          placeholder="Detail your task">
          </ion-input>
       </ion-item>

       <ion-button expand="block"
       (click)="addTask(taskName,taskDate,taskNote)">
          Add Task
       </ion-button>
...

Shall I create a task-detail page to pass parameters? But how to get the id of the task? I am quite confused, thx.

Posts: 1

Participants: 1

Read full topic

Browser/PWA and Supported Platforms in Cordova Plugins

$
0
0

@hyperlinked wrote:

I’m not sure how to read the “Supported Platforms” in the Ionic docs for Cordova Community Plugins and how they relate to PWAs.

Let’s take the http plugin for example:

Supported Platforms

  • Android
  • iOS

How do I know if the plugin is compatbile with PWAs? Does it need to say “Browser” as a supported platform or does Browser refer to direct usage of an Ionic app as a literal application inside a Web browser?

Posts: 1

Participants: 1

Read full topic

How to change style of IonSelectOption ionic-react

$
0
0

@victorcarvalhosp wrote:

Hi team,

I would like to know how do I change the style of IonSelectOption. I would like to do something like this:

<IonSelect>
      {categories.map((category, i) => {
        return (
                  <IonSelectOption  key={category.id} >
                      <span style={{color: category.color}}># </span>{category.name}
                  </IonSelectOption>
                );
         })}
 </IonSelect>

This, of course, is not working, I want just the # to have a different color.

Any help would be appreciated!

Yours,
Victor

Posts: 1

Participants: 1

Read full topic


Ionic 4: Don't minify on mobile device

$
0
0

@HashNotAdam wrote:

I 'm trying to debug a StaticInjectorError. Normally I would use ionic serve with optimization disabled to see which service is missing but this issue is only occurring on mobile.

Is there some way to stop code minification on mobile so I can see the name of the class that is missing?

Error: StaticInjectorError[e -> e]: 
  StaticInjectorError(Platform: core)[e -> e]: 
    NullInjectorError: No provider for e!

Please note, this is a duplicate of an unanswered StackOverflow question

Posts: 1

Participants: 1

Read full topic

E Weather - A beautiful weather app make with Ionic 4

Multiple selection of specific type of files!

$
0
0

@OliverPrimo wrote:

Hello,

I have an ionic 3 application where I want to add a feature that will allow the user to open his file browser and select multiple files with types (pdf, jpeg, jpg, and png) but I can’t succeed with this. I have tried Ionic ImagePicker but it is having a conflict with my android version (v7.0.0). I’ve also tried Ionic Chooser but it doesn’t allow multiple selections of files.

Do someone knows what plugin can I use that will satisfy my app requirements:

  • Multiple Selection of files
  • Allow pdf, jpg, jpeg, and png ONLY

I hope someone can help me with this. Thanks in advance :blush:

Posts: 1

Participants: 1

Read full topic

Facebook error: SERVER_ERROR: [code] 1675030 [message]: Error performing query: ionic 3 cordova

$
0
0

@adminAbhishek wrote:

I am unable to login with facebook. Just shows facebook icon popup for 2-3 sec.then disappers suddely.By the debugging, this issue appears.
what would be the reason?

Posts: 1

Participants: 1

Read full topic

Cannot find name ‘Windows’. Did you mean ‘Window’?

$
0
0

@tejak213 wrote:

Hello All,

I am facing some issues in Ionic while trying to use Windows.UI.Core.. Getting error like Cannot find name ‘Windows’. Did you mean ‘Window’? i need to use Windows.UI in my app.

i tried like this

if (platform.is('windows')) {
        let currentView = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
        currentView.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
      }

Thanks.

Posts: 1

Participants: 1

Read full topic

Guest wifi

$
0
0

@STARGUESTWIFI wrote:

Why Guest Wi-Fi.?

When you’re visiting a store/service at the venue/location you may not have internet connection or no proper internet connection. If you need a internet access for your official / personal purpose at the same time at venue having a internet connection with wifi access is available but secure password. But customer wants to internet access to his/her mobile/tablet he/she needs to know password of wifi to get access. After getting connected to wifi user can use internet without having any speed & time limitation.

What is Guest Wi-Fi?

If in a store/service location/venue the provider having guest wifi router to provide internet to their customers as well he/she can use the internet service. Customers can connect to the wifi without knowing password.

But internet provider for that venue/location he/she can restrict the data by depending upon Time/Speed/Quantity of data to the user.

star guest wifi

Posts: 1

Participants: 1

Read full topic

Should I go with ionic 4 for mobile app development

$
0
0

@ravibhoite22 wrote:

I want to build hybrid mobile app for our customer. I choose ionic framework 4 for that.
i want to know…
should i proceed with this ?
is there any changes coming in ionic 4 ?
is it good as per future scope of project ?
what about support to ionic 4 ?
is ionic version 4 stable now ?

Please suggest
Thanks

Posts: 1

Participants: 1

Read full topic


ERR_FILE_NOT_FOUND error showing on ionic 4 after create android apk file

$
0
0

@Subha3888 wrote:

I have started a new demo app by the command “ionic start myApp sidemenu”

After creating a new app, I add the platform for android device and after creating an APK file install that and trying to lunch the app but showing error ‘ERR_FILE_NOT_FOUND’.

So After a search on google found one solution fixed this
please check this link https://ionicframework.com/docs/v3/wkwebview/#downgrading-to-uiwebview

also added below code in config.xml

Also deleted the line from index.html.

after all the changes created a new apk file and installed the apk file, then ‘ERR_FILE_NOT_FOUND’ issue solved but not showing any content, showing blank.
And I have inspected and get an error ‘Failed to load module script: The server responded with a non-JavaScript MIME type of “”. Strict MIME type checking is enforced for module scripts per HTML spec.’

Posts: 2

Participants: 2

Read full topic

Ionic select options do not update once something is removed

$
0
0

@nomanshah wrote:

The problem is that i have two identical select on two different pages and once i delete the select option entry from a third page it gets removed from one of the pages but not from the other one.

Once i restart the app both selects get updated.

page 1: Where select options update.

<ion-select class="logo" [class]="this.global.device_text" [(ngModel)]="device" interface="popover"
        multiple="false" [selectedText]="this.global.selected_device_name"
        (ionChange)="this.function(device)">

   <ion-select-option *ngFor="let entry of this.global.device_name; let i=index;"
         [value]="this.global.device_name[i]">
         {{this.global.device_name[i]}}
   </ion-select-option>

</ion-select>

Page 2: Where options do not update;

 <ion-select [class]="this.global.arrow" [(ngModel)]="device"
        interface="popover" multiple="false" [selectedText]="this.global.selected_device_name"
        (ionChange)="this.function(device)">

    <ion-select-option [class]="this.global.arrow" *ngFor="let entry of this.global.device_name; let i=index;"
         [value]="this.global.device_name[i]">
         {{this.global.device_name[i]}}
     </ion-select-option>
</ion-select>

Ionic info is below.

Ionic:

   Ionic CLI                     : 5.2.3 (C:\Users\noman.shah\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.6.1
   @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 Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 11 other plugins)

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.7

System:

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

Posts: 4

Participants: 2

Read full topic

IONIC 5 is Amazing

$
0
0

@ishfaak wrote:

I was with Angular 4 and Updated to Angular 8 and it was amazing. IONIC 3 was disgusting. That was slow in rendering to see the changes.So I Installed IONIC 5 - and I have to say is: IONIC 5 is brilliant. Speed and and very nice. I installed the Angular Material Library too to IONIC 5 and came to know that it was so easy to sustain and fast in Rendering. Love IONIC5 Cheers. If anyone needs help in Installing IONIC 5 and help in creating the

Posts: 2

Participants: 2

Read full topic

How to get list of devices and connect using BluetoothLE plugin in ionic 4?

$
0
0

@gokujy wrote:

'm using BluetoothLE plugin and I want to get a list of active Bluetooth devices and click to connect with the device using ionic 4

statusMessage: string;

constructor(public bluetoothle: BluetoothLE,
    public platform: Platform,
    private ngZone: NgZone,
    public toastController: ToastController) {
    this.platform.ready().then((readySource) => {

      console.log('Platform ready from', readySource);

      this.bluetoothle.initialize().subscribe(ble => {
        console.log('ble', ble.status) // logs 'enabled'
      });

    });
  }

  adapterInfo() {
    this.bluetoothle.getAdapterInfo().then((success) => {
      console.log("adapterInfo: " + success);
      this.setStatus(success.name);
    })
  }

  startScan() {
    let params = {
      "services": [
        "180D",
        "180F"
      ],
      "allowDuplicates": true,
    }
    this.bluetoothle.startScan(params).subscribe((success) => {
      console.log("startScan: " + success);
      this.setStatus(success.address);
    }, (error) => {
      console.log("error: " + error);
      this.scanError(error);
    })
  }

  stopScan() {
    this.bluetoothle.stopScan().then((resp) => {
      console.log("stopScan: " + resp);
      this.setStatus(resp.status);
    })
  }

  retrieveConnected() {
    let params = {
      "services": [
        "180D",
        "180F"
      ]
    }

    this.bluetoothle.retrieveConnected(params).then((resp) => {
      console.log("retrieveConnected: " + resp);
      this.setStatus("retrieveConnected");
    })
  }

  // If location permission is denied, you'll end up here
  async scanError(error: string) {
    this.setStatus('Error ' + error);
    const toast = await this.toastController.create({
      message: 'Error scanning for Bluetooth low energy devices',
      position: 'middle',
      duration: 5000
    });
    toast.present();
  }

  setStatus(message: string) {
    console.log("message: " + message);
    this.ngZone.run(() => {
      this.statusMessage = message;
    });
  }
<ion-header>
<ion-toolbar>
    <ion-title>
      Ionic Blank
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-button (click)="adapterInfo()">AdapterInfo</ion-button>
  <ion-button (click)="startScan()">StartScan</ion-button>
  <ion-button (click)="stopScan()">StopScan</ion-button>
  <ion-button (click)="retrieveConnected()">RetrieveConnected</ion-button>
</ion-content>

<ion-footer>
  <ion-toolbar>
    <p>{{ statusMessage }}</p>
  </ion-toolbar>
</ion-footer>

Please help

Posts: 1

Participants: 1

Read full topic

iPhone Status Bar (Problem with top positioned tabs)

$
0
0

@ahuber wrote:

Hello,

my app structure is based on the default “tabs layout”. The only difference is that i positioned the tabs to the top with (slot="top").

Recently i switched to capacitor, where the native status bar plugin does not have the method StatusBarOverlaysWebView(boolean) anymore.

I am a bit confused how to continue, because the status bar on iPhone overlays the webview. The default <ion-header> of the page adds padding to solve this problem, but my tabs are above them, so the tabs underlay the status bar.

I think you will understand it better with my screenshots.

17 03

If i remove the slot="top" key from the tabs it would work perfectly, but that destroys my design.

Please help me.

Thanks in advance.

Best regards,
Andi

Posts: 1

Participants: 1

Read full topic

Viewing all 71530 articles
Browse latest View live


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