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

I have facing array map function

$
0
0

@flycoders_sourav wrote:

I tired to insert new object in my existing array but when i used this below code showing an error ERROR TypeError: “this is undefined” please help me out it would be appreciate

for(let j=0; j<this.rating.length;j++){
              var result = this.allpohotographer.map(function(el) {
                console.log(el)
                var o = Object.assign({}, el);
                o.averageRating = this.rating[j].averageRating
                return o;
              })
              console.log(result)
}

Thanks in advance

Posts: 1

Participants: 1

Read full topic


APK empty when packaged through Ionic Dashboard

$
0
0

@leeprice wrote:

Hi,

I’ve been having a strange issue when packaging the APK through Ionic Dashboard.

I get the ‘Success’ message, no errors or warning. However, when I download the APK it’s completely empty at zero bytes.

The iOS build works fine.

Any suggestions why this may be happening?

Posts: 1

Participants: 1

Read full topic

Interactive bar

$
0
0

@planika wrote:

Hello,
It is any possibility to create interative bar like this on image? Vertical bar which is interactive with click and swipe event. On any event value of bar is changing.

bar

Do you have any idea? or tips for me?

Thanks !

Marcin

Posts: 1

Participants: 1

Read full topic

How to apply background color for a full page in ionic

Problem with ion-item-sliding -IONIC 4

$
0
0

@ravo93 wrote:

Once I remove 1 element from the list, it stops sliding and I can’t remove other element. the Real problem is that I don’t have reported problems on my consolle :sweat_smile:. PLEASE HELP

html

 <ion-item-sliding *ngFor="let c of table.Consumptions">
      <ion-item>
        <ion-label>
          {{c.Ora}}&nbsp;-&nbsp;{{c.DescConsumazione}}
          <p style="color:white">{{c.Tempo}} minuti</p>
        </ion-label>
        <ion-label>
          <p style="color:white" text-right>{{c.Prezzo | currency:'EUR'}}</p>
        </ion-label>
      </ion-item>
      <ion-item-options side="end">
        <ion-item-option color="danger" (click)="delete(c)">
          <fa-icon [icon]="faTrashAlt"></fa-icon>
        </ion-item-option>
      </ion-item-options>
    </ion-item-sliding>

typescript (the function works correctly)

async delete(c) {
    this.alertCtrl.create({
      header: "Eliminare Consumazione?",
      cssClass: "costumAlert",
      buttons: [
        { text: "Annulla", role: "cancel" },
        {
          text: "Elimina",
          handler: () => {
            this.alertController.create({
              header: "Reinserire prodotto in magazzino?",
              cssClass: "costumAlert",
              buttons: [
                {
                  text: "no",
                  handler: () => {
                    c.Recharge = false;
                    this.table.Consumptions.splice(this.table.Consumptions.indexOf(c), 1);
                  }
                },
                {
                  text: "si",
                  handler: () => {
                    c.Recharge = true;
                    this.table.Consumptions.splice(this.table.Consumptions.indexOf(c), 1);
                  }
                }
              ]
            }).then(alert => alert.present())

          }
        },
      ]
    }).then(alert => alert.present());

Posts: 1

Participants: 1

Read full topic

Removed cordova-plugin-ionic and app not working anymore

$
0
0

@laurineWermann wrote:

Since I received alert from Ionic telling me that I have hit the Deploy limit, event though I never used Deploy, I decided to remove ionic pro from my app (at least to continue testing). I launched

cordova plugin rm cordova-plugin-ionic

and

npm rm @Ionic/pro

now when the app launch, I get this error and the splash screen is stucked. I don’t know if this.platform.ready() is even fired, it hit neither the “then” neither the “catch”. I put a console log juste before and it is hit, but after that, nothing.

Unhandled Promise rejection: Class not found ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Class not found undefined

Posts: 1

Participants: 1

Read full topic

Run App on background mode

$
0
0

@Kyrax80 wrote:

Hello, I need to check user’s location while the App is closed and then send a local notification to the user when he’s within a certain radius near of a place.

What can I do to keep the App in background even if it’s closed? Thanks.

Posts: 1

Participants: 1

Read full topic

Ionic input number pattern


Ionic best practices for reusable code

$
0
0

@JMourao wrote:

i have been developing my app with the programming ideology of reusing as much code as possible, with that i was creating custom components and using them initially the application behaved very well, but as the application started growing performance and behaviour started deteriorating.

I am currently optimizing the application and reading documentation, and i can’t seem to find any official information regarding do’s and don’ts, just in posts in forums and internet posts. What are the best practises for reusing code?

I read that for example a HEADER component for the whole application is a bad practise, as the application has 3 root components and ion-footer. How to reuse code here so that behaves properly with ionic?

Another example is the list & refresher component, if i want to have a component with a list that always has a specific refresher on top, this requires the ion-refresher to be enclosed near a . If the ion-content is inside of the component doesn’t it defeat the purpose of having to be a root component of a page?

TLDR: Is there any documentation of do’s and don’ts of ionic development and where can i read some limitations during development?

Posts: 1

Participants: 1

Read full topic

Version-stamping of generated resources on every build

$
0
0

@ccpizz wrote:

By default, a release build of an Ionic app uses fixed paths for resources such as JS, CSS, images, e.g:

index.html
build/vendor.js
build/main.js
build/main.css
build/polyfills.js
...etc

This is proving problematic with regards to caching when the app is accessed via a conventional browser, because browsers tend to aggressively cache js libraries and styles, and a manual cache purge is required in order for updates to show up. Also, if some CDN caching is used, then the cache should be manually flushed on CDN too.

Is there a way to force automatic file versioning for Ionic, so that on each build unique file names as created?

I.e. how to get Ionic to generate the following instead?

index.html
build/vendor.a66f828dca56eeb90e02.js
build/main.18b12496ca4a0f639e59.jss
build/main.ef8cbc5c544fd62b6df3.css
build/polyfills.77d2aa935bdcf01897be.js

I am looking at generating unique hashes on every build or using the last git commit hash or whatever other approaches exist for this.

Angular does this by default without having to do any explicit configurations, but I could not find how to enable this for Ionic.

Any hints?

Posts: 1

Participants: 1

Read full topic

Ionic App not working anymore

$
0
0

@yavorivanov wrote:

Hello,
A few days everything was working okay and unfortunately i don`t remember what i did, but now the app is not working as it should. I think i deleted the platforms folder and after adding again the platforms it stopped working. It added Android 7.0.0 and i had to remove it and installed 6.3.0 like before.

Ionic info:

Ionic:
ionic (Ionic CLI) : 4.10.2
Ionic Framework : ionic-angular 3.9.3
@ionic/app-scripts : 3.2.2
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 6.3.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)
System:
NodeJS : v11.9.0 (C:\Program Files\nodejs\node.exe)
npm : 6.5.0
OS : Windows 10

Plugins:
com.scott.serviceDiscovery 0.2.0 “serviceDiscovery”
cordova-fabric-plugin 1.1.14-dev “cordova-fabric-plugin”
cordova-plugin-advanced-http 1.11.1 “Advanced HTTP plugin”
cordova-plugin-app-version 0.1.9 “AppVersion”
cordova-plugin-camera 3.0.0 “Camera”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-document-viewer 0.9.10 “SitewaertsDocumentViewer”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-geolocation 3.0.0 “Geolocation”
cordova-plugin-globalization 1.11.0 “Globalization”
cordova-plugin-ionic-keyboard 2.1.3 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-nativegeocoder 3.1.3 “NativeGeocoder”
cordova-plugin-nativestorage 2.3.2 “NativeStorage”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-networkinterface 2.0.0 “NetworkInterface”
cordova-plugin-secure-storage 2.6.8 “SecureStorage”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
phonegap-plugin-barcodescanner 8.0.1 “BarcodeScanner”
phonegap-plugin-push 2.1.3 “PushPlugin”

I am using - “ionic cordova run android -lc” and there is nothing unusual there. After the splash screen i am getting this error and if i click cancel i can see the LoginPage but if click Login it will show the same error and if i click cancel it is only white page. I removed all plugins, but didnt help. I used ionic-cli 4.4.0 before but it is still not working.

I can upload only 3 images:

If i missed some information please let me know.

Posts: 1

Participants: 1

Read full topic

Accept input and show to user

IOS package build failed, PodFile?

$
0
0

@danieleelt wrote:

image

Hi all, i have an error building a package for IOS… the error seems “library not found for -lGoogleToolboxForMac”

First time i tried to build on xcode i got same error, then i updated my PodFile with this line " pod ‘GoogleToolboxForMac’ " and local build result successful :slight_smile:

But when i try the same solution with Ionic i get the same error again :persevere:

Someone can help me? <3 thanks

Posts: 1

Participants: 1

Read full topic

Ionic push notifications custom sound are not playing on Android Oreo and above versions

$
0
0

@RAJBABAR wrote:

As per Ionic documentation of push plugin, I created Channel for android O and above version. Refer link:-

https://ionicframework.com/docs/native/push/

I actually wanna play custom sound when push notification received and its already working on Android 7(Nougat) and below versions, but I am getting issues on Android Oreo and above versions, push notifications are receiving, but not custom sounds are not playing. I refer lots of links to resolve this issue, but its nothing to work.

Refer links:-

https://github.com/phonegap/phonegap-plugin-push/issues/2017

https://github.com/phonegap/phonegap-plugin-push/issues/2446

In mostly suggested solutions they suggested to add “sound” parameter in createChannel method like this:-

this.push.createChannel({
id: "testchannel7",
description: "asdf",
sound: 'pulse',
// The importance property goes from 1 = Lowest, 2 = Low, 3 = Normal, 4 = High and 5 = Highest.
importance: 4,
vibration: true
}).then(() => console.log('Channel created'));

But I am getting

Typescript error :- Typescript Error Argument of type ‘{ id: string; description: string; importance: 3; sound: string; }’ is not assignable to parameter of type ‘Channel’. Object literal may only specify known properties, and ‘sound’ does not exist in type ‘Channel’.

Even I stored my sound.mp3 files in following position:- platforms/android/app/src/main/res/raw

In my payload sound parameter is already added without extension such as :-

{
...,
...,
sound: soundname,
...
}

My ionic environment configuration:-

Ionic:

ionic (Ionic CLI) : 4.5.0 (/usr/local/lib/node_modules/ionic)

Ionic Framework : ionic-angular 3.9.2

@ionic/app-scripts : 3.1.6

Cordova:

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

Cordova Platforms : android 7.1.4

Cordova Plugins : cordova-plugin-ionic-webview 3.1.1

Push Plugin Version:-

phonegap-plugin-push 2.2.3 “PushPlugin”

Please help me to solve this issue, Thanks in advance.

Posts: 1

Participants: 1

Read full topic

How to unblock the CORS policy

$
0
0

@gokulanathan wrote:

i tried apiurl in post method for signup page…

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

let apiUrl = 'http://aaaaa.in/outfit/index.php/api/v1/';

@Injectable()
export class AuthServiceProvider {

  constructor(public http: Http) {
    console.log('Hello AuthServiceProvider Provider');
  }
  public register(data){
    return new Promise((resolve, reject) => {
      let headers = new Headers();
      alert('11');
        headers.append('Content-Type', 'application/json');
        headers.append('Access-Control-Allow-Origin', '*');
         headers.append( 'Access-Control-Allow-Headers', 'Authorization, Content-Type' );

        //headers.append('Access-Control-Allow-Origin', 'http://localhost:8100');
//headers.append('Access-Control-Allow-Credentials', 'true');

        alert(apiUrl);
        this.http.post(apiUrl+'account', JSON.stringify(data), {headers: headers})
        
          .subscribe(res => {
            resolve(res.json());
           alert(Response);
          }, (err) => {
            reject(err);
          });
    });
  
  }

}

it shows the error like this…“Access to XMLHttpRequest at ‘http://aaaaa.in/outfit/index.php/api/v1/account’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.”

Posts: 1

Participants: 1

Read full topic


After importing into Android Studio

$
0
0

@viraj28 wrote:

Hi,

I created an app using ionic 3. Now I need to create a widget for the app, so I imported the project in Android studio after adding platform android.

The app builds and runs fine on the emulator after the import.

Now I am stuck. There’s just lot of files and i don’t see any of my code that i can understand. I don’t see any android Studio MainActivity or layouts as well.

I would like if someone were to guide me regarding this as I also need to create a Widget.

Posts: 1

Participants: 1

Read full topic

Ionic 4 secure storage not working

Ionic serve not not working

Speech recognition

$
0
0

@babita112 wrote:

Hello,

I have query regarding speech recognition plugin in ionic-native


I want the functionality that when I say somethnig like ‘ok google’ then my start listening event should have to start inside the application. If I say anything other than this there should not be any listening from this plugin. can this be possible.

Posts: 1

Participants: 1

Read full topic

I cannot find the github link for ionic 4 components demo source examples

Viewing all 70435 articles
Browse latest View live