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

Ionic Code Push / Hot Update causes change from Production to Development Environment in App

$
0
0

@brianivander wrote:

I’ve followed this steps (https://ionicframework.com/docs/appflow/quickstart/installation) and allow my app to receive code push / hot update through ionic Appflow. However now I have unexpected error, which is, my app suddenly changed from the PRODUCTION to DEVELOPMENT.

This always happen.

The way I can replicate this issue is, I open the app, then I close it. Then I wait about 5 minutes, then when I open the app again, it suddenly in the development environment

My workaround now is to change my environment in DEV to use the PROD parameters.

Anybody has this issue? Or how to solve it properly?

Thanks

Posts: 1

Participants: 1

Read full topic


Translated text not presented on screen

$
0
0

@whereskeem wrote:

Using nx-translate I populate an array with text. This array gets populated during ionViewDidEnter(). On the HTML page I pass the array to a custom component called verify-form which passes the array to another custom component called progress-bar, within the progress-bar custom component I have a *ngFor loop to display the text in this array in a list but sometimes the list will show blank. I may have to refresh the page several times before the text appears.

parent page HTML

<ion-slides effect="fade">
			<ion-slide>
				<ion-card class="amc-card">
					<ion-card-header>
						<h1 text-wrap>
							{{'global.title' | translate}}
						</h1>
					</ion-card-header>
					<ion-card-content>
						<h2 text-wrap id="verify-title" class="custom-h2">
							{{title}}
						</h2>
						<verify-form [stages]="stages" (outputSubmitVerifyForm)="verifyForm($event)"></verify-form>
					</ion-card-content>
				</ion-card>
			</ion-slide>
			<ion-slide>
				<ion-card class="amc-card">
					<ion-card-header>
						<h1 text-wrap>
							{{'global.title' | translate}}
						</h1>
					</ion-card-header>
					<ion-card-content>
						<h2 text-wrap id="info-title" class="custom-h2">
							{{title}}
						</h2>
						<enter-info-form [name]="name" (outputSubmit)="enterInfoForm($event)"></enter-info-form>
					</ion-card-content>
				</ion-card>
			</ion-slide>
</ion-slides>

parent page TS

import { Component, ViewChild, ChangeDetectorRef } from '@angular/core';
import { IonicPage, NavController, NavParams, Content, Events, Slides } from 'ionic-angular';
import {Validators, FormBuilder } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';

@IonicPage()
@Component({
  selector: 'page-password-reset-initial',
  templateUrl: 'password-reset-initial.html',
})
export class PasswordResetInitialPage {
  stageOne:string;
  stageTwo:string;
  stageThree:string;
  stageFour:string;
  stages: any;
  @ViewChild(Content) content: Content;
  @ViewChild(Slides) slides: Slides;
  constructor(public translate: TranslateService) {
this.translate.get(['page.passwordResetInitial.progressBar.stages.forgotPassword','page.passwordResetInitial.progressBar.stages.verifyOne','page.passwordResetInitial.progressBar.stages.verifyTwo','page.passwordResetInitial.progressBar.stages.createPassword'])
    .subscribe((res:string) => {
      this.stageOne = res['page.passwordResetInitial.progressBar.stages.forgotPassword'],
      this.stageTwo = res['page.passwordResetInitial.progressBar.stages.verifyOne'],
      this.stageThree = res['page.passwordResetInitial.progressBar.stages.verifyTwo'],
      this.stageFour = res['page.passwordResetInitial.progressBar.stages.createPassword']
    });
  }

ionViewDidEnter(){
    this.stages = [
      [this.stageOne,'active'],
      [this.stageTwo,'future'],
      [this.stageThree,'future'],
      [this.stageFour,'future']
    ];
  }

enterInfoForm(event) {
}

verifyForm(event) {
}
}

verify-form custom component HTML

<progress-bar [stages]="stages" ></progress-bar>
<form [formGroup]="verifyForm" (ngSubmit)="submitVerifyForm()">
..........
</form>

verify-form custom component TS

import { Component, Input, Output, EventEmitter } from '@angular/core';
import {Validators, FormBuilder, FormGroup } from '@angular/forms';

@Component({
  selector: 'verify-form',
  templateUrl: 'verify-form.html'
})
export class VerifyFormComponent {

  @Input() stages:any;
  @Output() outputSubmitVerifyForm = new EventEmitter();
  verifyForm: FormGroup;

  constructor(public formBuilder: FormBuilder) {
    this.verifyForm = this.formBuilder.group({
      verify: ['', Validators.required]
    });
  }

  submitVerifyForm() {}
  }

}

progress-bar HTML

<div class="progress-bar-div">
	<ul class="progress-bar-ul" role="list" *ngFor="let stage of stages;let i = index">
		<li role="listitem" [class]="stage[1]">
			{{i+1}}. {{stage[0]}}
		</li>
	</ul>
</div>

progress-bar TS

import { Component, Input } from '@angular/core';

@Component({
  selector: 'progress-bar',
  templateUrl: 'progress-bar.html'
})
export class ProgressBarComponent {

  @Input() stages:any;

  constructor() {
  }
}

Posts: 1

Participants: 1

Read full topic

Sqlite with firebase database in ionic 3 or 4

Gyroscope in ionic

Cordova-ios v5.0.0 + ionic deeplinks broken

$
0
0

@_oliver wrote:

Just a heads up for everyone that uses the above setup.

I created two tickets, hoping that someone with sufficient (plugin) coding skills can pick this up:


Cheers,
Oliver

Posts: 1

Participants: 1

Read full topic

Image not showing in iOS device

$
0
0

@rubenmgar wrote:

Hi,
I’ve a problem with an image, running in device (iOS). The image is a background-image, for “barra”. “barra” is a ion-toolbar in ion-header. This code is in app/app.scss

.barra {
  background-color: transparent;
  background-image: url("../assets/img/pantalla-inici5_fons_up.png");
  background-size: 100% 50px;
  background-repeat: no-repeat;
  background-position: left top;
  height: 80px !important;
  width: 100%;
  border-bottom: none;
  padding-top: 0;
  font-size: 12px;
}

But I use another image, and it works!

ion-content {
background-image: url("../assets/img/fons1.jpg");
-webkit-background-image: url("../assets/img/fons1.jpg");
color: #fff;
}

Both images are in src/assets/img. When I create IPA, and copy to device, ion-content backgorund is shown, but “barra” background, no. Safari shows “Failed to load resource: The requested URL was not found on this server. file:///var/containers/Bundle/Application/______/______.app/www/build/assets/img/pantalla-inici5_fons_up.png”

I’ve seen some other topics, about images folders, and trying to change “assets” path.

Any ideas? Thank you!

Posts: 1

Participants: 1

Read full topic

Ionic 3 prepopulated database always create new db, it is unable to find from project directory in device

$
0
0

@vcass wrote:

private options = { name: “student.db3”, location: ‘default’, createFromLocation: 1 };

  this.sqlite.create(this.options).then((dmis_db: SQLiteObject) => {
    dmis_db.executeSql("SELECT* FROM tbl_student where studentId=?", [1]).then((data) => {
      alert("here")
      alert("inner inside" + data.rows.item(0).villageId)
      if (data.rows.length > 0) {
        // this.villageList = [];
        // for (var i = 0; i < data.rows.length; i++) {
        //   this.villageList.push({
        //     'valueInteger': data.rows.item(i).villageId,
        //     'text': data.rows.item(i).villageName

        //   })
        // }
      }
    }, error => {
      alert(JSON.stringify(error));
    })
  });

Posts: 1

Participants: 1

Read full topic

Ionic life cycle hooks are not getting called

$
0
0

@truptijoshi21 wrote:

Using ionic-v3: We have add button on home page,on click of which modal will be opened to add notes. After closing of that modal, no ionic life cycle hooks are getting called like ionViewDidEnter() or ionViewWillEnter(). We want to refresh home page with latest saved data after closing of saved notes modal.

Posts: 1

Participants: 1

Read full topic


Click-to-Call APP : IOS return

$
0
0

@Aphelion wrote:

Hello,

i’m trying to emprove a click-to-call experience from my app and i didn’t know how to remove the IOS popup when number is sended to dialer.

I’m using Callnumber from Ionic Native library and i also tried cordova-plugin-call-number. Both run the IOS popup and trigger the onSuccess callback even if the user choose “Cancel” from this popup.

Did you have any trick for this problem ?

Best Regards.

Posts: 1

Participants: 1

Read full topic

Ionic v3 weried issue

$
0
0

@lalitv wrote:

Please help me with the issue which I have never seen before. The issue is when the page comes from multiple redirects then some of the features on the page are not working properly. Like segment, rating form, form validation. It starts working when I rotate the device (In Browser) it’s working.

When I first login and then page redirected to a Home page, the segment on the home page is not working but when I open the home page from the sidemenu then it’s working. Same issue on the Rating form page.

Not getting what’s the issue because there is no error in console. Please help me if someone has the same issue before.

Here is the output of the ionic info

Ionic:

ionic (Ionic CLI) : 4.6.0
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 4 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\android\sdk)
NodeJS : v10.15.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 7

Posts: 1

Participants: 1

Read full topic

Emulator Showing Blank Screen

$
0
0

@OmDIonic wrote:

Hi All
I am developing Ionic app but while testing on Android emulator it is showing nothing after splash screen.

Ionic Info:
Ionic:
ionic (Ionic CLI) : 4.10.2
Ionic Framework : @ionic/angular 4.0.0
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0

Cordova:
cordova (Cordova CLI) : 7.1.0
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 5 other plugins)

System:
Android SDK Tools : 26.1.1
NodeJS : v10.15.1
npm : 6.4.1
OS : Windows 10

Posts: 1

Participants: 1

Read full topic

Google maps autocomplete place

Trigger ion-input focus when ion-icon clicked

$
0
0

@Sasol wrote:

Good day all

I am building my first ionic 4 mobile application, and have a question about how label, icons and other elements can be connected to a form input.

In normal HTML forms you have a relationship between labels and inputs using the “for” attribute, like so:

<label for="name">Please enter name</label>
<input type="text" id="name" name="name"/> 

With this relationship in place the input field gains focus when you either click on the label or on the input itself to gain focus on the input.

In ionic you use ion-label and ion-input instead of the default HTML form elements, and these seem to not share this capability.

I am specifically interested in using an icon as the aforementioned label. I tried the following without any success:

<ion-item>
  <ion-label for="searchText">
    <ion-icon name="search"></ion-icon> <!--name here refers to the icon displayed-->
  </ion-label>
  <ion-input id="searchText" name="searchText" type="text" placeholder="Search" ></ion-input>
</ion-item>

Is there something similar that one can use, or do I need to use JavaScript to achieve this?

Any advice would be greatly appropriated

Posts: 1

Participants: 1

Read full topic

Set background image - Ionic 4

$
0
0

@InfantJoseph wrote:

I want o set background image for Ionic 4 Application (all page). This was pretty straight forward when using Ionic 3 but the same approach didn’t worked here. I read the theming of Ionic 4 but I couldn’t find a way to set an image as background.

As given in the document, background colour can be set and it worked.

:root {
    --ion-background-color: linear-gradient(197deg, rgba(100,100,100,1) 0%, rgba(63,63,63,1) 13.5%, rgba(29,29,29,1) 33.33%, rgba(0,0,0,1) 100%) !important;
}

But on setting the image as background, it didn’t responds,

:root {
    --background: url('assets/imgs/appBg.png') no-repeat fixed center; 
}
 As well, setting remote images worked by local images didn't worked. The below is the working code

ion-content{
  --background: url(https://i.stack.imgur.com/mSXoO.png)!important;
  --background-repeat: no-repeat;
  --background-size:100% 100%;
}

And the below didn't worked.

ion-content{
    --background: url(../../assets/imgs/appBg.png) !important;
    --background-repeat: no-repeat;
    --background-size:contain;
  }

Like to know what is the possible way to set image background in Ionic 4. Thanks.

Posts: 1

Participants: 1

Read full topic

Ionic 4 tabs navigation error

$
0
0

@mavillavishnu wrote:

Hello all,
I am working on an app where on click of a button redirects to a new page with tabs “project-details”. I have created the routing for the page too. Here is the routing:

const routes: Routes = [
  {
    path: 'project-details',
    component: ProjectDetailsPage,
    children: [
      {path: 'pd-tabs-info',children: [{path: '',loadChildren: './pd-tabs-info/pd-tabs-info.module#PdTabsInfoPageModule'}]},
      {path: 'pd-tabs-scope',children: [{path: '',loadChildren: './pd-tabs-scope/pd-tabs-scope.module#PdTabsScopePageModule'}]},
      {path: 'pd-tabs-contacts',children: [{path: '',loadChildren: './pd-tabs-contacts/pd-tabs-contacts.module#PdTabsContactsPageModule'}]},
      {path: 'pd-tabs-news',children: [{path: '',loadChildren: './pd-tabs-news/pd-tabs-news.module#PdTabsNewsPageModule'}]},
      {path: 'pd-tabs-milestones',children: [{path: '',loadChildren: './pd-tabs-milestones/pd-tabs-milestones.module#PdTabsMilestonesPageModule'}]},
      {path: '',redirectTo: '/project-details/pd-tabs-info',pathMatch: 'full'}
    ]
  },
  {
    path: '',
    redirectTo: '/project-details/pd-tabs-info',
    pathMatch: 'full'
  }
];

But i get the below error and the page won’t initialize:
Error: Cannot match any routes. URL Segment: 'project-details/pd-tabs-info'

Please help. Thanks in advance!

Posts: 1

Participants: 1

Read full topic


Check media file exists

$
0
0

@Gesti wrote:

Hello
I’m using ionic v3.

I download and save an audio file

this.file.writeFile(this.file.externalDataDirectory, fileName, xhr.response, { replace: true })
                .then(success => {
                  audio = this.media.create(success.nativeURL.replace(/file:\/\//g, ''));
                  audio.play();
                }, function (error) {
                  console.log("KO");
                });
            }

But when check if the file exsits I get only error status code 5, ENCODING_ERR:

let filePath = this.file.externalDataDirectory + fileName;
    let path = this.file.externalDataDirectory.replace(/file:\/\//g, '');

    console.log(path + fileName);
    this.file.resolveLocalFilesystemUrl(path + fileName)
      .then(res => {
 console.log("OK"
      }).catch(err => {
console.log("KO")}

Where I’m wrong?
I expect an NOT_FOUND_ERR, not and ENCODING_ERR

Posts: 1

Participants: 1

Read full topic

Ionic V3: Mylocation button is not working :Google maps

$
0
0

@naveenvuppu wrote:

My location option not showing in google maps.

loadMap() {
this.geolocation.getCurrentPosition().then((position) => {
let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

  let mapOptions = {
    center: latLng,
    zoom: 10,
    streetViewControl: false,
    zoomControl: false,
    mapTypeControl: false,
    controls : {
      compass : true,
      myLocationButton : true,
      myLocation: true,
      indoorPicker : false,
      zoom : false,
      mapToolbar : true
    },
    mapTypeId: google.maps.MapTypeId.ROADMAP,

  }

Posts: 1

Participants: 1

Read full topic

Firebase iOS key restriction not working

$
0
0

@didigrand wrote:

Hello,

We have put restriction on the Firebase keys through the Google API console, and it’s working correctly for the Android key (app ID + SHA1) and the web key (IP address).

But we are not able to make it work for the iOS key (bundle ID).

We put our app bundle ID in the key restriction, but then, our iOS app won’t connect to Firebase and show this error message: "Requests from this ios client application <empty> are blocked"

According to the <empty> in the error message, it seems the bundle ID is not passed to Firebase when the iOS app try to connect.

Do you have any idea how we can correctly pass this bundle ID for iOS ?
We have been searching on the doc and forums for several days but without any success…

Thanks for your help !

Posts: 1

Participants: 1

Read full topic

Ionic with Phaser game in inappbrowser

$
0
0

@CroStudio wrote:

We want implement mini Phaser game inside Ionic app which can be played inside inappbrowser. So basically game is set on standard host, we used Firebase host for it. In Ionic app we have button for lunch game, one button for one game.
After use press button for lunch game we run it in inappbrowser. Game work perfectly but we have few problem with back button.

  1. We cant implement back function inside game for back in Ionic app. We tried windws.close(), cordova.InAppBrowser.close()
  2. We can disable hardware back button, so if user press hardware back button it will exit for game no matter in which view user is on. We try to set propetry to: cordova.InAppBrowser.open()ardwareback=no,hidenavigationbuttons=yes

Do you have any idea or solution for this problem. Thanks :slight_smile:

Posts: 1

Participants: 1

Read full topic

OneSignal integration -

$
0
0

@lsantaniello wrote:

Hi guys,
I integrated Onesignal library into my app but when I try to init, I have an exception.

my app.component.ts

this.oneSignal.startInit(APP_ID, FIREBASE_SENDER_ID );
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
     
this.oneSignal.handleNotificationReceived().subscribe(() => {
      alert("handleNotificationReceived");
});
     
this.oneSignal.handleNotificationOpened().subscribe(() => {
      alert("handleNotificationOpened");
});
     
this.oneSignal.endInit();
"Uncaught (in promise): TypeError: object is not a function
TypeError: object is not a function
    at OneSignal.startInit (http://localhost/build/vendor.js:85108:151)
    at MyApp.enablePush (http://localhost/build/main.js:734:24)
    at http://localhost/build/main.js:761:19
    at t.invoke (http://localhost/build/polyfills.js:3:14976)
    at Object.zone._inner.zone._inner.fork.onInvoke (http://localhost/build/vendor.js:5445:33)
    at t.invoke (http://localhost/build/polyfills.js:3:14916)
    at r.run (http://localhost/build/polyfills.js:3:10143)
    at http://localhost/build/polyfills.js:3:20242
    at t.invokeTask (http://localhost/build/polyfills.js:3:15660)
    at Object.zone._inner.zone._inner.fork.onInvokeTask (http://localhost/build/vendor.js:5436:33)"

Could you please support me?

Thanks

Posts: 3

Participants: 2

Read full topic

Viewing all 70443 articles
Browse latest View live


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