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

Ionic 4 Folder structure

$
0
0

@martinstolz wrote:

ionic 4 “ionic start …” generates no subfolders below /src app, such as ‘/page’, ‘/service’ etc. Also “ionic generate …” places new elements in /src/app/. Did I miss something?

Posts: 1

Participants: 1

Read full topic


Only just the blank page

XML to JSON object (renaming attributes)

$
0
0

@angelarg wrote:

Hi!
I’m currently trying to convert an XML to a JSON Object in my Ionic app. I’ve tried the x2js plugin and also jsonix (but this one won’t work). The thing is, with x2js I can convert the xml to a json with the same attribute names of each field, but what i want is to rename them in the object.
let’s say the XML has an attribute “n” and i want it to be mapped as “name” in the object.
(I know this can be done with JAXB in a java project, for example)

I appreciate your support in advance.

cli packages:

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)

local packages:

@ionic/app-scripts : 3.1.11
Cordova Platforms  : android 6.4.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.10.3
npm               : 5.6.0
OS                : Windows 10

Posts: 1

Participants: 1

Read full topic

Using Native Configs in Appflow to have different versions of app side by side

$
0
0

@sportjohan wrote:

Have anyone used the Native Configs feature where you override the bundle id, and have it working on iOS? By working I do mean installed and running on a device; you end up with the 2 apps side by side on the device.

I have 2 different Native Configs and changed the bundle id for one; this works on Android but I can’t get it working on iOS.

BUNDLE_ID --> no.myapp.app.qa
NAME --> MyAppQA

BUNDLE_ID --> no.myapp.app
NAME --> MyApp

I did have to create a new App Id with a wildcard e.g. no.myapp.* for the iOS package build to work… It now builds successfully.
I cannot add this file to HockeyApp (as a new app) and if I install this manually then it wont run and the icon is wrong etc.
That is as far as I get.

Posts: 1

Participants: 1

Read full topic

Facebook Error on login - Object(...) is not a function

$
0
0

@test-nikko wrote:

Upon calling on login, the function returns some error message.

image

My code is just only this piece of code

image

Posts: 1

Participants: 1

Read full topic

Ionic-v4 how to make transparent modal

$
0
0

@askona1 wrote:

I have modal component, created with

async openCalendar() {
        const modal = await this.modalController.create(<any>{
            component: CalendarComponent
        });
        return await modal.present();
    }

I saw, that ion-modal have –background property, but it doesn`t affect my calendar modal. My calendar modal have app-calendar selector, I tried
app-calendar{
–background:red;
}
ion-content {
–background: red;
}

It doesn`t work.

Posts: 1

Participants: 1

Read full topic

I Use the plugin yesterday it's work

$
0
0

@boxmobiledev wrote:

I Use the plugin yesterday it’s work

now today

public loginGoogleTest() {
alert(“1”); <<< i’t Work
this.googlePlus
.login({})
.then(res => {
alert(“3”); <<< NOT response
alert(JSON.stringify(res)); <<< NOT response
})
.catch(err => {
alert(“4”); <<< NOT response
alert(JSON.stringify(err)); <<< NOT response
});
}

please anwser me thankyou.

Posts: 2

Participants: 2

Read full topic

In App Purchase Problems

$
0
0

@charlesvila wrote:

Hello everyone,
I Have a question about the implementation of in App Purchase plugin.

when i want to put import { InAppPurchase } from '@ionic-native/in-app-purchase';
in my providers list i got this:

{
	...
	"owner": "typescript",
	"code": "2322",
	"severity": 8,
	"message": "Impossible to assignate **le type 'InAppPurchaseOriginal' au type 'Provider'**.\n  Type 'InAppPurchaseOriginal' is missing the following properties from type 'FactoryProvider': provide, useFactory",
	...
}

so i use import { InAppPurchase } from '@ionic-native/in-app-purchase/ngx';

i my app can build and run.

But when i want to use

  this.iap
 .getProducts(['app.myapp.product1'])
 .then((products) => {
   console.log(products);
   
 })
 .catch((err) => {
   console.log(err);
 });
  }

I got this error

My products are set in https://appstoreconnect.apple.com/,
I set up the bundleID in my config.xml

do you have a solution?
Thx a lot

Posts: 2

Participants: 2

Read full topic


“prefs:root=” non-public URL scheme

$
0
0

@brickolicious wrote:

We are facing an issue where the iOS App store rejects our submission.
Due to the use of "prefs:root="

We have tried to search for any plugins causing this issue but cannot pinpoint the issue.
We’ve contacted Apple but they have no further details for us.

Any help or debugging tips are greatly appreciated.

Rejection message

Guideline 2.5.1 - Performance - Software Requirements
Your app uses the “prefs:root=” non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.
Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.
Next Steps
To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the “prefs:root” or “App-Prefs:root” URL scheme.
If there are no alternatives for providing the functionality your app requires, you can file an enhancement request.

We have the following url type for Facebook (social sharing)


And these capabilities

Plugins used

    <plugin name="cordova-plugin-device" spec="1.1.7" />
    <plugin name="cordova-plugin-statusbar" spec="2.1.3" />
    <plugin name="cordova-plugin-app-version" spec="0.1.9" />
    <plugin name="cordova-plugin-inappbrowser" spec="1.4.0" />
    <plugin name="cordova-plugin-x-toast" spec="2.5.2" />
    <plugin name="cordova-plugin-whitelist" spec="1.2.2" />
    <plugin name="cordova-plugin-screen-orientation" spec="1.4.3" />
    <plugin name="cordova-plugin-exitapp" spec="1.0.0" />
    <plugin name="cordova-plugin-x-socialsharing" spec="5.1.8" />
    <plugin name="cordova-plugin-network-information" spec="1.3.4" />
    <plugin name="cordova-plugin-facebook4" spec="1.9.1">
        <variable name="APP_ID" value="xxxxxx" />
        <variable name="APP_NAME" value="xxxxxxxx" />
    </plugin>
    <plugin name="cordova-plugin-code-push" spec="1.9.3-beta" />
    <plugin name="cordova-plugin-google-analytics" spec="1.8.3" />
    <plugin name="cordova-plugin-splashscreen" spec="4.0.3" />
    <plugin name="cordova-plugin-networkinterface" spec="1.2.0" />
    <plugin name="cordova.custom.plugins.exitapp" />
    <plugin name="cordova-plugin-geolocation" spec="3.0.0" />
    <plugin name="cordova-plugin-firebase" spec="0.1.25" />
    <plugin name="cordova.plugins.diagnostic" spec="4.0.10" />
    <engine name="browser" spec="4.1.0" />
    <engine name="android" spec="6.4.0" />
    <engine name="ios" spec="^4.5.5" />

Posts: 1

Participants: 1

Read full topic

Can not delete the platform ionic 4

$
0
0

@Ludolefrenchy wrote:

I have a problem to try my app on emulator and I would like to uninstall and then reinstall android but I get an error and do not delete

PS C:\Users\ludo\migration> ionic cordova platform rm android --force
> cordova platform remove android --save
rm: could not remove file (code EBUSY): C:\Users\ludo\migration\platforms\android/app/google-services.json

rm: could not remove file (code EBUSY): C:\Users\ludo\migration\platforms\android/app/google-services.json
rm: could not remove directory (code ENOTEMPTY): C:\Users\ludo\migration\platforms\android/app

rm: could not remove file (code EBUSY): C:\Users\ludo\migration\platforms\android/app/google-services.json
rm: could not remove directory (code ENOTEMPTY): C:\Users\ludo\migration\platforms\android/app
rm: could not remove directory (code ENOTEMPTY): C:\Users\ludo\migration\platforms\android

Removing platform android from config.xml file...
PS C:\Users\ludo\migration>

an idea?

thank you in advance

ludo

Posts: 1

Participants: 1

Read full topic

Ionic 4 custom icons

$
0
0

@Remzy wrote:

I follow this instructions to generate custom icon ionic cordova resources

How can I use generated custom icon in code?

I tried: <ion-icon src="/path/to/external/file.svg"></ion-icon>

also
ion-icon { &[class*="custom-"] { mask-size: contain; mask-position: 50% 50%; mask-repeat: no-repeat; background: currentColor; width: 1em; height: 1em; } &[class*="custom-lock"] { mask-image: url(../assets/kljuc.svg); } };

Posts: 1

Participants: 1

Read full topic

TypeError: Cannot read property 'then' of undefined while using ionic-v4 with Sqlite

$
0
0

@raghavendrav90 wrote:

Hi,

I am a newbie in ionic. I am trying to create a simple app with ionic + sqlite db.
But, every time I run I am getting the following error.

core.js:15714 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'then' of undefined
TypeError: Cannot read property 'then' of undefined

here is the app.component.ts

import { Component } from '@angular/core';

import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html'
})
export class AppComponent {

   private db: SQLiteObject;

  constructor(
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar, 
    private sqlite: SQLite

  ) {
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      this.createDB();
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

  private createDB() {
     alert('database creating')
    this.sqlite.create({
      name: 'myDB.db',
      location: 'default'
    })
    .then((db: SQLiteObject) => {
      alert('database created')
      this.db = db;
      // this.createTable();
    })
    .catch(e => alert(e));
  }
}

can anybody help me to solve this.

Regards

Posts: 1

Participants: 1

Read full topic

Ionic live deploy downgrades the app into the store version

$
0
0

@fontventa wrote:

Hi, I’ve got a problem with the live deploy’s feature. When I upload a new version via git, there are times that, when downloaded from the app, it’s like i lose all the live deploy’s updates and I’m back into the store version.

Versions:

Ionic: 4.3.1
Cordova CLI: 8.0.0
ionic-plugin-cordova: 6.1.0
Node: v8.11.1

Everytime I run:

git add .
git commit -m "test"
git push ionic production

And, after downloading the update like this…

checkUpdates() {
    if (!this.platform.is('core') && !this.updateWindow && window != undefined && window.IonicCordova != undefined && window.IonicCordova.deploy != undefined) {
      // Initialize the deploy plugin (OPTIONAL)
      window.IonicCordova.deploy.init(this.configDeploy, (res: any) => {
        console.log(res)
      }, (err: any) => {
        console.log(err);
      })
      // Check for available updates
      window.IonicCordova.deploy.check((res: any) => {
        if (res === 'true') {
          // A new version is ready to download
          this.alertService.showConfirm("Hay una actualización disponible. ¿Desea actualizar la aplicación?", "Actualización disponible")
            .then((resp) => {
              if (resp == 'yes') {
                let toast = this.toastCtrl.create({
                  message: 'Descargando...',
                  position: 'bottom',
                  showCloseButton: false,
                  dismissOnPageChange: true
                });
                toast.present();
                window.IonicCordova.deploy.download((res: any) => {
                  if (res === 'true') {
                    // We can unzip the latest version
                    window.IonicCordova.deploy.extract((res: any) => {
                      if (res === 'true' || (this.utils.isNumber(res) && res == 1)) {
                        this.alertService.hideLoading();
                        // we are ready to load the new version
                        window.IonicCordova.deploy.redirect(() => {
                          this.nav.setRoot(LoginPage);
                        }, (e: any) => {
                          toast.setMessage('Error al instalar la actualización')
                        })
                      }
                    }, (e: any) => {toast.setMessage('Error al instalar la actualización')})
                  }
                }, (e: any) => {toast.setMessage('Error al descargar la actualización')});
              }
            });
        }
      }, (e: any) => {
        this.alertService.showToast("Error al comprobar nuevas versiones.");
      })
    }
  }

… there are times that my app is back into the store version… And I don’t know why.
Any thoughts are welcome. Thank you very much!

Posts: 1

Participants: 1

Read full topic

Ionic 4 on machine with Ionic 3 projects, what happens?

$
0
0

@franzisk4sis wrote:

I have a very important question.

If I update Ionic CLI from 3.2.0 to 4.9.0 what happens with my Ionic 3 projects??
I really don’t want to face “new” problems on my Ionic 3 projects (I already have problems enough).

What would be the difference since I update it?

When I run some ionic command (like ionic serve) I get this message:
The Ionic CLI has an update available (3.20.0 => 4.9.0)! Would you like to install it? (Y/n)

So far I did not feel confident enough to update it, I can not ruin my projects now, every time I update something I get several problems in the projects.

My question is because meanwhile I would like to go trying a bit of Ionic 4 too.

Posts: 2

Participants: 2

Read full topic

Ionic native issue in ionic app

$
0
0

@babita112 wrote:

I have a serious issue regarding ionic-native plugin. I have used ionic native camera plugin and ionic native barcode scanner plugin but I unable to use them .I am facing the same issue in both type of plugin. I have implemented it according to the documentation from https://ionicframework.com/docs/native/barcode-scanner/ and used the example from
https://dontpaniclabs.com/blog/post/2018/07/31/creating-a-barcode-scanner-app-with-ionic/!
My error is:
" Typescript Error

Argument of type ‘{ declarations: (typeof HomePage | typeof MyApp); imports: (ModuleWithProviders | typeof Browse…’ is not assignable to parameter of type ‘NgModule’. Types of property ‘providers’ are incompatible. Type ‘(typeof SplashScreen | BarcodeScannerOriginal | ToastOriginal | { provide: typeof ErrorHandler; u…’ is not assignable to type ‘Provider’. Type ‘typeof SplashScreen | BarcodeScannerOriginal | ToastOriginal | { provide: typeof ErrorHandler; us…’ is not assignable to type ‘Provider’. Type ‘BarcodeScannerOriginal’ is not assignable to type ‘Provider’. Type ‘BarcodeScannerOriginal’ is not assignable to type ‘ClassProvider’. Property ‘provide’ is missing in type ‘BarcodeScannerOriginal’.


every time i build it for android I am facing this error.

Posts: 3

Participants: 2

Read full topic


CK-editor classic ckfinder error

$
0
0

@shyamsingh wrote:

Module parse failed: Unexpected character ‘@’ (6:0)
You may need an appropriate loader to handle this file type.
| */
|
| @import “./_hidden.css”;
| @import “./_reset.css”;
| @import “./_zindex.css”;

When i call beclow code

plugins: [CKFinder],

  // Enable the "Insert image" button in the toolbar.
  toolbar: ['imageUpload',],
  image: {
    toolbar: ['imageTextAlternative', '|', 'imageStyle:full', 'imageStyle:side']
  },

  ckfinder: {
    // Upload the images to the server using the CKFinder QuickUpload command.
    uploadUrl: 'https://example.com/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&responseType=json'
  }

The error occur.

Thanks.

Posts: 1

Participants: 1

Read full topic

Cannot understand "Can't resolve all parameters for page" Ionic 3 + Firebase

$
0
0

@Manel00 wrote:

Error: Uncaught (in promise): Error: Can't resolve all parameters for XXXPage: ([object Object], [object Object], [object Object], [object Object], [object Object], ?).

Where i have to take a look? .ts? .html? It’s being a little bit annoying when gives this kind of error because it aren’t explicit…

Thanks you so much

Posts: 6

Participants: 4

Read full topic

Select first element in array

$
0
0

@pettrin wrote:

Select first element in array

My Select

 <ion-item>
   <ion-label floating color="primary" interface="popover">Opções de Parcelamento</ion-label>
   <ion-icon name="pricetags"></ion-icon>
   <ion-select class="myCustomSelect" [(ngModel)]="formaVezes" [ngModelOptions]="{standalone:true}">
     <ion-option *ngFor="let p of parcelamentosArray" [value]="p.type" [selected]="p.type[0]" > {{ p.value}}  </ion-option>
  </ion-select>
</ion-item>

My Array

console.log(this.parcelamentosArray);

(8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
0: {type: "1"value: "1x de R$ 38,50 (sem juros)"}
1: {type: "2"value: "2x de R$ 20,12 - Total: R$ 40,24 (2.99% a.m)"}
2: {type: "3", value: "3x de R$ 13,61 - Total: R$ 40,82 (2.99% a.m)"}
3: {type: "4", value: "4x de R$ 10,36 - Total: R$ 41,42 (2.99% a.m)"}
4: {type: "5", value: "5x de R$ 8,40 - Total: R$ 42,02 (2.99% a.m)"}
5: {type: "6", value: "6x de R$ 7,11 - Total: R$ 42,63 (2.99% a.m)"}
6: {type: "7", value: "7x de R$ 6,18 - Total: R$ 43,24 (2.99% a.m)"}
7: {type: "8", value: "8x de R$ 5,48 - Total: R$ 43,86 (2.99% a.m)"}

what I can do for pre select this element first?

0: {type: "1"value: "1x de R$ 38,50 (sem juros)"}

Posts: 2

Participants: 2

Read full topic

App with activation

$
0
0

@mofeisa wrote:

Hi everyone,

How can I build ionic 3 app with online activation for the app only for first running.

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

NativeAudio vs NativeAudioOriginal

$
0
0

@JMourao wrote:

i have added the plugin nativeAudio to my project (ionic 3) and also the native part. The regular NativeAudio give me a error while trying to use and then i use NativeAudioOriginal. What is this Original inside ionic-native? i cant seem to find any documentation about it

Posts: 1

Participants: 1

Read full topic

Viewing all 70434 articles
Browse latest View live