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

Boolean for loading different data

$
0
0

@aligassan wrote:

l am working on ionic 4 project. My project is getting data json from url content flights schedules . Everything is okay , but l want to use button boolean when users click on button show to users the flights schedules for yesterday . l don`t want to create another page for holding flights schedules for yesterday l want used in same page and same code . l did like this but when l click on button he is not load any information shows for flights schedules yesterday

  Loadearlierflights : boolean = true;

      async getData() {


        const loading = await this.loadingController.create({
          message: 'Loading'
        });
        await loading.present();

          /// flights details for today ///

        if (this.Loadearlierflights=true) {
          this.http.get('xxxxxxx/airport.json?code=bsr', {}, {})
          .then(data => {

            this.test = JSON.parse(data.data);
            const parsed = JSON.parse(data.data);
            this.items = parsed.pluginData.schedule.arrivals.data;
            loading.dismiss()


            console.log(this.items)

          }), err=>{
            this.test =err
            loading.dismiss()
          } 

                   /// flights details for yesterday ///

        }else if (this.Loadearlierflights=false) {
          this.http.get('xxxxxxxx/airport.json?code=bsr&page=-1', {}, {})
          .then(data => {

            this.test = JSON.parse(data.data);
            const parsed = JSON.parse(data.data);
            this.items = parsed.pluginData.schedule.arrivals.data;
            loading.dismiss()


            console.log(this.items)


          }), err=>{
            this.test =err
            loading.dismiss()
          }

        }

html

<ion-button shape="round" (click)="getData()">load earlier flights</ion-button>

any ideas please ?

Posts: 4

Participants: 2

Read full topic


Gif animation work just once

$
0
0

@safaAlshaarri wrote:

hi everyone
i have app where i am showing a gif img, the problem that when it shows the gif first time the animation played one when i go to another pages then back to the page the have the gif it doesn’t animate again how i can fix that

Posts: 1

Participants: 1

Read full topic

Map is loaded but Polyline are not draw in the map in ionic3?

$
0
0

@RomnEmpire wrote:

Hi
I am working in an App in Ionic 3 that shows current position in the map as well click start track button we have to add polyline between the lat and lang.i know there are some ways to draw polylines my idea is to extract the lat, long coordinates of the marker, save them in an array and then set that as a “path” to draw the Polyline but I’m having problems polylines are not drawn in the map. check our below code

loadMap(){

    this.geolocation.getCurrentPosition().then((position) => {
      let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      let mapOptions = {
        center: latLng,
        position: latLng,
        zoom: 15,

        mapTypeId: google.maps.MapTypeId.ROADMAP
      }

      this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
      this.addMarker();

    }, (err) => {
      console.log(err);
    });
  }

  startTracking() {

    this.isTracking = true;
    this.trackedRoute = [];
 
    this.positionSubscription = this.geolocation.watchPosition()
      .pipe(
        filter((p) => p.coords !== undefined) //Filter Out Errors
      ).subscribe(data => {
        setTimeout(() => {
          this.trackedRoute.push({ lat: data.coords.latitude, lng: data.coords.longitude });
          this.redrawPath(this.trackedRoute);
        }, 0);
      });
  }
 
  redrawPath(path) {
    if (this.currentMapTrack) {
      this.currentMapTrack.setMap(null);
    }
 
    if (path.length > 1) {
      this.currentMapTrack = new google.maps.Polyline({
        path: path,
        geodesic: true,
        strokeColor: '#ff00ff',
        strokeOpacity: 1.0,
        strokeWeight: 3
      });
      this.currentMapTrack.setMap(this.map);
    }
  }

Posts: 1

Participants: 1

Read full topic

Ion-menu-button element is a unknown element

$
0
0

@marvtdawson72 wrote:

Hi, I just downloaded the latest Ionic package (beta 5) and added a new component called “CustomerPage”. I am getting a error that said Ionic does not recognized a ionic element on compile. I tried adding Custom_Element_Schema to the module and got nothing. Is anyone else experiencing this type of problem with Ionic and Angular?

Posts: 1

Participants: 1

Read full topic

Ng-bind-html not working in ionic

$
0
0

@fahd123 wrote:

<ion-card *ngFor="let act of actualite ">
        <ion-card-header>
          <ion-img src='https://www.proweb.ma/ten-pass/photos-actualite/small/{{act.photo}}'></ion-img>
          <ion-card-subtitle>{{act.lib1}}</ion-card-subtitle>
          <ion-card-title>{{act.sub_title}}</ion-card-title>
        </ion-card-header>
      
        <ion-card-content>
        <ion-p ng-bind-html='{{act.text1}}'></ion-p>
        </ion-card-content>
      </ion-card>

Posts: 1

Participants: 1

Read full topic

Cordova-plugin-facebook4 Facebook login not opening on iOS

$
0
0

@almen21 wrote:

Hello,

I have a problem with cordova-plugin-facebook4 (https://github.com/jeduan/cordova-plugin-facebook4) on iOS devices. After following the installation procedure as indicated in the documentation (“iOS Guide”) and configuring correctly the app in the Facebook Developer Console,
when I click on my Facebook login button nothing happens. The XCODE console outputs the following error:

2019-02-15 17:22:58.678937+0100 HelloCordovaApp[59179:1228209] Logging in with CORDOVA ... 2019-02-15 17:22:58.692742+0100 HelloCordovaApp[59179:1228209] Checking login status: unknown 2019-02-15 17:22:58.692947+0100 HelloCordovaApp[59179:1228209] Performing Fb login ... 2019-02-15 17:22:58.693087+0100 HelloCordovaApp[59179:1228209] Starting login 2019-02-15 17:22:58.693271+0100 HelloCordovaApp[59179:1228209] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> Permissions should each be specified in separate string values in the array. 2019-02-15 17:22:58.694627+0100 HelloCordovaApp[59179:1228209] Client application failed to make a policy decision via WebPolicyDecisionListener, using defaultPolicy 2

The app I developed is written in AngularJs and it’s wrapped using Cordova.
What could it be? On Android devices it works perfectly…
Here’s the code that’s executed when user clicks on my Facebook login button:

function fbLoginButtonClick(){
	console.log('Logging in with CORDOVA ...');
	facebookConnectPlugin.getLoginStatus(_fbLoginStatusSuccess, _fbLoginStatusError);
}

////////

function _fbLoginStatusSuccess(response) {
	var responseStatus = response.status;
	console.log('Checking login status: ', responseStatus);
	if (responseStatus === 'connected') {
	  _fbLoginSuccess();
	} else if (responseStatus !== null) {
	  _doFbLogin();
	} else {
	  handleFacebookError(responseStatus);
	}
 }

function _fbLoginStatusError(error) {
	handleFacebookError(error);
}   
 
function _doFbLogin() {
	console.log('Performing Fb login ...');
	facebookConnectPlugin.login(['email, public_profile'], _fbLoginSuccess, _fbLoginError);
}

function _fbLoginSuccess(result) {
	console.log('Fb API: getting user data ...');
	facebookConnectPlugin.api('/me?fields=id,name,first_name,last_name,email', ['email', 'public_profile'], _fbApiSuccess, _fbApiError);
}

function _fbLoginError(error) {
	handleFacebookError(error);
}  

function _fbApiSuccess(userData) {
	alert('User Authenticated!!');
	//redirect to admin page
}

function _fbApiError(error) {
	handleFacebookError(error);
}

function handleFacebookError (error) {
  if(error){
    console.log(error);
  }
}

And this is the configuration on my config.xml file:

<plugin name="cordova-plugin-facebook4" spec="4.2.1">
    <variable name="APP_ID" value="************" />
    <variable name="APP_NAME" value="HelloCordovaApp" />
    <variable name="FACEBOOK_HYBRID_APP_EVENTS" value="false" />
    <variable name="FACEBOOK_ANDROID_SDK_VERSION" value="4.40.0" />
</plugin>

Posts: 1

Participants: 1

Read full topic

Sending ion range results to database

$
0
0

@quotennial wrote:

I’m using ion range to get a response, after clicking a button I would like to send the value the ion range is currently set at to a database, what method is best to do this using typescript I assume? The current HTML:

<div class="slider_position">
    <ion-range min="1" max="5" start="3" [(ngModel)]="surveyRange" pin = "true" color="raptor2" snaps="true">
      <ion-label range-left>1</ion-label>
      <ion-label range-right>5</ion-label>
    </ion-range>
</div>

Thank you! :slightly_smiling_face:

Posts: 1

Participants: 1

Read full topic

Device Motion v3

$
0
0

@lunneyd wrote:

I get the following error and do not know why when trying to use the device motion plugin.

[Error] ERROR TypeError: Object(WEBPACK_IMPORTED_MODULE_1__ionic_native_core[“cordova”]) is not a function. (In ‘Object(WEBPACK_IMPORTED_MODULE_1__ionic_native_core[“cordova”])(this, “getCurrentAcceleration”, {}, arguments)’, ‘Object(WEBPACK_IMPORTED_MODULE_1__ionic_native_core[“cordova”])’ is an instance of Object) getCurrentAcceleration

Posts: 1

Participants: 1

Read full topic


How do I set the fixed background image in my Ionic 4 app?

$
0
0

@dungeonbaba wrote:

I am using Ionic 4 . On my Login Page whenever keyboard is pressed, background image scrolls up. I found no workaround until now.

I applied below css to ion-content :

ion-content{
 --background: #fff url('/assets/img/bigscren.jpg') no-repeat center center / cover !important;
 --background-size: cover !important;
 --background-attachment: fixed;
}

This is my front page:

<ion-content padding>
//My Content
</ion-content>

I also applied fixed attribute to ion-content (from latest ionic doc) but that also not working.

Please help me out. Thanks!

Posts: 1

Participants: 1

Read full topic

Ionic Market Updates

$
0
0

@ahmadao wrote:

Why there are no updates to Ionic Market, it seems Ionic team forgot about it, although I believe it is great opportunity for developers to help other people and monetize.

Posts: 1

Participants: 1

Read full topic

Send Push Notification via Server

$
0
0

@lsantaniello wrote:

Hi friends,
I need to integrate custom notification manager into my php web site. I’m searching some framework or application to integrate in my site.

Could you please support me?

Thanks

Posts: 1

Participants: 1

Read full topic

Sound in my notification?

$
0
0

@CreativeArtDesign wrote:

I got a notification with default notification sound that is the default notification sound preferences that is set for my phone, but the sound that i choose to play in my scheduled notification wont work.
The only thing is i getting a notification but no sound file is played when i have set a own file.

Should i not get sound from the mp3 file i selected.

Have i missed anything?

Your Environment

General summary of the issue:
When notification with sound is triggered while iphone is muted, it’s not playing.

  • Plugin version: beta 3
  • Platform: Android
  • OS version: Pie and Oreo
  • Ionic Version (if using Ionic): 4.0 latest uppdate

Expected Behavior

When getting a notification play a sound file i have selected.

sound: 'file://assets/tone_nokia.mp3',

Actual Behavior

I got a Notification but i can not get the mp3 file to start play.

Steps to Reproduce

import { Component } from '@angular/core';
import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { Storage } from '@ionic/storage';
import { NavController, AlertController, Platform } from '@ionic/angular';
import { ToastController } from '@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})

export class HomePage {
  constructor(
    public navController: NavController,
    public navCtrl: NavController,
    private platform: Platform,
    private localNotifications: LocalNotifications,
    private alertController: AlertController,
    private toastController: ToastController) {



      this.localNotifications.on('trigger').subscribe(notification => {
          this.presentToast();
      });
      this.localNotifications.on('yes').subscribe(notification => {
          this.presentAlert(notification.data.meetingId);
      });
      this.localNotifications.on('no').subscribe(notification => {
          this.presentAlert(notification.data.meetingId);
      });
    }


// TRIGGER
  async presentToast() {
    const toast = await this.toastController.create({
      message: 'Athan spelas upp!',
      duration: 2000
    });
    toast.present();
  }

  async presentAlert(test) {
    const alert = await this.alertController.create({
      header: 'Alert',
      subHeader: 'Subtitle',
      message: test,
      buttons: ['OK']
    });

    await alert.present();
  }



// On load or every check!
  scheduleNotification() {
    var myDate = new Date(2019, 1, 12, 9, 4, 5, 0);  // create a date object fo the 'trigger' 'at'
    var arrayOfNotifications = [{
        id: 1,
        foreground: true,
        trigger: { at: myDate }, // MUST be a date object
        text: 'Abdelbaset Athan spela upp.',
        title: 'Spela upp Athan',
        data: { meetingId:"Athan - 1" },
        sound: 'file://assets/sms.mp3',
      }];
      this.localNotifications.schedule(arrayOfNotifications);

  }


}

I tried to put it in scheduleNotification() method but no buttons or sound are working.

Any ide? I tried to clear upp the code so you easy can see what i am doing.

Or should i install the beta version? if so how do I do that?hat?

Posts: 1

Participants: 1

Read full topic

Use HTML in ionic4 Loading

$
0
0

@distante wrote:

With Ionic 3 I was able to do this:

const loader = this.loadingCtrl.create({
        message: this.sanitizer.bypassSecurityTrustHtml(loadingText) as string,
        spinner: 'dots'
});

or

loader.message = this.sanitizer.bypassSecurityTrustHtml(loadingText) as string,

And use there custom HTML inside Ionic Loading Component. With Ionic4 I just get an empty Loading. Is there a way to use HTML in the Loading Component with Ionic4 ?

Edit: when I append some text after the Safe HTML I get after the bypassSecurity i see this

SafeValue must use [property]=binding: 

Edit 2: In the official docs says

and any optional HTML can be passed in the content property.

But there is no content property in HTMLIonLoadingElement

Posts: 1

Participants: 1

Read full topic

Help ionic 3 build ios cannot get data from firebase

$
0
0

@Heolun wrote:

Hi everyone, i build my app on ios device, i run app on browser ok, it got data from firebase. Then i used xcode build and run on my iphone 5s, build successed, and running, app load backgroud, image local but not get data from firebase. So i hope you help me solve this problem

Posts: 1

Participants: 1

Read full topic

How Can i Change Button to 2 buttons onClick


Xcode simulator device list is empty

$
0
0

@ejerskov wrote:

No matter what I try I can’t get access to the Xcode simulators from my ionic/cordova project. Xcode Command Line Tool is installed.

cordova run ios --list

returns

Available ios devices:

Available ios virtual devices:

ionic cordova emulate ios --list

returns

Available ios virtual devices:

I have all the simulators in Xcode and it’s working fine when Im opening the project in Xcode and run the simulators manually.

The consequence of this is that I cant run my app with livereload from the terminal:

ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1"

returns

Device id for device name “iPhone X” and runtime “iOS 12.1” could not be found, or is not available.

How do I progress from here? :expressionless:

Posts: 1

Participants: 1

Read full topic

How can i create a sidemenu page and show it on homepage as sidemenu?

$
0
0

@harshm90 wrote:

Is it possible to create a new page name sidemenu and use it as a sidemenu on homepage rather than using it on app.html?
If yes then can i see some examples?

Posts: 1

Participants: 1

Read full topic

How to disable token in app

$
0
0

@shaikjilani29 wrote:

i m new ionic i m try to change the root page, root page is sign in page, i dont wont signin page in starting, i need to change the signin page position, if i m change the root page, home page not showing any thing, in console it is showing token not provided, how to disable token and how to run this thing please help me

Posts: 1

Participants: 1

Read full topic

Custom Pipe not found on Ionic 3

$
0
0

@nirajhinge wrote:

I have an issue that is exactly similar to this issue but it seems to have no answer yet. I created a brand new project in Ionic 3 where I have a custom pipe that converts seconds to minutes. But I am simply getting the following error:

Uncaught Error: Template parse errors:
The pipe 'duration' could not be found ("
</ion-header>

<ion-content padding> {{ [ERROR ->]2000 | duration }} </ion-content>

I am not sure what I am doing wrong for the duration pipe not to be found. I have included all the relevant code and version information below. Any pointers on what I am doing wrong would be appreciated.

# ionic info
Ionic:

   ionic (Ionic CLI)  : 4.8.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

System:

   NodeJS : v10.8.0 (/usr/local/Cellar/node/10.8.0/bin/node)
   npm    : 6.3.0
   OS     : macOS Mojave
# home.html
<ion-content padding> {{ 2000 | duration }} </ion-content>
# home.ts
import { Component } from '@angular/core'

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  constructor() {}
}

# home.module.ts
import { NgModule } from '@angular/core'
import { IonicPageModule } from 'ionic-angular'
import { HomePage } from './home'
import { PipesModule } from '../../pipes/pipes.module'

@NgModule({
  declarations: [HomePage],
  imports: [IonicPageModule.forChild(HomePage), PipesModule]
})
export class TestPageModule {}

# pipes.modules.ts
import { NgModule } from '@angular/core';
import { DurationPipe } from './duration/duration';
@NgModule({
	declarations: [DurationPipe],
	imports: [],
	exports: [DurationPipe]
})
export class PipesModule {}
# duration.ts
import { Pipe, PipeTransform } from '@angular/core'
@Pipe({
  name: 'duration'
})
export class DurationPipe implements PipeTransform {
  transform(value: number, ...args) {
    return Math.floor(value / 60)
  }
}

Posts: 1

Participants: 1

Read full topic

Objec(...) is not a function

$
0
0

@akil27 wrote:

Anytime I wanna use the one of the ionic-native plugins I am getting this error. I know this forum has 4 topic on the same issue but all of them was using version 4. I am using version 3. but still getting the same error. Once I has solved it by installing the older version of the plugin. But I don’t know every time which versions of the plugins are compatible with ionic 3. Those same plugins were not giving any errors a few months ago when I was using them. I assume this is because of ionic team is updating the plugins according to the version of the packages in ionic v4. So Do you guys have any idea is this the problem? If so where can I find last versions of the packages that are compatible with V3.

My current versions:

@angular/core”: “5.2.11”,
@ionic-native/core”: “~4.18.0”,
“ionic-angular”: “3.9.3”,
“rxjs”: “5.5.11”,
@ionic/app-scripts”: “3.2.1”,
“typescript”: “~2.6.2”
and cordova is 7 I think.

Thanks!

Posts: 1

Participants: 1

Read full topic

Viewing all 70442 articles
Browse latest View live


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