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

No console log output when running on device using Ionic 4?

$
0
0

@franzisk4sis wrote:

Hey all,

What happened that now when I run the app on debug mode on the the device I cannot see output on console anymore?

I just run:
% ionic cordova run android -lc

The apps runs on my Samsung device but none of my debug outputs are displayed on my terminal console (Mac computer), what I see is just Ionic outputs, something like:

...
[ng] Date: 2019-02-15T17:31:26.394Z
[ng] Hash: ae25cfd2ee8089660e5e
[ng] Time: 55056ms
[ng] chunk {common} common.js, common.js.map (common) 20.6 kB  [rendered]
[ng] chunk {cordova} cordova.js, cordova.js.map (cordova) 71.1 kB [entry] [rendered]
[ng] chunk {main} main.js, main.js.map (main) 72.1 kB [initial] [rendered]
[ng] chunk {pages-about-about-module} pages-about-about-module.js, pages-about-about-module.js.map (pages-about-about-module) 5.93 kB  [rendered]
[ng] chunk {pages-cards-cards-module} pages-cards-cards-module.js, pages-cards-cards-module.js.map (pages-cards-cards-module) 22.9 kB  [rendered]
[ng] chunk {pages-chats-chats-module} pages-chats-chats-module.js, pages-chats-chats-module.js.map (pages-chats-chats-module) 6.35 kB  [rendered]
[ng] chunk {pages-contacts-contacts-module} pages-contacts-contacts-module.js, pages-contacts-contacts-module.js.map (pages-contacts-contacts-module) 6.14 kB  [rendered]
[ng] chunk {pages-groups-details-details-module} pages-groups-details-details-module.js, pages-groups-details-details-module.js.map (pages-groups-details-details-module) 6.13 kB  [rendered]
[ng] chunk {pages-groups-groups-module} pages-groups-groups-module.js, pages-groups-groups-module.js.map (pages-groups-groups-module) 6.42 kB  [rendered]
[ng] chunk {pages-home-home-module} pages-home-home-module.js, pages-home-home-module.js.map (pages-home-home-module) 23.6 kB  [rendered]
[ng] chunk {pages-login-login-module} pages-login-login-module.js, pages-login-login-module.js.map (pages-login-login-module) 7.56 kB  [rendered]
[ng] chunk {pages-nearby-nearby-module} pages-nearby-nearby-module.js, pages-nearby-nearby-module.js.map (pages-nearby-nearby-module) 6.42 kB  [rendered]
[ng] chunk {pages-profile-profile-module} pages-profile-profile-module.js, pages-profile-profile-module.js.map (pages-profile-profile-module) 6.49 kB  [rendered]
[ng] chunk {pages-register-register-module} pages-register-register-module.js, pages-register-register-module.js.map (pages-register-register-module) 6.59 kB  [rendered]
[ng] chunk {pages-settings-settings-module} pages-settings-settings-module.js, pages-settings-settings-module.js.map (pages-settings-settings-module) 6.56 kB  [rendered]
[ng] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 236 kB [initial] [rendered]
[ng] chunk {runtime} runtime.js, runtime.js.map (runtime) 9.49 kB [entry] [rendered]
[ng] chunk {styles} styles.js, styles.js.map (styles) 400 kB [initial] [rendered]
[ng] chunk {tabs-tabs-module} tabs-tabs-module.js, tabs-tabs-module.js.map (tabs-tabs-module) 9.38 kB  [rendered]
[ng] chunk {vendor} vendor.js, vendor.js.map (vendor) 6.23 MB [initial] [rendered]
[INFO] ... and 173 additional chunks
[ng] ℹ 「wdm」: Compiled successfully.
[cordova]  LAUNCH SUCCESS

I really need to see those outputs, what can I do?

Posts: 1

Participants: 1

Read full topic


Multiple firebase projects

$
0
0

@cfwebsitesde wrote:

Hey there,

is it possible to init a second firebase DB Project while runtime after the customer submit a id which is needed to get the second firebase config ?

After receiving the config of DB2 I want to store the config in the storage so that the user doesn’t have to submit the id again and can work with DB2…

Posts: 1

Participants: 1

Read full topic

Ionic native with import /ngx don't work in 15/02/2019

$
0
0

@azizsana wrote:

All ionic native with import …/ngx don’t work in 15/02/2019 for me and i really don’t understand

I’m using

  • ionic 4.6.0
  • cordova 8.1.2 (cordova-lib@8.1.1)
  • npm 6.50

Anyone to help me please

Posts: 1

Participants: 1

Read full topic

Android backbutton catch and handle exit app

$
0
0

@heidji wrote:

There have been a few topics on how to handle the back button primarily for functions like press back twice to exit etc, and the main issue was that users didn’t want to override the functionality for the whole app just to handle it on one page or a specific scenario… some others had the problem when using tabs applications when app.goBack() failed or popped the wrong pages.

I therefore created a plugin that helps handling all of these scenarios without having to worry about losing the default behavior and the ability to revert overrides…

If you still are having problems implementing the android back button handling then ths plugin could be for you. Please read the examples in the README in order to understand how it works.

npm package

Posts: 1

Participants: 1

Read full topic

Stuck on IOS In App Purchase when submit Product to review

Having issues with devApp

$
0
0

@dev-gilbert wrote:

I’m currently having issues trying to open my app with the devApp, I run the command ionic serve -c but I don’t see the project listed in the devApp, it just keeps searching.

I created my project with the following command: ionic start myApp type=angular --cordova

Is there something missing here to test my app with the devApp on my phone?

Posts: 3

Participants: 2

Read full topic

Adding platforms later in development (with Cordova)

$
0
0

@GrahamW wrote:

Hello!

I was just wondering if it was possible to add additional platforms later in development. An example of this would be, I just finished developing a UI outline for my application and have been testing it on android and the browser. Would I then be able to use a command such as ‘ionic cordova platform add ios’ to add iOS as a new platform? Or do the platforms of an app need to be determined at the beginning of development?

Thanks!

Posts: 2

Participants: 2

Read full topic

LocalNotification.on('click'...Error


Ionic 4. How to programmaticaly navigate back with Angular Router

$
0
0

@EugeneVB wrote:

Hi, i’m making PWA, and I need navigate back (with back transitions) to custom route (not parent).
With button all works

<ion-button [routerLink]="['','someroute']" routerDirection="back">
        <ion-icon slot="icon-only" name="arrow-back"></ion-icon>
</ion-button>

But how can I do it with router.navigate()?
There is Location.back(), but it’s not good when current route was first (users can open my app not at root route, and Location.back() will return them to their history)

Posts: 1

Participants: 1

Read full topic

(Ionic 4) toolbar title truncated

$
0
0

@guidosl wrote:

Long title appears truncated on a small screen

word-wrap: break-word inside ion-title do not work

14

How I can get this?

Posts: 1

Participants: 1

Read full topic

Error on Upload image and also the uploaded image will update the database for changing profile picture (PHP)

$
0
0

@kimjosh187 wrote:

uploadImage(){
if(this.clickedImagePath = null){
this.presentToast(“Don’t leave any field.”);
}

else{
  const actionSheet = this.actionSheetCtrl.create({
    title: 'Update changes?',
    buttons: [
      {
        text: 'Yes',
        handler: () => {
          let loader = this.loadingCtrl.create({
            content: "Uploading..."
          });
          loader.present();


    let completeUrl = this.url;
    let postData = new FormData()
    postData.append('file', this.clickedImagePath, this.userid);
    let data:Observable<any> = this.http2.post(completeUrl, postData);
    data.subscribe((result) => {
      console.log(result);
      alert("Success");
      loader.dismiss();
    }, (err) => {
      console.log(err);
      alert("Error");
      loader.dismiss();
    });
  }
},{
  text: 'Cancel',
  role: 'cancel',
  handler: () => {
    console.log('Cancel clicked');
  }
}

]
});
actionSheet.present();
}
}

This is my code for uploading image to the server

<?php $data = [ 'result' => false]; $target_path = time().'.jpg'; if (isset($_POST['file'])) { $img = mysqli_real_escape_string($con, $_REQUEST['img']); $id = mysqli_real_escape_string($con, $_REQUEST['id']); $sql1 = mysqli_query($con,"SELECT * from sl_user where u_id = '".$id."'"); $row=mysqli_fetch_array($sql1); $imgs = $row['u_image']; $sql4 = "UPDATE sl_user SET u_image='".$img."' WHERE u_id='".$id."'"; if(mysqli_query($con,$sql4)) { $row_array['type'] = "sucess"; die(json_encode($row_array)); } else{ $row_array['msg'] = 'Ooops - something went wrong: '.mysqli_error($con); $row_array['type'] = "error"; die(json_encode($row_array)); } $imagedata = $_POST['file']; $imagedata = str_replace('data:image/jpeg;base64','', $imagedata); $imagedata = str_replace('data:image/jpg;base64','', $imagedata); $imagedata = str_replace(' ','+', $imagedata); $imagedata = base64_decode($imagedata); file_put_contents($target_path, $imagedata); $data['result'] = true; $data['image_url'] = 'http://slcal.net/images/'.$target_path; } header('Access-Control-Allow-Origin: *'); header('Content-Type: application/json'); echo json_encode($data); ?>

This is the php server code

It will not upload and also update the database.
I would appreciate those who help me with this error. Thanks

Posts: 1

Participants: 1

Read full topic

Ionic v1 application issue with Chrome WebView

$
0
0

@lincolnminto wrote:

Application works fine on browser (ionic serve) but running with Chrome WebView implementation (72.0.3626.105) my app crashes and goes to background just after launching (after splash screen)

Using other WebView implementation such as Android System WebView (61.0.3163.98) it works fine.

ps.: If I try to reopen it repeatedly it ends opening and working.

I have no idea what is going on here. :cold_sweat:

No significant error is throw:

02-15 19:11:18.570 927-4122/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=io.cronapp.apps.testmotog/.MainActivity bnds=[31,808][235,1086]} from uid 1000
02-15 19:11:18.674 24620-24620/io.cronapp.apps.testmotog I/CordovaLog: Changing log level to VERBOSE(2)
02-15 19:11:18.674 24620-24620/io.cronapp.apps.testmotog I/CordovaActivity: Apache Cordova native platform version 7.1.4 is starting
02-15 19:11:18.674 24620-24620/io.cronapp.apps.testmotog D/CordovaActivity: CordovaActivity.onCreate()
02-15 19:11:18.726 24620-24620/io.cronapp.apps.testmotog D/SystemWebViewEngine: CordovaWebView is running on device made by: ZUK
02-15 19:11:18.738 24620-24620/io.cronapp.apps.testmotog D/PluginManager: init()
02-15 19:11:18.743 24620-24620/io.cronapp.apps.testmotog D/CordovaWebViewImpl: >>> loadUrl(file:///android_asset/www/index.html)
02-15 19:11:18.774 927-10300/system_process I/ActivityManager: Start proc 24754:com.android.chrome:sandboxed_process1/u0i100 for webview_service io.cronapp.apps.testmotog/org.chromium.content.app.SandboxedProcessService1
02-15 19:11:18.776 24620-24620/io.cronapp.apps.testmotog D/CordovaActivity: Started the activity.
02-15 19:11:18.783 24620-24620/io.cronapp.apps.testmotog D/CordovaActivity: Resumed the activity.
02-15 19:11:18.799 24620-24620/io.cronapp.apps.testmotog D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)
02-15 19:11:18.898 927-963/system_process I/ActivityManager: Displayed io.cronapp.apps.testmotog/.MainActivity: +276ms
02-15 19:11:19.569 24620-24620/io.cronapp.apps.testmotog D/JsMessageQueue: Set native->JS mode to EvalBridgeMode
02-15 19:11:20.019 24620-24661/io.cronapp.apps.testmotog E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/views/logged/home.view.html
02-15 19:11:20.039 24620-24648/io.cronapp.apps.testmotog E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/views/login.view.html
02-15 19:11:20.060 24620-24620/io.cronapp.apps.testmotog D/CordovaActivity: Paused the activity.
02-15 19:11:20.117 24620-24620/io.cronapp.apps.testmotog D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
02-15 19:11:20.332 24620-24708/io.cronapp.apps.testmotog I/App: WARNING: Back Button Default Behavior will be overridden.  The backbutton event will be fired!
02-15 19:11:20.439 24620-24620/io.cronapp.apps.testmotog D/CordovaActivity: Stopped the activity.
02-15 19:11:20.440 24620-24620/io.cronapp.apps.testmotog D/CordovaActivity: CordovaActivity.onDestroy()
02-15 19:11:20.448 24620-24620/io.cronapp.apps.testmotog D/CordovaWebViewImpl: >>> loadUrl(about:blank)
02-15 19:11:20.460 24620-24620/io.cronapp.apps.testmotog W/cr_AwContents: WebView.destroy() called while WebView is still attached to window.
02-15 19:11:20.563 927-1926/system_process W/ActivityManager: Scheduling restart of crashed service io.cronapp.apps.testmotog/org.chromium.content.app.SandboxedProcessService1 in 1000ms
02-15 19:11:20.574 24620-24642/io.cronapp.apps.testmotog W/cr_ChildProcessConn: onServiceDisconnected (crash or killed by oom): pid=24754

Posts: 1

Participants: 1

Read full topic

How to get value from multiple check box as well as textbox

$
0
0

@flycoders_sourav wrote:

I have a multiple a check and when user clicks on anyone checkbox there open a text box and the user can put there any value in this textbox also i attached my desire outputScreenshot_97
.html

  <ion-item *ngFor="let abc of serviceList">
      <ion-label>{{abc.servicenam}}</ion-label>
      <ion-checkbox color="dark" (click)="isActive = !isActive"></ion-checkbox>
  </ion-item>
  <div *ngIf="isActive">
      <button color="light" ion-button small>Red</button>
      <button color="light" ion-button small>Green</button>
      <button color="light" ion-button small>Yellow</button>
      <button color="light" ion-button small>Blue</button>
   </div>

please help me out

Posts: 1

Participants: 1

Read full topic

(Ionic 4) how to build two menus

How to identify if a bluetooth device is a printer in ionic

$
0
0

@fordyfy wrote:

can you teach me how to scan only bluetooth device? i don’t know how to do it. here’s my code. My goal is to get only type of bluetooth printer devices.

printer classs

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController, AlertController, ToastController  } from 'ionic-angular';
import {PrintProvider} from '../../providers/print/print';
import { DatabaseProvider } from '../../providers/database/database';

@IonicPage()
@Component({
  selector: 'page-printer',
  templateUrl: 'printer.html',
})
export class PrinterPage {
  SelectedPrinter:any = [];
  Bluetooth_Printer_List:any = []
  Bluetooth_Name: string = null
  Bluetooth_ID: string = null
  Bluetooth_Address:string = null
  Bluetooth_Device_List:any = []

  constructor(public navCtrl: NavController, public navParams: NavParams, private modalCtrl:ModalController,
    private printProvider:PrintProvider, private alertCtrl:AlertController, 
    public toastCtrl: ToastController, private database: DatabaseProvider) {
  }

  ionViewDidLoad() {
    
  }

  ionViewDidEnter(){
    this.getBluetoothPrinter()
  }

  getBluetoothPrinter(){
    this.database.readBluetoothPrinter().then(data=>{
      this.Bluetooth_Printer_List = data
      this.Bluetooth_Name = this.Bluetooth_Printer_List[0].bluetooth_name
      this.Bluetooth_Address = this.Bluetooth_Printer_List[0].bluetooth_address
      this.Bluetooth_ID = this.Bluetooth_Printer_List[0].bluetooth_id
    }, (error) => {
      console.log(error);
    })
  }

  listBTDevice()
  {
    this.printProvider.searchBt().then(datalist=>{
      
      this.Bluetooth_Device_List = datalist
      this.showBluetoothDeviceList()

    },err=>{
      this.errorToast(err);
    })
  }

  testConnectPrinter()
  {
    var id = this.Bluetooth_ID

    if(id==null||id==""||id==undefined)
    {
      //nothing happens, you can put an alert here saying no printer selected
      this.informationtoast("Please select printer.");
    }
    else
    {
        this.printProvider.connectBT(id).subscribe(data=>{
          this.informationtoast("Connected successfully!");
      },err=>{
        this.informationtoast(err);
      });
    }
  }

  testPrinter()
  {
    var id = this.Bluetooth_ID
    if(id==null||id==""||id==undefined)
    {
      //nothing happens, you can put an alert here saying no printer selected
      this.informationtoast("Please select printer.");
    }
    else
    {
      this.printProvider.formatPrint(id);
    }
  }

  informationtoast(textMessage: string) {
    const toast = this.toastCtrl.create({
      message: textMessage,
      duration: 3000,
      cssClass: 'information-toast'

    });
    toast.present();
  }

  errorToast(textMessage: string) {
    const toast = this.toastCtrl.create({
      message: textMessage,
      duration: 3000,
      cssClass: 'error-toast'
    });
    toast.present();
  }

  saveDefaultBlutoothPrinter(){
    this.database.insertBluetoothPrinter(this.SelectedPrinter);
    this.getBluetoothPrinter()
  }
  

  showBluetoothDeviceList() {

    let alert = this.alertCtrl.create();
    alert.setTitle('Bluetooth device list');

    for(var i = 0; this.Bluetooth_Device_List.length > i ; i++){
      alert.addInput({
        type: 'radio',
        label: this.Bluetooth_Device_List[i].name,
        value: this.Bluetooth_Device_List[i].name
      });
    }
  
    alert.addButton('Cancel');
    alert.addButton({
      text: 'OK',
      handler: data => {
       this.getBluetoothDeviceData(data)
       this.saveDefaultBlutoothPrinter()
      }
    });
    alert.present();
  }

  getBluetoothDeviceData(bluetooth_name: string){
    this.Bluetooth_Device_List.forEach(element => {
      if(element.name ==bluetooth_name ){
        this.SelectedPrinter = element
      }
      
    });
  }
}

  

bluetooth provider class

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import {AlertController, LoadingController, ToastController } from 'ionic-angular';
import { BluetoothSerial } from '@ionic-native/bluetooth-serial';
import {MutableBuffer} from 'mutable-buffer';

/**
 * RGB interface
 */
interface IRGB {
  r: number;
  g: number;
  b: number;
  a: number;
}

@Injectable()
export class PrintProvider {

  buff=new MutableBuffer(1000,1000);
  
  constructor(public http: HttpClient, private btSerial:BluetoothSerial, 
    private alertCtrl:AlertController , public loadingCtrl: LoadingController, public toastCtrl: ToastController) {
    
  }

  searchBt()
  {
    return this.btSerial.list();
  }

  connectBT(bluetooth_address)
  {
    return this.btSerial.connect(bluetooth_address);
  }  

  disconnectBT(){
    this.btSerial.disconnect();
  }

  formatPrint(bluetooth_address){
    var temp_date = new Date();
    var year = temp_date.getFullYear();
    var month = temp_date.getMonth().toString();
    var day = temp_date.getDate();

    var hour = temp_date.getHours();
    var minutes = temp_date.getMinutes();
    var period = "AM"

    if(hour > 12){
      var result = Number.parseInt(hour.toString()) - 12
      hour =  result
      period = "PM"
    }

    var time = hour + ":" + minutes +" " + period

    var todayDate = month + "/" + day + "/" + year + " " + time
   
    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_CT);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_ON);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_2HEIGHT);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_2WIDTH);

    this.buff.write("PCG Cellphone Shop");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    
    this.buff.write(this.Command.TEXT_FORMAT.TXT_NORMAL);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_OFF);

    this.buff.write("Plaza Burgos, Guagua, Pampanga");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF); //2 lines
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_OFF);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_OFF);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_FONT_A);

    this.buff.write("Smart Padala No.");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write("5577-5194-0426-6109");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    
    this.buff.write("5577-5194-0426-7109");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write("0999-3209009");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF); //2 lines
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
/////////////////////////////////////////////////////////////
    this.buff.write("Cashier: PCG Sales POS");

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write("POS: SP POS 1");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF); //2 lines
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);

    this.buff.write("Customer: Nora B. Beiza");

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write("09430359637");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write("------------------------------------------------");
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);

    this.buff.write("Receive - Smart Padala:   ");
    this.buff.write("2,000.00");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write("1 x 2,000.00");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write("20Jan 10:19: Received P2,000.00 with P23.00 commission from 09393965558 to PCG LA.LIBRE ang pag-claim! Ref:174813715fdf Bal:P16,297.84");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write("03. 1,500.01 to 2,000 -> ");
    this.buff.write("0.00");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write("Receive Charge");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write("1 x 0.00");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write("------------------------------------------------");
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_ON);

    this.buff.write("Total:   ");
    this.buff.write("2,000.00");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_LT);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_OFF);
    this.buff.write(this.Command.TEXT_FORMAT.TXT_NORMAL);

    this.buff.write("Cash:   ");
    this.buff.write("2,000.00");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write("------------------------------------------------");
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
/////////////////////////////////////////////////////////////

    this.buff.write(this.Command.TEXT_FORMAT.TXT_ALIGN_CT);
    this.buff.write("Thank you for choosing Smart Padala!");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_ON);
    this.buff.write("Bald Puppies Solutions Inc.");
    this.buff.write(this.Command.TEXT_FORMAT.TXT_BOLD_OFF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF); 
    this.buff.write("2nd Floor, Traders Square Building");
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write("P. Burgos Street");
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write("Naga, Camarines Sur 4400");
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write("(054) 881 1748");

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);
    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.buff.write(todayDate);

    this.buff.write(this.Command.FEED_CONTROL_SEQUENCES.CTL_LF);

    this.presentLoading();
    let xyz=this.connectBT(bluetooth_address).subscribe(data=>{
      this.btSerial.write(this.buff.buffer).then(dataz=>{
        this.buff.flush();
        this.buff.write(this.Command.HARDWARE.HW_INIT)

       this.informationtoast("Print successfully!");

        xyz.unsubscribe();
      },errx=>{
        this.buff.flush();
        this.buff.write(this.Command.HARDWARE.HW_INIT)
        this.errorToast("Print failed.");

      });
      },err=>{
        this.buff.flush();
        this.buff.write(this.Command.HARDWARE.HW_INIT)
        this.disconnectBT();
        this.errorToast("Connection error.");
      });
  }

  Command={
    LF: '\x0a', //Line feed for new lines
    EOL: '\n', //end of line
    FEED_CONTROL_SEQUENCES: {
        CTL_LF: '\x0a', // Print and line feed
        CTL_FF: '\x0c', // Form feed
        CTL_CR: '\x0d', // Carriage return
        CTL_HT: '\x09', // Horizontal tab
        CTL_VT: '\x0b', // Vertical tab
    },
    LINE_SPACING: {
        LS_DEFAULT: '\x1b\x32',  //Spacing
        LS_SET: '\x1b\x33'  //Spacing
    },
    HARDWARE: {
        HW_INIT: '\x1b\x40', // Clear data in buffer and reset modes
        HW_SELECT: '\x1b\x3d\x01', // Printer select
        HW_RESET: '\x1b\x3f\x0a\x00', // Reset printer hardware
    },
    CASH_DRAWER: {
        CD_KICK_2: '\x1b\x70\x00', // Sends a pulse to pin 2 []
        CD_KICK_5: '\x1b\x70\x01', // Sends a pulse to pin 5 []
    },
    MARGINS: {
        BOTTOM: '\x1b\x4f', // Fix bottom size
        LEFT: '\x1b\x6c', // Fix left size
        RIGHT: '\x1b\x51', // Fix right size
    },
    PAPER: {
        PAPER_FULL_CUT: '\x1d\x56\x00', // Full cut paper
        PAPER_PART_CUT: '\x1d\x56\x01', // Partial cut paper
        PAPER_CUT_A: '\x1d\x56\x41', // Partial cut paper
        PAPER_CUT_B: '\x1d\x56\x42', // Partial cut paper
    },
    TEXT_FORMAT: {
        TXT_NORMAL: '\x1b\x21\x00', // Normal text
        TXT_2HEIGHT: '\x1b\x21\x10', // Double height text
        TXT_2WIDTH: '\x1b\x21\x20', // Double width text
        TXT_4SQUARE: '\x1b\x21\x30', // Double width & height text

        TXT_CUSTOM_SIZE: function(width, height) { // other sizes
            var widthDec = (width - 1) * 16;
            var heightDec = height - 1;
            var sizeDec = widthDec + heightDec;
            return '\x1d\x21' + String.fromCharCode(sizeDec);
        },

        TXT_HEIGHT: {
            1: '\x00',
            2: '\x01',
            3: '\x02',
            4: '\x03',
            5: '\x04',
            6: '\x05',
            7: '\x06',
            8: '\x07'
        },
        TXT_WIDTH: {
            1: '\x00',
            2: '\x10',
            3: '\x20',
            4: '\x30',
            5: '\x40',
            6: '\x50',
            7: '\x60',
            8: '\x70'
        },

        TXT_UNDERL_OFF: '\x1b\x2d\x00', // Underline font OFF
        TXT_UNDERL_ON: '\x1b\x2d\x01', // Underline font 1-dot ON
        TXT_UNDERL2_ON: '\x1b\x2d\x02', // Underline font 2-dot ON
        TXT_BOLD_OFF: '\x1b\x45\x00', // Bold font OFF
        TXT_BOLD_ON: '\x1b\x45\x01', // Bold font ON
        TXT_ITALIC_OFF: '\x1b\x35', // Italic font ON
        TXT_ITALIC_ON: '\x1b\x34', // Italic font ON

        TXT_FONT_A: '\x1b\x4d\x00', // Font type A //normal font
        TXT_FONT_B: '\x1b\x4d\x01', // Font type B //small font
        TXT_FONT_C: '\x1b\x4d\x02', // Font type C //normal font

        TXT_ALIGN_LT: '\x1b\x61\x00', // Left justification
        TXT_ALIGN_CT: '\x1b\x61\x01', // Centering
        TXT_ALIGN_RT: '\x1b\x61\x02', // Right justification
    },
    BARCODE_FORMAT: {
        BARCODE_TXT_OFF: '\x1d\x48\x00', // HRI barcode chars OFF
        BARCODE_TXT_ABV: '\x1d\x48\x01', // HRI barcode chars above
        BARCODE_TXT_BLW: '\x1d\x48\x02', // HRI barcode chars below
        BARCODE_TXT_BTH: '\x1d\x48\x03', // HRI barcode chars both above and below

        BARCODE_FONT_A: '\x1d\x66\x00', // Font type A for HRI barcode chars
        BARCODE_FONT_B: '\x1d\x66\x01', // Font type B for HRI barcode chars

        BARCODE_HEIGHT: function(height) { // Barcode Height [1-255]
            return '\x1d\x68' + String.fromCharCode(height);
        },
        // Barcode Width  [2-6]
        BARCODE_WIDTH: {
            1: '\x1d\x77\x02',
            2: '\x1d\x77\x03',
            3: '\x1d\x77\x04',
            4: '\x1d\x77\x05',
            5: '\x1d\x77\x06',
        },
        BARCODE_HEIGHT_DEFAULT: '\x1d\x68\x64', // Barcode height default:100
        BARCODE_WIDTH_DEFAULT: '\x1d\x77\x01', // Barcode width default:1

        BARCODE_UPC_A: '\x1d\x6b\x00', // Barcode type UPC-A
        BARCODE_UPC_E: '\x1d\x6b\x01', // Barcode type UPC-E
        BARCODE_EAN13: '\x1d\x6b\x02', // Barcode type EAN13
        BARCODE_EAN8: '\x1d\x6b\x03', // Barcode type EAN8
        BARCODE_CODE39: '\x1d\x6b\x04', // Barcode type CODE39
        BARCODE_ITF: '\x1d\x6b\x05', // Barcode type ITF
        BARCODE_NW7: '\x1d\x6b\x06', // Barcode type NW7
        BARCODE_CODE93: '\x1d\x6b\x48', // Barcode type CODE93
        BARCODE_CODE128: '\x1d\x6b\x49', // Barcode type CODE128
    },
    CODE2D_FORMAT: {
        TYPE_PDF417: '\x1b\x5a\x00',
        TYPE_DATAMATRIX: '\x1b\x5a\x01',
        TYPE_QR: '\x1b\x5a\x02',
        CODE2D: '\x1b\x5a',
    },
    IMAGE_FORMAT: {
        S_RASTER_N: '\x1d\x76\x30\x00', // Set raster image normal size
        S_RASTER_2W: '\x1d\x76\x30\x01', // Set raster image double width
        S_RASTER_2H: '\x1d\x76\x30\x02', // Set raster image double height
        S_RASTER_Q: '\x1d\x76\x30\x03', // Set raster image quadruple
    },
    BITMAP_FORMAT: {
        BITMAP_S8: '\x1b\x2a\x00',
        BITMAP_D8: '\x1b\x2a\x01',
        BITMAP_S24: '\x1b\x2a\x20',
        BITMAP_D24: '\x1b\x2a\x21'
    },
    GSV0_FORMAT: {
        GSV0_NORMAL: '\x1d\x76\x30\x00',
        GSV0_DW: '\x1d\x76\x30\x01',
        GSV0_DH: '\x1d\x76\x30\x02',
        GSV0_DWDH: '\x1d\x76\x30\x03'
    }
};

  presentLoading() {
   const loader = this.loadingCtrl.create({
      content: "Please wait...",
   });
   loader.present();
  }

  informationtoast(textMessage: string) {
    const toast = this.toastCtrl.create({
      message: textMessage,
      duration: 3000,
      cssClass: 'information-toast'

    });
    toast.present();
  }

  errorToast(textMessage: string) {
    const toast = this.toastCtrl.create({
      message: textMessage,
      duration: 3000,
      cssClass: 'error-toast'
    });
    toast.present();
  }
}

Posts: 1

Participants: 1

Read full topic


How to show menu button when i push page by navCtrl?

$
0
0

@_Ali94 wrote:

As a title, I need a way to show menu button in the pushed page but I don’t know how

It shows in root pages but its not for pushed pages.

Any helps please ?

Posts: 1

Participants: 1

Read full topic

I cant get my ionic app to open in iOS emulator

$
0
0

@ejerskov wrote:

My new ionic app won’t run in the iOS emulator.

Its a fresh install of ionic and Xcode, these are my steps:

npm install -g ionic

ionic start myApp tabs

ionic cordova platform add ios

ionic cordova build ios

ionic cordova emulate ios

Then I get the following error:

No target specified for emulator. Deploying to undefined simulator
/localhost/myApp/platforms/ios/build/emulator/MyApp.app/Info.plist
file not found.

According to this thread (Fresh Ionic Fails to Emulate iOS 12 - Info.plist file not found) it should work with the following command:

ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"

But then I get the following error:

No target specified for emulator. Deploying to undefined simulator
Device type “com.apple.CoreSimulator.SimDeviceType.undefined” could not be found.

And then according to this thread (Issues starting iOS simulator from CLI) it should work by updating ios-sim like this:

cd platforms/ios/cordova && npm install ios-sim@latest

But I still get the following error:

No target specified for emulator. Deploying to undefined simulator
Device type “com.apple.CoreSimulator.SimDeviceType.undefined” could not be found.

How do I proceed from here?

Ionic:

   ionic (Ionic CLI)             : 4.10.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.1
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

Cordova:

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

System:

   ios-sim : 7.0.0
   NodeJS  : v10.15.1 (/usr/local/bin/node)
   npm     : 6.4.1
   OS      : macOS Mojave
   Xcode   : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic

Toolbar with horizontal scroll

$
0
0

@rosunad wrote:

Hi everyone,

Didn’t find anything about this with Ionic-v4. I need to make scrollable horizontally a toolbar because of it has several options (see images below)


(Normal view)
image
(Phone view)

My idea is to show two directions marks at both sides and scroll horizontally the options of the toolbar. Each toolbar is a separated component, in this case the code of this one is:

<app-header [title]="title"></app-header>

<ion-toolbar>
    <div style="overflow-x:scroll;overflow:hidden">
        <ion-segment>
            <ion-segment-button value="Clientes" checked>
                Clientes
            </ion-segment-button>
            <ion-segment-button value="Proveedores">
                Proveedores
            </ion-segment-button>
            <ion-segment-button value="Agentes">
                Agentes
            </ion-segment-button>
            <ion-segment-button value="Almacenes">
                Almacenes
            </ion-segment-button>
            <ion-segment-button value="Articulos">
                Artículos
            </ion-segment-button>
            <ion-segment-button value="Usuarios">
                Usuarios
            </ion-segment-button>
        </ion-segment>
    </div>
</ion-toolbar>

Hope someone got an idea about this.

Thank you

Posts: 1

Participants: 1

Read full topic

What i can do with AppFlow?

$
0
0

@badpenguin wrote:

IT is not clear to me what i can do with AppFlow and what do i need to purchase to be able to automatically publish my app to the stores.

  1. With the basic/free account it seems basically useless, is it correct?

  2. Do i need to purchase the 29$/month additional pack to be enable the “cloud build” feature?

  3. Do i need to purchase the “growth” pack (200$/month) to be able to publish the app to the store, or not?

Thanks.

Posts: 1

Participants: 1

Read full topic

How to do a simply Logout on Ionic 4 with Firestore?

$
0
0

@Manel00 wrote:

Hi everyone!

I’m looking for a simply code and useful to do a logout with these technologies, thank you so much, i’m trying to avoid to use AngularFirestoreAuth and kind of…

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>