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

Pos Printer sending ESC/POS commands

$
0
0

@Vartex05 wrote:

Hi, in my ionic app, iam using bluetooth serial plugin to connect to pos printer, so i can print bills. Everything is working fine, but i have problems with diacritics(instead of some czech characters it prints Chinese). I find out, that i have to send some commands to printer(its ESC/POS compatible), but i dont know how to do it. Do i have to send pure string or encode it somehow? Currently my code looks like this:

print(billToPrint){
    return new Promise((resolve,reject)=>{
      this.bluetoothSerial.list().then((data)=>{
        if(data.length==0) reject(new Error("Printer not connected"));
        let subscription=this.bluetoothSerial.connect(this.selectedPrinter.address).timeout(3000).subscribe(data=>{
          console.log("subscribed",data);
          this.bluetoothSerial.write(billToPrint).then((data)=>{
            resolve(true);
          });
          subscription.unsubscribe();
        },err=>{
          reject(new Error("cant connect to printer"));
        });
      },err=>{
        reject(new Error("error finding bluetooth connection"));
      });
    });
  }

Any ideas?

Posts: 1

Participants: 1

Read full topic


Razorpay plugin receive SMS permission issue

$
0
0

@vibinflogesoft wrote:

Hi all,
My application has been rejected on playstore publishing because of razorpay android.permission.RECEIVE_SMS,I removed this permission from my android manifest but it automatically adding on build,can anyone help me on this?
Error
Based on our review, we found your app’s expressed user experience did not match your declared core functionality {SMS-based financial transactions (e.g., 5 digit messages), and related activity including OTP account verification for financial transactions and fraud detection}. Please remove these permissions from your app.

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Displaying third party software licenses

$
0
0

@angelarg wrote:

Hello,

so far I understood that we should display a licenses section in our commercial app, with the list of open source libraries and plugins we use. (most of them are under the MIT license or the Apache 2.0 license).

However, could anyone here explain me how it works when the library you are using is not open source? Should the plugin contain a License file with the description of their terms? Should the company decide what we display (e.g. Copyright XX 2019)? Or is it not needed to display it at all because I am paying for it?

I’m not sure if this is the place to ask, but if not, I would appreciate if someone could redirect me to the right place.

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Ionic 4: iOS not showing time values

$
0
0

@B3nvo wrote:

Hi,

I am working on an ERP system using Ionic 4.

Version Info:

Ionic:

   ionic (Ionic CLI)             : 4.10.3 (C:\Users\BasVoss\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.2
   @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) : not installed
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : not available

System:

   NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

in the hours overview page there are dates, timestamps, etc. Everything shows fine on android. iOS has 1 issue. i can’t see any timestamps. Its not an API problem cuz i see the other data fine.
the original time value from the API is a string like “08:30” which i first turn into a datetime value and then turn into a time value.

i change the time values seperate. so i make them for iOS and android seperate.

                    var currentDate = moment().format('YYYY-MM-DD');
                    
                    //turn start_time and end_time into datetime's
                    let startDate = currentDate + " " + data[i]['start_time'];
                    let endDate = currentDate + " " + data[i]['end_time'];
            
                    if (this.platform.is('ios')) {
                        
                        //get time out of the new data
                        let startNewTime = moment(startDate).format('THH:mm');
                        let endNewTime = moment(endDate).format('HH:mm');  //both of these are not working
                    
                        //make startNewTime the new start_time data types
                        data[i]['start_time'] = startNewTime;
                        data[i]['end_time'] = endNewTime;
            
                        //push new data into this.table
                        this.table.push(data[i]);
                       
                        } else {
                        //get time out of the new data
                        let startNewTime = moment(startDate).format('HH:mm');
                        let endNewTime = moment(endDate).format('HH:mm'); // both of these work on android
                    
                        //make startNewTime the new start_time data types
                        data[i]['start_time'] = startNewTime;
                        data[i]['end_time'] = endNewTime;
                        console.log(data[i]['start_time']);
                        //push new data into this.table
                        this.table.push(data[i]);
                    }


// used HTML
<ion-datetime displayFormat="HH:mm" [value]="filteredItems[(config.itemsPerPage * (config.currentPage - 1)) + i].end_time" readonly></ion-datetime>

// tried throwing it into an empty html div
              <div>
                    {{filteredItems[(config.itemsPerPage * (config.currentPage - 1)) + i].end_time | date: 'HH:mm'}}
                </div>

// again this works for android, but not iOS

i tried using regular date and then converting it to an ISOString in an ion-datetime. This stopped the entire page from working on iOS.

besides moment i have tried using date-fns. no luck there either. still an empty output. I can’t debug on iOS since i am using a windows device.

as far as i know, i am out of options and can’t find any help on other forums.

i’d really appreciate the help.

~ b3nvo

Posts: 1

Participants: 1

Read full topic

Ionic V3 Fcm Help

$
0
0

@sharuk4all wrote:

Hello Good Afternoon, I am using ionic v3 to build mobile app in that i haved fcm to send push notification i want to add customize action button like approve/reject to fcm notification when app is in background

Posts: 1

Participants: 1

Read full topic

Ionic 4, how to get coordinates of content (pageX, pageY)

$
0
0

@Gorkun wrote:

hello guys,
Can I get the coordinates of the page (pageX,pageY) when the event is triggered on (IonStart) ?

Posts: 1

Participants: 1

Read full topic

[Ionic 4] Changes in Multi-line list

$
0
0

@leonardofmed wrote:

I’m trying to implement some itens in a page with the “multi-line” option, like the examples provided in documentation:

example 1;
example 2;

As the documentation says: “When an <ion-item> component contains multiple header or paragraph elements, it will automatically expand it’s height to fit the new lines of text.” Clearly this was changed in Ionic 4, since the elements stands side by side now.

What I’m trying to do (the doc example):

<ion-list>
  <ion-item>
    <ion-thumbnail slot="start">
      <img src="assets/img/totoro.png">
    </ion-thumbnail>
    <h2>This looks cooler</h2>
    <p>Hayao Miyazaki • 1988</p>
    <ion-button clear slot="end">View</ion-button>
  </ion-item>
</ion-list>

What it looks like:

image

If someone have a workaround for this I will appreciate.

Posts: 1

Participants: 1

Read full topic

Ionic 4 - ionic serve not compiling sass

$
0
0

@bobyui wrote:

Hi,

this is very weird, my ionic 4 app was created based on starter blank template, and I have tried to delete node_modules and reinstall it using npm install but running

ionic serve does not bother about any scss file changed at all

I am wondering if I am missing anything?

thank you

Posts: 1

Participants: 1

Read full topic


Ionic app is not working on IOS 10 and below

$
0
0

@oporje wrote:

Hi, We have upgraded to mojave and XCODE 10.2
And building our application using below command

ionic cordova build ios – --buildFlag="-UseModernBuildSystem=0"

App works well on the IOS 11 and 12
But it is not going past the splash screen in the ios 10 & 9

Posts: 1

Participants: 1

Read full topic

Ios app problem

$
0
0

@michele87 wrote:

Hi everywhere. Firstly sorry for my bad English, I have a problem with my app in Ios platform. The app in Android work perfectly, but when I test in Iphone devices the app is slowly, some navPush don’t work while other work fine, ion-grid load some element. Can I solve? I try to reinstall new Ionic App but the problem is still here.

I past my configuration:

{
  "name": "OpenGoNew",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "^7.2.15",
    "@angular/compiler": "^7.2.15",
    "@angular/compiler-cli": "^7.2.15",
    "@angular/core": "^7.2.15",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@ionic-native/app-update": "^5.5.1",
    "@ionic-native/camera": "^5.5.1",
    "@ionic-native/core": "^5.5.1",
    "@ionic-native/email-composer": "^5.5.1",
    "@ionic-native/splash-screen": "^5.5.1",
    "@ionic-native/status-bar": "^5.5.1",
    "@ionic/storage": "^2.2.0",
    "@ng-idle/core": "^2.0.0-beta.15",
    "@ng-idle/keepalive": "^2.0.0-beta.15",
    "cordova-ios": "5.0.0",
    "cordova-plugin-app-update": "^2.0.2",
    "cordova-plugin-appversion": "^1.0.0",
    "cordova-plugin-camera": "4.0.3",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-email-composer": "0.9.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^3.1.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "es6-promise-plugin": "4.2.2",
    "ionic-angular": "3.9.2",
    "ionicons": "^4.5.8",
    "rxjs": "^6.3.0",
    "rxjs-compat": "^6.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.29"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.3",
    "typescript": "2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-camera": {},
      "cordova-plugin-email-composer": {
        "ANDROID_SUPPORT_V4_VERSION": "28.+"
      },
      "cordova-plugin-app-update": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "ios"
    ]
  }
}
import { ListAppartmentPageModule } from './../pages/list-appartment/list-appartment.module';
import { RiepilogoUtentePageModule } from './../pages/riepilogo-utente/riepilogo-utente.module';
import { DocumentsPageModule } from './../pages/documents/documents.module';
import { CamerePageModule } from './../pages/camere/camere.module';
import { CamerePage } from './../pages/camere/camere';
import { ListAppartmentPage } from './../pages/list-appartment/list-appartment';
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/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { RiepilogoUtentePage } from '../pages/riepilogo-utente/riepilogo-utente';

import { HttpClientModule } from '@angular/common/http';
import { HttpModule } from '@angular/http';

import { PostProvider } from '../providers/post-provider';
import { IonicStorageModule } from '@ionic/storage';
import { DocumentsPage } from "../pages/documents/documents";
import { GetLocalUserProvider } from '../providers/get-local-user';
import {NgIdleKeepaliveModule} from "@ng-idle/keepalive";

import { Camera } from '@ionic-native/camera/ngx';
import { EmailComposer } from '@ionic-native/email-composer/ngx';


@NgModule({
  declarations: [
    MyApp,
    HomePage,
    // ListAppartmentPage,
    // RiepilogoUtentePage,
    // CamerePage,
    // DocumentsPage
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    HttpModule,
    CamerePageModule,
    DocumentsPageModule,
    RiepilogoUtentePageModule,
    ListAppartmentPageModule,
    NgIdleKeepaliveModule.forRoot(),
    IonicStorageModule.forRoot(),
    IonicModule.forRoot(MyApp, {
       autocomplete: false,
       autocorrect: 'off',
       scrollAssist: false,
       autoFocusAssist: false
    })
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    RiepilogoUtentePage,
    ListAppartmentPage,
    CamerePage,
    DocumentsPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    Camera,
    EmailComposer,
    PostProvider,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    GetLocalUserProvider
  ]
})
export class AppModule {}

I have to deliver the final version app in two weeks. I am desperate. Please someone help me.

Posts: 1

Participants: 1

Read full topic

How can I find the styles that Ionic's directives apply?

$
0
0

@Kyrax80 wrote:

How can I get the styles that Ionic applies depending on the directives?

For example with this:

<ion-button expand="full" fill="outline">Outline + Full</ion-button>

Where can I find the styles that “full” apply to the button?

I want to do it through a class only instead of using expand="full". Like:

<ion-button class="full-button" fill="outline">Outline + Full</ion-button>

Thanks.

Posts: 4

Participants: 2

Read full topic

Any suggestions for this?

$
0
0

@Fares95 wrote:

Hello , i am really unable how to select an item of data and pass them to another page when rooting, thanks
here my code html

<ion-header>
  <ion-navbar color="tertiary">
    <ion-title>Suivre-réclamations</ion-title>
  </ion-navbar>
</ion-header>


<ion-content padding class="background">
  <ion-list>
    <ion-item *ngFor="let item of items">
  <button ion-item (click)="onLoadReclamation()">
      <b>Type réclamation :</b> &nbsp; &nbsp; {{item.type_rec}} <br />
  </button>
    </ion-item>
  </ion-list>

</ion-content>

here my code Typescript

import { Component } from '@angular/core';
import { NavController , ToastController, App, ActionSheetController} from 'ionic-angular';
import { ReclamationPage} from '../reclamation/reclamation';
import { SingleReclamationPage } from '../single-reclamation/single-reclamation';
import { Http, Headers, RequestOptions }  from '@angular/http';
import { PostProvider } from '../../providers/post-provider';
import { Storage } from '@ionic/storage';
import 'rxjs/add/operator/map';



@Component({
  selector: 'page-suivre-reclamation',
  templateUrl: 'suivre-reclamation.html',
})

export class SuivreReclamationPage {
 
  items: any;
  public dt: any;

  cin: string ="";
  rec_id: string ="";
  type_rec: string ="";
  description: string ="";
  adresse: string="";
  laptitude: any;
  longitude: any;
  etat_rec: string ="";
  datetime: string=""
  gouvernorat: string ="";
  commune: string="";
  cin_admin: string=""
  postal: string="";
  fichiers: string="";
  myphoto:any;

  constructor(public navCtrl: NavController, private postPvdr: PostProvider, public http: Http,
    public storage: Storage , public toastCtrl: ToastController, appCtrl: App,
    public actionSheetCtrl: ActionSheetController ){

    }


    //evenement d'entrée
    ionViewWillEnter()
    {
      console.log('ionViewWillEnter SettingsPage');
      this.storage.get('session_storage').then((result) => {
        this.dt = result;
        this.cin = this.dt[0].cin;
        console.log(this.cin + 'here');
        this.load(this.cin);
      });
    }


    load(cin: string)
    {
      let body = {
        cin:  cin ,
        aksi: 'suivre_reclamation'
      }
      console.log(body);

      this.postPvdr.postData(body) .subscribe(data => {
           this.items= data.items;
        console.log(data.items);
      });
    }


  onLoadReclamation()
    {
    this.navCtrl.push(SingleReclamationPage);
    }

  }

here the screen capture

any suggestions about how to do this?

Posts: 1

Participants: 1

Read full topic

How to call a function from an JS library?

$
0
0

@Liquidcms wrote:

FYI - no category here for Ionic 4. This question is re: Ionic 4.

I have a JS library (jdrupal) that i need to use in my app. It is available via npm but doesn’t have any .ts files associated with it. It is also does not define any classes; just simple js functions. The JS lib does define a JSON object (Drupal) to hold config variables.

In my .page.ts i have added this:

import * as jdrupal from ‘jdrupal’;
declare var Drupal: any;

then in my ngOnInit i have this:

ngOnInit() {
Drupal.settings.site_path = ‘http://example.org’;
Drupal.settings.endpoint = ‘rest’;
this.initDrupal();
this.userLogin();
}

this seems to work fine. The 2 function calls refer to functions i wrote in the class for this page, one of them is this:

initDrupal() {
system_connect({
success: function(result) {

    // Prepare a message for the user.
    const text = result.user.uid === 0 ? 'Hello World' : 'Hello ' + result.user.name;

    // Show the message in the paragraph.
    document.getElementById('msg').innerHTML = text;

  }
});

}

In my IDE, the function “system_connect” (which is from my lib) shows as red, stating the name cannot be found. I figured this was just a setting in my IDE as the app runs as expected.

However, if i restart ionic serve i get this error (for both the function calls):

ERROR in src/app/pages/drupal-test/drupal-test.page.ts(23,5): error TS2304: Cannot find name ‘system_connect’.

I am assuming i am still missing something in allowing my app to use/see my JS lib properly.

Posts: 1

Participants: 1

Read full topic

Image slider with photo zoom

$
0
0

@lsantaniello wrote:

Hello everyone,

I’m trying to build a slider with ion-slides where I want the user to be able to pinch to zoom (in/out) like “photo” app for iPhone.

I have tried hard coding it but zooming isn’t smooth and I feel like there is much better ways to do it natively.

I’d like to integrate an open source plugin into my app. Any ideas?

Thank you!

Luca

Posts: 1

Participants: 1

Read full topic

How do I customize the ion-searchbar box-shadow by not using the global.scss file Ionic 4

$
0
0

@x2652k19 wrote:

I have used the global.scss to apply the style and it works:

.searchbar-input {
  border-radius: 10px !important;
  box-shadow: none !important;
  color: #000 !important;
}

However when I apply the same style to my home.page.scss it doesnt work

Here is my html :

<ion-content
  ><ion-toolbar color="primary">
    <ion-searchbar ></ion-searchbar>
  </ion-toolbar>
  <div class="ion-padding">
    The world is your oyster.
    <p>
      If you get lost, the
      <a target="_blank" rel="noopener" href="https://ionicframework.com/docs/"
        >docs</a
      >
      will be your guide.
    </p>
  </div>
</ion-content>

Is there anyway I can apply the style to the home.page.scss and having it work?

Posts: 1

Participants: 1

Read full topic


Help me urgent! How to get json array?

$
0
0

@Feri98 wrote:

Hi All

i Have problem with get data json array… this my code app.module.ts

import {HttpClientModule} from '@angular/common/http';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    HttpClientModule
  ],

and home.page.ts

import { Component } from '@angular/core';
import {Http, Headers } from '@angular/http';
import 'rxjs/add/operator/map';

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

export class HomePage {

 
constructor(public http:Http) {

}
}
users:any
load()
{
  this.http.get('http://www.mywebsite.json').subscribe(data => {
  console.log(data);
  }) ; 
}
}

but i can’t get data json …

Posts: 1

Participants: 1

Read full topic

Help me how to get nested json

$
0
0

@Feri98 wrote:

hy all can you help me… i want get this json but i always failed

nested json.

{
  "data": [
    {
      "ID_JENIS": 1,
      "NAMA": "Jurnal Umum",
      "TOTAL": 3
    },
    {
      "ID_JENIS": 2,
      "NAMA": "Pembelian",
      "TOTAL": 1
    },
    {
      "ID_JENIS": 3,
      "NAMA": "Retur Pembelian",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 4,
      "NAMA": "Purchase Order",
      "TOTAL": 2
    },
    {
      "ID_JENIS": 5,
      "NAMA": "Purchase Quotation",
      "TOTAL": 1
    },
    {
      "ID_JENIS": 8,
      "NAMA": "Sales Order",
      "TOTAL": 1
    },
    {
      "ID_JENIS": 6,
      "NAMA": "Penjualan",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 7,
      "NAMA": "Retur Penjualan",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 9,
      "NAMA": "Sales Quotation",
      "TOTAL": 1
    },
    {
      "ID_JENIS": 10,
      "NAMA": "Pembayaran Hutang",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 11,
      "NAMA": "Pembayaran Piutang",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 12,
      "NAMA": "Kas Masuk",
      "TOTAL": 2
    },
    {
      "ID_JENIS": 13,
      "NAMA": "Kas Keluar",
      "TOTAL": 1
    },
    {
      "ID_JENIS": 21,
      "NAMA": "Kode Proyek",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 16,
      "NAMA": "Transfer Barang Antar Gudang",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 14,
      "NAMA": "Penghapusan Piutang (Write Off Piutang)",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 15,
      "NAMA": "Penghapusan Hutang (Write Off Hutang)",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 17,
      "NAMA": "Penyesuaian Persediaan",
      "TOTAL": 1
    },
    {
      "ID_JENIS": 18,
      "NAMA": "Penentuan Harga Jual",
      "TOTAL": 0
    },
    {
      "ID_JENIS": 22,
      "NAMA": "Uang Muka Pembelian",
      "TOTAL": 0
    }
  ],
  "error_msg": null,
  "paging": null
}

this is my link json
http://202.179.137.23:8077/boaapproval/?mod=Menu

Posts: 1

Participants: 1

Read full topic

Build Failed when ionic cordova run android

Add Firebase phone verification to ionic4

$
0
0

@abdul4 wrote:

Hi there, I need to use Firebase phone Verification to my ionic4 application, there are plenty of tutorials for ionic3 which guiding to the task. However, I couldn’t find a topic or tutorial for ionic4. Hence if you guys have a piece of codes or anything to help, please share them with me, I would appreciate your help.
Note: following ionic 3 tutorials, I faced an issue which asked on StackOverflow . If you guys know the answer, please don’t hesitate.

Posts: 1

Participants: 1

Read full topic

About ChangeDetectionStrategy and components

$
0
0

@Kyrax80 wrote:

I want to use ChangeDetectionStrategy.OnPush on my whole App, but I don’t know if I have to define this only in the page where I’ll use my custom components or if I also have to define it in the component itself aside of the page.

Is it needed to define the detectionstrategy on the page only? Or in both custom component and page where it’s used?

I think it’s just in the page but I wanna be sure.

Thanks.

Posts: 1

Participants: 1

Read full topic

Viewing all 49252 articles
Browse latest View live


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