Thanks
Have a good day.
[ERROR] Unable to find command: platform add android
Ionic-4-rest-api-calls-not-working-on-the-device
Hi. I am facing exactly the same problem. Did u solve it?
How to prevent restart on resume?
This strikes me as a categorically impossible wish, unless the underlying OS provides the equivalent of hibernation functionality. When your app gets killed, all resources it was using are freed up and reallocated for other tasks. There isn’t anything to resume.
Ionic-4-rest-api-calls-not-working-on-the-device
The post you replied to is using an HTTP endpoint, not HTTPS. If that’s the case with you as well, try changing your endpoint to use HTTPS instead and see if the problem persists.
Ionic-4-rest-api-calls-not-working-on-the-device
Hi. I am facing the same problem. Did u solve it?
Ionic-4-rest-api-calls-not-working-on-the-device
Hi! I am already using HTTPS endpoints. It is really weird since the api calls are sent but the data is coming back with a delay. In the browser, everything works in time.
HTTP Get Requests (Wordpress website Rest API calls) not working in iOS App
I would focus attention on the server; I don’t think this is an Ionic issue. Your SSL cert is for www.thesosial.org, not the bare domain.
Ionic-4-rest-api-calls-not-working-on-the-device
That doesn’t sound like exactly the same problem as the post you replied to. I would start a new topic, and please try to post as much information as is needed for people to reproduce your situation.
Ion-content is not a known element
I created a component and add the following to the my-add-component.html:
<ion-content></ion-content>
Everything is fine so far.
Now I add a route in app-routing-module.ts:
import { MyAddComponent } from './my-add/my-add.component';
const routes: Routes = [
{
path: 'tabs/tab2/myadd',
component: MyAddComponent
As soon as I do this, I receive the error in my-add-component.html:
ion-content is not a known element
Does anyone know what is happening? Thank you.
Ion-content is not a known element
I wish whoever decided to (a) pimp the page generators that (b) default to creating modules for every page would spend a few hours every day reading support forum threads.
Does MyAddComponent
have a dedicated module for it? If so, does said module import IonicModule
?
Ionic 3 How to display a toast on modal?
Respectfully, I think this is the fundamental problem here, both technically and practically. Users extrapolate from their previous experiences to form expectations of how apps and their UI components are going to behave, and when there’s a mismatch there, it’s disorienting and frustrating. Likewise, framework authors design frameworks to encourage following well-traveled paths.
There are a number of ways to go here, but the key I think is the contract of a modal. A modal means “your normal flow of work needs to be interrupted in order to take care of this single, short, urgent task”, and anything that involves navigating away from the page that popped the modal is neither single, short, nor urgent. So I would try to redesign this workflow in order to eliminate the modal, at which point your technical problem should also vanish.
Monitor internet connection
I am working with ionic v3 | v4 and I need to persist when my app has an internet connection. https://ionicframework.com/docs/native/network this solution does not work because when connecting to a wifi network but we do not have connection to the external network it continues to inform that it is connected.
import { Injectable , HostListener } from ‘@angular/core’;
import { Platform } from ‘@ionic/angular’;
import { BehaviorSubject, interval } from “rxjs”
import { HTTP } from ‘@ionic-native/http/ngx’;
const tcpie = require(‘tcpie’);
const pie = tcpie(‘google.com’, 443, { count: 10, interval: 6000, timeout: 2000 });
import { Plugins } from ‘@capacitor/core’;
import { Network } from ‘@ionic-native/network/ngx’;
// // const { Network } = Plugins;
// import { HttpClientModule } from ‘@angular/common/http’;
// import { HttpModule } from ‘@angular/http’;
// import { Http ,Response ,Headers, RequestOptions} from ‘@angular/http’;
import { HttpClient } from “@angular/common/http”;
import { first } from “rxjs/operators”;
import { Subscription } from ‘rxjs’;
import { map } from ‘rxjs/operators’
import { Diagnostic } from ‘@ionic-native/diagnostic/ngx’;
import * as firebase from ‘firebase’;
@Injectable({
providedIn: ‘root’
})
export class ConnectivityService {
onDevice: boolean;
public connected$ = new BehaviorSubject(false);
// private config = ‘http://economizeplus-app.firebaseio.com’;
private config: string = ‘https://economizeplus-app.firebaseio.com/’;
public connState: boolean;
private source = interval(6000);
private timeout
public isOnline: boolean;
public showConnectionStatus: boolean;
private showConnectionStatusSub: Subscription;
constructor(private http: HttpClient, public platform: Platform, private HTTPs: HTTP,
private network: Network,private diagnostic: Diagnostic) {
this.diagnostic.isNetworkLocationAvailable
console.log('network');
// this.network.onDisconnect().subscribe(() => {
// console.log('network was disconnected :-(');
// console.log('this.network', this.network);
// });
// this.network.onConnect().subscribe(() => {
// console.log('we got a this.network.type ', this.network.type );
// console.log(' this.network.Connection ', this.network.Connection );
// console.log(' this.network.downlinkMax ', this.network.downlinkMax );
// console.log('this.network', this.network);S
// })
// var connectedRef = firebase.database().ref(".info/connected");
// connectedRef.on("value", function (snap) {
// if (snap.val() === true) {
// console.log('network connected! ');
// } else {
// console.log('not connected! ');
// }
// });
// firebase.database().ref(".info/connected").on("value", data => {
// console.log('network ! ', data);
// });
firebase.database().ref('.info/connected').on('value', connectedSnap => {
if (connectedSnap.val() === true) {
console.log('network ! ', connectedSnap.val() );
} else {
console.log(' not network ! ', connectedSnap.val() );
}
});
this.source.subscribe(async () => {
// console.log('network check');
// this.http.get('www.google.com',{}).pipe(map((res: Response) =>{
// var data = res.json();
// console.log('network connected! ', res);
// }));
// this.http.get('www.google.com',{}).subscribe(data =>{
// console.log('network connected! ', data);
// })
// this.network.onConnect().subscribe(() => {
// console.log('network connected!');
// // We just got a connection but we need to wait briefly
// // before we determine the connection type. Might need to wait.
// // prior to doing any api requests as well.
// console.log('this.network.downlinkMax', this.network.downlinkMax);
// console.log('we got a wifi connection, woohoo!', this.network.type );
// });
// this.http.get('http://www.google.com.br', {}, {})
// .then(data => {
// console.log(data);
// console.log(data.status);
// console.log(data.data); // data received by server
// console.log(data.headers);
// })
// .catch(error => {
// console.log(error.status);
// console.log(error.error); // error message as string
// console.log(error.headers);
// });
// let handler = Network.addListener('networkStatusChange', (status) => {
// console.log("Network status changed", status);
// });
// // To stop listening:
// // handler.remove();
// // Get the current network status
// let status = await Network.getStatus();
// console.log("Network status status", status);
// pie.on('connect', function (stats) {
// console.info('connect', stats);
// }).on('error', function (err, stats) {
// console.error(err, stats);
// }).on('timeout', function (stats) {
// console.info('timeout', stats);
// }).on('end', function (stats) {
// console.info(stats);
// // -> {
// // -> sent: 10,
// // -> success: 10,
// // -> failed: 0,
// // -> target: { host: 'google.com', port: 443 }
// // -> }
// }).start();
// try {
// this._http.request()
// .pipe(first())
// .subscribe(resp => {
// console.log("ConnectivityService: resp", resp);
// if (resp.status === 200) {
// if (!this.connected$.value) {
// this.connected$.next(true);
// }
// }
// }, erro => {
// console.log("ConnectivityService erro: ", erro)
// if (this.connected$.value) {
// this.connected$.next(false);
// }
// })
// } catch (error) {
// console.log("ConnectivityService data: ", error)
// }
// });
// var xhr = new XMLHttpRequest();
// xhr.open("get", "https://www.google.com", true);
// xhr.getAllResponseHeaders
// xhr.onreadystatechange = function() {
// console.log('network connected! ', xhr);
// // if (xhr.readyState == 4) {
// // // JSON.parse does not evaluate the attacker's scripts.
// // var resp = JSON.parse(xhr.responseText);
// // }
// }
// xhr.send();
// try {
// this.http.get('http://www.google.com.br',CONNECT).pipe(first()).subscribe(data => {
// console.log('network data ', data);
// })
// } catch (error) {
// console.log('network erro ',error);
// }
// console.log('network this.network ',this.network);
// console.log('network this.network.downlinkMax) ',this.network.downlinkMax);
// console.log('network this.network.type ',this.network.type);
// console.log('network this.network.Connection ',this.network.Connection);
// let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
// console.log('network was disconnected :-(');
// });
// // stop disconnect watch
// disconnectSubscription.unsubscribe();
// // watch network for a connection
// let connectSubscription = this.network.onConnect().subscribe(() => {
// console.log('network connected!');
// // We just got a connection but we need to wait briefly
// // before we determine the connection type. Might need to wait.
// // prior to doing any api requests as well.
// setTimeout(() => {
// if (this.network.type === 'wifi') {
// console.log('we got a wifi connection, woohoo!');
// }
// }, 3000);
// });
// // stop connect watch
// connectSubscription.unsubscribe();
});
}
@HostListener(‘window:offline’, [’$event’]) onOffline() {
this.isOnline = false;
this.showConnectionStatus = true;
if (this.showConnectionStatusSub) {
this.showConnectionStatusSub.unsubscribe();
}
}
@HostListener(‘window:online’, [’$event’]) onOnline() {
this.isOnline = true;
this.showConnectionStatus = true
}
}
Detect Screen Orientation
I think there is something broken within Ionic itself.
Ionic 4 network check example problem
Hello, you said that your code, works perfectly, you tried to disconnect the cable that provide connection to the wifi, in this model I realized that the answer remains true
Chart.js for ionic 3 version: Cannot find module “@angular/core/src/render3”
Please post package.json
and src/pages/profile.ts
(especially the imports: don’t elide those). Incidentally, there is never any reason to run npm
under sudo
, and doing so can wreak massive havoc that is very hard to clean up.
Property 'loadingController' does not exist
I think it might help you to go through some of the core Angular documentation, especially (on this topic) the services overview and how DI works.
Imagine you have a social circle, and you know that if you invite Alice over, she will always bring her friend Bob, who makes awesome desserts. Therefore if Alice is coming to a dinner party, you don’t need to worry about dessert. However, if next Saturday you’re only inviting Claire and Dennis, but not Alice, you can’t expect Bob to show up with a berry pie
That’s basically the situation you’re in here. You’ve injected the LoadingController
into AppComponent
but are expecting it to be in Tab2Page
.
I can sympathize with this sentiment, but the closest you’re going to get to that is making a service (as described in the Angular docs linked above), and I’m also going to caution you that you will rearchitect this whole thing at least three times before you end up with something that really fits your style. I at least have decided that it’s harder to figure out a balance between reusability and customization than one would initially think.
Can't bind to 'formGroup' since it isn't a known property of 'form'. problem
This was supposed to be a suggestion for what you could do next to move the conversation forward. I may very well be wrong in my guesswork, but nobody but you has the information required to make that determination at present, and since you’re asking for help, that would tend to indicate that you aren’t completely confident in your ability to do so alone.
Build APK from ionic react
First Install Android Studio:
https://developer.android.com/studio
Next, use this guide to add Capacitor to your project:
https://capacitor.ionicframework.com/docs/getting-started/with-ionic/
Then use npx cap open android
from your project folder, wait for Android Studio to finish building the project and go to Build -> Build Bundle(s) APK(s) -> Build APK(s)
Search bar over google maps
Hi, have u solved the issue?
Ionic CLI error on getting start
That is what is happening to me also.
Infact i uninstalled it and downloaded the lastest “NPM”, but still giving me the same reply