Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228529 articles
Browse latest View live

Having a nightmare with button taps

$
0
0

Thanks vasanthb, I didnt think of emitting it like an event you have. You are still using clicks though, and from my recent experience this will be slower than (touchstart)


Having a nightmare with button taps

$
0
0

That’s great!! does it work on Ionic 3 too ?

Having a nightmare with button taps

$
0
0

Yes I am using Ionic 3. I want to migrate to 4 on this project, but i’ve had a look and it’s too involved for timescales. The only reason I wanted to upgrade was in the hope of UI responsiveness on screen touches, but this this solution seems to have resolved that. In my opinion it’s as responsive as a native app now

[SOLVED] "export 'IonContent' was not found in '@ionic/angular'

$
0
0

Hi @jjdev, yes, done!

The strange thing is that a week before it worked and compiled …

Tank you!

Ionic how to define onclick button event like normal html

$
0
0

(click)="myFunction($event)" give the same error?

How send a PDF made in pdf maker in email composer - IONIC 4

$
0
0

I have the following code, where I create a pdf with pdf maker, the goal would be to be able to send that pdf through email composer of ionic 4

Is it possible to do this without having to download the pdf? When you click the submit button it automatically attaches the pdf to the email

Sorry if my English is not very good, I do not have much practice in it.

I have already tried to have the email composer take the variable fileEntry and the url fileEntry.nativeURL in the attachments part, but there is an empty file error in the email application

create pdf:

this.storageService.getBovinos().then(bois=>{
      var body = this.getBoisSelecionados(bois);
      var docDefinition = {
        content: [
          { text: 'BOIS ESCOLHIDOS', style: 'header' },
          { text: 'CLIENTE: ' + nomeU, style: 'header' },
          { text: new Date().toTimeString(), alignment: 'right' },

          { text: 'EMAIL: ' + emailU, style: 'subheader' },

          { text: 'TELEFONE: ' + telefoneU, style: 'subheader' },

          { text: 'BOIS ESCOLHIDOS', style: 'story', margin: [0, 20, 0, 20] },
          {
            table: {
              widths: ['10%', '*', '*', '*','13%','*'],
              body: body
            }
          }
        ],
        styles: {
          header: {
            fontSize: 20,
            bold: true,
          },
          subheader: {
            fontSize: 16,
            bold: true,
            margin: [0, 15, 0, 0]
          },
          story: {
            italic: true,
            alignment: 'center',
            width: '50%',
          },
          tableHeader: {
            alignment: 'center',
            bold: true,
            fontSize: 12,
            color: 'white',
            fillColor: 'black',
          }
        }
      }
      this.pdfObj = pdfMake.createPdf(docDefinition);
    });
  }

   getBoisSelecionados(bois){
      var headers = {

        top:{
            col_1:{ text: 'CODIGO', style: 'tableHeader', alignment: 'center' },
            col_2:{ text: 'NOME', style: 'tableHeader', alignment: 'center' }, 
            col_3:{ text: 'RAÇA', style: 'tableHeader', alignment: 'center' },
            col_4:{ text: 'RGD', style: 'tableHeader', alignment: 'center' },
            col_5:{ text: 'SEXO', style: 'tableHeader', alignment: 'center'},
            col_6:{ text: 'CRIADOR', style: 'tableHeader', alignment: 'center'}
        }
    }
    var rows = bois;

    var body = [];
    for (var key in headers){
        if (headers.hasOwnProperty(key)){
            var header = headers[key];
            var row = new Array();
            row.push( header.col_1 );
            row.push( header.col_2 );
            row.push( header.col_3 );
            row.push( header.col_4 );
            row.push( header.col_5 );
            row.push( header.col_6 );
            body.push(row);
        }
    }
    for (var key in rows) 
    {
        if (rows.hasOwnProperty(key))
        {
            var data = rows[key];
            var row = new Array();
            row.push( { text: data.bovinoID.toString(), alignment: 'center', fontSize: 10,} );
            row.push( { text: data.nomeBovino.toString(), alignment: 'center', fontSize: 10,} );
            row.push( { text: data.racaBovino.toString(), alignment: 'center', fontSize: 10,});
            row.push( { text: data.rgd.toString(), alignment: 'center', fontSize: 10,});
            row.push( { text: data.sexo.toString(), alignment: 'center', fontSize: 10,});
            row.push( { text: data.criador.toString(), alignment: 'center', fontSize: 10,});
            body.push(row);
        }
    }
    return body;
  }

download pdf:

if (this.plt.is('cordova')) {
      try {
        this.pdfObj.getBuffer((buffer) => {
          var blob = new Blob([buffer], { type: 'application/pdf' });

          // Save the PDF to the data Directory of our App
          try {
            this.file.writeFile(this.file.dataDirectory, 'ITENS SELECIONADOS.pdf', blob, { replace: true }).then(fileEntry => {
              console.log(fileEntry);
              console.log(fileEntry.nativeURL);
              //console.log(this.file.dataDirectory);
              // Open the PDf with the correct OS tools
              this.fileOpener.open(this.file.dataDirectory + 'ITENS SELECIONADOS.pdf', 'application/pdf');
            });
          } catch (error) {
            console.log(error);
          }
        });
      } catch (error) {
        console.log(error);
      }
    } else {
      // On a browser simply use download!
      try {
        this.pdfObj.download('ITENS SELECIONADOS.pdf');
      } catch (error) {
        console.log(error);
        this.showToast("GERAR O PDF ANTES DE REALIZAR O DOWNLOAD");
      }
    }
  }

send email Note: I removed the attachment part because of giving error

    console.log(emailU + " " + telefoneU + " " + nomeU);
    let email = {
      to: 'rafael.cmota@hotmail.com',
      subject: 'COMPRA DO APLICATIVO',
      body: 
      'INFORMAÇÕES DO USUARIO: ' + '<br><br>' +
      'Nome: ' + nomeU + '<br>' +
      'Email: ' + emailU + '<br>' +
      'Telefone: ' + telefoneU + '<br><br>'
      ,
      isHtml: true
    };
    try {
      this.emailComposer.open(email);
    } catch (error) {
      console.log(error);
    }
  }

Change ion-input type. Show/Hide password directive/component

$
0
0

Simple and neat solution. Thank you

Unable to navigate back

$
0
0

Hi, am unable to navigate back from chat details(Login->Chat Screen->Chat details). It is showing nothing on back click. It is showing error as ERROR Error: Uncaught (in promise): navigation stack needs at least one root page.

this.platform.registerBackButtonAction(() => {
     
        this.navCtrl.pop();
     
   
  });

So please help me how to solve


Ionic 4 this.platform.is returning wrong value

$
0
0

Yes, same issue here, after run once

ionic serve --devapp

quitted the serve process, and then launched:

ionic serve

served

(3) ["android", "mobile", "mobileweb"]

in broswer.


Moreover, all github related issues are now closed without solutions, patch or upgrades.


Now trying to upgrade ionic from 5.0 to 5.2 latest and see it would help.

[SOLVED] "export 'IonContent' was not found in '@ionic/angular'

$
0
0

Looks like that change wasn’t added until 4.0.0-beta.18

[SOLVED] "export 'IonContent' was not found in '@ionic/angular'

$
0
0

I change version to 4.6, and done!

Is it possible use "await" with Observables?

$
0
0

Hi,
is it possible to use “await” with Observables?

I have to call a web service and when the server sends a response I have to execute other actions.

I’m using HttpClient (get and post) that returns an Observable when used.

Is this correct?

const response = await this.httpClient.post(...)
<other actions after response has been received>

Thank you

cld

Is it possible use "await" with Observables?

In app purchase 2 BUILD FAILED on task app:compileDebugAidl'

$
0
0

After adding the plugin, I can’t build the app anymore.
If I remove it, it build without any trouble.
For what I found, it might be my Jdk/sdk/java variables, I’m a bit stuck, if anyone can help me, that would be great !

system info

Ionic:
Ionic CLI : 5.2.0
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.2

Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 20 other plugins)

Utility:
cordova-res : 0.5.1
native-run : not installed

System:
NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 7

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
android: Command failed with exit code ENOENT Error output:
‘android’ n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Gradle: installed E:\Gradle\gradle-5.4.1\bin\gradle
Some of requirements check failed

"@ionic-native/in-app-purchase-2": "^4.20.0",
"cc.fovea.cordova.purchase": "^8.1.1",

Observed behavior

Task :app:preBuild UP-TO-DATE
Task :CordovaLib:preBuild UP-TO-DATE
Task :CordovaLib:preDebugBuild UP-TO-DATE
Task :CordovaLib:checkDebugManifest UP-TO-DATE
Task :CordovaLib:processDebugManifest UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :CordovaLib:compileDebugAidl NO-SOURCE
Task :app:compileDebugAidl FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:compileDebugAidl’.

java.io.IOException: com.android.ide.common.process.ProcessException: Error wh
ile executing process C:\Users\AppData\Local\Android\sdk\build-to
ols\29.0.0\aidl.exe with arguments {-pC:\Users\AppData\Local\Andr
oid\sdk\platforms\android-28\framework.aidl -oE:\Appname\platforms\android\app
build\generated\aidl_source_output_dir\debug\compileDebugAidl\out -IE:\Appname
platforms\android\app\src\debug\aidl -IE:\Appname\platforms\android\app\src\mai
n\aidl -IE:\Appname\platforms\android\CordovaLib\build\intermediates\aidl_parce
lable\debug\compileDebugAidl\out -IC:\Users.gradle\caches\transf
orms-1\files-1.1\support-media-compat-27.0.2.aar\a39188\aidl -IC:\Users
.gradle\caches\transforms-1\files-1.1\support-compat-27.0.2.aar\ace5d\aidl -dC:\Users\AppDa
ta\Local\Temp\aidl2934.d E:\Appname\platforms\android\app\src\ma
in\aidl\com\android\vending\billing\IInAppBillingService.aidl}

BUILD FAILED in 2s
4 actionable tasks: 1 executed, 3 up-to-date
E:\Appname\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

Even when I create a new project with:

ionic start test blank
cordova plugin add cc.fovea.cordova.purchase
npm install @ionic-native/in-app-purchase-2

I still got the issue

Ionic Android 5.1.1 SyntaxError: Use of const in strict mode

$
0
0

The Solution for me was that I had some plugin that stop the cordova platform add to adding all the necessary plugin. So removing that plugin solved my problem. (this was the in-app-purchase for me)

there was only a little “warn” on the console without anything else


Is it possible use "await" with Observables?

$
0
0

Something like this?

await this.httpclient
.post()
.toPromise()

I’ll try. Thank you.

cld

Is ionic framework good enough to make a taxi app with booking and gps tracking?

$
0
0

Hi There,

If you are going to launch a taxi booking app with GPS tracking option? According to me, it’s very simple and easy to create, Are you already have a built and want to add some extra features like GPS option, then it will be easy with the mobile app solution providers like SpotnRides. They will guide you technically and help you with the customization.

Error: ENOENT: no such file or directory, open 'platforms/android/app/build/outputs/apk/debug/app-debug.apk'

Is it possible use "await" with Observables?

Customize svg ionicon via css

Viewing all 228529 articles
Browse latest View live


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