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

Page contact us


Cordova plugin or javascript library for sound meter?

$
0
0

@jamesharvey wrote:

Hello ionic users,

I’m using Ionic’s native audio plugin… is there any javascript library or cordova plugin which can visualize sound meter from ionic’s native audio?
I wonder if there is… there’s a Cordova plugin which can display sound meter for microphone.
If there’s a way, please let me know.

Thanks,

Posts: 1

Participants: 1

Read full topic

Ionic search will not show overflow

$
0
0

@jamesharvey wrote:

Hello guys,

I built a search bar and list item entries based on info here.

I realized when I populate listing page with

  <ion-list style="background: black; color: white;" *ngFor="let item of items">
                                     <ion-item style="background: black; color: white;" >

                                      <div>
                                        <h4><strong>{{item.title}}</strong></h4>
                                        <p>{{item.description}}</p>

                                      </div>

                                    </ion-item>
                                    </ion-list>

my page automatically hides overflow… it can’t display more item than 5, it doesn’t allow me to scroll. There 20 items but I can see only the ones which are on top.
Why does this happen and how can I enable overflow for items from data entry?

This search page is inside ion-segment… when I manually populate without using *ngFor tag, it allows me to scroll.

Posts: 1

Participants: 1

Read full topic

Ion-segment within ion-segment?

$
0
0

@jamesharvey wrote:

Hello guys,

I’m trying to use Ion-segment & buttons as a part of other Ion-segment. Despite of using different [ngModel] name, it caused an error.

Is there any example of Ion-segment within a parent Ion-segment?

Posts: 1

Participants: 1

Read full topic

Image Upload Ionic 2 to Remote Server Using Php

$
0
0

@Unnis wrote:

I was able to upload Image using below code, but the same code with base64 format is also working for me without even decoding the Base64 code in Php server.

I would like to understand how does the php code accept “fileTransfer.upload(imge, url, options)”. Does my php code gets the “imge” argument of fileTransfer function as Base64 data or real image directory link of android or Real Image Data?


app.component.ts

import { Component } from ‘@angular/core’;
import { Platform } from ‘ionic-angular’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;

import { HomePage } from ‘…/pages/home/home’;
@Component({
templateUrl: ‘app.html’
})
export class UploadImage {
rootPage:any = HomePage;

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
});
}
}

app.module.ts

import { BrowserModule } from ‘@angular/platform-browser’;
import { ErrorHandler, NgModule } from ‘@angular/core’;
import { IonicApp, IonicErrorHandler, IonicModule } from ‘ionic-angular’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { FileTransfer } from ‘@ionic-native/file-transfer’;

import { UploadImage } from ‘./app.component’;
import { HomePage } from ‘…/pages/home/home’;

@NgModule({
declarations: [
UploadImage,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(UploadImage)
],
bootstrap: [IonicApp],
entryComponents: [
UploadImage,
HomePage
],
providers: [FileTransfer,
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}

home.html

Ionic Blank


<button ion-button outline block (click)=“selectPicture()”>
Take picture

<button ion-button outline block (click)=“upload()”>
Uload picture

home.ts

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { Camera } from ‘ionic-native’;
import { FileTransfer, FileTransferObject } from ‘@ionic-native/file-transfer’;

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

currentName:any
selectedImage:any
alert:any
loader: any;

constructor(public navCtrl: NavController, private transfer:FileTransfer) {
}
selectPicture() {
let cameraOptions = {
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
destinationType: Camera.DestinationType.FILE_URI,
encodingType: Camera.EncodingType.JPEG,
correctOrientation: true
}
Camera.getPicture(cameraOptions).then(file_uri => {
this.currentName = file_uri.substring(file_uri.lastIndexOf(’/’) + 1,
file_uri.lastIndexOf(’?’));
this.selectedImage = file_uri;
},
err => {
this.selectedImage = ‘’;
alert(err)
});
}
upload(){
const fileTransfer: FileTransferObject = this.transfer.create();
var url = 'http://www.remote.in/upload/upload.php
var imge = this.selectedImage;
var options = {
fileKey: ‘file’,
fileName: this.currentName,
mimeType: “image/jpg”
};
fileTransfer.upload(imge, url, options).then((results) => {
alert(‘file uploaded successfully’);
}, error => {
alert(‘server error’);
});
(err) => {
let alert = this.alert.create({
title:‘Warning’,
subTitle: “ERROR”,
buttons: [‘OK’]
})
alert.present(); };
}
}

upload.php in remote server

<?php header('Access-Control-Allow-Origin: *'); $target_path = "./images/"; $target_path = $target_path . basename( $_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { echo "Success"; } else { echo $target_path; echo "Failed"; } ?>

In home.ts file, if I use below code to convert the image as Base64, still its uploading in server without even decoding it in php code.

let cameraOptions = {
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
    destinationType: Camera.DestinationType.**DATA_URL**,
    encodingType: Camera.EncodingType.JPEG,
    correctOrientation: true
  }
  Camera.getPicture(cameraOptions).then(file_uri => {
       **this.selectedImage = "data:image/jpeg;base64," + file_uri;**
    },

Can someone help me understand what exactly does fileTransfer sends to remote server?

Posts: 1

Participants: 1

Read full topic

How to use SSL Pinning with cordova-plugin-advanced-http

$
0
0

@optisicra wrote:

Would anyone have an example of how to enable the SSL Pinning with this plugin function? How do I put a certificate and set they? There are no examples of this function in the documentation.

Posts: 1

Participants: 1

Read full topic

Ionic Pro Migration Error git@git.ionicjs.com: Permission denied (publickey)

$
0
0

@SaeedAnsari wrote:

I am getting permission Denied when i am trying to migrate my app to Pro

F:\Development\CommunitiesV3>git push ionic master
git@git.ionicjs.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I can verify i am looged in to VisualStudioCode with the right Git account. i am not understanding which GIT is it going to. the GIT already for my Project or some new GIT for IONIC.

i created the ssh-key using no name and no password and still not able to get this going.

Can you help me understand what this error is and what i need to do to move out of it?

Please I appreciate your help :slight_smile:

Posts: 1

Participants: 1

Read full topic

How to generate an iOS .ipa file without paid developer account and ios device

$
0
0

@mfouash wrote:

**Hi **
Well I have developed my app for android and i get my APK FILE ,
Now i have Mac OS and Xcode installed and i have free apple ID
but i don’t have IOS device or paid developer account
how Can I Generate .ipa File to Share With Other IOS Devices
So they can install my awesome IOS app build by Ionic

Posts: 1

Participants: 1

Read full topic


Could not get unknown property 'GOOGLE_PLAY_SERVICES_VERSION'

$
0
0

@YousefRabieKhalil wrote:

hey all ,
my ionic project was working well before setup the cordova background geoloactions it’s give me this error

* Where:
Build file '/Volumes/Partion/App/Projects/Go-Taxi-Driver-Final/platforms/android/build.gradle' line: 255

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'GOOGLE_PLAY_SERVICES_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

my plugin list

cordova-custom-config 4.0.2 "cordova-custom-config"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-mauron85-background-geolocation 2.3.3 "CDVBackgroundGeolocation"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
onesignal-cordova-plugin 2.2.2 "OneSignal Push Notifications"

and my ionic info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-sim : 6.1.2
    Node    : v8.4.0
    npm     : 4.2.0
    OS      : macOS Sierra
    Xcode   : Xcode 8.2.1 Build version 8C1002

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

this error happen when build android only , by when build ios every thing work fine
any one can help me ?
thanks in advance

Posts: 1

Participants: 1

Read full topic

Accessing data passed via PopoverController.create

$
0
0

@leegee wrote:

The PopoverController docs give the signature of create as create(component, data, opts), and say that data is Any data to pass to the Popover view – but do not say how that data can be accessed?

Posts: 1

Participants: 1

Read full topic

Ionic can not update Firebase in APK

$
0
0

@richiewijaya wrote:

I make an application using Ionic and Firebase. The database in Firebase successfully run when run in ionic lab or ionic serve. See the picture, prove it when the database changed.

But, when i run in Emulator (Nox that i used) or My device, the database Can’t run as in ionic serve. See the picture, prove the database not changed.

Here my TypeScript


import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

import { Item } from '../../models/lamp/lamp.model';
import { LampServices } from '../../services/lamp/lamp.services';
import { Observable } from 'rxjs/Observable';

@IonicPage()
@Component({
  selector: 'page-turn-lamp',
  templateUrl: 'turn-lamp.html',
})
export class TurnLampPage {
  lamp$: Observable<Item[]>;
  item: Item;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private lampS: LampServices
  ) {
    this.lamp$ = this.lampS
    .getLamp()
    .snapshotChanges()
    .map(
      changes => {
        return changes.map(c => ({
          key: c.payload.key, ...c.payload.val()
        }))
      }
    )
  }

  turnLamp(item: Item){
    this.lampS.turnLamp(item);
  }
}

Here the Service of getLamp() and turnLamp()

import { Injectable } from "@angular/core";

import { AngularFireDatabase } from "angularfire2/database";
import { Item } from "../../models/lamp/lamp.model";

@Injectable()
export class LampServices{
    private lampRef = this.db.list<Item>('lamp');

    constructor(private db: AngularFireDatabase){}

    getLamp(){
        return this.lampRef;
    }

    addLamp(item: Item){
        return this.lampRef.push(item);
    }

    turnLamp(item: Item){
        return this.lampRef.update(item.key, item);
    }
}

Here how i call the function in HTML

<ion-item *ngFor="let item of lamp$ | async">
  <ion-label>Condition</ion-label>
  <ion-toggle [(ngModel)]="item.condition" (click)="turnLamp(item)"></ion-toggle>
</ion-item>

Is it a bug? or is there any error on my code?

Thanks before.

Posts: 1

Participants: 1

Read full topic

Ionic scrollbar

Sound from ear speaker

$
0
0

@Dorado wrote:

Hello guys I faced with problem, when I receive audio stream from server it plays in ear speaker. How I can change it and forward it to bottom speaker?
To clarify some moments, I have no streaming url or separate file to play it. I got exactly webrtc audio stream and have to play it through bottom speaker

Posts: 1

Participants: 1

Read full topic

Ionic iframe - not working

Navigation problem using setRoot

$
0
0

@orlstefano wrote:

Hi guys,

This is what I have:
I have a very simple app with 3 pages:

  1. LoginPage
  2. HomePage
  3. HomeDetailPage ( I call it from HomePage with navController.push(HomeDetailPage) )

And this is what I want:
I want that when the user do login, the app should redirect He to the HomePage.
If the user is in the HomePage or in HomeDetailPage and launch logout function, the app should redirect he to the LoginPage and if He’ll make login again, The app will go in the HomePage.

But this is my trouble:
If I call logout function from the HomePage all is well.
But If I call the logout function from the HomeDetailPage, the App come back to LoginPage correctly but if i try to call login again, I recive an error:

ERROR TypeError: Cannot read property 'push' of null
    at Tab.NavControllerBase._queueTrns (vendor.js:51240)
    at Tab.NavControllerBase.push (vendor.js:51128)
    at SafeSubscriber._next (main.js:259)
    at SafeSubscriber.__tryOrUnsub (vendor.js:22842)
    at SafeSubscriber.next (vendor.js:22789)
    at Subscriber._next (vendor.js:22729)
    at Subscriber.next (vendor.js:22693)
    at MapSubscriber._next (vendor.js:124303)
    at MapSubscriber.Subscriber.next (vendor.js:22693)
    at SwitchMapSubscriber.notifyNext (vendor.js:129085)

app.component.ts
I’ve used AngularFireAuth for make login and logoud and check the authentication

import { Component, ViewChild } from '@angular/core';
import { Platform, NavController } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { TabsPage } from '../pages/tabs/tabs';
import { LoginPage } from '../pages/login/login';
import { AngularFireAuth } from 'angularfire2/auth';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage: any = LoginPage;
  @ViewChild('rootNav') nav: NavController;

  constructor(platform: Platform,
    statusBar: StatusBar,
    splashScreen: SplashScreen,
    private afAuth: AngularFireAuth) {

    platform.ready().then(() => {
      //I've tried to move here the block of code in the ngOnInit but the behavieour is the same

      statusBar.styleDefault();
      splashScreen.hide();
    });
  }

  ngOnInit() {
    this.afAuth.auth.onAuthStateChanged(user => {
      if (user) {
        this.nav.setRoot(HomePage); //I've tried also with this.rootPage = HomePage and the behavieur is the same
      } else {
        this.nav.setRoot(LoginPage);  //I've tried also with this.rootPage = LoginPage and the behavieur is the same
      }
    });
  }
}

The Login function in login.ts page is:

  login(email: string, password: string) {
    this.afAuth
      .auth
      .signInWithEmailAndPassword(email, password)
      .then(value => { })
      .catch(err => {
        console.log('Something went wrong:', err.message);
      });
  }

And the logout function iinside the HomePage.ts and DetailHomePage is:

  logout() {
    if (this.navCtrl.last().index > 0) {
      this.navCtrl.remove(this.navCtrl.last().index)
        .then( () => {
          this.afAuth.auth.signOut();
        },
        error => {console.error(error); }
        );
    }
    else {
      this.authService.logout();
    }

I’ve tried with a simple logout version like this below also, but the error that I have had is the same.

logout() {
          this.afAuth.auth.signOut();
    }

Thank you :slight_smile:

Posts: 1

Participants: 1

Read full topic


Float to Integer

$
0
0

@rafaelmoura wrote:

I have 345.2323 (float), I want to change for 345 (integer), how can I to use pipes in :

<strong>Largura {{ horizontal }} X {{ resul_horizontal | number: ?  }}</strong>

Posts: 1

Participants: 1

Read full topic

Ionic Storage issue Uncaught (in Promise)

There is no directive with "exportAs" set to "ngModel" error

$
0
0

@valentinay wrote:

Hello I am getting this error while trying to pass data from page to page in ionic

There is no directive with "exportAs" set to "ngModel"

any ideas on how to fix it ?

My Code:

<ion-item>
        <ion-label stacked>Patient Username</ion-label>
        <ion-input  type="text" placeholder="P_JhonDoe" formControlName="p_username"
                    [(ngModel)]="PatientUsername" #ctl="ngModel"></ion-input>
</ion-item>

Posts: 1

Participants: 1

Read full topic

Content Security Policy for Video Preview

$
0
0

@junjunhernandez wrote:

Hi. I am developing a PWA (Progressive Web App) using Ionic. It has a feature which upload photos and short videos to Firebase. However, when the selected file is about to show preview, I encounter 2 errors for Content Security Policy. By the way, I made preview work with photos but not with videos. My PWA is in localhost yet. Thanks!
Here are the errors :

  1. Refused to load media from ‘data:video/mp4;base64,’ because it violates the following Content Security Policy directive: “default-src gap://ready file://* *”. Note that ‘media-src’ was not explicitly set, so ‘default-src’ is used as a fallback.
  1. Refused to load media from ‘data:video/mp4;base64,’ because it violates the following Content Security Policy directive: “media-src *”.

Posts: 1

Participants: 1

Read full topic

Cannot create new project

Viewing all 49526 articles
Browse latest View live


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