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

Firebase database running number

$
0
0

hello World,

i would like to ask how to generate running member id during member registration automatically if using firebase?

example : if member A register, firebase besides create unique ID, there’s no member id : 001 unless manually key in,

if 10 members register, 10 members will have member id from 001, 002, 003, 004, 005 automatically assigned

can firebase do auto increment? or do we need to set in at TS?

regards

1 post - 1 participant

Read full topic


LocalNotifications Capacitor V3

$
0
0

@netkow

The documentation for this V3 is extremely lacking.

Please can someone from the core team (or community) give an example of what the schedule needs to be, so that it works for each of the following:

  1. Schedule a DAILY notification at a specific time, e.g. Every DAY at 15:00
  2. Schedule a WEEKLY notification at a specific time, e.g. Every WEEK at 15:00
  3. Schedule a SPECIFIC DAY OF THE WEEK notification at a specific time, e.g. Every WEDNESDAY at 15:00

Searched everywhere, tried lots of things and not getting anything reliable working.

At the moment if I do:

      var d = new Date();

      schedule = {
        on: {
          hour: d.getHours(),
          minute: d.getMinutes()
        },
        allowWhileIdle: true
      };

I can get a daily notification appearing, but it always says it’s late by 1d or 2d from whenever I’d first set it, not ‘Now’ or ‘Today’.

Thank you

1 post - 1 participant

Read full topic

How to use ion-picker in Vue?

$
0
0

I want to implement ion-picker with Ionic Vue, but am struggling with finding a good example.

Can someone help me with rewriting this code for Vue?

Regards,
Tetsuya

1 post - 1 participant

Read full topic

Using callback in ref attribute breaks IonInput

$
0
0

Other attributes of IonInput are ignored when I set callback to ref. But it works fine with simple html input

  const callback = useCallback((elem) => {
    console.dir(elem);
  }, []);

....
          <IonInput 
            className="asdasd" // <-- className ignored
            onIonChange={(e) => setText(e.detail.value)} // <-- this callback ignored too
            ref={callback} // <-- If remove this line ion-input will start work fine
          />

1 post - 1 participant

Read full topic

Location data not sent to server after I kill the app

$
0
0

I’m building a delivery application. I need to track driver location every X seconds when the app minimized it’s working fine but if I kill the app it’s not sending data to the server. below is my code.

startBackgroundGeolocation() {
const config: BackgroundGeolocationConfig = {
  desiredAccuracy: 1,
  stationaryRadius: 1,
  distanceFilter: 1,
  interval: 10000,
  startOnBoot: true,
  startForeground: true,
  notificationTitle: "Delivery App",
  notificationText: "Test notification text",
  debug: true, //  enable this hear sounds for background-geolocation life-cycle.
  stopOnTerminate: false // enable this to clear background location settings when the app terminates
};

this.backgroundGeolocation.configure(config).then(() => {
  this.backgroundGeolocation
    .on(BackgroundGeolocationEvents.location)
    .subscribe((location: BackgroundGeolocationResponse) => {
      console.log(location);
      console.log('Application Lat' + location.latitude);
      console.log('Application Lon' + location.longitude);

      this.geo.Latitude = location.latitude;
      this.geo.Longitude = location.longitude;
      console.log('API Geo Latitude' + this.geo.Latitude);
      console.log('API Geo Longitude' + this.geo.Longitude);

      //     alert(location.accuracy);

      this.sendGPS();
    });
});

3 posts - 2 participants

Read full topic

Change color seat

$
0
0

Can someone help me how to change the color and maintain it, my problem is when it goes to the next page, what was enabled is lost and it is not maintained

html
<ion-icon

              *ngFor="let seats of ReservasData;  let i = index;"

              class="cls-icon"

              [ngClass]="{'cls-icon1':seats.estado=='False','active':seats.estado=='True'}"

              src="../../../assets/img/icons/{{seats.img}}"

              (click)="openUpdate(seats,seats.estado,seats.id,seats.price)"

            ></ion-icon>

>
ts.
openUpdate(item, state, id, precio) {

    if (state == "ocupado") {

      console.log("Lo sentimos está ocupado");

    } else if (state == "space") {

      console.log("no hay nada");

    } else if (state == "chofer") {

      console.log("chofer");

    } else {

      item.estado = !item.estado;

}
.scss
.cls-icon {

              color: black;

              &.active {

                color: green;

              }

              &.inactive {

                color: black;

              }

            }

djiasjdas

1 post - 1 participant

Read full topic

How to remove cancel option from ionic-select-option

$
0
0
<ion-select  interface="action-sheet" formControlName="showArrow" placeholder="Select One" (ionChange)="submitUserInput($event.target,'showArrow')">

        <ion-select-option value="true" selected="true">On</ion-select-option>

        <ion-select-option value="false">Off</ion-select-option>

 </ion-select>

Is there any attribute then I put on ion-select to remove the cancel option from it?

1 post - 1 participant

Read full topic

Local notification custom alarm

$
0
0

not able to set the custom alarm in local notification

I have used the local notification plugin in ionic 5 app

any help regarding this will be helpful

1 post - 1 participant

Read full topic


Pass and return value from Ionic Services

$
0
0

Hello,

in Ionic TypeScript application, I’m trying to create class functions functionality to send value from page to services, set and get result, return it to home page :

In home.page.ts I have variable value, I want set this value from home.page.ts with data.service.ts and get it back in home.page.ts to display in html {{value}}:

  export class HomePage {
      value: any;

I’m passing numeric values with var value = this.myService(1, 3) function:

  getTextData() {
    this.value = this.myService(1, 0);
  }

from home.page.ts:

  async myService(item, set) {
    this.value = await this.dataService.returnData(item, set);  
    this.console(this.value);  
    return this.value;
  }

to data.service.ts which successfully shows result from console, but does not returns value to home.page.ts. this.console(this.value); from home.page.ts returns [object Promise] from data.service.ts, whereconsole.log(item+'\n'+set); shows received values from home.page.ts:

  returnData(item, set) {  
    this.serviceFunction(item, set);
    console.log(item+'\n'+set);
  }

and console.log(this.result); from following serviceFunction(item, set) function, which result wants to be attached to home.page.ts this.value:

serviceFunction(item, set) {
   this.result = response[item].title[set];
   console.log(this.result);
}

It seems like, I’m using something completely wrong, because I’m only sending parameters with request function in data.service.ts without set of variable in data.service.ts.

I’ve tried inside the return Promise.resolve:

 returnData(item, set) {
    return Promise.resolve(
       this.serviceFunction(item, set)
    );
  }

return after serviceFunction:

 returnData(item, set) {
    this.serviceFunction(item, set);
    return this.result;
 }

and set before Promise.resolve:

 returnData(item, set) {
    this.serviceFunction(item, set);
    return Promise.resolve(this.result);
 }

or:

 returnData(item, set): Promise<any> {
     return this.serviceFunction(item, set);
 }

and from home.page.ts:

myService(item, set) {
    this.dataService.returnData(item, set)
    .then(data => {
        var result = data;
        console.log(result);
    });
  }

In this case Property .then does not exist on type void.:

1 post - 1 participant

Read full topic

How do I run some code when user clicks arrow (enter/go) button on smartphone built-inkeyboard

$
0
0

Hi, I am trying to figure out how to emulate a button click when the user presses the arrow button on the keyboard that pops up on a smartphone. What I am talking about is this:

d

So that the user doesn’t have to click an actual button, they can just hit this. How do I grab this event and apply some functionality to it? I am using Ionic Vue. Thank you for the help.

3 posts - 2 participants

Read full topic

Refresh ionic select options

$
0
0

Hello,
I have an ionic-select with some ionic-select-options that I add through an array that I create through a call to the server. So far everything ok, I can create the select in this way

<ion-select formControlName="exams" interface="action-sheet">

              <ion-select-option value="all">All</ion-select-option>

              <ion-select-option *ngFor="let e of exams" value="{{e.id}}">{{e.name}}</ion-select-option>

            </ion-select>

Now my question is, how do I refresh the options when I add a new element to the array?
If I do it this way
this.exams = getExams();

I can see the new information only by clicking on the select, but the new values ​​do not update immediately.
For example, if I delete the old array of exams and create one with new values, the old values ​​remain in the select until I click on the select.

2 posts - 2 participants

Read full topic

Use chrome-cast in ionic app

Generate audio UIBackgroundMode

$
0
0

Hello,

It is really annoying when I execute ìonic cordova prepare iosand it auto-adds the labelaudio` how to solve it? i cannot figure out what to edit to solve this problem, because Apple is rejecting me the app because I don’t remove it (I don’t need this option and don’t know where i comes from…)

Thank you

Regards

<key>UIBackgroundModes</key>
<array>
	<string>fetch</string>
	<string>processing</string>
	<string>remote-notification</string>
	<string>audio</string>
</array>

1 post - 1 participant

Read full topic

WoCommerce Help for Authentication

$
0
0

Hello, i tried almost all to make connection between Ionic and Woocommerce.
But i cannot do it for days… :face_with_raised_eyebrow:

I know for this code:

import * as HA from 'woocommerce-api';
WooCommerce: any;
  woo() {
    this.WooCommerce = HA({
      url: 'https://websiteurl.com',
      consumerKey: 'ck_key',
      consumerSecret: 'cs_key',
      wpAPI: true,
      version: 'wc/v3',
      queryStringAuth: true
    });

But where exactly must be added?
I tried in tab1.page.ts & app.module.ts and get this error:

1 post - 1 participant

Read full topic

Ionic tabs with Font Awesome icons

$
0
0

Does anyone have any examples of how to use Font Awesome icons instead of the ionic ones for the tab?

I am using the following plugin with angular:
@fortawesome/angular-fontawesome
and use the icons with the element, but this does not seem to play nicely with the tabs.

Rather than messing around with the css for ages I thought I’d check and see if someone had an easy way to do it?

1 post - 1 participant

Read full topic


Suggestion: I suggest a website dedicated to ionic and capacitor plugin

$
0
0

I’m a web and mobile app developer I worked with ionic , angular , flutter , nativescript.

The most important thing about flutter for me that it has this website https://pub.dev/
which contain all plugin and you can sort it by rating, recently updated and more.

Because of that i can build app very fast and its so reliable all plugin are in one place and i can see the maintenance and rating of it.

Why it is important: maybe it is not important for company that want enterprise app but for most developer and freelancers its rely helpful these kind of service.

My suggestion is ionic and capacitor have something similar to that it will be great , because i love ionic and the team behind it they are doing really great job.

1 post - 1 participant

Read full topic

Expiring Daemon because JVM heap space is exhausted

$
0
0

Hi,
I’m tryng to build, for the platform Android, an Ionic app that uses FirebaseX, but I’ve this error:

> Task :app:processReleaseGoogleServices
Parsing json file: C:\myapp\platforms\android\app\google-services.json

> Task :app:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :app:lintVitalRelease
C:\myapp\platforms\android\app\src\main\res\drawable-land-hdpi\screen.png: Error: The drawable "screen" in drawable-land-hdpi has no declaration in the base drawable folder
...
12 errors, 0 warnings
Expiring Daemon because JVM heap space is exhausted
Daemon will be stopped at the end of the build after running out of JVM memory
Expiring Daemon because JVM heap space is exhausted
Expiring Daemon because JVM heap space is exhausted

> Task :app:mergeExtDexRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexRelease'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > java.lang.OutOfMemoryError (no error message)

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4m 13s
43 actionable tasks: 43 executed
Expiring Daemon because JVM heap space is exhausted
Command failed with exit code 1: C:\myapp\platforms\android\gradlew cdvBuildRelease -b C:\myapp\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --release exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

How can I solve this problem?

Thank you

cld

1 post - 1 participant

Read full topic

Change Galery Image or add the gallery text above

$
0
0

Dear, the reason for the consultation is to ask you about how I can change the gallery logo or add the text “gallery” on the logo?

In this way, users will not be confused when seeing that it is also possible to select a photo from the device’s gallery and not only use the camera.

image

Thanks in advance.

1 post - 1 participant

Read full topic

How to hide/show side menu on big screens

$
0
0

Hello, so here is the deal, I can’t hide side menu on screens higher than 990px. On the screens that are bigger than 990px it is always shown and I can’t hide it.

What I tried is that I setup a button to call these functions:
On Constructor i called private ionMenu: IonMenu

then on the button:
this.ionMenu.toggle();
this.ionMenu.open();

But these only work on small screen and on on the bigger screens.

I need to hide the side menu on higher screens and the user to be able to open it or swipe to open the side menu whenever they want.

Thanks in advance, Milot.

2 posts - 1 participant

Read full topic

Ionic/Angular + Capacitor + Firestore

$
0
0

Hey Guys,

I am wondering about the writing an application with usage of Ionic + Firestore to reduce the time of development and mostly focus on the FE part. The goal is to create simple app for mobile devices that will be assistent in speech therapy - few simple screens + recording audio feature.

The logic behind is going to be pretty simple, most likely I will use Angular

to filter the Firestore within Angular pipes.

Have anyone of you had any experienecs with Firestore and can say any pros/cons of such solution?

Here are some screens



1 post - 1 participant

Read full topic

Viewing all 49268 articles
Browse latest View live


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