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

Nested routes with tabs in React

$
0
0

Hello guys, I’m having an issue with the nested routing in React. I generated a normal tabs project by using the Ionic CLI. The problem is that when I navigate to the DayDetailsPage, I get issues with the tabs bar that still gets rendered and also the page seems to freeze (I cannot click on anything). If I refresh the page, it works as expected and the tabs no longer appear + the buttons work, so I’m pretty sure this is a routing issue. I’ve had this issue before and I was forced to do a workaround by cutting off some functionality.

I navigate to DayDetailsPage with

 history.push(DailyRoutes.DayDetails, {
            day: day
        });

Can you guys give me some pointer as to how I should approach this issue?

App.tsx

const App: React.FC = () => (
  <IonApp>
    <IonReactRouter>
      <IonRouterOutlet>
        <Route exact path="/">
          <SetMoodPage />
        </Route>
        <Route exact path={DailyRoutes.DayDetails}>
          <DayDetailsPage />
        </Route>

        <Route path="/tabs">
          <TabsRouting />
        </Route>
       </IonRouterOutlet>
    </IonReactRouter>

  </IonApp>
);

TabsRouting.tsx

        <IonTabs>
            <IonRouterOutlet>
                <Route exact path={DailyRoutes.Main}>
                    <MainPage />
                </Route>
                <Route exact path={DailyRoutes.Settings}>
                    <SettingsPage />
                </Route>
                <Route exact path="/">
                    <Redirect to={DailyRoutes.MoodInput} />
                </Route>
            </IonRouterOutlet>
            <IonTabBar slot="bottom">
                <IonTabButton tab="main" href={DailyRoutes.Main}>
                    <IonIcon aria-hidden="true" icon={triangle} />
                </IonTabButton>
                <IonTabButton tab="settings" href={DailyRoutes.Settings}>
                    <IonIcon aria-hidden="true" icon={ellipse} />
                </IonTabButton>
            </IonTabBar>
        </IonTabs>

1 post - 1 participant

Read full topic


Can't make OneSignal works on Android SDK 33

$
0
0

I’ve got same issue this topic and can make OneSignal works on IOS with these version of libraries:

Related topic

npm i onesignal-cordova-plugin@2.11.3
npm i @ionic-native/onesignal@5.31.1

By the way, from Android SDK 33, the old extension doesn’t work, here is the log
android:exported needs to be explicitly specified for element <receiver#com.onesignal.ADMMessageHandler$Receiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See <activity>  |  Android Developers for details.

Try with some newer version of those library and neither of them works

Any one help me resolve this head each?
Many thanks!

Ionic:

Ionic CLI : 7.1.5 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.6.11
@angular-devkit/build-angular : 13.3.1
@angular-devkit/schematics : 13.1.4
@angular/cli : 13.1.4
@ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 3.9.0
@capacitor/android : 5.0.5
@capacitor/core : 5.0.5
@capacitor/ios : 5.0.5

Cordova:

Cordova CLI : 12.0.0 (cordova-lib@12.0.1)
Cordova Platforms : none
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 12 other plugins)

Utility:

cordova-res : not installed globally
native-run (update available: 2.0.0) : 1.5.0

System:

Android SDK Tools : 26.1.1
NodeJS : v16.20.1
npm : 8.12.1
OS : macOS Unknown
Xcode : Xcode 15.0 Build version 15A240d

1 post - 1 participant

Read full topic

How to Share Chaatsapp.com WhatsApp Group Links

$
0
0

Sharing WhatsApp group links should be done responsibly to maintain privacy and security. To share a group link:

  1. Open the WhatsApp group Chaatsapp.comyou want to share.
  2. Tap on the group name at the top.
  3. Go to “Invite to Group via Link.”
  4. Choose to share the link via WhatsApp, copy the link, or share it through other apps.

Remember to only share links with trusted individuals to prevent unwanted participants.

1 post - 1 participant

Read full topic

Ionic 7 Capacitor Angular - HttpClient request works everywhere but in android

$
0
0

I used android httpClient to make my requests, everything works perfectly in ios or web. When i build my app in Android Studio my requests all error with this message:
Msg: Native: tried accessing the undefined plugin but it's not installed.
This is the code from the function:

login() {
  this.loading = true;
    if (this.loginForm.value)
      this.api.login(this.loginForm.value)
        .pipe(catchError((e) => {
          this.loading = false;
          console.log(e);
          console.log("NAYYYY");
          
          throw e;
        }))
        .subscribe(async (r) => {

          console.log("YAY");
          await this.auth.login(r)
          this.loading = false;
        }
        );
  }

and the request from the service:

login(data: any) {
    this.headers.append('Content-Type', 'application/json; charset=utf-8');
    return this.http.post(`http://127.0.0.1:3000/login`, data, { headers: this.headers })
  }

Any help or guidance is greatly appreciated

1 post - 1 participant

Read full topic

Ionic2-calender Integration in Ionic5 version

$
0
0
**home.page.ts** 
  import { Component, Inject, LOCALE_ID, OnInit } from '@angular/core';
import { NavController, IonModal, AlertController } from '@ionic/angular';
import { ModalController } from '@ionic/angular';
import { Account } from 'src/model/account.model';
import { AccountService } from '../../services/auth/account.service';
import { LoginService } from '../../services/login/login.service';
import { HttpClient} from '@angular/common/http';
import { HttpResponse, HttpHeaders } from '@angular/common/http';
import { filter, map } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { CalendarComponent } from 'ionic2-calendar';
import { formatDate } from '@angular/common';
import { ViewChild } from '@angular/core';

  
@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {
  account: Account;
  type= 'task'
  map_detail: any; 
  name: string;
  eventSource = [];
  viewTitle: string;
  calendar = {
    mode: 'month',
    currentDate: new Date(),
  };
   selectedDate: Date;
     @ViewChild(CalendarComponent) myCal: CalendarComponent;

  constructor(public navController: NavController,  private alertCtrl: AlertController, @Inject(LOCALE_ID) private locale: string, 
  private modalCtrl: ModalController,private accountService: AccountService, private loginService: LoginService,public httpClient: HttpClient) {}

  async ngOnInit() {
    this.accountService.identity().then(account => {
      if (account === null) {
        this.goBackToHomePage();
      } else {
        this.account = account;
      }
    });
     
  }  
  next() {
    this.myCal.slideNext();
  }
  back() {
    this.myCal.slidePrev();
  }
  onViewTitleChanged(title) {
    this.viewTitle = title;
  }
  async onEventSelected(event) {
    let start = formatDate(event.startTime, 'medium', this.locale);
    let end = formatDate(event.endTime, 'medium', this.locale);
    const alert = await this.alertCtrl.create({
      header: event.title,
      subHeader: event.desc,
      message: 'From: ' + start + '<br><br>To: ' + end,
      buttons: ['OK'],
    });
    alert.present();
  }
  createRandomEvents() {
    var events = [];
    for (var i = 0; i < 50; i += 1) {
      var date = new Date();
      var eventType = Math.floor(Math.random() * 2);
      var startDay = Math.floor(Math.random() * 90) - 45;
      var endDay = Math.floor(Math.random() * 2) + startDay;
      var startTime;
      var endTime;
      if (eventType === 0) {
        startTime = new Date(
          Date.UTC(
            date.getUTCFullYear(),
            date.getUTCMonth(),
            date.getUTCDate() + startDay
          )
        );
        if (endDay === startDay) {
          endDay += 1;
        }
        endTime = new Date(
          Date.UTC(
            date.getUTCFullYear(),
            date.getUTCMonth(),
            date.getUTCDate() + endDay
          )
        );
        events.push({
          title: 'All Day - ' + i,
          startTime: startTime,
          endTime: endTime,
          allDay: true,
        });
      } else {
        var startMinute = Math.floor(Math.random() * 24 * 60);
        var endMinute = Math.floor(Math.random() * 180) + startMinute;
        startTime = new Date(
          date.getFullYear(),
          date.getMonth(),
          date.getDate() + startDay,
          0,
          date.getMinutes() + startMinute
        );
        endTime = new Date(
          date.getFullYear(),
          date.getMonth(),
          date.getDate() + endDay,
          0,
          date.getMinutes() + endMinute
        );
        events.push({
          title: 'Event - ' + i,
          startTime: startTime,
          endTime: endTime,
          allDay: false,
        });
      }
    }
    this.eventSource = events;
  }
  removeEvents() {
    this.eventSource = [];
  }
  isAuthenticated() {
    return this.accountService.isAuthenticated();
  }
  logout() {
    this.loginService.logout();
    this.goBackToHomePage();
  }

  private goBackToHomePage(): void {
    this.navController.navigateBack('');
  }
  openperson(){
    this.navController.navigateForward('profile')
  }
}





**home.page.html**          
 <ion-header>
  <ion-toolbar color="primary">
    <ion-title>
      Ionic Calendar
    </ion-title>
    <ion-buttons slot="end">
      <ion-button (click)="openCalModal()">
        <ion-icon name="add" slot="icon-only"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>
 <ion-content>
  <ion-segment [(ngModel)]="calendar.mode">
    <ion-segment-button value="month">
      <ion-label>Month</ion-label>
    </ion-segment-button>
    <ion-segment-button value="week">
      <ion-label>Week</ion-label>
    </ion-segment-button>
    <ion-segment-button value="day">
      <ion-label>Day</ion-label>
    </ion-segment-button>
  </ion-segment>
  <ion-row>
    <ion-col size="6">
      <ion-button (click)="createRandomEvents()" expand="block" fill="outline">
        Add random events
      </ion-button>
    </ion-col>
    <ion-col size="6">
      <ion-button (click)="removeEvents()" expand="block" fill="outline">
        Remove all events
      </ion-button>
    </ion-col>
  </ion-row>
  <ion-row>
    <ion-col size="2">
      <ion-button fill="clear" (click)="back()">
        <ion-icon name="arrow-back" slot="icon-only"></ion-icon>
      </ion-button>
    </ion-col>
    <ion-col size="8" class="ion-text-center">
      <h2>{{ viewTitle }}</h2>
    </ion-col>
    <ion-col size="2">
      <ion-button fill="clear" (click)="next()">
        <ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
      </ion-button>
    </ion-col>
  </ion-row> 
  <calendar
    [eventSource]="eventSource"
    [calendarMode]="calendar.mode"
    [currentDate]="calendar.currentDate"
    (onEventSelected)="onEventSelected($event)" 
    (onTitleChanged)="onViewTitleChanged($event)"
    startHour="6"
    endHour="20"
    step="30"
    startingDayWeek="1"
    >  
  </calendar>
</ion-content> 





**home.module.ts**     
   import { CommonModule } from '@angular/common';
import { LOCALE_ID, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { TranslateModule } from '@ngx-translate/core';
import { UserRouteAccessService } from 'src/app/services/auth/user-route-access.service';
import { HomePage } from './home.page';
import { NgxEchartsModule } from 'ngx-echarts';


  import { NgCalendarModule  } from 'ionic2-calendar';


import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
registerLocaleData(localeDe);

const routes: Routes = [
  {
    path: '',
    component: HomePage,
    data: {
      authorities: ['ROLE_USER'],
    },
    canActivate: [UserRouteAccessService],
  },
];

@NgModule({
  imports: [ NgCalendarModule ,
   IonicModule, CommonModule, FormsModule, TranslateModule, RouterModule.forChild(routes),
    NgxEchartsModule.forRoot({
      echarts: () => import('echarts'),
    })],
  declarations: [HomePage],
  providers: [
    { provide: LOCALE_ID, useValue: 'de-DE' }
  ]
})
export class HomePageModule {}
````Preformatted text`

2 posts - 1 participant

Read full topic

How can I move vertically a PopoverController

$
0
0

In my application, I use a button to display a popover from another page.

The popover is centered both horizontally and vertically in the window, which causes it to extend beyond the window if it is too tall.

Is there a way to better adjust the vertical position of the popover?

I have tried using the properties popover.side, popover.alignment, popover.reference, and popover.keepContentsMounted, but I have not seen any change in behavior.

This is the code for the button

async columnSelect() {
    const popover = await this.popoverController.create({
      component: ColumnSelectComponent,
      componentProps: {
        columns: this.columns,
        allColumns: this.allColums,
      },
      backdropDismiss: true,
      translucent: true,
    });
    popover.style.cssText = '--min-width: 300px;';
    await popover.present();
    await popover.onWillDismiss();
    this.columns = this.varServ.popoverValue;
  }

This is the css for the popover

.sc-ion-select-popover {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  --inner-border-width: 0;
}
ion-popover .popover-viewport {
  display: contents;
}
.popover-viewport .popover-content {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

This is how the popover is show

1 post - 1 participant

Read full topic

Ionic - In iOS the bottom input fields get hidden when keyboard opens

$
0
0

I would like to know why the ion-input fields in bottom of the form gets hidden instead of scrolling top when keyboard opens. This works fine in android. Not working in iOS. Kindly suggest how can I fix this.

2 posts - 2 participants

Read full topic

Customizing SwiperJS to be more like ion-slides?

$
0
0

Hi

Im most cases when you just try out any ion-slides examples with swiperjs, nothing works exactly the same at all.

So I found out the ion-slides component code here, ionic-framework/core/src/components/slides/IonicSlides.ts at 75ffeee933ae353d2601670178896116c81923e0 · ionic-team/ionic-framework · GitHub

Which I will just apply to my example and see how it will work. I hope for success. I have noted that even though some properties are default in swiper js, on the ts file they are also set, perhaps for completeness, not really sure, will do the same either way.

I have just done a search on the swiper api and I cant seem to find some props, e,g slidesPerColumn, slidesPerColumnFill, though I have seen one example these were uses.

Has anyone tried to redo the ion-slides examples with swiperjs and was successful to the letter t, like a 100% match working example? If so, can you please advise?

Thanks in advance for your help.

1 post - 1 participant

Read full topic


Npm version problem or chip problem

$
0
0

I installed ionic --react to my Apple M1 laptop and was getting several errors with ai - assistance suggesting update npm via nvm. I updated and still did not work. While working on my I-Mac which has the intel processor, decided to install ionic cli and run quickstart. Ionic Serve – run application with no errors. Checking current version of node at 16, I used nvm on m1 chip on macbook to see if problem was in node – same errors. In conclusion, the ionic --react cli isn’t broken running intel but has issues on m1 which I confirm using same node versions on each. Hope this helps in isolating problem to chip rather than node.

1 post - 1 participant

Read full topic

Browser.open() rejects my perfectly valid URL. How do I fix this?

$
0
0

Happy new year everyone.

I am currently trying to implement an openIdConnect flow using PingIdentity in an Ionic 7 Angular app. The app is very simple and is just a prototype to demonstrate possible implementations on ping in Ionic 7 to my team as part of a spike. I am testing this in an xCode iPhone simulator.

I am using this sdk created by Ping themselves to connect.

This all works fine except the sdk is created for angular not for ionic, so it by default redirects to ping in a new browser window, rather than an in app browser, as would be more natural for a mobile application. I therefore am trying to edit the signOn method to use the Capacitor Browser API instead.

See below my modified signIn function from auth.js. Refer to the original file here. I have changed out window.open and window.location.replace for Browser.open.

  function signIn(reqOptions) {
    try {
      clearSessionData();

      // verify required parameters
      checkRequiredInfo(
          ['client_id', 'redirect_uri', 'authorization_endpoint']);

      let reqOptionsExist = !!reqOptions;
      let state = null;
      let nonce = null;

      if (reqOptionsExist && (reqOptions['nonce'] && reqOptions['state'])) {
        state = reqOptions['state'];
        nonce = reqOptions['nonce']
      }

      // Replace state and nonce with secure ones
      let crypto = window.crypto || window.msCrypto;
      if (crypto && crypto.getRandomValues) {
        let D = new Uint32Array(2);
        crypto.getRandomValues(D);
        state = reqOptionsExist && reqOptions['state'] ? reqOptions['state']
            : D[0].toString(36);
        nonce = reqOptionsExist && reqOptions['nonce'] ? reqOptions['nonce']
            : D[1].toString(36);
      } else {
        let byteArrayToLong = function (/*byte[]*/byteArray) {
          let value = 0;
          for (let i = byteArray.length - 1; i >= 0; i--) {
            value = (value * 256) + byteArray[i];
          }
          return value;
        };

        let sRandom = new SecureRandom();
        let randState = new Array(4);
        sRandom.nextBytes(randState);
        state = byteArrayToLong(randState).toString(36);

        let randNonce = new Array(4);
        sRandom.nextBytes(randNonce);
        nonce = byteArrayToLong(randNonce).toString(36);
      }

      // Store the them in session storage
      sessionStorage.setItem('state', state);
      sessionStorage.setItem('nonce', nonce);

      let response_type = 'id_token';
      let scope = 'openid';
      let acr_values = null;
      let max_age = null;

      if (reqOptionsExist) {
        if (reqOptions['response_type']) {
          let parts = reqOptions['response_type'].split(' ');
          let temp = [];
          if (parts) {
            for (let i = 0; i < parts.length; i++) {
              if (parts[i] === 'code' || parts[i] === 'token' || parts[i]
                  === 'id_token') {
                temp.push(parts[i]);
              }
            }
          }
          if (temp) {
            response_type = temp.join(' ');
          }
        }

        if (reqOptions['scope']) {
          scope = reqOptions['scope'];
        }
        if (reqOptions['acr_values']) {
          acr_values = reqOptions['acr_values'];
        }
        if (reqOptions['max_age']) {
          max_age = reqOptions['max_age'];
        }
      }

      // Construct the redirect URL for getting an id token, response_type of "token id_token" (note the space), scope of "openid", and some value for nonce is required.
      // client_id must be the consumer key of the connected app. redirect_uri must match the callback URL configured for the connected app.

      let optParams = '';
      if (acr_values) {
        optParams += '&acr_values=' + acr_values;
      }
      if (max_age) {
        optParams += '&max_age=' + max_age;
      }

      let url = activeParameters['authorization_endpoint']
          + '?response_type=' + response_type
          + '&client_id=' + activeParameters['client_id']
          + '&redirect_uri=' + activeParameters['redirect_uri']
          + '&state=' + state
          + '&scope=' + scope
          + '&nonce=' + nonce
          + optParams;

      // if (reqOptions['window']) {
      //   return window.open(url, '_blank', reqOptions['window']);
      // }
      return Browser.open({url: url});
    } catch (e) {
      throw new AuthException(
          'Unable to redirect to the Identity Provider for authenticaton: '
          + e.toString());
    }
  }

Unfortunately, when I do this I get the following error:

To Native ->  Browser open 54105259
ERROR MESSAGE:  {"message":"Must provide a valid URL to open","errorMessage":"Must provide a valid URL to open"}

This has baffled me for the past day or so because the URL is totally fine. It works with window.open and window.location.replace, and it even works somewhat if I just paste it in the browser (it sends me to a ping domain it just says some credentials are not correct, it doesn’t fail to use the url at all though).

The URL is valid and there are no other logs. I cannot find any documentation on this issue nor anyone else with this problem.

Does anyone have any idea of why this might be happening and how to fix it? Any help would be appreciated, since this is absolutely sinking my time.

1 post - 1 participant

Read full topic

IonIcon giving error with vitest

$
0
0

While running vitest on the components using IonIcon, the test is failing with following error though the image is rendered properly in the project
Using IonIcon as: <IonIcon src="/image.svg"/>
It works fine when using ion icon with with inbuilt icons provided by ionic but causes issues when we try to use any image url with it.

1 post - 1 participant

Read full topic

Capacitor plugins limitations

$
0
0

Hello everyone,

I am new to the Ionic Framework, and so far, I am pleased with its efficiency in delivering projects rapidly.

Recently, I came across the generation of Capacitor plugins, which enables me to implement certain features in Java if they are not already provided by the framework. In this context, I am curious to understand the limitations of these plugins written in Java. Will they allow me to achieve every functionality that could be achieved by native Java/Kotlin? Or are there some functionalities that can only be accomplished using native Java/Kotlin due to the restrictions imposed by the webview concept?

Thank you in advance. Have a great day.

1 post - 1 participant

Read full topic

Automatic Client Certificate selection with Android

$
0
0

Hi,
I am building an Android App and my backend wants a certificate to be installed, so it can be accessed.
I also have a (different) Web-App and there the certificate is installed in the browser and the browser asks, when connecting for the first time.
So what I did is, I installed this certificate on the Android device and used “App and VPN” option. When I now use the Ionic App as Web-App and open the page in Chrome, I am asked to select the certificate and then it works.
If I now deploy an Android-Ionic-App and open it, it says “No certificate selected”. So the question is, how can I get the App to select the certificate? Can this work automatically?
I found this old thread here, but it seems the plugins don´t work anymore:

Any ideas? Thanks!

1 post - 1 participant

Read full topic

What database solution to choose for offline data storage (complex data)

$
0
0

The alrady known data storages I don’t want to talk about here.
(Preferences API, IonicStorage, capacitor/sqlite, Ionic SecureStorage).

I have lots of complex data, so simple things like IonicStorage are not enough for me.

I would like to know what you guys of think of using other solutions for ionic capacitor apps.

Things like:

  • PouchDB
  • SQL.js

Maybe you guys could list even more such data storages that allow complex data handling. I am just unsure of going for @capacitor-community/sqlite - npm since I had some bugs with it and there is only mainly one person maintining 95% of it. I am not sure about its future.

How does sth like SQL.js compare to capacitor-sqlite? Are those viable options or is their performance that much worse? What are their upsides/downsides?

Is the native-device SQLITE database that capacitor-sqlite interacts with really that much faster than the one that SQL.js would use in the browser? This is actually my main question. I am wondering why there is capacitor-specific sqlite solutions when we could just use web standard technology. What exactly are the benefits except for things like performance, which I think should be OK/Acceptable for sth like pouchdb - npm, considering it has 20.000 npm downloads per week

1 post - 1 participant

Read full topic

How to force light theme

$
0
0

Hi, I have an application Ionic 7 /angular, is it possible to force the light theme? and if yes how?

1 post - 1 participant

Read full topic


Convert aac / webm to mp3 - FFMpeg [ionic]

$
0
0

I’ve implemented capacitor voice recorder, so it gives me on android and ios m4a. in web it gives me webm format audio

i want to convert it to mp3 and send to backend to then kick to whisper from open ai

i tough FFMpeg would be a good idea but i dont understand if its compatible with capacitor. Has anyone implement it? Examples?

1 post - 1 participant

Read full topic

Is it possible to select a commit from a non-default branch?

$
0
0

Hi, I am new to AppFlow and didn’t find this question already asked.

I have configured AppFlow to access my GitHub organization/repo. However, I can’t find anywhere in the UI to select another branch. When creating a new build, it only shows my commits from the default branch.

What am I missing? Thank you.

1 post - 1 participant

Read full topic

I am trying to use capacitor background Runner. But not able to run on my android app

$
0
0

I am trying to use capacitor background Runner. But not able to run on my android app. using npx cap run android getting this error .

× Running Gradle build - failed!
[error]
> Configure project :app
WARNING: Using flatDir should be avoided because it doesn’t support any meta-data formats.

    > Configure project :capacitor-background-runner
    WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.

    > Configure project :capacitor-cordova-android-plugins
    WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats.

    > Task :app:preBuild UP-TO-DATE
    > Task :app:preDebugBuild UP-TO-DATE
    > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
    > Task :app:javaPreCompileDebug UP-TO-DATE
    > Task :capacitor-android:preBuild UP-TO-DATE
    > Task :capacitor-android:preDebugBuild UP-TO-DATE
    > Task :capacitor-android:writeDebugAarMetadata UP-TO-DATE
    > Task :capacitor-app:preBuild UP-TO-DATE
    > Task :capacitor-app:preDebugBuild UP-TO-DATE
    > Task :capacitor-app:writeDebugAarMetadata UP-TO-DATE
    > Task :capacitor-background-runner:preBuild UP-TO-DATE
    > Task :capacitor-background-runner:preDebugBuild UP-TO-DATE
    > Task :capacitor-background-runner:writeDebugAarMetadata UP-TO-DATE
    > Task :capacitor-community-sqlite:preBuild UP-TO-DATE
    > Task :capacitor-community-sqlite:preDebugBuild UP-TO-DATE
    > Task :capacitor-community-sqlite:writeDebugAarMetadata UP-TO-DATE
    > Task :capacitor-cordova-android-plugins:preBuild UP-TO-DATE
    > Task :capacitor-cordova-android-plugins:preDebugBuild UP-TO-DATE
    > Task :capacitor-haptics:preBuild UP-TO-DATE
    > Task :capacitor-haptics:preDebugBuild UP-TO-DATE
    > Task :capacitor-haptics:writeDebugAarMetadata UP-TO-DATE
    > Task :capacitor-keyboard:preBuild UP-TO-DATE
    > Task :capacitor-keyboard:preDebugBuild UP-TO-DATE
    > Task :capacitor-keyboard:writeDebugAarMetadata UP-TO-DATE
    > Task :capacitor-status-bar:preBuild UP-TO-DATE
    > Task :capacitor-status-bar:preDebugBuild UP-TO-DATE
    > Task :capacitor-status-bar:writeDebugAarMetadata UP-TO-DATE
    > Task :app:generateDebugResValues UP-TO-DATE
    > Task :capacitor-android:generateDebugResValues UP-TO-DATE
    > Task :capacitor-android:generateDebugResources UP-TO-DATE
    > Task :capacitor-android:packageDebugResources UP-TO-DATE
    > Task :capacitor-app:generateDebugResValues UP-TO-DATE
    > Task :capacitor-app:generateDebugResources UP-TO-DATE
    > Task :capacitor-cordova-android-plugins:writeDebugAarMetadata
    > Task :capacitor-app:packageDebugResources UP-TO-DATE
    > Task :app:checkDebugAarMetadata FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.
    > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    > Could not find :android-js-engine-release:.
    Searched in the following locations:
    -
    file:/E:/Ionic/loandigitalization/android/capacitor-cordova-android-plugins/src/main/libs/android-js-engine-release.aar
    - file:/E:/Ionic/loandigitalization/android/app/libs/android-js-engine-release.aar
    Required by:
    project :app > project :capacitor-background-runner

    * 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

    BUILD FAILED in 8s
    15 actionable tasks: 2 executed, 13 up-to-date 

I am using java 17.

1 post - 1 participant

Read full topic

BarcodeScanner

$
0
0

Estoy construyendo una app con ionic 6, capacitor 5 y angular 15 para leer códigos qr, veo que en la documentación de ionic para la versión 6 no hay un plugin para utilizar el barcodeScanner que es esta en versiones anteriores, he buscado plugins y librerías realizadas por la comunidad pero ninguna me sirve, alguno en la comunidad sabrá que librería o plugin me pueda servir para ello, o definitivamente tendré que cambiar las versiones del proyecto ?

1 post - 1 participant

Read full topic

Unit testing service with Capacitor plugin

$
0
0

Hello. :wave:

I’m new to Ionic/Capacitor and in my application, I am using Aparajita’s SecureStorage et BiometricAuth plugins and i’d like to do some unit tests on my service that uses SecureStorage.

I have the Capacitor’s documentation with me, but I’m quite confused since it seems it is written for components and not services. I’m wondering if someone already did something like that, or if it’s not really useful to unit test plugin’s methods?

For now I only tried to test one method, which is setKeyPrefix:

it('should set key prefix', async () => {
      spyOn(service, 'initVault');
      spyOn(SecureStorage, 'setKeyPrefix');
      service.initVault();
      expect(service.initVault).toHaveBeenCalled();
      expect(SecureStorage.setKeyPrefix).toHaveBeenCalledWith('prefix');
    });

But i get an error when running it:

VaultService > #init > should set key prefix
Error: <toHaveBeenCalledWith> : Expected a spy, but got Function.
Usage: expect(<spyObj>).toHaveBeenCalledWith(...arguments)

Thanks! :grinning:

1 post - 1 participant

Read full topic

Viewing all 70910 articles
Browse latest View live


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