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

Ionic V4, how to inject build files to index.html manually

$
0
0

@BDominikGT wrote:

I need to migrate an ionic v3 app to ionic 4.
And we have some logic inside the index.html file, where we making request to the server first.
And if the user is not logined then we injecting the html form from the server, than logining, and than when everything is fine we injecting the build files into the index.html and booting the app.
But in the ionic v4 those build files are added automatically.
So my question is is there any way to prevent adding those files, and inject them manually?
Thanks.

Posts: 1

Participants: 1

Read full topic


Critical behavior to create a custom FormCrontrol with an ion-input element inside. (ControlValueAccessor writeValue)

$
0
0

@BrankoEnero wrote:

I want to create a component that works like a FormControl (ReactiveForm) and that inside have a “ion-input” element.

Really I don’t understand the following behavior and I think that is a critical issue to attend.

Expected behavior:

It expects that, by creating a custom component that implements ControlValueAccessor and its template contains an “ion-input”, “writeValue” method to be throw when an default value has been set.

Actual behavior:

The “writeValue” method, it never throw while “ion-input” element exists in component template. If “ion-input” element it is removed, the “writeValue” method will be throw properly.

Information about the issue:

ionic (Ionic CLI) : 4.2.1
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.3

Steps to reproduce the behavior:

  1. Create a component that implements ControlValueAccessor properly.
  2. Create a simple page that includes that component inside a FormGroup.
  3. Set a default value for that custom component FromControl.

Reference code:

simple-form.page.ts

import {IonicPage} from "ionic-angular";
import {FormBuilder, FormGroup} from "@angular/forms";

@IonicPage({name: 'simple-form-page', segment: 'simple-form'})
@Component({
  selector: 'simple-form-page', 
  template: `
    <form [formGroup]="simpleForm">
      <simple-input formControlName="simpleInputValue"></simple-input>
    </form>`
})

export class SimpleFormPage {
  protected simpleForm: FormControl;
  constructor(private formBuilder: FormBuilder){
    this.formBuilder.group({simpleInputValue: ['12345']});
  }
}

simple-input.component.ts

import {ControlValueAccessor} from "@angular/forms";
import {forwardRef} from "@angular/core";
import {NG_VALUE_ACCESSOR} from "@angular/forms";

@Component({
  selector: 'simple-input',
  providers: [{
    multi: true,
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => SimpleInput)}],
  template: `<ion-input></ion-input>`
})
export class SimpleInput implements ControlValueAccessor {
  writeValue(value: any): void {
    console.log('writeValue: value', value);
  }

  registerOnChange(fn: any): void {this.propagateChange = fn;}
  registerOnTouched(fn: any): void {this.propagateTouch = fn;}
  setDisabledState(isDisabled: boolean): void {};

  private propagateChange(_: any) {};
  private propagateTouch() {}
}

Posts: 1

Participants: 1

Read full topic

How run c file in ionic

$
0
0

@admins1 wrote:

i have installed cordova-plugin-cpp-bridge this plugin but not working
then how import this plugin module

Posts: 1

Participants: 1

Read full topic

How can i rank high my website on personality development and self improvement?

Google map on separate page

Ionic Pinch To Zoom or double tap to zoom

How to save array of data in native-storage

$
0
0

@robertnic wrote:

I am trying to make offline mode which saves data from API to native-storage but the issue is I cannot get them in array instead every time I save one it replaces with old one.

So the question is how do I save my data as an array in native-storage?

Code

View
This simply send my post url to server and return all data of that post in order to save them.

<ion-button (click)="addFavorite(post.url)">
  <ion-icon slot="icon-only" name="download"></ion-icon>
</ion-button>

posts.page.ts This function is supposed to store the returned data in an array.


item: any[] = [];


addFavorite(url: string) {
    return this.postsService.getDetails(url).subscribe(res => {
      this.storage.setItem('item', res)
        .then(
          () => {
            console.log('Item Stored');
          },
          error => console.error('Error storing item', error)
        );
      this.item.push(res);
      return res;
    });
  }

any idea?

Posts: 1

Participants: 1

Read full topic

SSH Key with fingerprint already exists when adding new SSH key to appflow

$
0
0

@SimoneMSR wrote:

When I try to add a new SSH key to my account via
https://dashboard.ionicframework.com/settings/ssh-keys

I get this error:

SSH Key with fingerprint already exists

and I cannot add the key to my account. What I am doing wrong?

Posts: 1

Participants: 1

Read full topic


Is it possible to print rich content (img and text) using a Star Print100 printer with ionic3?

$
0
0

@S3lman wrote:

I use ionic 3. I was able to connect my application to the Star Print 100 printer. I want to print text and image. I can print only text or just image. But I failed to print the text and the image together.

rasterObj = { 
text : "        Star Clothing Boutique\n" + 
"             123 Star Road\n" + 
"           City, State 12345\n" + 
"Charge\n" + "156.95\n" + 
"Visa XXXX-XXXX-XXXX-0123\n" + 
"Refunds and Exchanges\n" + 
"Within 30 days with receipt\n" + 
"And tags attached\n", fontSize: 25,       //Defaults to 25 
paperWidth: 576,    // options: 384 = 2", 576 = 3", 832 = 4" 
uri: 'https://www.domainname.com/image.jpg', openCashDrawer:true // Defaults to true }; 

printRasterReceipt('USB:TSP100', 'StarGraphic', rasterObj).then(result => {},error=>{alert('Error!');});

Posts: 1

Participants: 1

Read full topic

Building IOS version of my App

$
0
0

@bamboriz wrote:

I wish to build an IOS version of my app. I do not have a MAC so I am particularly interested in how App Flow can help me do this and how it all works ?

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Grabbing changed value from dropdown list

$
0
0

@JohnCressman wrote:

What is the correct way to get the selected value from a dropdown list on change.

I tried [ngmodel)]=“tankSize” (input)=“updateTank(tankSize)” and (onchange)=“updateTank(tankSize)”

but when I console the results, it’s always the PREVIOUS choice… for instance, if I select B, it shows me the default A, if I select C then, it shows me B.

What is the right way to pass that value?

Posts: 1

Participants: 1

Read full topic

Request: Admob-Plus for Ionic DevApp

$
0
0

@reinerluke97 wrote:

Since Admob-Plus is the way to go and everyone should use it it would really recommended if you add this plugin to the DevApp.

Admob-Plus provides 2 App IDs for Android & iOS and everyone who creates an app for both platfroms uses this Plugin.

Admob-Free is provided so please add Admob-Plus too!

Posts: 1

Participants: 1

Read full topic

Can't add platform Android when building Ionic 3 app - Sqlite Issue?

$
0
0

@IonicGeoff wrote:

I’m trying to build an Ionic 3 app I haven’t built for a while and getting an error when I try to add the Android platform to the app…

ionic info

Ionic:

   Ionic CLI          : 5.0.1 (C:\Users\User\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 9 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : 0.2.5

System:

   Android SDK Tools : 26.1.1 (C:\Users\User\AppData\Local\Android\android-sdk)
   NodeJS            : v8.11.4 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

ionic cordova platform add android results in an error, seemingly when installing cordova-sqlite-storage …

...
Installing "cordova-sqlite-storage" for android
Failed to install 'cordova-sqlite-storage': CordovaError: Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
    at Context.requireCordovaModule (C:\ionic\bthr3\node_modules\cordova-lib\src\hooks\Context.js:57:15)
    at module.exports (C:\ionic\bthr3\plugins\cordova-sqlite-storage\scripts\beforePluginInstall.js:13:21)
    at runScriptViaModuleLoader (C:\ionic\bthr3\node_modules\cordova-lib\src\hooks\HooksRunner.js:181:32)
    at runScript (C:\ionic\bthr3\node_modules\cordova-lib\src\hooks\HooksRunner.js:157:16)
    at C:\ionic\bthr3\node_modules\cordova-lib\src\hooks\HooksRunner.js:125:20
    at <anonymous>
Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
    at process._tickCallback (internal/process/next_tick.js:188:7)
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd platform add android --save exited with exit code 1.

Can someone please enlighten me what I need to do to get this to work again?

Posts: 2

Participants: 1

Read full topic

How to integrate atomtech Payment gateway?

$
0
0

@sanipilani wrote:

You can follow the below mentioned steps and integrate the payment gateway in minutes:

  1. Download SDK: Download the latest version of the SDK for your development platform provided by atom.

  2. Get the Merchant Key: Every merchant has a unique merchant key which will be provided to the merchants after successful registration.

  3. Final Integration: Handle successful / failed payments with correct SDK and Merchant Key and you are good to go.

Know More : www.atomtech.in

Posts: 1

Participants: 1

Read full topic

Payment Gate Configuration

$
0
0

@Tshepang01 wrote:

How do you solve an ionic jsonRes error in Ionic? The jsonRes comes from a JavaScript code that is a payment gateway code.

Posts: 1

Participants: 1

Read full topic


Ionic 4 Red Glow on Alert Prompt

$
0
0

@mtarroyo wrote:

Hi!

I have a password recover alert prompt in my application. The prompt has an type="email" input. The problem is that the input are receiving an ugly red border when the inputed email are badly formatted.

Any ideas on how to turn off the red border? Thanks! :grinning:

Screenshot_2019-06-13_11-30-20

Posts: 1

Participants: 1

Read full topic

How to check if an object property is present in an object array list

$
0
0

@champion007 wrote:

What i need is, to compare based on id’s if element passing to an array list should not store duplicate items.

Here is my object where i have id’s and can be compared with array list just below this -

{
      _id: "10001",
      name: "Computer science and technologies"
 }

Here is an array list to compared with

[
    {
      _id: "10001",
      name: "Computer science and technologies"
    },
    {
      _id: "10002",
      name: "HTML 5"
    }
]

Thank you :blush:

Posts: 1

Participants: 1

Read full topic

How to put a plethora of components inside another component (module -> module -> module)

$
0
0

@rafaeldcastro wrote:

I have a wrapper component that contains (by context) several other components. I also already have in the folder “components” a module that exports other components for the application (menu, headers, etc.) perfectly.

What I wanted was to create a module for this component wrapper, import it into components.module and make it visible to the entire application, keeping a clean organization.

But if I import the wrapper-module into the components.module and use the wrapper-component on the HomeComponent for example it breaks and don’t recognize the component.

Here’s my code, any help?

Folder Structure

components

    wrapper-component
        comp1
        comp1
        wrapper-component.module.ts
    menu
    topnavbar
    components.module.ts

pages
    home
        home.module.ts

wrapper-component.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';

/** COMPONENTS */
import { WrapperComponent } from './wrapper.component';
import { ChildComponent1 } from './comp1/comp1.component';
import { ChildComponent2 } from './comp2/comp2.component';

@NgModule({
  declarations: [
    WrapperComponent,
    ChildComponent1
    ChildComponent2
  ],
  imports: [
    CommonModule,
    IonicModule
  ],
  exports: [
    WrapperComponent,
    ChildComponent1
    ChildComponent2
  ]
})
export class WrapperComponentsModule { }

components.module.ts

    import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { IonicModule } from '@ionic/angular';

    /** MODULES */
    import { WrapperComponentsModule } from './wrapper-component/wrapper-component.module';

.. other components imports

    @NgModule({
      declarations: [
.. other components declarations (works fine)
      ],
      imports: [
        CommonModule,
        IonicModule,
        WrapperComponentsModule 
      ],
      exports: [
.. other components exports (works fine)
      ]
    })
    export class ComponentsModule { }

home.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { ComponentsModule } from './../../components/components.module';

import { HomeComponent } from './home.component';

@NgModule({
  imports: [
    CommonModule,
    IonicModule,
    ComponentsModule,
    ..other imports
  ],
  declarations: [
    HomeComponent,
  ]
})
export class HomePageModule {}

I know I could simply write all the components inside ComponentsModule, it works fine this way, but I thought it could work in another more civilized way…

Can you help?

Posts: 1

Participants: 1

Read full topic

Ionic 3 push notification when app closed

$
0
0

@mcihak wrote:

Hi to all,
I know that this issue is 100x discussed but on my app I receive notification for fine. The only thing what I need is to redirect after click, when app is in background.
API send me payload as data, not as notification, but this has no effect for my click on notification. Always is shown root page.

Can you please show me you implementation? Or help with mine?

Mine implementation:


    pushObject.on('notification').subscribe((notification: any) => {
      console.log('Received a notification', notification)

      if (notification.additionalData.foreground) {
        console.log("FOREGROUND Push notification clicked");
        
      } else {
        console.log("BACKGROUND Push notification clicked");
      
      }
    });

Only foreground log is recieved.

and Guy on backend is doing notification this way:
image

I do not see any mistake here, do you?

Thanks

Posts: 1

Participants: 1

Read full topic

[ERROR] native-run was not found on your PATH. Please install it globally:

$
0
0

@Camilandia wrote:

I constantly get this error when I run the code ionic cordova run android,

[ERROR] native-run was not found on your PATH. Please install it globally:
npm i -g native-run

Even though I got this,

Ionic:

Ionic CLI : 5.0.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.5.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

cordova-res : 0.3.0
native-run : 0.2.5

System:

Android SDK Tools : 26.1.1 (/Users/Camila/Library/Android/sdk/)
NodeJS : v12.4.0 (/usr/local/Cellar/node/12.4.0/bin/node)
npm : 6.9.0
OS : macOS Mojave

Which means that native-run is installed, but I don’t have it on my path?

I need to fix this, because I want to emulate my app from VS code and I think it has to be in order to publish my anroid app.

Posts: 1

Participants: 1

Read full topic

Viewing all 70435 articles
Browse latest View live


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