Ionic App not showing assets and ionic components properly on iOS - android

I have an ionic 3 app working in production on Android.
Now I just build the iOS version but I have a problem with the assets and some ionic components like ion-input.
For example I expect to see that screens:
But, instead I got these:
I already checked the absolute and relative paths for images but I don't have relative paths.
For example I have this type of paths:
<ion-slide class="third-slide">
<div class="flex-container">
<div class="image-container">
<img class="corner-image" src="/assets/img/corner_plants.png" alt="corner">
<img class="center-image" src="/assets/img/mariposa.png" alt="corner">
</div>
<div class="title-container">
<h1 class="title">
Regístrate para comenzar.
</h1>
</div>
<div class="description-container">
<ion-grid class="description-grid">
<ion-row>
<ion-col col-2 class="nav-button-column">
<button class="previous" (click)="onPreviousButtonClick()">
<img src="/assets/img/icons8-chevron_left.png" alt="next">
</button> </ion-col>
<ion-col col-8 class="description-column">
<p class="description">
Meditar te ayudará a cultivar la paciencia, mejorar tu capacidad de adaptación y liberar tensiones.
</p>
</ion-col>
<ion-col col-2></ion-col>
</ion-row>
</ion-grid>
</div>
<div class="access-buttons-container">
<button class="register-button" ion-button block round (tap)="openCreateAccountPage()">
{{ texts.btn_register }}
</button>
<button class="login-button" (tap)="openLoginOptionsPage()">
{{ texts.btn_login }}
</button>
</div>
</div>
</ion-slide>
And another weird thing is that the ionic components are not showing neither. You can see that the register page has three inputs and in the iPhone they don't appear. And I can't see the background image neither.
I researched about this but I could not find anything, because the most of the people only have problems with relative paths. I don't know what is the problem.
PD: Sorry for using images, but it's the only way I can share that.
Anyone can help me, please?
Thanks in advance.
EDIT:
The app works fine if, for example, I do login with facebook and navigate through it. It connects to firebase and then.. the problem is only that I mentioned.
In browsers works fine too.

Related

ionic 3 URL images showing up in iOS but not android

I'm trying to load images from http://admin:1234#192.168.8.112/ on my local network
Here are iOS and android screenshots from the emulators respectively
For some reason the images only show up on iOS and not on android.
Here is the relevant typescript code
this.cameras = ["http://admin:1234#192.168.8.112/video1.mjpg","http://admin:1234#192.168.8.112/video2.mjpg","http://admin:1234#192.168.8.112/video3.mjpg" ]
and the relevant html code
<ion-grid>
<ion-row>
<ion-col col-6 col-md-4 col-xl-3 *ngFor="let item of cameras; let id = index">
<div align="center" style="flex-wrap: wrap" class="camera">
<img [src]="item" #imageToView (click)="presentProfileModal(item)" />
<p id="text" text-wrap >Camera {{id + 1}}</p>
</div>
</ion-col>
</ion-row>
</ion-grid>
I've tried using iframes instead of img tags as well as sanitising the URL's with domsanitizer to no avail.
any help or pointers in the right direction would be highly appreciated

Images don't get displayed on Android with Ionic 3

My html file contains:
</ion-content>
<ion-content class="card-background-page">
<ion-list>
<ion-card ion-item *ngFor="let item of items" (click)="itemTapped($event,item) ">
<img src="{{item.image}}"/>
<div class="card-title">{{item.title}}</div>
<div class="card-subtitle">{{item.subTitle}}</div>
</ion-card>
</ion-list>
</ion-content>
the controller contains this code:
this.items.push(
{title:"Item 1",subTitle:"one",image:"assets/img/preview_1.png"},
{title:"Item 2",subTitle:"two",image:"assets/img/panorama_2.png"}
)
it works well when running in the browser using ionic serve, but once built for Android (with the Ionic Cloud service) the images don't get displayed on the device.
I tried:
1)./assets/img/panorama_2.png instead of assets/img/panorama_2.png
2)<img src="url({{item.image}})"/> instead of <img src="{{item.image}}"/>
but still nothing
Make sure your assets are inside src/assets/img and not inside www/assets/img

Ionic 1 input get weird after special characters are introduced

Essentially, I don't have complex code but when using input fields in my Ionic 1 app there is an error that screws up the text in the field after I use anything that isn't alphanumeric. So typing in the email address 'o#o.com' (each letter chronologicaly) in a field displays like this:
o
o#
oo#
oo#.
oo#..
oo#..o
oo#..om
This is happening on an android device. I don't know whether or not it works on an ios device. It doesn't happen in an emulator or in ionic serve --lab. I've tested the ionic templates and it breaks with those projects too. So I don't think it matters what my specific code looks like but here it is:
<form ng-submit="doLogin()">
<div class="list">
<label class="item item-input">
<span class="input-label">Email</span>
<input type="text" ng-model="loginData.email">
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="text" ng-model="loginData.password">
</label>
<label class="item">
<button class="button button-block button-positive" type="submit">Log in</button>
</label>
</div>
</form>
I've recently started working in Ionic 2 in the last couple months, and don't know if that has had negative effects on Ionic 1 apps (I know they say it doesn't but this wasn't a problem in the past). What do you all think of this?
The problem sat for a while until I was forced to update my JDK and do some updates in Android SDK Manager. Then it seemed to work fine.

PhoneGap Build Get App Version inside About Us Page

I've built an About Us page of the app and I want to include the app version defined in the config.xml. Therefore, I want it to get version automatically rather then inserting it manually.
<script type="text/ons-template" id="about.html">
<ons-navigator title="Navigator" var="sNavigator">
<ons-page id="page-about">
<ons-toolbar>
<div class="left">
<ons-toolbar-button onclick="setHome();">
<ons-icon icon="fa-chevron-left"></ons-icon>
</ons-toolbar-button>
</div>
<div class="center white"><span id="search-text" class="trn" data-trn-key="settings">About Us</span></div>
</ons-toolbar>
<div class="about-page wrapper center">
<img src="css/images/logo2.png" width="40%" class="logo-about" alt="">
<p>App Application</p>
<strong> **+version+** </strong>
<p>Owner & Founder</p>
<strong> XXXXX</strong>
<p>Website</p>
<strong> www.domain.com</strong>
<p> </p>
<p>Developed & Designed by</p>
<strong>Developer</strong>
</div><!--End Homepage -->
</ons-page>
</ons-navigator>
</script>
Kindly advise, thank you :)
#WiTon
As with anything with Cordova/Phonegap, use a plugin and search for "app version".
My favorite is cordova-plugin-appversion. Here is a test app that works with Phonegap Build.

Can’t get ng-show/ng-hide to work in ion-header inside ion-modal-view ionic

I am using ng-show/ng-hide to switch between two different header titles. It works in the browser but does not work in android (4.1) in a cordova app. I also tried using ng-switch and also ng-if, but the same net result.
<ion-modal-view> <<<<< it works OK when not in an $ionicModal
<ion-header-bar>
<h1 class="title" >
<span ng-hide="clipboardMsg">{{title()}}</span>
<span ng-show="clipboardMsg" class="clipboard-msg">{{clipboardMsg}}</span>
</h1>
<button class="button button-clear button-primary" ng-click="close()">Close</button>
</ion-header-bar>
...
Apologies for the cross-post but I will really appreciate some help.

Categories

Resources