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

GET request with nested JSON object

$
0
0

Hi rapropos, thanks for the quick answer. I believe I'm using it, the problem is that the value of the parameter is itself an object. So another example would be:

api/whatever?param={id:1,kind:'abc',innerobjects:[{prop1:'something else',prop2:9999},{prop1:'another',prop2:2212}]}

The main point here is that it's not possible to disassemble the object's properties into parameters, as they are nested...

Cheers


Ion-item-sliding option probem

Ionic android gradle build takes long time!

$
0
0

I solved this issue by downgrading cordova-android to v6.1.2

A traditional way of launching an app

$
0
0

Have you ever see an application which does that? Most probably no

Ionic Native File.readAsDataURL giving error code: 1 message: NOT_FOUND_ERR

GET request with nested JSON object

$
0
0

I wish you the best of luck with this, but if I were in your shoes I would redesign the API so that such complex query strings are not needed. There seems to be just too much possibility here for not just complexity in writing and testing the app, but also securing it from malicious access.

Ionic v1 with pwa

$
0
0

Is there any possibility ionic --v1 work as progressive web app.

Ionic 3 Ionic View does not show any styles

$
0
0

I just created a fresh ionic app, ionic v 3.4

I applied some styles in my app.scss and changed some styles in the theme variables.scss

I did ionic upload to upload the app, I see the HTML, but the app has no styles or images.

Any ideas?

**Correction, the app shows images in an tag, but if they are background images in CSS they do not show, so it seems to be a styles issue


GET request with nested JSON object

$
0
0

Thanks for the suggestion, I just wanted to make sure there's currently no alternative for ionic 2, as the $httpParamSerializerJQLike approach would solve the problem without requiring redesigning the API...

Cheers

Ionic v1 with pwa

Ionic 3 Ionic View does not show any styles

Image not displaying while displaying contacts

$
0
0

You are doing everything fine except that you don't know the data structures you are dealing with (and have confused others too in the process). Most probably because you've copy pasted this code, that's okay though. The thing is, you have to understand what the code is doing. Here is what it is actually doing and what your problem is:

  1. The Contacts service/facade is fetching native Android mobile contacts for you ( co:Contacts, co.find )
  2. You are adapting the returned data ( contacts ) and filling the local obj object with required values inside the loop
  3. You are pushing the filled obj into the local contacts array ( this.contacts.push(obj) ) thereby creating a local copy of the records to use in your template

Now the problem:

obj["image"]= contacts[i].photos;

The above line is fetching the photos object rather than the url of the image you need, that's why you are getting the Failed to load [object%02Object] error. You need to know the structure of the photos object to fetch the url from it. That's what @Sujan12 has been trying to request from you in different ways, but to no avail.

If you refer to the docs for the relevant plugin, I'd guess the photos object is a ContactField object and has a property named value. So to really make sure that you are actually getting an url or not, change the for loop to the following and show us the screen shot of the console:

for (var i=0; i < contacts.length; i++){
   if(contacts[i].displayName !== null){
      var obj = {};
      obj["name"] = contacts[i].displayName;
      obj["number"] = contacts[i].phoneNumbers[0].value;
      obj["image"]= contacts[i].photos[0].value;
      this.contacts.push(obj)
      console.log("Image URL: " + contacts[i].photos[0].value);
   }
}

This will show you whatever is being returned as the value properties of the photos objects, whether those have image urls or not is a different matter and affects the ultimate output.

Infinite scroll is visible

$
0
0

I figured out how to check for the element. Any Idea how to call a function as you scroll with infiinite scroll? Is there a scroll even listener?

Adding Windows platform is trying to add cordova-plugin-wkwebview-engine and causing an error

$
0
0

I have an existing Ionic application where I have had all of Android, iOS, and Windows platforms included. I have left out Windows for a while, but now have the need to build a Windows 10 UWP version.

I thought since I added the Windows platform a long time ago (when Ionic in Beta and on a different Windows machine), I'd first remove it and then add it back (as it didn't build anyway).

I Now seem get an error that sees to be related to the cordova-plugin-wkwebview-engine that I added for iOS.

I have Visual Studio 2017 installed (and all the Cordova etc packages)..

Here is the error I get...

ionic cordova platform add windows --info
> cordova platform add windows --save
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova platform add windows --save (exit code 1):


        You have been opted out of telemetry. To change this, run: cordova telemetry on.
        Using cordova-fetch for cordova-windows@~5.0.0
        Adding windows project...

			  Creating Cordova Windows Project:
        Path: platforms\windows
        Namespace: com.myapp
        Name: Mayapp
        Windows project created with cordova-windows@5.0.0
        The following image was skipped because it has an unsupported size (undefinedxundefined):
        resources\android\icon\drawable-xhdpi-icon.png
        Installing "cordova-plugin-app-version" for windows
        Installing "cordova-plugin-compat" for windows
        Installing "cordova-plugin-console" for windows
        Installing "cordova-plugin-device" for windows
        Installing "cordova-plugin-email-composer" for windows
        Installing "cordova-plugin-file" for windows
        Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-compat" already installed on windows.
        Installing "cordova-plugin-ios-disableshaketoedit" for windows
        Installing "cordova-plugin-network-information" for windows
        Installing "cordova-plugin-splashscreen" for windows
        Installing "cordova-plugin-statusbar" for windows
        Installing "cordova-plugin-whitelist" for windows
        Installing "cordova-plugin-x-socialsharing" for windows
        Installing "cordova-plugin-x-toast" for windows
        Installing "cordova-plugin-zip" for windows
        Plugin dependency "cordova-plugin-file@4.3.1" already fetched, using that version.
        Dependent plugin "cordova-plugin-file" already installed on windows.
        Installing "cordova-sqlite-storage" for windows
        installing external dependencies via npm
        npm install of external dependencies ok
        Installing "ionic-plugin-keyboard" for windows
        Discovered plugin "cordova-plugin-wkwebview-engine" in config.xml. Adding it to the project
        Failed to restore plugin "cordova-plugin-wkwebview-engine" from config.xml. You might need to try adding it
        again. Error: Failed to fetch plugin
        cordova-plugin-wkwebview-engine@git+https://github.com/driftyco/cordova-plugin-wkwebview-engine.git via
        registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.
        Error: cmd: Command failed with exit code 1 Error output:
        npm ERR! git fetch -a origin (https://github.com/driftyco/cordova-plugin-wkwebview-engine.git) fatal: Unable to
        find remote helper for 'https'
        npm ERR! Windows_NT 10.0.15063
        npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
        Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
        "cordova-plugin-wkwebview-engine@git+https://github.com/driftyco/cordova-plugin-wkwebview-engine.git" "--save"
        npm ERR! node v6.11.0
        npm ERR! npm  v3.10.10
        npm ERR! code 128

        npm ERR! Command failed: git -c core.longpaths=true fetch -a origin
        npm ERR! fatal: Unable to find remote helper for 'https'
        npm ERR!
        npm ERR!
        npm ERR! If you need help, you may report this error at:
        npm ERR!     <https://github.com/npm/npm/issues>

        npm ERR! Please include the following file with any support request:
        npm ERR!     H:\dev\Pitram\mobileapps\pitramconnect\trunk\node_modules\npm-debug.log
        The following image was skipped because it has an unsupported size (undefinedxundefined):
        resources\android\icon\drawable-xhdpi-icon.png
        --save flag or autosave detected
        Saving windows@~5.0.0 into config.xml file ...

My Ionic info is

ionic info

global packages:

    @ionic/cli-plugin-proxy : 1.3.0
    @ionic/cli-utils        : 1.4.0
    Cordova CLI             : 7.0.1
    Ionic CLI               : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 ios 4.3.1 windows 5.0.0
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.11.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.10

Does anyone have any idea why I am getting this error and how I can get around it?

Thanks in advance

Ionic v1 with pwa

$
0
0

but if i used 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

$
0
0

When i am writing ..Contacts[i]. Photos [0].Value..
I am getting the error with no output on the screen...
Cannot read property 0 of null...
But if I am writing
Contacts​[i]. Photo.
I am getting name and phone number but no photos.

Image not displaying while displaying contacts

$
0
0

Please do as I said, change the loop to exactly what I've written and show me the screenshot of the console. Perhaps you don't have images set for the contacts the *ngFor is iterating over first and you are not checking for that in the template as there is no condition around the <img> tag. In effect, it will show the error you are saying it is showing.

Getting ID of detail-page instance that is currently open

$
0
0

That sounds charming @rapropos. Up to now, I put the logic to handle the notification to my app.component.ts. There I've got someting like this:

FCMPlugin.onNotification( data => {

    if(data.wasTapped){
      // Handle notification that was received on device tray and tapped by the user.

    } else{
      // Handle notification that was received in foreground.
      // My logic depending on which item is shown...

      if ( (...) ){

      }
    }
  });

Would you just move this code from app.component to Page1? I wasn't sure if it would be called there anytime a new notification comes in, even if the user didn't even open Page1.
Or would you somehow split the code between Page1 and app.components?

Image not displaying while displaying contacts

$
0
0

co.find(["displayName", "phoneNumbers","photos"], {multiple: true, hasPhoneNumber: true}).then((contacts) => {
    for (var i=0 ; i < contacts.length; i++){
     if(contacts[i].displayName !== 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);
  })

html--


{{group.letter}}

    <ion-item-sliding *ngFor="let contact of group.contacts" class="contactlist">
   <ion-item>
     <ion-avatar item-start>
     <img src="{{contact.image}}">
</ion-avatar>
   {{contact.name}}
         <p>{{contact.number}}</p>
       </ion-item>
         <ion-item-options side="right">
<button ion-button color="secondary" *ngIf="contact.phoneNumbers"
    (click)="callContact(contact.phoneNumbers[0].value)">
  <ion-icon name="call"> Call</ion-icon>
</button>



<button ion-button color="danger"
(click)="sendmessage()">
SMS




Image not displaying while displaying contacts

$
0
0

no condition around the tag.
what condition should i add here

Viewing all 228529 articles
Browse latest View live


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