Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

Set mode of alert and toast

$
0
0

You are in luck, you can actually call a setMode method on the alert object :smiley:

Like this:

let alert = this.alertCtrl.create({
   .......
   .......
});
alert.setMode("md");
alert.present();

About the toast though, I am not sure whether it looks much different on IOS as there is no exact native equivalent of toast there. So, I believe ionic would give it more or less the same look & feel. But, if you still need something then probably you can tweak some css.


[FRENCH BEGUINNER] I can't refresh my testpage

$
0
0

Hello everybody,

Firstly, sorry for my english...

I have a problem.
When i save home.html, she's refreshing but when i want to do samething for a testpage who i create, the first version display but i can't refresh her, where i can find the file for change that please?

Thank you very much.

Can't display a base64 image like a thumbnail

$
0
0

At the minimum, we need to see the code you are using to build the listeSignalements array to understand your problem.

Multiple Brands / White labeling

$
0
0

I have an app that a client wants to "white label" and sell to several different clients of theirs. Each will have the exact same functionality. Included in the build is a config file that selects the color scheme, logo, icons, and enables/disabled the required features. I have all of this in place.

My question is, is there a way to simplify the submission process to apple and google? I don't have an issue submitting the initial builds manually, but what if I have 50 versions floating out in the app stores and I need to release a bug fix?

Is there a way to submit the app to each app store through the cli or programmatically? or am I stuck submitting 50 app updates to each of the markets?

Multiple Brands / White labeling

$
0
0

Apparently while trying to find a way to explain my problem, I figured out a better way to ask google. It looks like google has an api for publishing updates or changes to apps (first must be submitting manually).

And for Apple, it looks like the best option is to use fastlane, and its "deliver" feature


Native Instagram login

$
0
0

Did you figure this out? How did you accomplish it?

Can anyone else supply a tutorial?

Native Instagram login

$
0
0

It's a hard problem. Working on it myself, and I've seen forums where devs complain about how hard Instagram makes it. So I don't have a solution yet, but you're not alone!

Ionic run time error

$
0
0

Hi,
I am getting below errors while running my ionic app using command 'ionic lab' and app is showing blank page (no content). I am new to ionic. Could anyone please help?

This is shown while I am opening console in developer option.

polyfills.js:3 Unhandled Promise rejection: No ErrorHandler. Is platform module (BrowserModule) included? ; Zone: ; Task: Promise.then ; Value: Error: No ErrorHandler. Is platform module (BrowserModule) included?
at core.es5.js:4754
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:4128)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at NgZone.run (core.es5.js:3996)
at PlatformRef_._bootstrapModuleFactoryWithZone (core.es5.js:4749)
at core.es5.js:4790
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3) Error: No ErrorHandler. Is platform module (BrowserModule) included?
at http://localhost:8100/build/main.js:5032:23
at t.invoke (http://localhost:8100/build/polyfills.js:3:8971)
at Object.onInvoke (http://localhost:8100/build/main.js:4406:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:8911)
at r.run (http://localhost:8100/build/polyfills.js:3:4140)
at NgZone.run (http://localhost:8100/build/main.js:4274:62)
at PlatformRef_._bootstrapModuleFactoryWithZone (http://localhost:8100/build/main.js:5027:23)
at http://localhost:8100/build/main.js:5068:59
at t.invoke (http://localhost:8100/build/polyfills.js:3:8971)
at r.run (http://localhost:8100/build/polyfills.js:3:4140)
n.onUnhandledError @ polyfills.js:3
polyfills.js:3 Error: Uncaught (in promise): Error: No ErrorHandler. Is platform module (BrowserModule) included?
Error: No ErrorHandler. Is platform module (BrowserModule) included?
at core.es5.js:4754
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:4128)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at NgZone.run (core.es5.js:3996)
at PlatformRef_._bootstrapModuleFactoryWithZone (core.es5.js:4749)
at core.es5.js:4790
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at core.es5.js:4754
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:4128)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at NgZone.run (core.es5.js:3996)
at PlatformRef_._bootstrapModuleFactoryWithZone (core.es5.js:4749)
at core.es5.js:4790
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
at
n.onUnhandledError @ polyfills.js:3

Thanks,
Shree


Can't display a base64 image like a thumbnail

$
0
0

Here is the complete code

import { Signal } from '../../models/signal';
import { SqliteCrudProvider } from './../../providers/sqlite-crud/sqlite-crud';
import { Component } from '@angular/core';
import { NavController, NavParams, IonicPage } from 'ionic-angular';

@IonicPage()
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  //variables formulaire récuperées
  public signalementFinal = new Signal();
  public listeSignalements : Array<Signal> = [ ];

  constructor(public navCtrl: NavController, public navParams: NavParams, private dbService: SqliteCrudProvider ) {
  }

  ionViewDidLoad(){
    //création de la base de données et de la table si non existantes
    this.dbService.createDatabase();

    //transfert des données SQLite vers le tableau 'listeSignalements' et Affichage
    this.dbService.selectAll(this.listeSignalements);

    /*
    *   Vérification de la présence de données saisies en cours
    *   afin d'éviter d'insérer des données 'vides' dans la base
    */
    let temp = this.navParams.get('signal.signalement');
    if (temp!='') {
      this.signalementFinal = this.navParams.get('signal');

      //insertion des données récupérées duu formaulaire dans la base de données locale SQLite
      this.dbService.insertInto(this.signalementFinal);
    }
  }

  //méthode pour naviguer vers la page formulaire
  addSignal() {
    this.navCtrl.push('FormulairePage');
 }

  //méthode d'ouverture de la page détaillant les principales infos du signalement
  openSignal(signal) {
    this.navCtrl.push('SignaldetailsPage', {
      signalement: signal
    });
  }

  //suppression du signalement...
  delete(signal) {
    //...dans la base de données
    this.dbService.deleteSignal(signal);

    //...de la liste des signalements
    let index = this.listeSignalements.indexOf(signal);
    if (index > -1) {
      this.listeSignalements.splice(index, 1);
    }
  }
}

and the Signal Model imported in the HomePage

export class Signal {
    idSignalement: number;
    signalement: string;
    categorie: string;
    commentaires: string;
    date: string;
    base64Image: string;
    latitude: number;
    longitude: number;

    constructor() {
        this.idSignalement = null;
        this.signalement = '';
        this.categorie = '';
        this.commentaires = '';
        this.date = '';
        this.base64Image = '';
        this.latitude = null;
        this.longitude = null;
    }
}

And in the case you will need my SQLite queries request provider code, here he is :wink:

/*
  Generated class for the SqliteCrudProvider provider.

  See https://angular.io/docs/ts/latest/guide/dependency-injection.html
  for more info on providers and Angular DI.
*/

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite';

const DATABASE_NAME: string = 'signalementsDatabase.db';
const TABLE_SIGNALEMENTS = 'CREATE TABLE IF NOT EXISTS "signalements" ( `idsignalement` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `signalement` TEXT NOT NULL, `commentaires` TEXT NOT NULL, `date` TEXT NOT NULL, `base64image` BLOB NOT NULL, `longitude` INTEGER NOT NULL, `latitude` INTEGER NOT NULL, `categorie` TEXT NOT NULL )';

@Injectable()
export class SqliteCrudProvider {

  constructor(public http: Http, public sqlite: SQLite) {
  }

  //création de la base de données 'signalsDatabase.db' et des tables 'signalements' et 'categories'
  public createDatabase() {
    this.sqlite.create({name: DATABASE_NAME,
                        location: 'default'
    })
    .then((db: SQLiteObject) => {
      console.log('Connecté à la base de données...');
      db.executeSql(TABLE_SIGNALEMENTS, {})
      .then(() =>
        console.log('Création de la table SIGNALEMENTS réussie'))
      .catch(e => console.log('erreur création table' + e));
      })
    .catch(e => console.log('erreur connexion BD : ' + e));
  }

  //méthode d'insertion des données dans la base
  public insertInto(signal_details) {
    let insert_query = 'INSERT INTO `signalements` (signalement, categorie, commentaires, date, base64Image, longitude, latitude) VALUES (?, ?, ?, ?, ?, ?, ?)';
    let tabCategorie: Array<string> = signal_details.categorie;
    let categorie: string ='';

    //conversion du tableau catégorie en string en vue du stockage sqlite
    categorie = this.convertArrayToString(tabCategorie);

    this.sqlite.create({name: DATABASE_NAME,
                        location: 'default'
    })
    .then((db: SQLiteObject) => {
      db.executeSql(insert_query, [signal_details.signalement,
                                   categorie,
                                   signal_details.commentaires,
                                   signal_details.date,
                                   signal_details.base64Image,
                                   signal_details.longitude,
                                   signal_details.latitude
                                   ])
      .then((data) => alert("Insert Into OK"))
      .catch((e) => alert('erreur insert Into : ' + e));
      })
    .catch(e => alert('erreur connexion BD : ' + e));
  }

  //méthode permettant de convertir un Array en String car SQLite ne permet pas de sauvegarder des variables de type Array
  convertArrayToString(tabCategorie: Array<string>) {
    let nomsArray : string = '';
    for (let i = 0; i < tabCategorie.length; i++) {
      nomsArray = nomsArray + tabCategorie[i];
      if (i < tabCategorie.length - 1) {
        nomsArray = nomsArray + ",";
      }
    }
  return nomsArray;
  }

  //méthode de mise à jour du signalement
  public updateSignal(signal_details) {
    let update_query = 'UPDATE `signalements` SET signalement = ?, categorie = ?, commentaires = ?, date = ?, base64Image = ?, longitude = ?, latitude = ? WHERE idsignalement = ?';
    let tabCategorie: Array<string> = signal_details.categorie;
    let categorie: string ='';
    categorie = this.convertArrayToString(tabCategorie);

    this.sqlite.create({name: DATABASE_NAME,
                        location: 'default'
    })
    .then((db: SQLiteObject) => {
      db.executeSql(update_query, [signal_details.signalement,
                                   categorie,
                                   signal_details.commentaires,
                                   signal_details.date,
                                   signal_details.base64Image,
                                   signal_details.longitude,
                                   signal_details.latitude,
                                   signal_details.idSignalement
                                   ])
      .then((data) => alert("update query OK"))
      .catch((e) => alert('erreur update : ' + e));
      })
    .catch(e => alert('erreur connexion BD : ' + e));
  }

  //méthode de lecture des données de la base
  public selectAll(tabSignalements){
    this.sqlite.create({name: DATABASE_NAME,
                        location: 'default'
    })
    .then((db: SQLiteObject) => {
      db.executeSql('SELECT * FROM `signalements`', [])
      .then((data) => {
        if (data == null) {
          console.log('aucune données dans la base');
          return;
        }
        if (data.rows) {
          if (data.rows.length > 0) {
            for (var i=0; i < data.rows.length; i++) {
              tabSignalements.push(data.rows.item(i))
              console.log('données exportées');
            }
          }
        }})
    .catch(e => console.log(e));
  })
  .catch(e => console.log(e));
  }

  //méthode de suppression de la table
  public dropDatabase(){
    this.sqlite.deleteDatabase({name: DATABASE_NAME,
                                location: 'default'
                              })
  }

  //méthode de suppression d'un signalement
  public deleteSignal(signal_details) {
    let deleteQuery = 'DELETE FROM `signalements` WHERE idsignalement = ?';

    this.sqlite.create({name: DATABASE_NAME,
                        location: 'default'
    })
    .then((db: SQLiteObject) => {
      db.executeSql(deleteQuery, [signal_details.idSignalement
                                 ])
      .then((data) => alert("Suppression des données réussie"))
      .catch((e) => alert('erreur delete from: ' + e));
      })
      .catch(e => alert('erreur connexion BD : ' + e));
  }
}

I can not install local Notification and Cordova Toast plugin

$
0
0

Do I have to remove cordova platform android and then try installing plugins again?

Is the command to remove ionic cordova platform remove android?

Increment variable faster while pressing button

Remove top bar in windows

$
0
0

I am trying to remove the top bar (the one with the app title, close and minimize button) on a Windows app.

This plugin appears to do what I need cordova-fs-plugin-fullscreen just not sure how to get it to work in my ionic app.

Any help is appreciated.

How to write data to a csv file in ionic

$
0
0

So you want to put a .csv file on the device.

Okay, 2 steps: 1) Build the file as a "string" in memory first, then 2) write the stuff you have onto the device.

Step 2 is pretty standard, look at https://ionicframework.com/docs/native/file/

For step 1 you have to understand what you actually want to build. What data should be in there? How should it be seperated?
Then you have to find a way to transform the array of data you have into that format. One "naive" way is to loop over the data with for ... loop and add to a string at the end. When the string is in the correct format, go on with step 2. (The other non-naive way is to find a library to build a CSV from an array automatically. They probably exist, but you will have to find the right one that works.).

Error: exporting my App from Creator

$
0
0

This is a necessary and essential step. You have to make it work.

Set mode of alert and toast

$
0
0

Thanks a lot. For the toast I just see that it is more beautiful with ios mode :slight_smile:


Multiple Brands / White labeling

$
0
0

Yeah I just keep the branding and labeling in one directory for each brand where I can copy over the directory into the build directory and then rebuild the app for each brand. Each one is just at a particular version of the code base (i.e. brand A is v2.3, brand B is v2.4, etc). If I have a bug fix I make a v2.5 and then bring each app up to v2.5 and release each one (ick manually)

I can not install local Notification and Cordova Toast plugin

$
0
0

Yes, sorry I didn't explain it further:
ionic cordova platform remove android to remove the Android platform, ionic cordova platform add android to add it again. The plugins should be installed when the platform is added if they were installed correctly before. Run ionic cordova plugin list to check.

Error: exporting my App from Creator

$
0
0

I've create a new project the same way I did the first time and following the same steps and it finally worked.

I've been able to generate de .apk file for release and upload it after some troubles. I will make a guide about what i've done, maybe someone could have the same problems i had.

Now let's see if i can create

Thank you Sujan12 for your help and answering me those many times i have bother you . I really appreciate that man.

Ionic Push custom sound not works!

$
0
0

What did you do? What code did you write?

I can not install local Notification and Cordova Toast plugin

$
0
0

Thanks for the reply, now I try.

Viewing all 228535 articles
Browse latest View live


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