Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228529 articles
Browse latest View live

Image not displaying while displaying contacts

$
0
0

Avoid to share contact list real numbers. thanks


Image not displaying while displaying contacts

$
0
0

You need to put condition inside the loop itself as it seems you don't have photos set in the contacts. Check there if photos is not null then only do this obj["image"]= contacts[i].photos[0].value

Ionic add platform ios error

$
0
0

I am able to solve this problem by calling npm install buffer-shims on the project directory.

Image not displaying while displaying contacts

$
0
0

is this the right way

co.find(["displayName", "phoneNumbers","photos"], {multiple: true, hasPhoneNumber: true}).then((contacts) => {
    for (var i=0 ; i < contacts.length; i++){
     **if((contacts[i].displayName !== null)||(contacts[i].photos[0].value!=null)){**
       var obj = {};
       obj["name"] = contacts[i].displayName;
       obj["number"] = contacts[i].phoneNumbers[0].value;
       obj["image"]= contacts[i].photos[0].value;
      // console.log(contacts[i].photos);
        this.contacts.push(obj)
            console.log( "Image url="+ contacts[i].photos[0].value);
        }
         console.log(contacts);
       // console.log(obj);
    }
    this.groupContacts(this.contacts);
  })

Image not displaying while displaying contacts

$
0
0

Try this:

f((contacts[i].displayName !== null) && (contacts[i].photos !== null))

PS: Check what I've said earlier again and try these things, I'll be back later.

Ionic v1 with pwa

$
0
0

but if i use cordova plugin like socialsharing, file-opener2, sqlite-2 in ionic-2
Is that support for pwa? beacuse this plugins are not supporting to browser this are work only on device or emulator .
If i am not wrong?

Image not displaying while displaying contacts

Ionic android --release not working

$
0
0

use this ionic build android --release --prod


Ionic 1.x and 2.x in the same machine

Image not displaying while displaying contacts

Image not displaying while displaying contacts

$
0
0

My bad! Probably we need to check the current contact whether the photos object in it (which would be there in any case as it is the structure) has any element at all or not. Like this:

if((contacts[i].displayName !== null) && (contacts[i].photos[0] !== null))

Let me know what is the output you get.

EDIT:

Sorry in a hurry so again did something wrong, it should be:

if((contacts[i].displayName !== null) && (contacts[i].photos.length > 0))

iOS splashscreen spinner not centered

$
0
0

Yes, that's weird. I built the project with the '--prod' tag, and the spinner shows up at the wrong place like 2 seconds before it moves to the center, when I build in debug mode, it's more like 7 seconds. It looks like there is something wrong during the initialization, but I can't find what. I think I will have to hide the spinner :frowning:

How to obfuscate the code in ionic platform

$
0
0

In my case, I have placed proguard-android.txt file inside platforms\android. Add your rules for obfuscation as per requirement. Add below lines in your build.gradle file:

android {

    defaultPublishConfig "release"

    buildTypes {
        release {
            //signingConfig signingConfigs.release
            minifyEnabled true
            debuggable false
            shrinkResources true
            proguardFile 'proguard-android.txt'
        }
    }
}

This works fine and obfuscates my src files. However, the drawback is that I am unable to avoid obfuscation of files present in the assets directory due to which my application crashes.

Also, the solution you mentioned about uncommenting the lines is applicable for eclipse projects (Not sure).

Thanks.

Application error. The connection to the server was unsuccessful

$
0
0

<platform name="android"><preference name="loadUrlTimeoutValue" value="700000" />

Do we need to mention platform name as well ?

or simply <preference name="loadUrlTimeoutValue" value="700000" />

If I am developing a application for both iOS and android platform

How to open image on click in ion-slide-box?

$
0
0

alert is just for testing....for check method is working or not.. it can be replace with your code...don't think about it


Credit Card Reader/Swiper

AlertController Cancel Button / Dismiss is not working

$
0
0

import { Component } from '@angular/core';
import { NavController, ActionSheetController, AlertController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  person:any = {
	name: ""
  };

  constructor(
	public navCtrl: NavController,
    public actionSheetCtrl: ActionSheetController,
    public alertCtrl: AlertController
  ) {}

  DoAction() {
    let buttons:any = null;

	buttons = [
		{
		  text: 'Change Name',
		  icon: 'create',
		  handler: () => {
			this.changeName();
		  }
		}
	];


    let actions = this.actionSheetCtrl.create({
      title: 'Actions',
      buttons: buttons
    });

    actions.present();
  }

  changeName() {
    let prompt = this.alertCtrl.create({
      title: 'Change Name',
      message: "Insert new name",
      inputs: [
        {
          name: 'personName',
          placeholder: 'new name'
        }
      ],
      buttons: [
        {
          text: 'Cancel',
          role: 'cancel'
        },
        {
          text: 'OK',
          handler: data => {
            this.person.name = data.personName.length ? data.personName : "No Name";
          }
        }
      ]
    });

    prompt.present();
  }

}

and html:

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Home</ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>
  <button ion-button secondary (click)="DoAction()">Click me</button>
</ion-content>

Issue in using custom Cordova plugin with Ionic app

Image not displaying while displaying contacts

Ionic android gradle build takes long time!

$
0
0

How long does the Cordova build need there?

Viewing all 228529 articles
Browse latest View live


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