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

Ionic 4 / firebase RTDB / wait that a field in table is modified / update a list

$
0
0

Hello everyone,

I have a firebase RTDB with description:

var postData = {

** flag_upd_templ: 1,**

** key_upd_templ: xxxx**

** };**

1- First I set flag ‘flag_upd_templ’ to ‘1’
2- another application check this flag and set it to ‘0’

Then I have to wait for this flag to be set ‘0’ to proceed more data…

I’ve tried the:
this.db.database.ref(’***********’).equalTo(0)

but how can I embedded in a function that would wait for it?

Thanks.

1 post - 1 participant

Read full topic


Reject Apple message : purchase-2

$
0
0

Could someone clear me reject message sent by apple?

Have you ever met this problem ?

thanks in advance

Valère

Guideline 2.1 - Performance - App Completeness

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 13.5.1 on Wi-Fi.

  1. An error message is displayed when attempting to complete an IAP transaction.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead.

Resources

You can learn more about testing in-app purchase products in your development sandbox environment in App Store Connect Developer Help.

For more information on receipt validation, please see What url should I use to verify my receipt? in the In-App Purchase FAQ.

Learn how to generate a receipt validation code in App Store Connect Developer Help.

1 post - 1 participant

Read full topic

How to build nest tab work with router link

Ion-content slides left when ion-input is clicked

$
0
0

I have a form which is built using ion-content that has several ion-input fields inside of them. Whenever I click into one of the input fields (emulating on Google Chrome), the entire ion-content slides to the left. When I click on a different input field, or double click on an input field, the content slides back to its original position in the middle of the screen.

I need help figuring out how to fix the ion-content such that no matter what is being clicked, there is no movement in the x direction.

Thank you for the help!

Here is a snapshot of some of the relevant HTML:

1 post - 1 participant

Read full topic

Oauth using capacitor plugin on electron

$
0
0

Hey, I am using Ionic 5 for making a PWA for web, ios, android, and desktop using electron. so I was able to work around with GoogleAuth and OutlookAuth using the Plugins from ‘@capacitor/core’ then Plugins.GoogleAuth.signIn() but the issue is this google auth is working in all other platforms but not the only electron it just gives and error about data not found. In case of Plugins.OAuth2Client.authenticate(oauth2Options) it just simply opens the mini browser and closes immediately causing an error…

1 post - 1 participant

Read full topic

Embed an ionic app in a native one

$
0
0

Hello,

is there any way to run an ionic app inside a native app?

We have a old native app running and we are on the go to migrate to ionic, this kind of embed whold help a lot in the process.

2 posts - 2 participants

Read full topic

Help with ionic tabs ionic 4/5

$
0
0

Hi there,
I would like to customize my ionic tabs menu like the one in the image below. I am using ionic5. Any idea how?

image

4 posts - 3 participants

Read full topic

Ionic 3 prod build errors

$
0
0

My company forced us to upgrade Mac and test iphone 7 to 13.5.1.

Finally able to build app (as normal I start fresh with installing node modals and remove and add ios 5.1).
Now getting problems testing app on said iphone.
I can get the app to work if I don’t do a prod build.
Everything being the same, just one build using --prod another not.

No build errors. Open in Xcode, no build errors. Pushed build to phone. Get errors in log.
See something similar as its loading.

On our login screen just tapping into a text field get this error.

ERROR: ERROR Error: StaticInjectorError[l]:

StaticInjectorError[l]:

NullInjectorError: No provider for l!

Every time a key is pressed. This is the cause of something else.

Strange thing is push same build to iphone 8 simulator running 13.5 no errors.
Honestly I’m not sure what else to do.

Any idea why a prod build now on 13.5.1 would cause this?

Cordova CLI       : 8.0.0   
Cordova Platforms : android 8.1.0, browser 5.0.4, ios 5.1.1

1 post - 1 participant

Read full topic


Apple Watch Plugin

$
0
0

Before I go down the path of working out how to make an Apple Watch plugin is anyone aware of any concerted efforts or progress made by anyone? I’ve been Googling on and off for a month or so and can’t find anything in recent history.

If anyone is aware of something I’d be very appreciative of a link or two.

Thanks!

1 post - 1 participant

Read full topic

Adjust font size dynamically at runtime

$
0
0

This is for Ionic 5, Angular 9, Capacitor 2.

Most of this app users have low vision ability. I need to make the capacity for user to adjust the font size in all areas. I am making variables in variables.scss:

--normalprint: 14px;
--titleprint: 18px;
--largetitleprint: 22px;
--font-size-adj: 1.4vw;

In the other scss files, I can refer those variables and calculate:

.normalprint {
font-size: calc(var(--normalprint) + var(--font-size-adj));
text-align: left;
}

But how to do it dinamic from user input? I want to use a “font-size-adj” value entered from the user. But I don’t see the way to use it.

Thank you.

1 post - 1 participant

Read full topic

Navigation between pages with two different menus

$
0
0

Hello!

I am creating an application with two pages: a home page(displaying different workspaces), and a page for editing a workspace once it is clicked.

The home page uses the standard <ion-menu>, while the workspace page uses the standard <ion-split-pane>.

I am navigating between the two pages with a button press. To navigate to the workspace page:

goToWorkspace() {
    this.route.navigate(["/workspace"]);
  }

And, to navigate from the workspace page back to the home page (the root page):

goHome() {
    this.route.navigate(["/"]);
  }

Both use the angular router.

The problem is that when I navigate to and from these pages, the menu bar breaks down for both. Going from workspace to home causes the menu toggle in the top left to disappear, and navigating from home to workspace causes the split pane to disappear.

I have tried using the deprecated navController, but the same behavior remains.

Here is the HTML for home.page.html:

<ion-menu
  type="push"
  content-id="main-content"
  persistent="true"
  auto-hide="false"
  mode="ios"
  style="--side-max-width: 100px;"
>
  <ion-content>
    <ion-list lines="none">
      <ion-item
        *ngIf="afAuth.authState | async as user"
        style="padding-top: 20px; margin-bottom: 20px;"
      >
        <ion-avatar slot="start">
          <img [src]="user.photoURL" alt="?" />
        </ion-avatar>
        <ion-label>
          {{user.displayName}}
        </ion-label>
      </ion-item>
      <!-- Handle sign out and global tags (click)="presentPopover($event)"-->
      <ion-button
        expand="block"
        (click)="auth.signOut()"
        style="
          margin-top: 20px;
          padding-right: 10px;
          padding-left: 10px;
          margin-bottom: 20px;
        "
        >Log Out</ion-button
      >

      <!-- render if we do not have a user -->
    </ion-list>
  </ion-content>
</ion-menu>
<!-- MAIN CONTENT AREA -->
<!-- MAIN CONTENT AREA -->
<!-- MAIN CONTENT AREA -->
<!-- MAIN CONTENT AREA -->
<div class="ion-page" id="main-content" mode="ios">
  <!-- TOOLBAR -->
  <!-- TOOLBAR -->
  <!-- TOOLBAR -->
  <ion-header>
    <ion-toolbar color="primary">
      <ion-buttons slot="start">
        <ion-menu-toggle>
          <ion-button>
            <ion-icon slot="icon-only" name="menu"></ion-icon>
          </ion-button>
        </ion-menu-toggle>
      </ion-buttons>
      <ion-title>Marion - Home </ion-title>
    </ion-toolbar>
  </ion-header>
  <!-- MAIN CONTENT -->
  <!-- MAIN CONTENT -->
  <!-- MAIN CONTENT -->
  <ion-content class="ion-padding">
    <!-- RENDER ALL THINGS -->
    <app-workspaces></app-workspaces>
  </ion-content>
</div>

Here is the HTML for workspace.page.html:

<ion-split-pane
  when="xl"
  content-id="main-content"
  persistent="true"
  auto-hide="false"
  mode="ios"
  enable-menu-with-back-views="“true”"
  style="--side-max-width: 100px;"
>
  <ion-menu
    type="push"
    content-id="main-content"
    #mymenu
    style="--side-max-width: 100px;"
  >
    <ion-content>
      <ion-list lines="none">
        <!-- User information, allowing for signing out -->
        <ion-item style="padding-top: 20px; margin-bottom: 20px;">
          <ion-avatar slot="start">
            <img
              src="https://pbs.twimg.com/profile_images/1206645456450793474/x0o6c-tz.jpg"
            />
          </ion-avatar>
          <ion-label>
            <h2>Username</h2>
          </ion-label>
        </ion-item>
        <ion-button
          expand="block"
          style="
            margin-top: 20px;
            padding-right: 10px;
            padding-left: 10px;
            margin-bottom: 20px;
          "
          >Add (note or item)</ion-button
        >
        <ion-item
          ><h5>
            Popover contains sign in/out, and global tags modal
          </h5></ion-item
        >

        <ion-menu-toggle auto-hide="false">
          <ion-item button (click)="goHome()" id="nav-button">
            <ion-icon slot="start" name="arrow-back-outline"></ion-icon>
            <ion-label>
              Back to Workspaces
            </ion-label>
          </ion-item>
          <ion-item button>
            <ion-icon slot="start" name="documents-outline"></ion-icon>
            <ion-label>
              All
            </ion-label>
          </ion-item>
          <ion-item button id="nav-button">
            <ion-icon slot="start" name="trash-outline"></ion-icon>
            <ion-label>
              Trash
            </ion-label>
          </ion-item>
          <ion-item button id="nav-button">
            <ion-icon slot="start" name="git-network-outline"></ion-icon>
            <ion-label>
              Map
            </ion-label>
          </ion-item>
          <ion-item button id="nav-button" style="margin-bottom: 20px;">
            <ion-icon slot="start" name="pricetags-outline"></ion-icon>
            <ion-label>
              Local Tags
            </ion-label>
          </ion-item>
        </ion-menu-toggle>
      </ion-list>
      <!-- TAG SECTION -->
      <ion-item-divider color="light" style="margin-bottom: 20px;">
        Tags
      </ion-item-divider>
      <ion-list lines="none">
        <ion-menu-toggle auto-hide="false">
          <!-- Example Tag Group -->
          <ion-item>
            <ion-chip color="primary">
              <ion-icon name="pricetag-outline"></ion-icon>
              <ion-label color="dark">Class 1</ion-label>
            </ion-chip>
          </ion-item>
          <ion-item>
            <ion-chip color="warning">
              <ion-icon name="pricetag-outline"></ion-icon>
              <ion-label color="dark">Week 1</ion-label>
            </ion-chip>
          </ion-item>
          <ion-item>
            <ion-chip color="danger">
              <ion-icon name="pricetag-outline"></ion-icon>
              <ion-label color="dark"
                >Ionic Sub-Menu Replaces ion-select</ion-label
              >
            </ion-chip>
          </ion-item>
        </ion-menu-toggle>
      </ion-list>
    </ion-content>
  </ion-menu>
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <!-- MAIN CONTENT AREA -->
  <div class="ion-page" id="main-content">
    <ion-header>
      <ion-toolbar color="primary">
        <ion-buttons slot="start">
          <ion-menu-toggle>
            <ion-button>
              <ion-icon slot="icon-only" name="menu"></ion-icon>
            </ion-button>
          </ion-menu-toggle>
        </ion-buttons>
        <ion-title
          >CS348 (background color matching the workspace color)
        </ion-title>
      </ion-toolbar>
    </ion-header>
    <!-- Man Content Area Rendered Here (Kieran)-->
    <ion-content class="ion-padding">
      <h1>Main Content Area</h1>
    </ion-content>
  </div>
</ion-split-pane>

Thank you!

1 post - 1 participant

Read full topic

Ionic-v5 File Transfer error 3

$
0
0

At the beginning, all worked fine to tranfer files to MongoDB-db but after an upgrade of Android (to Android 10) I can’t tranfer any picture to my MongoDB-db.

async uploadImages(images: string[]){
    for (let i = 0; i< images.length; i++){
      const element: string = images[i];
      let elementName: string = element.substr(element.lastIndexOf('/')+1);
      console.log('elementName', elementName);

      let fileTransfer: FileTransferObject =  this.transfer.create();
      const url: string = `${environement.api_url}/Containers/photos/upload`;
      console.log('url', url);

      let options: FileUploadOptions = {
        fileKey: 'Clothy',
        fileName: elementName,
        //chunkedMode: false,
        mimeType: 'image/jpeg',
        headers: {}
      }
      if (!this.imgUploaded){
        let data = await fileTransfer.upload(element, url, options);
        console.log('data', data);
        let id: string = JSON.parse(data.response)._id
        console.log('id', id);
        console.log('typeof id', typeof id);
        this.article.pictures.push(id);
        this.numImgUpload += 1;
      }
      if (this.numImgUpload === images.length){
        this.imgUploaded = true;
      }
    }
    return true;
  }

and I raise this error :

I read File Transfer was deprecated and I tried this https://github.com/silkimen/cordova-plugin-advanced-http
But I get an error :

Cannot find module '@ionic-native/http/ngx'.

My config

If someone can help :slight_smile:

2 posts - 2 participants

Read full topic

Tinnitus And Hearing Loss In Dentists Prevention

$
0
0

Over the course of the years, dentists have been on the receiving end of Tinnitus and hearing loss consequences emanating from their own practice. Apart from minor hand injuries and torn muscles operating on teeth, they experience continuous exposure to noise pollution. The sources of the noise they experience originate from the tools they use and from the natural environment. Some of the tools they use such as the handpieces generate too much noise which when the ear is exposed to for a long time, the dentist risks hearing loss. From the natural environment, the ear picks noise from the cries by the clients or from the people in the room during surgery. Without dentists, some of our toothache problems may lack an amicable solution, tooth alignment may stall and tooth removal ceases. If the dentists are such a blessing to us, why do they go down the victims of tinnitus and hearing loss?

1 post - 1 participant

Read full topic

Inappbrowser ionic 5 - how to remove url

Trying to run ionic app

$
0
0

Hi there,
after install node_modules then ionic serve giving error anyone suggest me how to resolve it.

1 post - 1 participant

Read full topic


IonList Using React - closeSlidingItems()

$
0
0

Below is an example containing an IonList.

When using React, how can I trigger IonList’s closeSlidingItems() method?

import React from 'react';
import { IonList, IonItem, IonLabel, IonInput, IonToggle, IonRadio, IonCheckbox, IonItemSliding, IonItemOption, IonItemOptions, IonContent } from '@ionic/react';

export const ListExample: React.FC = () => (
  <IonContent>
    {/*-- List of Text Items --*/}
    <IonList>
      <IonItem>
        <IonLabel>Pokémon Yellow</IonLabel>
      </IonItem>
      <IonItem>
        <IonLabel>Mega Man X</IonLabel>
      </IonItem>
      <IonItem>
        <IonLabel>The Legend of Zelda</IonLabel>
      </IonItem>
      <IonItem>
        <IonLabel>Pac-Man</IonLabel>
      </IonItem>
      <IonItem>
        <IonLabel>Super Mario World</IonLabel>
      </IonItem>
    </IonList>
  </IonContent>
);

1 post - 1 participant

Read full topic

PLaygroun manufacturer

Handle cross origin * with webview

$
0
0

It is not good to provide access origin * to access backend APIs from any short of source.

Is there any good way to bypass and restrict to hits from my app only.

I dont want to use native http it is hard to debug in web app and takes more time of dev finish

Thank you

1 post - 1 participant

Read full topic

Concurrency tolerant loader service

$
0
0

Hey all, I recently refactored my hide/show loader code and finally moved to concurrency tolerant loader service using ion loading. Wrote the article as I went through the steps.

1 post - 1 participant

Read full topic

How to handle Ionic React Tabs routing with re-used page components across several tabs?

$
0
0

Hi all, I am using Ionic React Tabs for a music application. I have a quick question on how to handle an IonRouterOutlet for tabs that share the same page component across tabs. For example, my application has two pages:

  • Search Page
  • Feed Page

On both the Search and Feed pages, I need to allow a user to route to an Artist page. According to the documentation, I should be making my IonRouterOutlet look something like the following in my App.tsx:

<IonRouterOutlet>
    <Route path="/:tab(search)" component={Search} exact />
    <Route path="/:tab(search)/artist/:artistId" component={Artist} exact />
    <Route path="/:tab(feed)" component={Feed} exact />
    <Route path="/:tab(feed)/artist/:artistId" component={Artist} exact />
</IonRouterOutlet>

This is manageable so far, but now on each Artist page, a user can click an Album so I’d have to add another Route for both the Search and Feed tabs to account for the ability to route to /(whatever-tab)/album/:albumId. This is getting quickly out of hand because I have several shared components that are used amongst several tabs (4 tabs in my actual app). Is there a better way to handle this?

As mentioned in the docs, path simply uses regex to match the url. Is there a way to do something like:

<IonRouterOutlet>
    <Route path="/:tab(search)" component={Search} exact />
    <Route path="/:tab(feed)" component={Feed} exact />
    <!-- updated the following line --->
    <Route path="/:tab(search || feed)/artist/:artistId" component={Artist} exact />
</IonRouterOutlet>

So it can match several tabs based on what I pass as the current tab from the match props to my routerLink?

What’s the best practice here? The example tabs app doesn’t even use this :tab() syntax…is this out of date now? Thanks!

1 post - 1 participant

Read full topic

Viewing all 70889 articles
Browse latest View live