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

IONIC 4 Firebase analytics multiple environment/project

$
0
0

@JulienRos wrote:

Hello everyone,

Is there anyone who has implemented firebase analytics with two custom environment and two native configs?

I personally have two native configs (“test”: com.xxx.app and “prod”: com.xxx.app).
I wish I could change the BUNDLE-id of “test” like com.xxx.development without the firebase prevent the build by taking me this error.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'com.xxx.development'

I understand that i need a second google-services.json and a second GoogleService-Info.plist with the new BUNDLE-it (correct me if im wrong?)
as this documentation (https://firebase.google.com/docs/projects/multiprojects) explains.
but I have difficulties to implement it.

In ios : where to put this code?

In android: where i set in the config or somewhere else the name of the folder app/src/???/google-services.json

did anyone succeed in having an equivalent and functional system?
Thanks a lot

Posts: 1

Participants: 1

Read full topic


Refresh the page when image source changed

$
0
0

@Kahroba2000 wrote:

Hello,
I wrote a code to show me an image from a URL. I also implement a alt image in the case the main URL is not available, alternative image be shown.
Problem is , if the main URL at the beginning of loading the page is not available, the alternative image would be shown but when the main URL get OK, it still shows the alt image!
Should I refresh my page regularly to solve this issue or any other idea?

Posts: 1

Participants: 1

Read full topic

Ionic 4 Vue Examples

$
0
0

@dalezak wrote:

I’d like to start using Vue for my new Ionic 4 apps, however struggling to find good examples for transitioning from Angular. :thinking:

There are a few good tutorials like Using Ionic 4 Components in Your Vue.js Apps and Learning Vue for Ionic/Angular Developers – Part 1, but still have lots of questions regarding routing, navigation, transitions, etc.

The documentation doesn’t provide a lot of examples on getting components wired up, for example it has Angular Navigation but does not have the equivalent for Vue.

What’s the best way to show a modal using Vue? Do you access the <ion-modal-controller/> tag?

const modalController = document.querySelector("ion-modal-controller");
await modalController.componentOnReady();
const modal = await modalController.create({
  component: 'form-details'
});
await modal.present();

Or is it better to make use of this.$ionic.modalController?

this.$ionic.modalController
.create({
  component: FormDetails,
  componentProps: { 
    title: "Form Details" 
    }          
})
.then(modal => modal.present());

What other components are accessible like this.$ionic.modalController?

Regarding routes and navigation, what’s the best way to push a new page? In Ionic 3 you’d use NavController but that’s not available in Ionic 4.

Looks like one way in Vue.js is using $router like this.$router.push({path:'/forms/1'}) but that doesn’t provide any slide animations. One option is to wrap your <router-view/> in <transition name="slide-fade"><router-view/></transition> to offer some animation, but that’s not the regular Ionic push animation you’d expect.

<template>
  <div id="app">
    <ion-app>
      <transition name="slide-fade">
        <router-view/>
      </transition>
    </ion-app>
  </div>
</template>
<style>
.slide-fade-enter-active {
  transition: all .3s ease;
}
.slide-fade-leave-active {
  transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}
.slide-fade-enter, .slide-fade-leave-to
  transform: translateX(10px);
  opacity: 0;
}
</style>

Since ion-nav is available in Ionic 4, can that be used as an alternative to the VueRouter? How do you use <ion-nav> in code to push a new page?

Any help answering these questions, and any other Ionic 4 + Vue information would be greatly appreciated!

Posts: 1

Participants: 1

Read full topic

How does one add External JavaScript Lib to an ionic 4 project?

$
0
0

@AaronYoo wrote:

Apologize in advance for not-so-accurate terminologies used in this post.

Here’s the Github repo of said JS lib: valence-sdk-javascript

I am new to ionic framework, heck, this is my first WebApp project and I’ve been searching for ways to include this js library to my app. Most of the info I found online are script tags in index.html which I believe does not exist in ionic 4. This library is not on npm. What should I do to include this lib?

This may be a silly request, but because this js contains auth, api call functions that I will be using on a lot of pages, could this lib be imported “globally”(as in I don’t need to import/include it on every page separately if I want to use it)

Thanks in advance for any help.

Posts: 1

Participants: 1

Read full topic

PWA and cross UI?

$
0
0

@sonnymeyer wrote:

Hi everyone,

Hope you can help me here. Is it correct understood that the progressive UI of Ionic is only available in the native part of it, and in the PWA, all UI elements will be the same for various platforms? I.e. The back button will be the same in ios and and android, in the compiled PWA, however different in the native experience?

Thanks,
Sonny

Posts: 1

Participants: 1

Read full topic

Problems when playing audio from http on ionic 4

$
0
0

@citylab wrote:

I am creating an audio streaming website that works very well in minor versions to android 9.

In android 9 does not play anything, after testing and testing plugins I thought that the reason could be the use of http instead of https.

To the surprise on Android 9, he plays audios (url) that are on https but not on http.

What can I do to solve this problem

Posts: 1

Participants: 1

Read full topic

REMOTE in US or UK

$
0
0

@Timothyjoh wrote:

Hi everyone. I work for http://beauthentic.digital/ as a Full-stack Architect, and we are looking for more of the same. We are looking for people with deep Angular experience, but we also have been building a lot of custom web components using LitElement and Stencil too. We also have some React work, but the majority of our client websites are Angular.

Please feel free to reach out to ask me questions about the role and company, I am not a recruiter, I am a developer and also sit in your shoes. Looking for people in the USA and/or London area at this time only

Or you can email our internal recruiter, Beth Cooper beth.cooper at beauthentic dot digital with your resume.

But if you want to find juicy details, find me. :wink:

Posts: 1

Participants: 1

Read full topic

Can someone help ?! ionic 1.3.3 on iOS 12 with error: not set for url='unsafe:ionic://localhost%23/menu/aboutUs'

$
0
0

@falconddddddd wrote:

Hi there, I met this error when I build an old ionic project (ionic 1.3.3).

ERROR Internal navigation rejected - <allow-navigation> not set for url='unsafe:ionic://localhost%23/menu/personalData'
ERROR External navigation rejected - <allow-intent> not set for url='unsafe:ionic://localhost%23/menu/personalData'

I have searched a lot, and try every methods, such as:

  1. Add the following in config.xml and add meta tag CPS in index.html, this is not working
<allow-intent href="http://ionic.local/*" />
<allow-navigation href="http://ionic.local/*" />
  1. Try to add in config.xml, still got error, which print, not supported url in xcode console.
<allow-intent href="*" />
<allow-navigation href="*" />
  1. Try to add , still not working
<allow-intent href="ionic:*" />
<allow-navigation href="ionic:*" />

Can someone help ?

Note: even I start a new project with ionic-cli

ionic start testionic1project --type ionic1

when I build with

ionic cordova build ios

and debug in xcode 10.12.1 in iPhone XR simulator, I also got this error!

Posts: 1

Participants: 1

Read full topic


Please slove this.Get Error when i use Camera plugin and specially give error Object(...) is not a function

$
0
0

@IonicDevlopAnshul wrote:

ypeError: Object(…) is not a function
at CameraPreview.startCamera (http://localhost:8100/build/vendor.js:124225:138)
at HomePage.webpackJsonp.195.HomePage.takePictureByCam (http://localhost:8100/build/main.js:76:28)
at Object.eval [as handleEvent] (ng:///AppModule/HomePage.ngfactory.js:37:27)
at handleEvent (http://localhost:8100/build/vendor.js:13914:155)
at callWithDebugContext (http://localhost:8100/build/vendor.js:15423:42)
at Object.debugHandleEvent [as handleEvent] (http://localhost:8100/build/vendor.js:15010:12)
at dispatchEvent (http://localhost:8100/build/vendor.js:10329:25)
at http://localhost:8100/build/vendor.js:10954:38
at HTMLButtonElement. (http://localhost:8100/build/vendor.js:39450:53)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660)
Ionic:

ionic (Ionic CLI) : 4.2.1 (C:\Users\nandk\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.2

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0, browser 6.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 6 other plugins)

System:

NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10

Posts: 1

Participants: 1

Read full topic

Offline OCR with TesseractJS and Ionic

$
0
0

@Mralaa2019 wrote:

I am trying to use Tesseract in offline mode in my Ionic 4 app. In order to do it I have based my code on what is explained in this example, although it is done with Ionic 3 and what the Tesseract GitHub explains regarding offline mode.

I have followed the same tutorial but i got errors in

i got error in (load)=”recognize($event)” as is not unknown in ionic 4

content: ‘Analyzing image’ and also on content and the last one type: ‘textarea’

i am using ionic 4 angular

Posts: 1

Participants: 1

Read full topic

Firebase collection update error in Ionic 3 app

$
0
0

@elisamaral wrote:

I’m having problems with a Firebase vs Ionic 3 app when I create a new user in the app, I don’t know why I can create a new user only once every day and I try again in the same day but the database doesn’t update. It seems nonsense but that’s exactly waht’s happening. I have a Firebase file called firebase.ts with the database credentials to create the connection:

export const firebaseConfig = {
  // I replaced the data with "#" here for security reasons:
    apiKey: "###",
    authDomain: "###",
    databaseURL: "###",
    projectId: "###",
    storageBucket: "###",
    messagingSenderId: "###",
    appId: "###"
}

Then I have the register function in login.ts file:

createAccount() {
    let load = this.loadingCtrl.create();
    load.present();

    this.authProvider.register(this.registerForm)
      .then((res) => {
        let uid = res.user.uid;

        //organize data
        let data = {
          uid: uid,
          name: this.registerForm.name,
          email: this.registerForm.email
        };

        //Gravar usuario no firestore
        this.firebaseProvider.postUser(data)
          .then(() => {         
                this.storage.set('usuario', data)
                  .then(() => {
                    load.dismiss();
                    this.navCtrl.setRoot('HomePage');

                  })
          })
          .catch((err) => {
            load.dismiss();
          })
      })
      .catch((err) => {
        load.dismiss();
      })
  }

And the providers settings in firebase.ts from folder Providers :

import { Injectable } from "@angular/core";
import { AngularFirestore } from "angularfire2/firestore";
import "rxjs/add/operator/map";


@Injectable()
export class FirebaseProvider {
  constructor(private afs: AngularFirestore) {}

  //Save user on firestore
  saveUser = data =>
    this.afs
      .collection("Users")
      .doc(data.$key)
      .update(data);

  //Create user on firestore
  postUser = data =>
    this.afs
      .collection("Users")
      .doc(data.uid)
      .set(data);

      getUser(uid){
        return this.afs.firestore.collection('Users').doc(uid)
        .get();
       }
}

And finally authentication.ts file also in Providers folder:

import { Injectable } from '@angular/core';
import { AngularFireAuth } from "angularfire2/auth";

@Injectable()
export class AuthProvider {

  constructor(
    private afAuth: AngularFireAuth
  ) {
  }

  //Create new user
  register = (data) => this.afAuth.auth.createUserWithEmailAndPassword(data.email, data.password);

  //Login for existing user
  login = (data) => this.afAuth.auth.signInWithEmailAndPassword(data.email, data.password);
}

What could I do? Literally when I create one user, the first from the day, everything is fine but then the next time I try it, the database doesn’t update! Any help?

Posts: 1

Participants: 1

Read full topic

Filter through ionic segmet using *ngSwitch and regex

$
0
0

@khashashin wrote:

I wont to filter words depending on chosen segment value e.g segments have values like
| aa | ab | ac | ad | ae | af | … etc. And click on one of the segment should show relevant words e.g click on | ab | should show only words that begin with “ad” and so on.

enter image description here

My current method to solve this (which is not working ofc. )

// letter.page.html
<ion-segment scrollable mode="md" (ionChange)="filterWords($event)" [(ngModel)]="filter.query">
    <ion-segment-button mode="md" class="ce-sm-segment" value="all">
        <ion-icon name="infinite"></ion-icon>
    </ion-segment-button>
    <ion-segment-button mode="md" class="ce-sm-segment" value="starred">
        <ion-icon name="star-outline"></ion-icon>
    </ion-segment-button>
    <ion-segment-button mode="md" *ngFor="let ltr of twoLettersList" class="ion-text-lowercase" value={{ltr}}>
        {{ltr}}
    </ion-segment-button>
</ion-segment>
<div [ngSwitch]="filter.q" *ngFor="let word of (words ? words : [])">
    <ion-item *ngSwitchCase="filter.q">
        <ion-label>
            {{word.word_chechen}}
        </ion-label>
    </ion-item>
</div>

//letter.page.ts
filter = {
    query: 'all',
    q: 'all' as any
};
filterWords($event) {
    console.log('All: ', $event.detail.value);
    console.log('Query: ', this.filter.query);
    this.filter.q = new RegExp('^' + this.filter.query + '\\w+');
    console.log('Filtered: ', this.filter.q);
}

Output of regex:
enter image description here

Posts: 1

Participants: 1

Read full topic

IonSlide : View is not updated?

$
0
0

@Dinath1 wrote:

Hello there!

I do a bug for with the IonSlides. Only on mobile, sometimes my view is not updated, I have to tap the slider to make the content visible (otherwise I only have the spinner).

My slider is here in the view :

<ion-slides #slides
                    [options]="slidesOptions"
                    (ionSlidesDidLoad)="ionSlidesDidLoad()"
                    (ionSlideDidChange)="ionSlideDidChange()"
                    (ionSlideNextStart)="ionSlideChanged()"
                    (ionSlidePrevStart)="ionSlideChanged()">

            <ion-slide *ngFor="let date of dates; index as i; trackBy: trackByDate">

                <div *ngIf="i !== currentSlideIndex">
                    <ion-spinner color="primary"></ion-spinner>
                </div>

                <ion-grid *ngIf="i === currentSlideIndex">
                    <ion-row>
                        <ion-col size="12">
                            <h2 class="ion-text-capitalize ion-text-center text-font-primary">
                                {{ date | date:'EEEE d MMMM y' }}
                            </h2>
                        </ion-col>
                    </ion-row>
                    <ion-row class="ion-margin-top">
                        <ion-col size-xl="3" size-md="6" size="12" *ngFor="let meal of user.meals; trackBy: trackByMealKey">
                            <!-- Meal passed is just a template -->
                            <app-meal *ngIf="meal.used" [date]="date" [meal]="meal"></app-meal>
                        </ion-col>
                    </ion-row>
                </ion-grid>
            </ion-slide>
        </ion-slides>

My typescript file :


  @ViewChild('slides') slides: IonSlides;

  public dates: Array<Date> = new Array<Date>(15);
  public currentSlideIndex = 7;

  ngOnInit(): void {

      const dates =  new Array<Date>(15);
      const dateFirst = new Date();
      dateFirst.setDate(new Date().getDate() - 7);

      for (let i = 0; i < 15; i++) {
        let date = new Date();
        let dateDay = dateFirst.getDate();
        let dateMonth = date.getMonth();
        date.setDate(dateDay + i);
        date.setMonth(dateMonth);
        dates[i] = date;
      }

      this.dates = dates;
  }

I want the first slide to be the 7th, so I am able to navigate a week before and after.

When I display the index in the page, when it bugs i = 0 in the view, when it works i = 7.

I tried so many things to fix that, I do not know how to do next.

PS: Trying to use this.changeDetectorRef.markForCheck(); did not help.

Thank you for your help :slight_smile:

Posts: 1

Participants: 1

Read full topic

EBUSY: resource busy or locked

$
0
0

@albincs wrote:

EBUSY: resource busy or locked, unlink ‘E:\ionicNew\platforms\android\app\google-services.json’

please help

Posts: 1

Participants: 1

Read full topic

How to show page from top without using scrollToTop?

$
0
0

@PlasticSoul wrote:

Hi guys, I have an Ionic 4 app that show a book index and when I navigage to the chapter content in the next page, I can navigate back to the book index, but I want the page show from the top, not scrolled, I want it to show the first chapters.
I tried used this.content.scrollToTop(0), but I didn’t like the scroll effect.
I tried Angular router ExtraOptions scrollPositionRestoration = ‘top’ but it didn’t work too.
I didn’t find a way to disable the page cache so it can reload again from the top.

How can I solve this, please?

Posts: 1

Participants: 1

Read full topic


Error in Youtube Video Player: ERROR TypeError: co.openVideo is not a function

$
0
0

@jgcoroleu wrote:

Hi,
Im using Ionic Video Player to watch Youtube channel videos on my application. The list of videos works fine but when i try to play it the emulator show me this error on this line:

<button ion-button icon-left clear small (click)=“playVideo($event, post)”>

TypeError: Object(...) is not a function
    at YoutubeVideoPlayer.openVideo (http://localhost:8100/build/vendor.js:84199:141)
    at YoutubePage.webpackJsonp.469.YoutubePage.playVideo (http://localhost:8100/build/4.js:131:22)
    at Object.eval [as handleEvent] (ng:///YoutubePageModule/YoutubePage.ngfactory.js:27:27)
    at handleEvent (http://localhost:8100/build/vendor.js:13607:172)
    at callWithDebugContext (http://localhost:8100/build/vendor.js:15092:42)
    at Object.debugHandleEvent [as handleEvent] (http://localhost:8100/build/vendor.js:14679:12)
    at dispatchEvent (http://localhost:8100/build/vendor.js:10056:25)
    at http://localhost:8100/build/vendor.js:10670:38
    at HTMLButtonElement.<anonymous> (http://localhost:8100/build/vendor.js:36952:53)
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660)

youtube.ts

<ion-header>
  <ion-navbar color="primary">
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Videos</ion-title>
  </ion-navbar>
</ion-header>
<ion-content>  
  <div *ngFor= "let post of posts">
    <ion-card>
      <img src="{{ post.snippet.thumbnails.high.url }}">
      <ion-card-content>
        <ion-card-title>
          <h4>{{ post.snippet.title }}</h4>
        </ion-card-title>
        <button ion-button icon-left clear small (click)="playVideo($event, post)">
          <ion-icon name="play">
            <div>Play Video</div>  
          </ion-icon>
        </button>
      </ion-card-content>
    </ion-card>
  </div>
    <!--  display error -->
    <div style="width:100%; height:100%; margin-top:50%;" *ngIf="no_result">
      <h1>Error recuperando videos</h1>
    </div>
</ion-content>>

youtube.ts

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, LoadingController } from 'ionic-angular';
import { YoutubeVideoPlayer } from '@ionic-native/youtube-video-player/ngx';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';

@IonicPage()
@Component({
  selector: 'page-youtube',
  templateUrl: 'youtube.html',
})
export class YoutubePage {

  // youtube channel Id
  channelID: string = 'UC7Nfr13PyP84jWgU5FS9LGg';

  //maximum number of video the search will return
  maxResults: string = '5';

  //incase if you want to use pagination
  pageToken: string;

  // youtube api key
  googleToken: string = 'AIzaSyCa_RLmwvsOYU-ql0K2jAHCEXMtlWOA90A';

  //the term we will use for the search
  //searchQuery: string = 'Pst. David Olusegun';

  //array that will contain the videos after they have been retrieved
  posts: any = [];

  // boolean to hide/show the error message
  no_result: boolean = false;

  loader: any;

  constructor(public loading: LoadingController, public http: Http, private youtube: YoutubeVideoPlayer, public navCtrl: NavController, public navParams: NavParams) {  

    // creates a loader
    this.loader = this.loading.create({
      // the content of the loader during its operations is specified here
      content: 'Cargando videos'
    });

    // makes loader visible
    this.loader.present().then(() => {
      this.fetchData();
    });
  
  } 

  fetchData() {

    //api to retrieve videos
    let url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=' +
    this.channelID + '&type=video&order=date&maxResults=' +
    this.maxResults + '&key=' + this.googleToken;

    // if you are interesting on pagination
    if (this.pageToken) {
        url +=  '&pageToken=' + this.pageToken;
    }

    this.http.get(url).map(res => res.json()).subscribe(data => {
      console.log(data.items);
      
    // populate post array  with the response
    this.posts = this.posts.concat(data.items);
    },

      // if error ocurs
    (error => {
      // show the error message
      this.no_result= true;

      //dismiss the loader
      this.loader.dismiss();
    }),

    // if sucessfully
    () => {
        this.loader.dismiss();
    });

  }

  playVideo (e, post){

    console.log(post);

    this.youtube.openVideo(post.id);

  }

}

Any ideas how to solve it?

Posts: 1

Participants: 1

Read full topic

Updatingionic project to last release version

$
0
0

@javiersoto1797 wrote:

I have tried to do some research but without luck, i have my CLI version up to date but the projects are still on the 4.4.0 release and i want to update them to the last one. How do i do it?
Thank you

Posts: 1

Participants: 1

Read full topic

Error while installing cordova-sqlite-storage

$
0
0

@rshivarkar wrote:

My command => ionic cordova plugin add cordova-sqlite-storage --save

Cordova version : 9.0.0 (cordova-lib@9.0.1)

Error:

ionic cordova plugin add cordova-sqlite-storage --save
cordova plugin add cordova-sqlite-storage --save
Installing “cordova-sqlite-storage” for android
installing external dependencies via npm
for package name: cordova-sqlite-storage
npm install of external dependencies ok
Unable to load PlatformApi from platform. Error: Cannot find module ‘properties-parser’
Failed to install ‘cordova-sqlite-storage’: Error [ERR_UNHANDLED_ERROR]: Unhandled error. (The platform “android” does not appear to be a valid cordova platform. It is missing API.js. android not supported.)
at CordovaEventEmitter.emit (events.js:178:17)
at CordovaEventEmitter.emit (C:\Users\shivarkr\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-common\src\events.js:69:22)
at Object.getPlatformApiFunction (C:\Users\shivarkr\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\util.js:384:20)
at Object.getPlatformApi (C:\Users\shivarkr\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\platforms.js:55:32)
at handleInstall (C:\Users\shivarkr\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:580:29)
at C:\Users\shivarkr\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:349:28
at process._tickCallback (internal/process/next_tick.js:68:7)
Unhandled error. (The platform “android” does not appear to be a valid cordova platform. It is missing API.js. android not supported.)

Posts: 1

Participants: 1

Read full topic

Horrible scrolling performance with just some text

$
0
0

@fermmm wrote:

I’m starting a project with Ionic 4 using React.
My problem is that a div with a couple of paragraphs of text to scroll with overflow-y: auto scrolls at 10fps in my phone (not a powerful phone). If I open chrome (in the device) and browse a website with a lot more text the scrolling is smooth, so the device and the browser is ok.
I added a console.log in all the render funcions and I’m rendering just once. Is this framework that slow? or it’s me?

Posts: 1

Participants: 1

Read full topic

Je n'arrive n'arrive pas à compiler mon application ionc4 sur android

$
0
0

@chifoidriss wrote:

Bonjour famille j’ai un souci après avoir développer mon application ionic 4.12 dans mon éditeur et mon navigateur web, je n’arrive toujours pas à compiler pour générer enfin le fichier apk.
Voici le message d’erreur que j’ai même après avoir tout installé


S’il vous plait une aide de votre part me serait de très grande faveur. Merci

Posts: 1

Participants: 1

Read full topic

Viewing all 70440 articles
Browse latest View live


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