Quantcast
Viewing all 70882 articles
Browse latest View live

Appflow and coco pods on Windows

Hi All

I have recently upgrade to capacitor from cordova .

I will be using Appflow as welll.

Prior to commit to Appflow , i believe in need to do a ionic capacitor sync. I am getting the following output with cocopods installing error.

Please advice what must i do? I am using Windows PC

G:\AVR_Project\Ionic Projects\app>ionic capacitor sync
> capacitor.cmd sync
√ Copying web assets from www to android\app\src\main\assets\public in 35.00s
√ Copying native bridge in 67.85ms
√ Copying capacitor.config.json in 2.02ms
/ copy  Found 7 Cordova plugins for android
    cordova-plugin-app-version (0.1.9)
    cordova-plugin-device (2.0.3)
    cordova-plugin-nativegeocoder (3.2.2)
    cordova-plugin-statusbar (2.4.3)
    cordova-plugin-whitelist (1.3.4)
    phonegap-plugin-barcodescanner (8.0.1)
    phonegap-plugin-multidex (1.0.0)
√ copy in 41.30s
√ Updating Android plugins in 35.71ms
  Found 0 Capacitor plugins for android:
  Found 7 Cordova plugins for android
    cordova-plugin-app-version (0.1.9)
    cordova-plugin-device (2.0.3)
    cordova-plugin-nativegeocoder (3.2.2)
    cordova-plugin-statusbar (2.4.3)
    cordova-plugin-whitelist (1.3.4)
    phonegap-plugin-barcodescanner (8.0.1)
    phonegap-plugin-multidex (1.0.0)
\ update android  Found 4 incompatible Cordova plugins for android, skipped install
    cordova-plugin-add-swift-support (2.0.2)
    cordova-plugin-ionic-keyboard (2.2.0)
    cordova-plugin-ionic-webview (4.2.1)
    cordova-plugin-splashscreen (5.0.3)
√ update android in 1.92s
√ Copying web assets from www to ios\App\public in 17.36s
√ Copying native bridge in 93.47ms
√ Copying capacitor.config.json in 32.36ms
\ copy  Found 4 Cordova plugins for ios
    cordova-plugin-app-version (0.1.9)
    cordova-plugin-device (2.0.3)
    cordova-plugin-nativegeocoder (3.2.2)
    phonegap-plugin-barcodescanner (8.0.1)
√ copy in 17.61s
√ Updating iOS plugins in 41.70ms
  Found 0 Capacitor plugins for ios:
  Found 4 Cordova plugins for ios
    cordova-plugin-app-version (0.1.9)
    cordova-plugin-device (2.0.3)
    cordova-plugin-nativegeocoder (3.2.2)
    phonegap-plugin-barcodescanner (8.0.1)
× Updating iOS native dependencies with "pod install" (may take several minutes):
× update ios:
[error] Error running update: 'pod' is not recognized as an internal or external command,
operable program or batch file.

√ copy in 418.71μp
√ update web in 12.27μp
Sync finished in 62.757s

1 post - 1 participant

Read full topic


Why two separate installations are required for native plugins on capacitor project

Can someone please explain me why two separate installations are required for a a plugin in a capacitor project, If I install the plugin in 1st line, why I need to install it again in 2nd line ?
npm install cordova-plugin-flashlight
npm install @ionic-native/flashlight
ionic cap sync

1 post - 1 participant

Read full topic

Open URL with InAppBrowser

Hi.

I’m trying to create a simple POC for an app that opens an URL as soon as it is started (Android). Followed the docs at https://ionicframework.com/docs/native/in-app-browser to no avail.

Not sure how to proceed beyond this line:

import { InAppBrowser } from '@ionic-native/in-app-browser/'

I’m a noob Image may be NSFW.
Clik here to view.
:pray:

1 post - 1 participant

Read full topic

Local Notifications: how to unsubscribe event?

So, I’ve been doing research on this topic and trying some workarounds with no success for some time: how are we supposed to unsubscribe events set on the local notifications plugin? The app I’m working on has to notify the user a few minutes before the time they should take their medicine. So I’m scheduling a notification and re-scheduling it when they tap the “Reschedule” action button. Inside my schedulePushNotification function, I have this, which applies to the cases where the meds should be taken every X hours (user defined).

/push-service.ts
schedulePushNotification(id, date : Date, message: string, repeat = -1){
(...)

//Handle the action button click
this.localNotifications.on('reschedule').subscribe((res) => {
            this.schedulePushNotification(id, new Date(date.getTime() +     repeat*1000), message, repeat);
});


this.localNotifications.schedule({
                id: id,
                text: message,
                trigger: {at: datetime},
                actions: [{id: 'reschedule', title: 'Schedule next dosis'}, {id: 'cancel', title: 'Cancel'}],
                foreground: true
              });
(...)

I’ve left only the relevant parts. This is the case when the notification should repeat. The variable datetime is calculated in the removed parts.

The issue is, I never unsubscribe. So everytime a notification with repetition is set, this subscribes another time, building a crescent amount of notifications to arrive in the next one - not to mention that if I click the button during the exact minute. From the documentation ( https://github.com/katzer/cordova-plugin-local-notifications ), there is supposed to be an “on” and an “un” method, but “un” does not exist. Looks like it has been removed.

Tl;dr: how do I unsubscribe events from the Local Notifications plugin now?

1 post - 1 participant

Read full topic

Ionic Cordova development workflow

Hi all,

TLDR: I’d like to know how to add Cordova to an existing Ionic project and install the build in my device.

I am trying to develop and deploy to my Android device an Ionic project using Cordova, I read the documentation but I feel the documentation for Cordova is not as good as the one for Capacitor. For example, in the section “Deploying Mobile” there’s nothing there about Cordova. Having said that, I have a few doubts:

How can I add Cordova to an existing Ionic project? I only care about Android. I think the command is cordova platform add android, but I am not entirely sure.

How do I prepare a build to run in Android Studio and install it in my device? If I’m not mistaken first I have to run npm build (like with Capacitor) but then I have no idea what follows. I found this command in the docs ionic cordova prepare android, but again, I am not sure.

I just feel the documentation is not clear enough about this process (using Cordova at least). Any help is greatly appreciated.

1 post - 1 participant

Read full topic

Single quote versus double quote in VS Code

Hi

I am using VS Code with some extensions

I tried to import a module which works fine but i always have to change the double quotes into single quotes manually.

IS : import { } from “module”;
SHOULD : import { } from ‘module’;

Where can i change from double quote to single quote ?

Best regards
Dietmar

1 post - 1 participant

Read full topic

How do i use: ionic serve --https

I am developing an ionic react app that needs Google / Facebook login. Facebook requires the site to be a https site. So i did the following:

  1. configured /etc/hosts to set localhost.mydomain.com to 127.0.0.1
  2. Obtained a real SSL cert and private key from godaddy for mydomain, and have it in my filesystem
  3. I want to use: ionic serve --https, but it is mysterious NOT DOCUMENTED anywhere. Whatever doc there is refers to --ssl (experimental), with no further instructions on how to configure and place the cert & key files

Why is this so obscure, when its such a common case? I did a search for this, and i see that a number of questions to this effect remain unanswered, or challenged with “why do you need https in localhost”

1 post - 1 participant

Read full topic

Getting CORS error in getting response from an api

Getting CORS error in getting response from API…How to solve it …

1 post - 1 participant

Read full topic


Ionic 5 auto complete

Hi Team,

How can i implement auto complete in ionic 5. We can use the

i used the below npm

npm i ion-autocomplete

i am getting below error when we build, How to resolve the issue.

ERROR in ./node_modules/ionic4-auto-complete/fesm2015/ionic4-auto-complete.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property ‘kind’ of undefined
at isAngularDecoratorMetadataExpression (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:265:35)
at checkNodeForDecorators (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:77:21)
at visitNodes (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16514:30)
at Object.forEachChild (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16740:24)
at checkNodeForDecorators (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
at visitNode (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16505:24)
at Object.forEachChild (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16635:21)
at checkNodeForDecorators (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
at visitNode (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16505:24)
at Object.forEachChild (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16703:24)
at checkNodeForDecorators (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
at visitNode (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16505:24)
at Object.forEachChild (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16692:24)
at checkNodeForDecorators (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
at visitNode (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16505:24)
at Object.forEachChild (E:\wamp64\www\rmf_mobile_app\devsonorousapp\node_modules\typescript\lib\typescript.js:16599:21)
[ERROR] An error occurred while running subprocess ng.

Thanks in Advance.

Regards,
Ramji

1 post - 1 participant

Read full topic

is not checked after router.navigate

Hello,

I am using Ionic v.6.7.0 and tried to create a two page android application. When I connect a variable (“car_id”) by ngModel to my radio-group, navigate to another page, change the variable and return to the first page, no radio-button is selected. The variable is changed correctly (proofed by printing it out). If I reset the variable by e.g. , the correct radio-button becomes selected.

home.page.html

  <ion-radio-group (ionChange)="carChangeEvent($event)"  [(ngModel)]="car_id">

                        <ion-item>
                            <ion-label>Button 1</ion-label>
                            <ion-radio slot="start" value="1"></ion-radio>
                        </ion-item>

                        <ion-item>
                            <ion-label>Button 2</ion-label>
                            <ion-radio slot="start" value="2"></ion-radio>
                        </ion-item>

                        <ion-item>
                            <ion-label>Button 3</ion-label>
                            <ion-radio slot="start" value="3"></ion-radio>
                        </ion-item>

     </ion-radio-group>

home.page.ts

export class HomePage {

    public car_id: string = "1";
    ...




    constructor(...) {...}


    carChangeEvent (event) {
        switch(this.car_id) { 
            case "1": { 
                ...do stuff by car_id...
            break; 
            } 
            case "2": {  
                ...do stuff by car_id...
            break; 
            }
            case "3": { 
                ...do stuff by car_id...
            break; 
            } 
            default: { 
                this.msg2 = "switch default";
                console.log('ERROR: Invalid car identifier: ' + event.target.value);
            break; 
            } 
        } 
    }

Is it a bug of ion-radio/ion-radio-group or am I doing a mistake?

1 post - 1 participant

Read full topic

Ludope India

Ionic email

can anyone help me i want to capture the image and send via email in ionic 5 but whenever i send via email is doing that time gmail app opens but image is not attached only path of the image is display. please help me for this,

in short capture image and send via email (same image) not showing in gmail app.

1 post - 1 participant

Read full topic

Tree Menu help

hi guys, im pretty new to ionic and react , Im trying to figure out how to get a tree Menu ( a menu with sub items) does anyone have a good example of that ? Or is there a Ionic component to handle this ? Any help much appreciated

1 post - 1 participant

Read full topic

Modify grid breakpoints ionic 5

Is there any way to customize $grid-breakpoints on ionic-5 ? I want to change the default values in order to have betters results for different desktop screens.

1 post - 1 participant

Read full topic

'Can't resolve all parameters for LoginPage' when injecting Storage

I have an app just about finished, but I need to store a few things in local storage. So, I followed https://ionicframework.com/docs/angular/storage to install ionic-storage.

Now, my page complains that it “Can’t resolve all parameters” when I have

private storage: Storage

as an injection into the constructor.

(Now, the really weird thing is the ionic build and ionic serve don’t complain about this “error”. So, maybe I should just ignore it.)

I made a test app with @ionic/storage being used, and it works fine, but my existing app has this problem. Here is the first part of the file:

import { Component } from '@angular/core';
import { Storage } from '@ionic/storage';

@Component({
  selector: 'app-login',
  templateUrl: './login.page.html',
  styleUrls: ['./login.page.scss'],
})
export class LoginPage {

  public userId = '';
  public firstName = '';
  public lastName = '';

  constructor(
    private storage: Storage,
  ) { }

My app.module.ts looks like this:

import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { IonicStorageModule } from '@ionic/storage';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { AngularFireModule } from '@angular/fire';
import { AngularFirestoreModule } from '@angular/fire/firestore';
import { firebaseConfig } from './credentials';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule, 
    IonicModule.forRoot(), 
    IonicStorageModule.forRoot(),
    AppRoutingModule,
    AngularFireModule.initializeApp(firebaseConfig),
    AngularFirestoreModule,
  ],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    BarcodeScanner,
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

Is it possible this problem is due to incompatibility between ionic/storage and the firebase stuff?

here is my setup:

$ ionic info

Ionic:

   Ionic CLI                     : 6.9.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.1.1
   @angular-devkit/build-angular : 0.901.6
   @angular-devkit/schematics    : 9.1.6
   @angular/cli                  : 9.1.6
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 2.1.0
   @capacitor/core : 2.1.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (2 plugins total)

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.0.0) : 0.3.0

System:

   Android SDK Tools : 26.1.1 (/Users/vtn2/Library/Android/sdk)
   NodeJS            : v10.16.0 (/usr/local/bin/node)
   npm               : 6.13.7
   OS                : macOS Catalina
   Xcode             : Xcode 11.5 Build version 11E608c

1 post - 1 participant

Read full topic


Can't refresh side menu after login

Ionic:

Ionic CLI : 5.4.13 (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.1.1
@angular-devkit/build-angular : 0.901.7
@angular-devkit/schematics : 9.1.6
@angular/cli : 9.1.6
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 13 other plugins)

Utility:

cordova-res : 0.9.0
native-run : 1.0.0

System:

Android SDK Tools : 26.1.1 (C:\Users\SAMSUNG\AppData\Local\Android\Sdk)
NodeJS : v12.13.1 (C:\Program Files\nodejs\node.exe)
npm : 6.12.1
OS : Windows 10

1 post - 1 participant

Read full topic

ERROR: The module 'capacitor-firebase-analytics' is an Android project without build variants, and cannot be built

I’m getting this error when i try to build my android app

  • ERROR: The module ‘capacitor-firebase-analytics’ is an Android project without build variants, and cannot be built

I haven’t changed anything since last week, when the app built fine.

I removed and added the android platform again, and it’s still doing it so i’m at a loss.

has anyone seen it before?

1 post - 1 participant

Read full topic

How to handle background mode on open modal

Hello,
I am developing a geolocation application which should record the position and send it even when it is in the background.
I use the modules

@ionic-native/background-mode

and

@ionic-native/background-geolocation

Everything seems to be working properly but when I open a modal or use the camera the background is automatically activated.

Is there any way to handle this behavior?

thanks in advance
maurizio

1 post - 1 participant

Read full topic

Firebase signInWithRedirect stop service?

Hello guys I’m trying to make a login with firebase using signInWithRedirect but after redirect all the data is lost and I can’t get the error from the try catch in the async call. Is there any way to persist this data or class even if it redirects me to other page ?

Whenever the redirect happens and I get back to my page my service constructor is called again.

  async platformSignMethod(provider: auth.AuthProvider): Promise<any> {
    if (this.platform.is('desktop')) {
      return this.angularFireAuth.signInWithPopup(provider);
    } else {
      // web but not desktop, for example mobile PWA
      return this.angularFireAuth.signInWithRedirect(provider);
    }
  }
  async socialSignIn(providerName: string, scopes?: Array<string>): Promise<any> {
    const provider = new auth.OAuthProvider(providerName);

    // add any permission scope you need
    if (scopes) {
      scopes.forEach(scope => {
        provider.addScope(scope);
      });
    }

    try {
     await this.platformSignMethod(provider);

    } catch (error) {

      if (error.code === 'auth/account-exists-with-different-credential') {
        var pendingCred = error.credential;
        var email = error.email;

        const providers = await this.angularFireAuth.fetchSignInMethodsForEmail(email);
        if (providers[0] === 'password') {
          this.promptUserForPasswordSubject.next(true);
          return;
        }

        const firstProviderMethod = providers.find(p => this.supportedSignInMethods.includes(p));
        if (!firstProviderMethod) {
          throw new Error(`Your account is linked to a provider that isn't supported.`);
        }
  
        const linkedProvider = this.getProvider(firstProviderMethod) as auth.OAuthProvider;
        linkedProvider.setCustomParameters({ login_hint: email });

        await this.platformSignMethod(linkedProvider);
        const user = await this.getUser();
        await user.linkWithCredential(pendingCred);
      }
    }
  }

1 post - 1 participant

Read full topic

Firebase: Can Ionic retrieve the uid?

Two newbie questions:
1.) Is it possible to obtain and use the client’s account uid (request.auth.uid)?
2.) If so, is it visible to the entire world or just the authorized user?

1 post - 1 participant

Read full topic

Viewing all 70882 articles
Browse latest View live