Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 49293 articles
Browse latest View live

How to take text of a page

$
0
0

@CoalaDrogado wrote:

I have to make a Android application for my business but i have a question how can i take a text of one site in the web ? Can use ionic to browse in console of this page and take the text or have one API to do this ?

Sorry for my bad English.

Posts: 3

Participants: 3

Read full topic


toString() function does not exist?

Http Post request to Woocommerce API creates empty order (no data)

$
0
0

@geo3433 wrote:

I post this data to Woocommerce API for creating a new order:

 orderData = {
       "payment_method": "bacs",
   "payment_method_title": "Direct Bank Transfer",
  "set_paid": true,
  "billing": {
    "first_name": "John",
    "last_name": "Doe",
    "address_1": "969 Market",
    "address_2": "",
    "city": "San Francisco",
    "state": "CA",
    "postcode": "94103",
    "country": "US",
    "email": "john.doe@example.com",
    "phone": "(555) 555-5555"
  },
  "shipping": {
    "first_name": "John",
    "last_name": "Doe",
    "address_1": "969 Market",
    "address_2": "",
    "city": "San Francisco",
    "state": "CA",
    "postcode": "94103",
    "country": "US"
  },
  "line_items": [
    {
      "product_id": 7,
      "quantity": 1
    }
  ],
  "shipping_lines": [
    {
      "method_id": "flat_rate",
      "method_title": "Flat Rate",
      "total": 7
    }
  ]
}

My http post request is like that:

his.http.post('API_URL?consumer_key=ck_&consumer_secret=cs_',
    JSON.stringify(orderData), {
      headers: { 'Content-Type': 'application/json'
    }
    }).subscribe(response => { newOrderData=response; console.log(newOrderData);});

A new order is created but the data of the body is not posted. I read about this issue on Stackoverflow and they claimed that it happens due to the lack of the header, which I include in my request.

Posts: 1

Participants: 1

Read full topic

Disable ctrl + mousewheel zoom in Ionic Windows Build

$
0
0

@iamchicken wrote:

Hi Ionic Team,

When using ionic cordova build windows, and when the app is running then i click ctrl+mousewheel it zoom and out the text become larger. How can disable this in ionic cordova build windows. I did try the other options like below examples but it did’nt work.

<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">

aslo using event event.preventDefault(); didnt work.

I can’t find a way to do this.
Thanks!

Posts: 1

Participants: 1

Read full topic

Apple Rejection

$
0
0

@rijink7 wrote:

I received this error when I tried for app submission: ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.

Cordova-plugin-ionic-webview - 2…4.1 is used (This plugin defaults to using WKWebView on iOS )

Posts: 1

Participants: 1

Read full topic

Formulário Ionic

$
0
0

@davsantos wrote:

Fala galera, uma dúvida.
Como posso fazer pra, em um formulário no Ionic, passar algo como uma entidade, dentro de outra entidade ?

Explicando melhor, tenho uma API com uma classe Cliente, e dentro dessa classe Cliente tem uma outra classe Endereço, guardando informações como rua, bairro, cep, etc

Eu não estou conseguindo ver uma forma de passar essa informação no Front-end.

O JSON seria algo mais ou menos assim

Exemplo :
{
“nome” : “Andre”,
“idade” : “15”,
“endereco”: [{
“rua” : “Aleatoria”,
“bairro” : “Qualquer”
}]
}

A pergunta é, como posso fazer isso no FormGroup do Ionic ?

Posts: 1

Participants: 1

Read full topic

IOS - Clear app secure storage after uninstalling the app

$
0
0

@sivaramakrishnan77 wrote:

IOS - not able to clear app secure storage data after uninstalling the app.
Is it possible to capture a event when the app is uninstalled?

Posts: 1

Participants: 1

Read full topic

Icon above text in ion-button

$
0
0

@fagerli93 wrote:

Hi all.

I’d like to have a ion-button with an icon and a text, but I cannot seem to get a way where I can get the icon above the text, much like a tab button.
In older versions of Ionic you could alter .inner-button { flex-direction: column } but this is no longer possible with shadow dom.

Any ideas?

Best regards,
Simon

Posts: 2

Participants: 2

Read full topic


Ionic 4 navigation stack

$
0
0

@abhissharma wrote:

Is there a way to modify the navigation stack of the application?

To be precise, if the current navigation state is
Page 1 --> Page 2 --> Page 3 --> Page 4

I want to remove Page 2 and Page 3 and modify the state to
Page 1 --> Page 4

Posts: 1

Participants: 1

Read full topic

Ionic v1 how to run gulp when live reloadinig

$
0
0

@cumibulat wrote:

ionic info :

Ionic CLI         : 5.2.4 (C:\Users\Phincon\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework   : ionic1 1.3.1
   @ionic/v1-toolkit : 1.0.22

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 7.1.4
   Cordova Plugins   : no whitelisted plugins (6 plugins total)

Utility:

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

System:

   Android SDK Tools : 26.1.1 (C:\Users\Phincon\AppData\Local\Android\Sdk)
   NodeJS            : v10.16.2 (C:\Program Files\nodejs\node.exe)
   npm               : 6.10.3
   OS                : Windows 10

how can i run gulp automatically when ionic serve / live reloading ?
i have add this config

"scripts": { 
    "ionic:serve:before" : "gulp" ,
    "ionic:build:before" : "gulp"
  }

at my package.json file, and it do run gulp before finish serve. But when i change any html file and trigger the live reloading, the gulp not triggered anymore. I also tried to add :

gulp.task('ionic:serve:before', gulp.series('default'),
function (done) {
  done();
});

in my gulpfile.js but its not working too. Please throw some enlightment for anyone who ever encountered this case before. Thanks in advance…

Posts: 1

Participants: 1

Read full topic

Can I verify the device screen lock

$
0
0

@siva0409 wrote:

I want to verify the device screen lock from the app and then I want to show some personal details, I don’t want to use any API for this verification.

Is there a way to verify it. screen lock may be PIN, Pattern or Password.

Any quick suggestions may help me.
Thank you.

Posts: 1

Participants: 1

Read full topic

I have built an ionic angular app it's getting build but once deployed in S3 getting issue

$
0
0

@krypton-01 wrote:

I have built an angular ionic app. I have build the code through ionic build --prod command and once deployed in S3 bucket I am getting an issue in console as Uncaught TypeError: Cannot read property ‘0’ of undefined main-es2015.76405d09ff6e059ed868.js:1.
I have built a web app not android app.
And not using cordova.

Posts: 1

Participants: 1

Read full topic

Html5 audio from url stops

$
0
0

@plc wrote:

Hi,

I created a mp3 player in my Ionic application. On brower it works fine, but when I build iOS application and install it on phone something strange happens. I click play button, audio isn’t playing, I pause the player, then play it again, one second of recoring playing and stops again, I pause player again and again press play, next second is playing. So I have to pause and play over and over again.

My audio player is crated in component property:

public audioPlayer: HTMLAudioElement = new Audio();

Audio source is loaded in ngOnInit:

this.audioPlayer.src = this.path;

Play and stop buttons trigger the following actions:

    play() {
        this.audioPlayer.play();
    }

    stop() {
        this.audioPlayer.pause();
    }

I tried with element controlled by code - the same result.
Audio is loaded from server, it’s mp3 and url uses htts://.

What can I do to make it play on first “play” button click?

Posts: 1

Participants: 1

Read full topic

SCSS Variables Not Working (Ionic-v4)

$
0
0

@egag21 wrote:

I have a project that won’t let me implement variables. For example, text with this paragraph tag will not be red:

// CSS
:root {
  --text-color: red;
}

p {
  color: var(--text-color);
}

I have other projects where CSS variables work. When I copy and paste from where they’re broken into something like CodePen the variables work fine. Are there settings that would disable variables like these?

Posts: 1

Participants: 1

Read full topic

Ion-img set default image

$
0
0

@dipankar123 wrote:

Hi guys,
how to set a default image before image is loaded inside ion-image tag
i have tried this code below.

 <ion-img [src]="item.documentpath || '../../assets/imgs/default-img.png'" alt='Error Loading Image'></ion-img>

but not working
please help

thanks

Posts: 1

Participants: 1

Read full topic


How to focus alerts inputs and submit on keyboard enter. (Ionic v4)

$
0
0

@Dovel wrote:

In Ionic 3 the alert inputs works a bit different. Since Ionic 4 the input is not focused anymore and not submitted on keyboard enter. How to do this in Ionic 4?
It’s a bit annoying for the user to focus the input and hide the keyboard before he can submit the value. Because the ok-button is hidden / behind the keyboard overlay.

Posts: 1

Participants: 1

Read full topic

How to prevent map scrolling when scroling ion-list?

$
0
0

@rageshantony wrote:

I am developing a hotel booking app for mobile and desktop

this this the screenshot

my problem this when I hover mouse over the card list and scroll using my scroll wheel the whole page is scrolling

How to prevent this ?

I tried but it not working

also gave slot=“fixed” in mapelement div , but map stop loading

also gave scroll-“false” in mapelement div , but still map scrolls

My code

<ion-header>
    <ion-toolbar color="primary">
      <ion-buttons slot="start">
          <ion-menu-button autoHide="false"></ion-menu-button>
        </ion-buttons>
      <ion-title>Hotel Location</ion-title>
    </ion-toolbar>
 
</ion-header>
<ion-content scroll="false" slot="fixed">


    <ion-grid  > 
      <ion-row>
          <ion-col size="2">
              <ion-list   >
                <ion-item  *ngFor="let hotel of hotels">
                  <ion-card >
                    <ion-img src="{{hotel.image}}" ></ion-img>
                    <ion-card-header>
                        <ion-card-title>{{hotel.hotelName}}</ion-card-title>
                      <ion-card-subtitle>Chennai</ion-card-subtitle>
                    </ion-card-header>
                    <ion-card-content> 
                       
                        <ion-item>
                            <ion-label>
                              <h2>Economy</h2>
                              <h3>2 Beds | 0 Balcony</h3>
                              <p>Listen, I've had a pretty messed up day...</p>
                            </ion-label>
                            <ion-badge style="text-align: end" color="danger" slot="end">$100</ion-badge>
                
                          </ion-item>
                               
                    </ion-card-content>
              
              </ion-card>
              </ion-item>
                </ion-list>
          </ion-col>
        <ion-col scroll="false"  size="10">
            <div  #mapElement class="map"></div>

        </ion-col>
       
      </ion-row>
    </ion-grid>
  


     
</ion-content>

.map {
    height: 95%;
  }

  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }
export class ListHotelDesktopPage implements OnInit, AfterViewInit {
  latitude: any;
  longitude: any;
  @ViewChild('mapElement',null) mapNativeElement: ElementRef;
  hotels: any;
  map: any;

  

  constructor(private router: Router,private httpN: HTTP,http: HttpClient,private geolocation: Geolocation,public modalCtrl : ModalController,public ngZone: NgZone) {
   
    const url: string = 'https://jsonbase.com/ragesh/getHotels';

    http.get(url).subscribe((data: any) => {
      console.log('get', data.hotels);
      this.hotels = data.hotels;
    }, (error) => {
      console.log('get - ERROR', error);
    });

  
  }
    
//------------------


ngOnInit() {
}

ngAfterViewInit(): void {
  this.geolocation.getCurrentPosition().then((resp) => {
    this.latitude = resp.coords.latitude;
    this.longitude = resp.coords.longitude;
    this.map = new google.maps.Map(this.mapNativeElement.nativeElement, {
      center: {lat: -34.397, lng: 150.644},
      zoom: 6
    });
    
    const pos = {
      lat: this.latitude,
      lng: this.longitude
    };

   

   this.map.setCenter(pos);
  }).catch((error) => {
    console.log('Error getting location', error);
  });
}
async openModal(){
  const modal = await this.modalCtrl.create({
    component: ModalPagePage
  });
  return await modal.present();
}



markMap(hotel: any)
{
  //alert(name);


  const pos = {
    lat: hotel.hotelLatLng.lat,
    lng: hotel.hotelLatLng.lng
  };
  const icon = {
    url: 'assets/icon/favicon.png', // image url
    scaledSize: new google.maps.Size(50, 50), // scaled size
  };

  const marker = new google.maps.Marker({
    position: pos, //marker position
    map: this.map, //map already created
    title: hotel.hotelName,
    icon: icon //custom image
  });
  
  const contentString = '<div id="content" style="height: 100%;margin: 10;padding: 10;" >' +

'<h1 id="firstHeading" class="firstHeading">'+hotel.hotelName+'</h1>' +
'<div id="bodyContent" style="height: 100%;margin: 10;padding: 10;">' +
'<img src="'+hotel.image+'" width="200">' +
'<ion-button color="primary" id = "'+hotel.hotelName+'">BOOK Now</ion-button> '+
'<p> '+hotel.hotelDescription+' </p>' +
'</div>' +
'</div>';

let infoWindow2 = new google.maps.InfoWindow({
  content : contentString
  });
  google.maps.event.addListenerOnce(infoWindow2, 'domready', () => {
  document.getElementById(hotel.hotelName).addEventListener('click', () => {
 // this.openModal();
 this.router.navigateByUrl('/hotel-details');
  });
  });

marker.addListener('click', function() {
  infoWindow2.open(this.map, marker);

});
}
   
}

Please help me make only card list scrollable

Posts: 1

Participants: 1

Read full topic

IONIC websocket

$
0
0

@wahibbel wrote:

Hello everyone, I’m in a big problem :frowning:
I’m searching for some help in IONIC WebSocket client.
I am working on a project and I have to send notification from WebSocket spring boot server to ionic client, I tried a lot of examples, but no one is working, to be clear, I didn’t find an ionic web socket example so I tried to transform angular example to ionic, but it doesn’t work with me.
I’m asking if anyone had an experience with this or anyone can help me I’ll be very thankful.
have a nice day :).

Posts: 1

Participants: 1

Read full topic

Ion-toggle freezes app with ngModel and ionChange

$
0
0

@BrentAshWilliams wrote:

Hello,

I am using the latest version of ionic 4.

I am trying to use ion-toggle in the following way:

    <ion-item>
        <ion-label>Test</ion-label>
      <ion-toggle color="warning" [(ngModel)]="testVar" (ionChange)="toggleEvent($event)"></ion-toggle>
    </ion-item>

When I launch the app (testing in chrome browser) with ionic serve if I try to toggle it will do the first one, but then the entire chrome brower tab running the app freezes up.

If I use the ngModel but remove the ionChange it works continually.

If I use ionChange and remove ngModel it works continually.

Both together do not work.

Any ideas?

Thanks

Posts: 1

Participants: 1

Read full topic

In App Browser | BrowserTab tryouts

$
0
0

@mtnoronha7 wrote:

Hello.

Installed and trying to use InAppBrowser (also tried BrowserTab),
but, nothing happens… Just no error, no success… No changes on the app… lol

Running on Genymotion, with chrome/inspect to debug.


//Imports
import { BrowserTab } from '@ionic-native/browser-tab/ngx'
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'

//Declarations
@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
  providers: [BrowserTab, InAppBrowser]
})
export class HomePage {

/html
<button ion-button (click)="open(carnet.moipBilletUri)">System browser</button>

Now, what I’ve tested:



//First go: 
  public open(url : string){
    console.log("Opeeeeeeeeen 2: ", url)
    this.iab.create(url, "_system"); 
  //also tried with .show(), just in case lol... but same result
  //also tried: _self and _blank
  }

//Second go:
    this.browserTab.isAvailable()
    .then(isAvailable => {
      if (isAvailable) {
        this.browserTab.openUrl(url);
      } else {
        console.log("errorrrr");
      }
    });

So, first case: nothing happens, no error nothing.
Second case: this error pops out:


ERROR Error: Uncaught (in promise): Class not found
    at resolvePromise (zone.js:831)
    at resolvePromise (zone.js:788)
    at zone.js:892
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Object.onInvokeTask (core.js:17290)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at drainMicroTaskQueue (zone.js:601)
    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:502)
    at invokeTask (zone.js:1744)

Posts: 1

Participants: 1

Read full topic

Viewing all 49293 articles
Browse latest View live


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