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

How to use XMLHttpRequest in ionic

$
0
0

@flycoders_sourav wrote:

Actually I tired to send headers but am not able to do

var data = new FormData();

data.append("email", "flycodersonesignal@gmail.com");

var xhr = new XMLHttpRequest();

xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {

if (this.readyState === 4) {

console.log(this.responseText);

}

});

xhr.open("POST", "http://mydomain.ca/helpify/api/password/create");

xhr.setRequestHeader("Content-Type", "application/json");

xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");

xhr.send(data);

}

Please help me out
thanks

Posts: 1

Participants: 1

Read full topic


Date and time not displaying for particular action

$
0
0

@Sangamesh30 wrote:

I am not getting the date for a particular action. example if I commit certain action, that particular action time and date should be display. I am posting that line code

Failed at {{ failjob.date }}

this line not displaying the time and date.

Posts: 2

Participants: 2

Read full topic

Firebase storage url - extra params - ionic 4

$
0
0

@rajeshvs wrote:

I have uploaded a jpeg to firebase storage. The getDownloadUrl() for the storageref has extra params at the end
For example,
https://firebasestorage.googleapis.com/v0/b/accountinggurutest-firebase.appspot.com/o/1547184676309_abc.jpeg?alt=media&token=a49fd5b7-00a4-4a5b-adfc-c690a61ad296

I am using Ionic 4:

I am not able to display the above url in the “img” tag in the ionic app.
However, if I give a another normal url without extra params at the end, then the image is displayed.
It happens in ‘ionic serve’. I did not had a chance to test on the actual device or in ionic3.

There is no problem in a angular application on the browser. The image is displayed fine with the ‘img’ tag in the angular app.

Any ideas.

Posts: 1

Participants: 1

Read full topic

IONIC 4 : Disable zooming of ion-slide

$
0
0

@dvtopiya wrote:

When I double tap on ion-slide, it is zooming an image and design is breaking due to this. Can any one please give me any solution how can I disable zooming of ion-slides in IONIC 4, I tried with zoom=“false” in ion-slides element but it is not working.

Posts: 1

Participants: 1

Read full topic

How i can open external applications on android with ionic 3

How to get objects by map key?

$
0
0

@wedusa wrote:

I have to get json through provider and save it in map where the key is “id” and other values is objects. This is my json:

{
    "data": {
        "stores": [{
                "description": "a1",
                "name": "b1",
                "id": ["_0010008"]
            },
            {
                "description": "a2",
                "name": "b2",
                "id": ["_0010007"]
            }
        ]
    },
    "message": "",
    "status": "ok"
}

This is my provider.ts:

import {
    HttpClient
} from '@angular/common/http';
import {
    HttpClientModule
} from '@angular/common/http'
import {
    Injectable
} from '@angular/core';
import 'rxjs/add/operator/map';
import {
    JsonStoresDataInterface
} from './../../providers/stores/stores';

/*
  Generated class for the StoresProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class StoresProvider {
    private JsonStoresData = new Map([]);
    defaultKey = "_0010008";
    url_request = "path/to/json";

    constructor(public http: HttpClient) {}

    getStoresRemote(s) {
        this.http.get < JsonStoresDataInterface > (this.url_request).subscribe(data => {
            var json = data.data;
            for (var store of json.stores) {
                var str = id[0];
                var arr = {
                    name: store.name,
                    description: store.description,
                }

                this.JsonStoresData.set(str, arr)
            }
        });

        console.log(this.JsonStoresData);
        console.log(this.JsonStoresData.get(this.defaultKey));
    }
}

console.log(this.JsonStoresData) is OK:

console.log(this.JsonStoresData.get(this.defaultKey)) is not OK:

Undefined

Whats wrong? And how to get objects by map key?

Posts: 1

Participants: 1

Read full topic

Execution failed for task ':app:transformClassesWithDesugarForDebug'

$
0
0

@sarathcm wrote:

I am using ionic for my mobile application. When I am using

ionic cordova build android

getting following error :

* What went wrong:
Execution failed for task ':app:transformClassesWithDesugarForDebug'.
> com.android.build.api.transform.TransformException: java.lang.Runtime

How can I fix this build issue ? I tried :

cordova clean android

But no luck issue is still existing. Please suggest one solution to fix this issue.

Posts: 1

Participants: 1

Read full topic

Deep Linking not working on second time clicked

$
0
0

@franwalverde wrote:

Good afternoon, I’m using deeplink to open my app and send a code. But it only works for me the first time, if I leave the app in the background and use the link again, the application opens correctly but does not get to do this part:
this.deeplinks.route ({
‘/’: {}
}). subscribe …

so I can not capture the code that is sent to the app the second time.

Posts: 1

Participants: 1

Read full topic


For which project is Ionic suitable?

$
0
0

@Fab4guy wrote:

Hello,
is it possible to create a website, an Android app and an IOS app with Ionic using only one codeline/Project? Or would you recommend it? Or you should create the development of Android app, Iphone app and responsive website as two projects. What problems could there be if you tried to realize everything in one project? Or there are certain types of websites, for example online shops, which should not be done with the Ionic Framework?

Many thanks and many greetings

Posts: 1

Participants: 1

Read full topic

Select all for ion-checkbox

$
0
0

@fhks wrote:

Hi am new to ionic and to this forum too. I am trying to get a select all option (and deselect) working in . I am not using .

html:

<ion-item>
    <ion-checkbox [(ngModel)]="SelAll" (click)="SelectAll()"></ion-checkbox>
    <ion-label>Select All</ion-label>
</ion-item>
<ion-item *ngFor="let dept of this.departments">
    <ion-checkbox></ion-checkbox>
    <ion-label>{{dept.name}}</ion-label>
</ion-item>

I am not sure what to have in the SelectAll() method in the ts file. I want everything in the same page and io-select takes me to a pop up, hence avoiding it.

Posts: 1

Participants: 1

Read full topic

Ionic iOS tabs page can bounce white space on top and bottom of app-area

$
0
0

@Jesse-H wrote:

My app shows white area when scrolling up/down tabspage when selecting header or tab area.

When you scroll down it shows the white background, when you scroll up the white space will move on top of the tabs button area. I included a gif showing the problem.

This problem only exsist on iOS, android works fine.

Tabs page (html) is as follows:

<div id="bgFab" *ngIf="showBgFab == 1" (click)="closeFab(fab);"></div>

<ion-fab center bottom class="pokeballfab" *ngIf="hidePokeball === 0" #fab>
       <button ion-fab class="pokeball" (click)="openFab(fab);" ></button>
       <ion-fab-list side="top">
            <button ion-fab (click)="openPage('SettingsPage', fab)"><ion-icon name="settings"></ion-icon></button>
            <button ion-fab (click)="openPage('FriendsPage', fab)"><ion-icon name="people"></ion-icon></button>
            <!-- <button ion-fab><ion-icon name="person"></ion-icon></button> -->
      </ion-fab-list>
</ion-fab>

<ion-tabs #homeTabs color="primary" no-bounce>
  <ion-tab [root]="tab1Root" tabTitle="Map" tabIcon="map"></ion-tab>
  <ion-tab [root]="tab2Root" tabTitle="Friends" tabIcon="people"></ion-tab>
  <ion-tab></ion-tab>
  <ion-tab [root]="tab3Root" tabTitle="Community" tabIcon="planet"></ion-tab>
  <ion-tab [root]="tab4Root" tabTitle="News" tabIcon="paper"></ion-tab>  
</ion-tabs>

If tried these CSS settings (in app.css) already but without results:

ion-tabs, ion-app, ion-nav, body, html, .ion-page, .nav-decor, .app-root {
    height: 100vh;
    overflow: hidden;
} 

Also I tried if the problem would resolve if I removed the ion-fab and bgFab div but it did not.

I hope somebody can point me in the right direction or had a similar problem.

Posts: 2

Participants: 1

Read full topic

[Ionic 4] Is it possible to make a modal appearing from side rather than bottom?

$
0
0

@zengstephen wrote:

When using a ModalController to display a component in a modal, by default it appears from bottom to top. Is it possible to change it to appear from right to left?

Thanks.

Posts: 1

Participants: 1

Read full topic

Ion-content getting over-ride by ion-tabs Ionic 3

$
0
0

@devsid wrote:

Hi, I have an un-usual problem and it seems like it has started now, i don’t know is this because of any un-stable plugin update or what.

My problem is that when i run this in Mobile, last two buttons gets behind the tabs. And the scrolling is not working either.

can someone help me.
Thank You

Posts: 1

Participants: 1

Read full topic

Ionic 3 Validators

$
0
0

@mhtchong wrote:

Hello,

I have been struggling to solve this. I hope someone can help me out with this. So basically, I have a form… Inside the form I have 4 fields: Source (radio group of Wallet and Card), Wallet dropdown (appears when you choose Wallet radio button), Card dropdown (appears when you choose Card radio button), and Amount.

This is the TS of my form:

Form builder

this.addExpenseForm = formBuilder.group({
      title: ['', Validators.compose([Validators.required, Validators.maxLength(40)])],
      category: ['', Validators.required],
      source: ['', Validators.required],
      wallet: [null, null],
      card: [null, null],
      amount: [null, null],
      date: [this.currentDate, Validators.required],
      time: [this.currentTime, Validators.required]
    });
//when you choose 'wallet' or 'card' radio button
  onSourceChange(event) {
    console.log('1. choose source: ' + event);
    if(event == 'wallet') {
      this.isWallet = true;
      this.isCard = false;

      this.addExpenseForm.controls['card'].validator = null; 
      this.addExpenseForm.controls['card'].setErrors(null); 
      this.addExpenseForm.controls['card'].reset(); 
      
      this.addExpenseForm.get('wallet').setValidators([Validators.required]);
    }
    if(event == 'card') {
      this.isCard = true;
      this.isWallet = false;

      this.addExpenseForm.controls['wallet'].validator = null; 
      this.addExpenseForm.controls['wallet'].setErrors(null); 
      this.addExpenseForm.controls['wallet'].reset(); 

      this.addExpenseForm.get('card').setValidators([Validators.required]);
    }
    this.addExpenseForm.controls['amount'].validator = null; 
    this.addExpenseForm.controls['amount'].setErrors(null); 
    this.addExpenseForm.controls['amount'].reset(); 
  }
//when you select an option from the dropdown
  onSourceSelect(id, source) {
    this.addExpenseForm.controls['amount'].validator = null; 
    this.addExpenseForm.controls['amount'].setErrors(null); 
    this.addExpenseForm.controls['amount'].reset(); 

    if(source == 'wallet') {
      console.log('2.1 wallet chosen: ' + id);
      this.getWalletAvailableAmount(id);
    } 
    if(source == 'card') {
      console.log('2.2 card chosen: ' + id);
      this.getCardAvailableAmount(id);
    }
  }
getCardAvailableAmount(cardId) {
    console.log('3.1 check card amount');
    // this.dp.getCardAvailableAmount(cardId)
    //   .then(data => {
    //     this.amount = data[0].amountCard;
    //     this.addExpenseForm.get('amount').setValidators([Validators.required, Validators.min(1), Validators.max(this.amount)]);
    //   }, err => {
    //     console.log(err);
    //   })
    
  }

  getWalletAvailableAmount(walletId) {
    console.log('3.2 check wallet amount');
    // this.dp.getWalletAvailableAmount(walletId)
    //   .then(data => {
    //     this.amount = data[0].amountWallet;     
    //     this.addExpenseForm.get('amount').setValidators([Validators.required, Validators.min(1), Validators.max(this.amount)]);    
    //   }, err => {
    //     console.log(err);
    //   })
  }

Let us say when the page loads for the first time and I choose Wallet radio button the console.log (1.) will print. Then when I choose a wallet in the dropdown, two console.logs will print (2.1 and 3.2). This is the expected behavior. However, lets say I changed my mind and choose Card radio button, the console.log (1., 2.2, and 3.1) will immediately print, which is not the expected behavior. Not sure why this is happening when I am resetting the validators of the fields.

Why is this happening?

Hope someone can help me with this.

Thank you!

Posts: 1

Participants: 1

Read full topic

'cdvBuildDebug' not found in root project 'android

$
0
0

@cikcoh wrote:

Hi, can anyone help me on how to debug this issue?
i hv trie removing and adding platform and got this error

Could not resolve all files for configuration ‘:app:classpath’.
Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.0/manifest-merger-26.0.0.jar
Could not find ddmlib.jar (com.android.tools.ddms:ddmlib:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/ddms/ddmlib/26.0.0/ddmlib-26.0.0.jar
Could not find dvlib.jar (com.android.tools:dvlib:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/dvlib/26.0.0/dvlib-26.0.0.jar
Could not find common.jar (com.android.tools:common:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/common/26.0.0/common-26.0.0.jar

then, i tried to change all build.gradle

from

jcenter()
maven { url "https://maven.google.com"}

to

maven { url "https://maven.google.com"}
jcenter()

then i got ‘cdvBuildDebug’ not found in root project 'android

Posts: 1

Participants: 1

Read full topic


[ionic 4] If I add Capacitor, do I need to remove ionic native?

$
0
0

@gigocabrera wrote:

I have an ionic 4 app I’ve been working on and I just added Capacitor. I noticed there is a “Splash Screen” and “Status Bar”.

Do I need to remove the ionic native counterparts in favor for the capacitor ones?

"@ionic-native/splash-screen": "5.0.0-beta.21",
"@ionic-native/status-bar": "5.0.0-beta.21",

Posts: 1

Participants: 1

Read full topic

Upgrade Android 6.3 to 6.4

$
0
0

@helpmelearn wrote:

Trying to upgrade to cordova android 6.4 from 6.3
I remove android
I add android@6.4.0 no error.
I then build,

I get this error.


For some reason there is stuff missing from build gradle, but I add it back.
Building again I get this.

BUILD FAILED in 1s
3 actionable tasks: 1 executed, 2 up-to-date
Error: /home/dev/Ionic-App/apps/coolApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
1

Yes it just says 1 is what went wrong. I try doing the stack, I try debug no other information.

I know I’m suppose to have gradle installed separately. In my linux machine I run gradle --version and get

------------------------------------------------------------
Gradle 4.0.1
------------------------------------------------------------

Seems like I either installed this already or linux had it.
Not sure what to try next.

Posts: 1

Participants: 1

Read full topic

Help to me please in Ionic Pro, I have this The user-provided path platforms/android/build/outputs/apk/debug/android-debug.apk does not exist

Error installing firebase-tools for cloud functions

$
0
0

@obinnae wrote:

I’ve used firebase-tools to create & manage cloud functions, but after recently updating the firebase plugin, I noticed that firebase-tools isn’t working. I tried reinstalling it using

npm install -g firebase-tools

but I’m getting a bunch of these warnings…

WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/…

followed by the error…

npm ERR! enoent ENOENT: no such file or directory, chmod ‘/usr/local/lib/node_modules/firebase-tools/node_modules/mkdirp/bin/cmd.js’

Any ideas? I’m at a standstill here.

Thanks.

Posts: 2

Participants: 2

Read full topic

How to create forum

$
0
0

@Moralizonleo wrote:

I just want to ask on how to create a forum in a mobile application using xampp as a database. Please help e, this is part of my project. Thanks!

Posts: 1

Participants: 1

Read full topic

Viewing all 48981 articles
Browse latest View live


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