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

Ionic Deploy does not use compression when download sources

$
0
0

@ptminder wrote:

We use cordova-plugin-ionic v5.2.7 for our application with UPDATE_METHOD = auto which do app sources update with the splash screen loading.

But we noticed that update works very slow and splash screen may stuck for a minute or more for initial app loading. After debug we found that Ionic do each file downloading instead of downloading www.zip one compressed file and then extract/unzip it.

Current output example:
File Transfer Finished with response code 200

File Transfer Finished with response code 200
downloaded batch 1 of 20 downloads. Done downloading 10 of 426 files
File Transfer Finished with response code 200

File Transfer Finished with response code 200
downloaded batch 2 of 20 downloads. Done downloading 20 of 426 files

etc it download each file, 426 requests in total and of course it works slow.

So my question is - how we can enable compression for our application to download sources zipped? Is there some setting to turn compression on? I did not find anything in documentation…

Posts: 1

Participants: 1

Read full topic


Ionic 4, mySQL and Node.js

$
0
0

@tsenre wrote:

I am using mySQL for my database (remote server). I am trying to make restful api using Node.js (still new). I am able to retrieve the data value from mySQL on my console terminal. However, I need to display the data value on my ionic application. Are there any tutorials or reference for me. Thank you.

Posts: 1

Participants: 1

Read full topic

THREAD WARNING: Plugin should use a background thread

$
0
0

@Kyrax80 wrote:

Hello,

I am getting the following warning starting from iPhone 5 and iOS 10.3.3:

**THREAD WARNING: ['TTS'] took '638.905029' ms. Plugin should use a background thread.**

It’s a real time App (a GPS) and I am using other plugins which are giving the same warnings and the App in iPhone 5 is really slow compared to an iPhone X. You might think this is normal of course because the iPhone X is much better, but the App is also working much faster on an Android 7 which isn’t much newer than iPhone 5.

How can I get rid of this and make the plugins run in background? Why am I not getting these warnings on Android or iPhone X?

Thanks!

Posts: 1

Participants: 1

Read full topic

No ripple effect when click on button programatically

$
0
0

@annmirosh wrote:

Hi,

I have an ion-button on my view. I want to click this button programmatically.

<ion-button size="small" id="myBtn" (click)='sayHi()'>Say Hi</ion-button>

If I do:

document.getElementById('myBtn').click();

it works, but there is no ripple visual effect. Is it possible to click a button with having this effect?

Posts: 1

Participants: 1

Read full topic

cors origin restriction WordPress WooCommerce

$
0
0

@obaidey wrote:

I have a WordPress website with WooCommerce plugin and I’m trying to load that website into a mobile application with the ionic4 framework, my app work with no problems on Andriod but I got this error when I run my app on the iOS device

Origin http://localhost:8100 is not allowed by Access-Control-Allow-Origin.
[Error] Fetch API cannot load http://www.mywebsite.com/wp-json/wc/v3/products?******** due to access

my problem is I can’t figure how to set CORS into server-side.

below is my .htaccess file code

RewriteEngine On                  
RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L] 
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]
</IfModule>

# END WordPress

I’m asking if there any way to set the Access-Control-Allow-Origin in my case to solve this problem, is there any missing line of code, or should I edit any other file in my WordPress file to set the headers into the right way

Posts: 1

Participants: 1

Read full topic

How much time will it take to publish stable release of @ionic/vue and @ionic/core ?

$
0
0

@sosuzitor wrote:

I’m waiting for the stable release of @ionic/vue & @ionic/core. I’m really excited. How much time will it take to publish stable release without limitation?

Posts: 1

Participants: 1

Read full topic

Not able to create ios app

$
0
0

@larryknoxweb wrote:

Please help…

I have built an app and I am trying to test it on an iPhone but I am getting an error message.

I am entering this code on cli inside the apps directory:

ionic cordova platform add ios
and
ionic cordova build ios

Then I get this error message:

No need to update build settings for launch storyboard support.
Set IPHONEOS_DEPLOYMENT_TARGET to "11.0".
Did not update build settings for launch storyboard support.
iOS Product Name has not changed (still "Commit2")
Updating icons at platforms/ios/Commit2/Images.xcassets/AppIcon.appiconset/
Updating splash screens at platforms/ios/Commit2/Images.xcassets/LaunchImage.launchimage/
Updating launch storyboard images at platforms/ios/Commit2/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
CordovaError: Promise rejected with non-error: "xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\n"
    at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
[ERROR] An error occurred while running subprocess cordova.
        
        cordova build ios --verbose exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more 
        information.
  ionic:utils-process onBeforeExit handler: process.exit received +0ms
  ionic:utils-process onBeforeExit handler: running 2 functions +0ms
  ionic:utils-process onBeforeExit handler: exiting (exit code 1) +26ms

Posts: 1

Participants: 1

Read full topic

I want implement push notification using ionic 3 and firebase. I am using cordova-plugin-fcm but I am getting the token as on getToken()

$
0
0

@sanim10 wrote:

I want to implement push notification using ionic 3 and firebase. I am using cordova-plugin-fcm but I am getting the token as on getToken(). I have already setup the project on firebase and downloaded the google services. When I used this plugin a year back everything was working perfect. Now when I am using it on my new project I am getting null as token. Is the getToken() depredicated?? Please help me on this one. I have installed the fcm plugin as we as @ionic-native/fcm. According to the new documentation the plugin in now renamed as cordova-plugin-fcm-with-dependecy-updated, I have tried this too but the result is same. I cant use console as native plugin are already installed.Please help!!!

my component.ts

this.fcm.subscribeToTopic('all');
  alert('here');
  this.fcm.getToken().then(token => {
    alert(token);
    localStorage.setItem('token', token);
    alert(token);
  });
  this.fcm.onNotification().subscribe(data =>{
    alert('Your order as been assigned.Please reload the page')
    if(data.wasTapped){
      //alert('background');
    } else {
      //alert('foreground');
    }
  });
  this.fcm.onTokenRefresh().subscribe(token => {
    //alert('token')
  });

Posts: 1

Participants: 1

Read full topic


Ionic 3: How make ionViewWillEnter only when back button pressed?

$
0
0

@thamaraiselvam wrote:

I have read Navigating Lifecycle Events

My use case here is. I had to refresh the content on page load as well as when back button pressed from another page.

ionViewDidLoad(){
   this.getProjects();
}

ionViewWillEnter(){
   this.getProjects();
}

this works fine but of course ionViewWillEnter runs on first page load as well. so two api requests triggered (ionViewDidLoad + ionViewWillEnter). Is there any way to restrict them like setting flag or something?

Posts: 1

Participants: 1

Read full topic

How to delete files?

$
0
0

@ellite1 wrote:

So, I’ve developed an App that records an Audio then display it to the user on a list. The audio has 2 buttons, play and remove, somehow the function removeAudio isn’t working. Am I doing something wrong?

  playAudio(file,idx) {
    if (this.platform.is('ios')) {
      this.filePath = this.file.documentsDirectory.replace(/file:\/\//g, '') + file;
       this.audio = this.media.create(this.filePath);

    } else if (this.platform.is('android')) {
      this.filePath = this.file.externalDataDirectory.replace(/file:\/\//g, '') + file;
        this.audio = this.media.create(this.filePath);
    }
    this.audio.play();
    this.audio.setVolume(0.8);
  }

  deleteAudio(){
    if (this.platform.is('ios')) {
    this.audio = this.file.removeFile(this.filePath, this.fileName);

   } else if (this.platform.is('android')) { 
    this.audio = this.file.removeFile(this.filePath, this.fileName);
   }
  }

Posts: 1

Participants: 1

Read full topic

Ionic4: Unit testing a component

$
0
0

@VictorNorman wrote:

I have created a new project and created a new component called “simple” in components/simple. So, I now have components/simple/simple.component.spec.ts.

I would expect that if I run npm test it would pass, right?

But, simple.component.spec.ts looks like this:

import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SimplePage } from './simple.page';

describe('SimplePage', () => {
  let component: SimplePage;
  let fixture: ComponentFixture<SimplePage>;

  beforeEach(async(() => {
  ... etc ...

And, there is no file called simple.page.ts. There is, of course, a simple.component.ts.

So, the test fails.

Is this by design? If so, how do I fix this? What goes in simple.page.ts?

Thanks.

Vic

Posts: 1

Participants: 1

Read full topic

How to connect vpn in ionic

$
0
0

@akkari97 wrote:

Hi i am new to vpn application, can anybody suggest me how to add vpn connection in ionic
provide one simple example vpn application.

Thank you…!

Posts: 1

Participants: 1

Read full topic

Show api json response data in table

$
0
0

@B3nvo wrote:

Hi,

I want to show the response data i get from the api in a table. I use a ng-repeat for this, but strangly enough i keep getting an undefined error, but if i console.log the entire variable i see my data.

.ts

export class HoursPage implements OnInit {
    data:any = {};
    table: any[] = [];

    constructor(public http: Http, public navCtrl: NavController, private menu: MenuController) {
        this.data.User = 320
        this.data.Token = asd2cb345nx93vnnv94vn
        this.data.expire = 14-03-2019 23:59:59
        this.table;
    }
this.http.get('https://foo/foo/app/index.php?type='+option+'&user_id='+this.data.User+'&token='+this.data.Token, requestOptions)
        .pipe(map(res => res.json()))
        .subscribe(data => {
            for (let i = 0; i < data.length; i++) {
                this.table.push(data[i]);
            }
            //console.log(this.table);

.html

<div class="row" ng-repeat="x in table; let i = index"> 

        <div class="col">{{x.id}}</div> 
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col"></div>
        <div class="col">make checkbox</div>

</div>

Json data

0: {id: "30123", date_created: "2019-01-28 11:33:29", created_by_user_id: "390",…}
created_by_user_id: "3920"
created_by_user_name: "foo bar"
created_for_user_id: "3920"
created_for_user_name: "foo bar"
date_created: "2019-01-28 11:33:29"
description: ""
end: "17:00:00"
incoming_date: "2019-01-28"
incoming_type_description: "foo"
incoming_type_id: "3"
not_here: "0"
id: "3015523"
breakminutes: "30"
start: "08:30:00"
total_num_minutes: "480"
1: {id: "3015567", date_created: "2019-01-29 16:44:09", created_by_user_id: "390",…}
2: {id: "3025530", date_created: "2019-01-31 08:38:16", created_by_user_id: "390",…}
3: {id: "3025531", date_created: "2019-01-31 08:38:54", created_by_user_id: "390",…}
4: {id: "3025574", date_created: "2019-02-01 16:44:44", created_by_user_id: "390",…}

i have looked all over but nothing seems to work.

i keep getting the same console error on the HTML output

ERROR TypeError: Cannot read property 'id' of undefined
    at Object.eval [as updateRenderer] (HoursPage.html:50)
    at Object.debugUpdateRenderer [as updateRenderer] (core.js:23927)
    at checkAndUpdateView (core.js:23302)
    at callViewAction (core.js:23538)
    at execComponentViewsAction (core.js:23480)
    at checkAndUpdateView (core.js:23303)
    at callViewAction (core.js:23538)
    at execEmbeddedViewsAction (core.js:23501)
    at checkAndUpdateView (core.js:23298)
    at callViewAction (core.js:23538)

i want all json data to be automatically filled in the table.

Posts: 1

Participants: 1

Read full topic

Ionic 4 need to crop gallery image in rectangle and display it

$
0
0

@manojpatel0217 wrote:

Hello,

I am trying to crop my gallery image for my app banner (Rectangle one).
I tried cropper.js but is don’t work for me.

Dose anyone has any idea what will work or any other plugin that i can try?

Thanks

Posts: 1

Participants: 1

Read full topic

Detect horizontal scroll on a div

$
0
0

@Hanzo wrote:

Hi,

Hi I am trying when the user scrolls horizontally inside a div. This is my code:

<ion-header no-border no-shadow>
  <ion-navbar class="home" hideBackButton="true" no-border no-shadow>
    <ion-buttons left navPop>
      <button ion-button icon-only>
        <img src="assets/icon/ic-back.svg">
      </button>
    </ion-buttons>
    <ion-title>{{ title }}</ion-title>
    
  </ion-navbar>
  <div class="header_mask_front"></div>
  <div class="sections" (scroll)="scrollTest($event)">
    <ion-segment mode="md" [(ngModel)]="sections" color="primary">
    ...
    </ion-segment>
  </div>
</ion-header>
  scrollTest(ev:Event){
    console.warn('scroll')
  }

My problem is that the scroll event is not fired. What am I doing wrong?

Ionic 3.9.2

thanks

Posts: 1

Participants: 1

Read full topic


Google maps + uiGmapgoogle-maps

$
0
0

@dblanco wrote:

Hi, a few years ago I have implemented in an app the use of google maps, using uiGmapgoogle-maps.

Currently, it is still working, but it does not show any images, the “icons” of google maps.

The error it shows is:
Content Security Policy: Las opciones para esta página han bloqueado la carga de un recurso en data:image/svg+xml,%3Csvg%20xmlns%3D%22h… (default-src).

OR

Refused to load the image 'data:image/svg+xml,...' because it violates the following Content Security Policy directive: "default-src *". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

Attached image to be understood.

As a first step to solve it, update the google maps version:

		uiGmapGoogleMapApiProvider.configure({
			key: 'key',
			v: '3.34', 
			libraries: 'weather,geometry,visualization',
			language: 'es'
		});

Before it was 3.20. But it is not solved.

I use these versions:
Ionic: 1.2.4
angular-google-maps 2.3.2
Lo-Dash 2.4.1
angular-simple-logger: It does not say version, the local implementation date is 2016-04-14

Any ideas on how to solve it? Did someone experience something similar?
Thanks

Posts: 1

Participants: 1

Read full topic

Ionic Hybrid Android Mobile App - Email and SMS Intents

$
0
0

@gecasti wrote:

I am working on a hybrid Android mobile app using NodeJS v11.9.0, npm v6.5.0, ionic v3.19.0, cordova 8.0.0, and Android Studio 3.2.0

  1. When i use below ionic3 code send sms email id not working
sendMessage(){
    var options:{
        replaceLineBreaks:true,
        android:{
            intent: 'INTENT'
        }
    }
    if(this.sms) {
        this.sms.send("0871357817", "Test Message",options).then((succes) => {
            alert('Message sent successfully');
        }, (error) => {
            alert(JSON.stringify(error));
        });
    }
}


have installed below plugin - https://ionicframework.com/docs/native/sms 

added the required permissions 


 



2019-03-14 19:55:04.469 10891-10891/io.ionic.starter D/SystemWebChromeClient: ng:///AppModule/MonitorPage.ngfactory.js: Line 23 : ERROR
2019-03-14 19:55:04.470 10891-10891/io.ionic.starter I/chromium: [INFO:CONSOLE(23)] "ERROR", source: ng:///AppModule/MonitorPage.ngfactory.js (23)
2019-03-14 19:55:04.470 3706-4938/? D/WindowManager: adjustSystemUiVisibilityLw : vis= 0x2608
2019-03-14 19:55:04.471 10891-10891/io.ionic.starter D/SystemWebChromeClient: ng:///AppModule/MonitorPage.ngfactory.js: Line 23 : ERROR CONTEXT
2019-03-14 19:55:04.471 10891-10891/io.ionic.starter I/chromium: [INFO:CONSOLE(23)] "ERROR CONTEXT", source: ng:///AppModule/MonitorPage.ngfactory.js (23) 
again and again same issues 

I know how to do this with Native Android but I need help with Ionic

Posts: 1

Participants: 1

Read full topic

How to edit existing ionic project?

$
0
0

@bedanta1998 wrote:

I downloaded an ionic 3 app project from Codecaynon. But I’m unable to run the project as after runningionic serve command, it gives the error Looks like @ionic/app-scripts isn't installed in this project. This package is required for ionic serve in ionic/angular 4 projects.

Posts: 1

Participants: 1

Read full topic

iPhone XS Max Screen Size Issue

$
0
0

@IndyJones72 wrote:

Splash screen works just fine, but then we see this:

57%20PM

Here’s the meta on the index page:

<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  

We unloaded and then reloaded the latest version of Cordova splash-screen (even though this isn’t splash screen related) but still seem to have the issue. Anything I’m perhaps forgetting?

Posts: 1

Participants: 1

Read full topic

Ionic v3 and braintree Integration (IOS)

$
0
0

@gentlemanoi wrote:

Hi guys.

Is anybody here tried using integrating braintree dropin?

Everything works fine in Android but not in IOS. Please have a look with my code below:

this.http.setDataSerializer('json');
      this.http.post('GET_BRAINTREE_TOKEN_URL', {customer_id: customer_id}, headers).then((response) => {
        braintree.dropin.create({
          authorization: response.data,
          container: '#dropin-container'
        }, (createErr, instance) => {
          button.addEventListener('click', () => {
            instance.requestPaymentMethod((err, payload) => {
                this.http.post('BRAINTREE_CHECKOUT_URL', {
                payment_method_nonce: payload.nonce
              }, headers).then((resp) => {

              });
            });
          });
        });
      });

This braintree loading will show in IOS but not the dropin UI. It will automatically remove the loading UI and then nothing happens.

Can anyone of you here help me please? Thanks

Posts: 1

Participants: 1

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>