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

Ionic PWA Firebase

$
0
0

I have a pwa application deployed to firebase. Why must we clear cache to see the changes? Is there any way without clearing the cache?

1 post - 1 participant

Read full topic


Ionic 4 Document scanner

$
0
0

I am working on Ionic Document scanner Plugin in Ionic 4.
After the scan, image is saved in Gallery, However i do not get return value from Plugin.
Below is my code
let opts: DocumentScannerOptions = {
quality: 100,
sourceType: srcType,
returnBase64 :true
};
this.documentScanner.scanDoc(opts) .then((res) => {
alert(res); // No alert coming
if (this.useURI) {
this.imageData = (window as any).Ionic.WebView.convertFileSrc(res);
} else { this.imageData = ‘data:image/jpeg;base64,’ + res;
}
}) .catch((error: any) => alert(error));

1 post - 1 participant

Read full topic

Ionic contents are not aligning properly

$
0
0

I have 3 buttons (Note: I have tried the same with other elements like 3 texts/labels/etc.)
first button should be at start (leftmost side of the screen),
second button should be at the middle of screen
3rd button should be at the end (rightmost side of the screen)

I was trying using class=“ion-justify-content-between”, but problem remains the same.

Here is screenshot :

Here is code :

<ion-card>

  <ion-card-content>

    <ion-item>

      <ion-grid>

        <ion-row class="ion-justify-content-between">

          <ion-col >

            <div>

              <ion-button>ok</ion-button>

            </div>

          </ion-col>

          <ion-col >

            <div>

              <ion-button>ok</ion-button>

            </div>

          </ion-col>

          <ion-col>

            <div>

              <ion-button>ok</ion-button>

            </div>

          </ion-col>

        </ion-row>

      </ion-grid>

    </ion-item>

  </ion-card-content>

</ion-card>

[Note: you can also try without ion-card/ion-card-content/ion-item. I mean you can just keep the ion-grid and the problem is same]

Someone please tell me what went wrong?

1 post - 1 participant

Read full topic

Extend form entry and save to firebase firestore as unique requests

$
0
0

I don’t know the proper terms to describe what i need to do so i can’t find the correct posts to help, so here it goes:

I have a request form that has a preset number of fields to fill out (from, to, date, time) and once submitted a bunch of firebase functions are triggered to pass the data to sendgrid email, sending a confirmation to the user and a quote request to the admins.

Right now everything is explicitly laid out as in the form fields are named and then passed to the function upon hitting submit.

My new hurdle is adding an unknown amount of additional requests to the form and saving them appropriately in firestore. So someone can fill out from, to, date, time, then click “Another Request” which will cause a new empty form to show below the one they filled in and allow them to enter a completely new set of from, to, date and time. Upon submitting the information both requests get filed under the same firestore document with the first one have “1” after the field names ( from1, to1, date1, time1) and the 2nd one having "2"s after (from2, to2, date2, time2). This would continue up until about 5 requests which then i would block additional ones from being added.

Currently i was just going to duplicate the entirety of the form, give all the field names a “2” at the end, and then have an *ngIf watch for if they click the “Another Request” button. But then i would have to have logic on all subsequent pages checking for if a 2, 3, 4 and 5 request count exist for each main request.

I’m using ionic 5 and firebase firestore.

TL:DR : Current form is setup to take 4 named fields and submit them to firestore collection/document. I would like to setup logic for the user to be able to add another form (the 4 same fields) but dynamically create the fields in the database grouped under a main ID (so i’m not creating a form with the same 4 fields repeating 5 times, and then having to track 5 sets of the variables in the database when most of them will be blank). Then subsequent pages that use these fields can just query the main ID, see how many sets of requests there are, and show the data in a list style loop.

1 post - 1 participant

Read full topic

Infinite loop with ionChange on ion-toggle

$
0
0

I have a toggle switch that subscribes a user to notifications on the backend.
When they turn the ion-toggle on, I go register them on the server. If anything fails, I turn the toggle back “off” programmatically in the component.

This triggers the ionChange event which unsubscribes on the server. If this fails, it turns the toggle back “on” programmatically.

This behavior is similar to iOS when you turn something like WiFi Calling or iMessage on, iOS sometimes does the neat little spinner next to the toggle to let the user know something is being “confirmed” on the backend.

There’s probably a combination of changing the event to maybe ionBlur or changing ngModel bindings but I can’t figure it out.

<ion-toggle
            color="danger"
            [(ngModel)]="villageCheckinNotifications"
            (ionChange)="toggleVillageCheckinsNotifications()"
          ></ion-toggle>
    console.log('changed value to: ', this.villageCheckinNotifications);
    if (this.villageCheckinNotifications) {
      this.notificationSvc.subscribeVillageCheckinNotifications().then(
        () => {
          // this.villageCheckinNotifications can stay true. accurately reflects state
        },
        (err) => {
          console.error('Error setting notifications: ', err);
          alert(
            'Error setting notifications. Please try resetting ReVillage Notification permissions in your phones Settings.'
          );
          // failed to configure so we need to reset UI
          this.villageCheckinNotifications = false;
        }
      );
    } else {
      this.notificationSvc.unsubscribeVillageCheckinNotifications().then(
        () => {
          // this.villageCheckinNotifications can stay true. accurately reflects state
        },
        (err) => {
          console.error('Error setting notifications: ', err);
          alert(
            'Error setting notifications. Please try resetting ReVillage Notification permissions in your phones Settings.'
          );
          // failed to configure so we need to reset UI
          this.villageCheckinNotifications = true;
        }
      );
    }
  }

Anyone smarter than me able to figure this out? :pray:t3:

2 posts - 2 participants

Read full topic

Issue with content jumping on keyboard open

$
0
0

Hello,
I have an issue with an almost-empty Ionic Capacitor project. Actually, I’ve seen this issue on many projects created using Ionic.
When the user focuses an Input, the keyboard opens animating up, and I would expect the content to be pushed up by the keyboard, animating smoothly with it. What happens is that the keyboard animates but the content just jumps up when the keyboard has fully opened, instead of following the animation. The same thing happens the other way around, when the keyboard closes completely, the content just jumps down.

1 post - 1 participant

Read full topic

iOS apple-app-site-association - does it need to be off the root of my server?

$
0
0

I am trying to configure deep linking for my Capacitor App and am following the instructions here: https://capacitorjs.com/docs/guides/deep-links. Apple mentions that

“The file needs to be accessible via HTTPS—without any redirects—at https:///apple-app-site-association or https:///.well-known/apple-app-site-association. Next, you need to handle universal links in your app”

and

“Upload the apple-app-site-association file to your HTTPS web server. You can place the file at the root of your server or in the .well-known subdirectory.”

https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html

My questions is: does the .well-known directory absolutely need to be off the root of my server? We use Google Cloud and Kubernetes and the website I need to link wit does not live at domain.com, it lives at domain.com/myapp. I need to be able to serve the apple-site-association file at domain.com/myapp/.well-known/apple-app-site-association. However, when I use serve the association file at domain.com/myapp/.well-known/apple-app-site-association I get “Error cannot fetch app site association” from https://search.developer.apple.com/appsearch-validation-tool. I’ve tested deep linking with my app on a device (just to see if the validator was wrong) but am always routed to our website and not our application. Any help/advice would be greatly appreciated.

3 posts - 3 participants

Read full topic

S Ionic Studio dead?

$
0
0

Hi, I have been watching the ionic studio for a while and I was happy as soon as it was released, but I was sad when there was no way to test it before we really decided to buy a license, but I was sad to see that it was simply deleted from the site, disappeared without leaving any justification for users, I saw some twitters saying that they are working on a new solution but I request that they be more transparent if they will abandon the project or what it will improve and what reason it has been removed, in the end I hope that it will come back and have a limited free plan so that the community can test before buying, i would love to collaborate but i need to know if it is really useful for me.

1 post - 1 participant

Read full topic


Ionic 5 - users mentions

$
0
0

I have Ionic-5 (angular 9) App with users chat, i want to add mentions functionality to the ion-textarea,

its need to be something like Whatsup, twitter ,Facebook when user typing ‘@’ or ‘#’ its will open dropdown with the users list with names and avatars, and when continue typing the list will be filtered and show the relevant users. when click on user from the list the keyboard stay opened and its name will be add to the textarea

is there ionic5/angular9 recommended libraries for mentions? or should i have to write it myself?

1 post - 1 participant

Read full topic

Why is Remote DBA important for organisations?

Which company provide better solution for Database Management Services provider in Pune?

Capacitor vs Cordova

$
0
0

We are starting a new ionic project. I came to understand that ionic is now recommending capacitor instead of cordova to build application.

My application has the requirement of touch id, face id and native storage. I can see these libraries readily available in cordova.

If i choose capacitor, do we have capacitor plugins correspondingly?. Since capacitor is pretty new, we are concerned about using it for our application. Can i proceed with capacitor or cordova ?

1 post - 1 participant

Read full topic

Angular HTTP Headers not being used

$
0
0

I have been trying to update my Angular version from 5 to version 9,1 and I have been facing some issues with the headers of my API calls. even though I have set up a process for the headers with the proper authorization. but whenever I try to make the API call the headers do not seem to show up. I have tested through postman if the API is callable with the token and it working as intended. Any ideas are appreciated.

getProfileDetails(userid) {
    return this.http.get(`${env.p3ApiUrl}/users/${userid}`, this.requestOptions()).pipe(
        catchError(this.handleError)).toPromise();
  }

private requestOptions() {
    const header = new HttpHeaders().set('content-type', 'application/json')
        .set('Access-Control-Allow-Origin', '*')
        .set('Authorization', 'Bearer ' + this.getTokenString());
    const requestOptions = {headers: header};
    return requestOptions;
  }
async getToken(){
    return await this.storage.get('userToken');
  }
  getTokenString(): any {
    this.getToken().then((val) => {
      console.log(val);
      return val;
    });
  }

Error:

Error: Uncaught (in promise): HttpErrorResponse: {"headers":{"normalizedNames":{},"lazyUpdate":null},"status":401,"statusText":"OK","url":"https://apicarenew.clinakos.com/users/50992","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://apicarenew.clinakos.com/users/50992: 401 OK","error":{"message":"unauthorized"}}

5 posts - 3 participants

Read full topic

Ionic Upgrade from 3 to 5

$
0
0

Hi All,
Am new into ionic development, my manager asked me to upgrade an existing App of ours from ionic 3 to 5. Its a quite big application, my doubt is can i upgrade directly from ionic 3 to 5 or should i go as like from 3 to 4 and then 4 to 5?

3 posts - 2 participants

Read full topic

Why Ionic 5 Router Issue?

$
0
0

just need your help guys!Navigation from (onclick) event using this.router.navigateByUrl(‘login’); changes route, but component not being rendered. After second click on any part of screen, component is rendered. thank you! 강북오피【bamclick1。com】◈밤클릭◈ ⟐강북마사지⟐강북안마⟐강북유흥⟐강북휴게텔⟐강북풀싸롱⟐강북키스방⟐강북건마⟐강북리얼돌⟐강북출장안마⟐강북룸싸롱⟐강북OP

1 post - 1 participant

Read full topic


Ionic: "Cannot match any route"

$
0
0

Hello,

On my Ionic app, I get the following error:

Cannot match any route. URL Segment: 'user-profile/edit/[userId]

when trying to go from “user-profile/[userId]” to “user-profile/edit/[userId]” page.
I can’t acces the said page when entering the route manually either.

My “user-profile-routing.module.ts” looks like so:

    const routes: Routes = [
      {
        path: "id",
        component: UserProfilePage,
      }, 
      {
        path: "edit/:id",
        component:EditProfilePage
      },
      {
        path:"prizes-list/:id", 
        component: PrizesListPage
      },
      {
        path: "add-prize/:id",
        component: AddPrizePage
      },
      {
        path: "stats/:id",
        component: StatsPage
      },
    ];

I have the same type of structure in another page which go from “message” page to “message/messages-details/[messageId]” page and have no problem navigating between the two:

    const routes: Routes = [
    
      {
          path: '',
          component: MessagesPage
      },
      {
          path: "messages-details/:id",
          component: MessagesDetailsPage
      },
    ];

What am I missing in my routing module to make it works? Thx for the help !

1 post - 1 participant

Read full topic

Ionic capacitor browser Api opening new tab

$
0
0

I am using capacitor browser API to open a window but the problem is it is opening new tab not staying on the current tab. How to prevent this?

Thank you in advance

Here is the code

import { Plugins } from '@capacitor/core';
const { Browser } = Plugins;


async test(){
  await Browser.open({url : 'http://localhost:8100/tabs/tab2'});

}

HTML

  <ion-button (click)="test()">test</ion-button>

1 post - 1 participant

Read full topic

IonReactRouter or react-router-dom not passing match for location props

$
0
0

I am trying to use IonReactRouter with private routes and am using the standard react-router-dom implementation.

For some reason that I am struggling to understand the router is not passing the match or location props.

I have added a question to stack overflow that explains in full. I would really appreciate any help.

1 post - 1 participant

Read full topic

Invoke capacitor sqlite plugin methods from Custom Plugin

$
0
0

Hi, I am working on implementing custom plugin and in that plugin I want to insert records into sqlite using capacitor sqlite plugin…
Is there any example, where we can call method of one plugin from another plugin…

I have tried, but while calling a method need to pass PluginCall object as parameter… for that i need to pass message handler, PluginCall(this.handler,pluginId,callbackid,methodname,data);

Any idea will be helpful for this implementation…

Thanks in advance…

1 post - 1 participant

Read full topic

Multiple "views/pages" in the same page

$
0
0

Hello everyone,

Currently I am developing an application, where I need to achieve several views in one content. One option is for that to use ion-card ( hide/show) based on the logic. However I am wondering if there is more “professional” way of achieving this requirement. I have tried with selectors but the thing is I have to be able to drag and drop that “views” as well.

In the picture is more understandable the requirement which I need to achieve.

Any help will be appreciated. Thank you all in advance.

1 post - 1 participant

Read full topic

Viewing all 71531 articles
Browse latest View live


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