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

Ionic 4 Getting ion-item ID or Assigning id/value to ID

$
0
0

@AmberS wrote:

Hi,

I am trying to find a way to get the id of an ion-item when the item is clicked or assign an id to the ion-item. I want to use the ID to display the correct picture on another page. Therefore, I won’t have to add an extra forty pages to my application.

list-buildings.page. html- this is where I need to assign or get the ID of the item

 <ion-item>
            <img src = "/assets/img/gym.jpg" (click) = "goToFunBuildings()">
            <ion-label color = "light" text-wrap text-right>Campus Gym!</ion-label>
        </ion-item>

funbuildings-page.page.ts- this is where I will be using the ID to display the correct image of the buildings

Posts: 1

Participants: 1

Read full topic


Error when trying using Device plugin ionic 4

Change colors at runtime

$
0
0

@Llarian wrote:

Hi,

I want to enable the user of my app to completely choose the colng of it, store the choice in the options, save them to and load them from storage.

So far this works when I load the settings at startup to a property of a class all pages derive from.
Most components can just bind to that. Problems come up e.g. with the ion-datetime, which has ok-, cancel-button, and currently selected values shown in the primary color.

I can not use sass/css since I can’t apply the user choice at runtime.
Is there any other way than writing my own ion-datetime or derive the existing?

Posts: 1

Participants: 1

Read full topic

Unable to set ion-content height

$
0
0

@meuserca wrote:

I’m want to adjust the the height my ion-content. Width works as expected: however, the height adjustment is ignored.

ion-content {
width: calc(100vw - 50px);
height: calc(100vh - 50px);
}

Can somebody tell me why this doesn’t work?

Posts: 1

Participants: 1

Read full topic

Manifest: Line: 1, column: 1, Unexpected token. [Ionic 4]

$
0
0

@jjdev wrote:

I am trying to optimize my app with lighthouse

I have added

<link rel="manifest"  href="./manifest.json">

to the index.html

then i have manifest.json as follows

{
    "name": "Ionic App",
    "short_name": "Ionic App",
    "theme_color": "#222428",
    "background_color": "#000000",
    "display": "standalone",
    "scope": "/",
    "start_url": "/index.html",
    "splash_pages": null,
    "orientation": "portrait",
    "icons": [
        {
            "src": "/assets/icons/favicon.png",
            "type": "image/png",
            "sizes": "192x192"
          }
    ]
}

I have tried compiling with the manifest file in the root and in src/
When i build with --prod --release and deploy to firebase, get the following error

Manifest: Line: 1, column: 1, Unexpected token.

and the lighthouse audit scores Performance 18 and PWA 31, and the rest of the scores are green

Does anyone have any insight into optimizing an Ionic app for PWA status? I have followed several tutorials to no avail and its driving me crazy.
here is a screenshot of the audit

Posts: 1

Participants: 1

Read full topic

Ionic 4 - JS Flex Calendar

$
0
0

@agustin-bravo wrote:

Hi everybody, I expect you are doing great!

I am new with ionic and looking for some help from you.

Please, could you tell if its possible to integrate this JS calendar with ionic v4? Here is the link: https://www.npmjs.com/package/flex-calendar

I tried following the detailed steps, but I dont know how to include the calendar module into the main module.

This is what I have done so far:

  1. execute npm i flex-calendar in the console

  2. Added this to index.html

<link rel=“stylesheet” href=“bower_components/flex-calendar.css”>

<script type=“text/javascript” src=“bower_components/angular-translate/angular-translate.min.js.js”></script>

<script type=“text/javascript” src=“bower_components/flex-calendar.js”></script>

  1. And here is the supposed step to inject the module into the main module
    • angular.module(‘App’, [‘flexcalendar’])

I am not quite sure of how to do it, if anyone could give and example of how to make I would really appreciate. I am stacked at this point since long time. I have a calendar tab and my idea is to add this calendar in it.

Many thanks!!
Agus

Posts: 1

Participants: 1

Read full topic

How to implement referral link for ionic app

$
0
0

@mathewk wrote:

Hi, did anyone have any idea how to implement the referral link functionality in the ionic app?
The user should be able to share the link and when some install the app using that link the referral code should be received in the app.(normal refer and earn thing).

Posts: 1

Participants: 1

Read full topic

Export apk - urgent requirement

$
0
0

@MarleneA wrote:

I’m working on an app that will be distributed as an apk file (to users with no internet connection) and can no longer export /package to apk. I’m not a developer and the Creator platform has allowed me to do exactly what I needed to, including exporting previous versions as apk, but now that the final version of my app is due, the option is no longer available. The help desk are not replying to my emails and my deadline is fast approching. Can anyone tell me what might be happening? My next option may be to download the files and ask someone else to package it for me…
Hoping for a solution
Marlene

Posts: 1

Participants: 1

Read full topic


Node-sass cannot download

$
0
0

@mehthaf wrote:

ionic sass cannot download . beacuse of this app apk build getting corrupted

Cannot download “https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

Posts: 1

Participants: 1

Read full topic

Iframe is not loading pdf data, after generating build in ionic3?

$
0
0

@RomnEmpire wrote:

Hi,
I have to load the PFD data in the HTML content using iframe, it is working properly in the localhost but after generating the build, pdf data is not loading in the body section of the HTML.i have attached both local and server screenshots, in local data, is loaded but in the server it didn’t work. Can you guys please help to solve my issue.

Check below screenshort 1st scscreenshort show after generated APK and not load data document setion is blank:

2nd is that the local in which data load properly:

  <main>
    <p><iframe *ngIf="pdfLink" [src]="pdfLink" width="100%" height="100%" frameborder="0" ></iframe></p>
  </main>

please tell me anyone how to fix this issue sir ?

Posts: 1

Participants: 1

Read full topic

App stuck on splash screen after uploading to app store

$
0
0

@a7mdFo2ad wrote:

my app after uploading to the app store to review I got responded with the issue that app stuck on splash screen
I instaled it from testFlight and getting the same issue
the app working fine before I upload it
How to can debug it?

Posts: 1

Participants: 1

Read full topic

Native barcode scanner installed with capacitor

$
0
0

@arpho wrote:

Hi, I am working on a pwa, would like to use capacitor with the barcode scanner plugin, I installed the plugin with:
ionic cordova plugin add phonegap-plugin-barcodescanner
npm install @ionic-native/barcode-scanner
Then
npx cap sync
I can build and use the app in my browser without problems, but using the barcode plugin i Get the error Cordova not available

Posts: 1

Participants: 1

Read full topic

Ionic4 - Tab-Layout with nested segment-bar navigation/routing

$
0
0

@Mike1707 wrote:

Hey Guys,

I have the following use-case:

I use a tab-layout in my ionic 4 app and have a segment-bar to switch between components of one tab, nested into my tab-pages (by importing the components’ modules in my tab-page and using their selector in the html-file). This was for ionic3 perfectly fine.

Unfortunately, when I use this style, my nested components do not have any route. Just my tab-pages have routes defined in the tabs.router.module.ts. Nevertheless, I want to navigateForward from the nested components to other pages which do have routes. And this is for me semantically not correct.

For example:

tab1 route: private/app/tabs/home (defined in tabs.router.module.ts as path of a child)

  • segment1 imports achievements.module.ts
  • segment2 imports news.module.ts

tab2 route: private/app/tabs/profile (defined in tabs.router.module.ts as path of a child)

  • segment1 imports account.module.ts
  • segment2 imports friends.module.ts

Now I want to navigateForward from tab2, segment1 to “change account”. At this point, I use the route private/app/tabs/profile/account/change for this. Also, I want to navigateForward from tab2, segment2 to “edit friends” with the route private/app/tabs/profile/friends/edit.

For me, it’s semantically not correct routing because the routes private/app/tabs/profile/account and private/app/tabs/profile/friends don’t exist. If I use private/app/tabs/profile/change and private/app/tabs/profile/edit it wouldn’t be correct as well because the “account” and “friends” part would be missing.

Unfortunately, I don’t know how I can change this to a better solution. Do you have advises?

Thanks in advance
Mike

Posts: 1

Participants: 1

Read full topic

After installing google maps plugin "object(....) is not a function"

$
0
0

@keloa wrote:

hi
I was trying to add google maps to an app that I was working on and after running these commands :

ionic cordova plugin add cordova-plugin-googlemaps \
  --variable API_KEY_FOR_ANDROID="key" \
  --variable API_KEY_FOR_IOS="key"
npm install @ionic-native/core @ionic-native/google-maps

I get this error:

 Runtime error
    Object(...) is not a function

even though I didn’t use the plugin in my code yet !

here is my package.json :

{
  "name": "cake-driver",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/base64": "^4.20.0",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/google-maps": "^4.20.0",
    "@ionic-native/image-picker": "^4.20.0",
    "@ionic-native/onesignal": "^4.20.0",
    "@ionic-native/splash-screen": "~4.18.0",
    "@ionic-native/status-bar": "~4.18.0",
    "@ionic/pro": "2.0.4",
    "@ionic/storage": "^2.2.0",
    "com-badrit-base64": "0.2.0",
    "cordova-android": "7.1.4",
    "cordova-ios": "4.5.5",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-googlemaps": "2.5.0",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.3.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-telerik-imagepicker": "2.2.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "3.0.0",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "onesignal-cordova-plugin": "2.4.6",
    "rxjs": "6.0.0",
    "rxjs-compat": "^6.4.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "onesignal-cordova-plugin": {},
      "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": {},
      "cordova-plugin-telerik-imagepicker": {
        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "yoWe need this permission to get the needed photos"
      },
      "com-badrit-base64": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-googlemaps": {
        "API_KEY_FOR_ANDROID": "AIzaSyCOd-Z643z1lP19CDHw-tr3eBugmpAXz8k",
        "API_KEY_FOR_IOS": "AIzaSyDFr-FqOKG_WDNKYggLeCJw8yPPkHOyR5Q"
      }
    },
    "platforms": [
      "android"
    ]
  }
}

Posts: 1

Participants: 1

Read full topic

FileOpener open file not working Object(…) is not a function error

$
0
0

@nir-z wrote:

HI,

I am using FileOpener plugin in order to open a based64 file converted to Blob.
The file is being created succesffuly in the download folder, but file opener fails to open it/

Error:

TypeError: Object(…) is not a function

at FileOpener.open (vendor.js:101647)
at 8.js:323
at t.invoke (polyfills.js:3)
at Object.onInvoke (vendor.js:4982)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:4973)
at t.invokeTask (polyfills.js:3)

MY code:

    let filename = "temp.pdf";
    this.file.writeFile(this.file.externalRootDirectory + '/Download/', filename, this.convertBaseb64ToBlob(data.file, 'application/pdf'), {replace: true})
    .then((fileEntry: FileEntry) => {

      console.log("File created!");
      debugger;
      let test = fileEntry.toURL();
      //Open with File Opener plugin


      this.fileOpener.open(test, 'application/pdf')
        .then(() => {
          console.log('File is opened');
          loading.dismiss();}
          ).
          catch(err =>  {
            debugger;
              console.error('Error openening file: ' + err);
              loading.dismiss();}
            );
    })
    .catch(function(err) {
      debugger;
      console.log(err);
      loading.dismiss();
  });

THanks!

Posts: 1

Participants: 1

Read full topic


How to to get data in alertController for updation?

$
0
0

@FK2193 wrote:

In ionic how to get data in AlertController so that we can easily edit it rather to make a new page i want to update data through alert controller.

Posts: 1

Participants: 1

Read full topic

Incompatibility to cordova-ios 5.0.0

$
0
0

@smartmarketiq wrote:

Steps to reproduce:

  1. Create Brand New Ionic Project.
  2. Upgrade package.json to latest Ionic packages (7.2.2)
  3. Run: npm i cordova-ios (5.0.0)
  4. Run ionic build (or npm run build or ng build)
  5. See error about ionic.core.js.

ERROR in ./node_modules/@ionic/core/dist/esm/es5/ionic.core.js 6:2160
Module parse failed: Unexpected token (6:2160)

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.13.1
@angular-devkit/schematics : 7.3.1
@angular/cli : 7.3.1
@ionic/angular-toolkit : 1.3.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

System:

NodeJS : v10.14.2 (/usr/local/bin/node)
npm : 6.7.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic

Load internet js script inside home page to load a form

$
0
0

@dawerdrew wrote:

I have a payment button. developed just for the web and I have to adapt it to work in ionic

  1. I have a function to send some parameters to the server of my provider of the payment button. and this returns an id = checkoutId. this works well.

  2. with the Id checkout I have to load the following script: <script src = “https://test.example.com/v3/file.js?checkoutId={checkoutId}”> </ script>

-I can not place it in index.html because I need to get a dynamic id in home and load the script with that id. Any suggestions or recommendations?

Posts: 1

Participants: 1

Read full topic

Reference.child failed: First argument was an invalid path

$
0
0

@ariff23 wrote:

Reference.child failed: First argument was an invalid path = “undefined”. Paths must be non-empty strings and can’t contain “.”, “#”, “$”, “[”, or “]”

any solution with this code…plis help me

import { Component } from ‘@angular/core’;
import { IonicPage, NavController, LoadingController, ToastController, NavParams } from ‘ionic-angular’;
import { UserserviceProvider } from ‘…/…/providers/userservice/userservice’;
import { HomePage } from ‘…/home/home’;

/**

@IonicPage()
@Component({
selector: ‘page-register’,
templateUrl: ‘register.html’,
providers: [UserserviceProvider]
})
export class RegisterPage {

public first_name : any;
public last_name : any;
public email : string;
public password : any;
public phone : any;
public state : any;

constructor(public navCtrl: NavController, public navParams: NavParams,
public usersserviceProvider : UserserviceProvider,
public toastCtrl: ToastController, public loadingCtrl: LoadingController) {
//
}

ionViewDidLoad() {
console.log(‘ionViewDidLoad RegisterPage’);
}

doSignup(){

 var account = {
   first_name: this.first_name,
  last_name: this.last_name,
  email: this.email, 
  password: this.password,
  phone: this.phone,
   state: this.state
 

};

var that = this;

var loader = this.loadingCtrl.create({
content: “Please wait…”,

});
loader.present();


this.usersserviceProvider.signupUserService(account).then(authData => {
	//successful
	loader.dismiss();
	that.navCtrl.setRoot(HomePage);

}, error => {

loader.dismiss();
// Unable to log in
let toast = this.toastCtrl.create({
message: error,
duration: 3000,
position: ‘top’
});
toast.present();

  that.password = ""//empty the password field

});

}
}

Posts: 1

Participants: 1

Read full topic

Convert PDF content to HTML in IONIC3?

$
0
0

@RomnEmpire wrote:

Hello guys,
I want to convert an pdf file to HTML.actually i have load pdf data in the HTML content section and i used jframe for load pdf in the HTML but problem is that the pdf data are not loaded in the APK but in the localhost pdf is loaded.that’t the i have choose 2nd way firstly we have convert pdf to HTML then display in the HTML.tell m anyone there is any other way in the ionic3 to convert to HTML?

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>