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

Url api JSON object equal to firebase

$
0
0

@hatrek wrote:

hello i try call object from api json and if equal to firebase json display

ionViewWillEnter(){
    this.http.get( this.url )
    .map(res => res.json())
    .subscribe(data => {
      this.items = [];
      // we've got back the raw data, now generate the core schedule data
      // and save the data for later reference
     //this.data = data;
      this.items.push(data);


    });
    this.postSubscription = this.db.list('/posts',{
    query: {
      orderByChild: 'country',
      equalTo: this.items

    }

Posts: 3

Participants: 2

Read full topic


Popover reloads my page

$
0
0

@RamKumar3457 wrote:

Hi

I have a image inside a form which on click opens a popover. My problem is the component gets reloaded once the popover has been raised. Is there any way to prevent this.

Thanks

Posts: 1

Participants: 1

Read full topic

How to call grpc call from ionic?

Ionic 3 Ios Sqlite

$
0
0

@pendora7 wrote:

Hey guys ! I am using Sqlite in Ionic 3 to create an IOS application.
Here is my code. I have downloaded this code from “https://github.com/TeamClouders/Ionic-2-sqlite-demo” it works fine on Android but didn’t work on IOS.


It is my error i tried google alot but nothing seems to work.

Posts: 1

Participants: 1

Read full topic

'split' function dosn't work ONLY on IOS

$
0
0

@Carllos64 wrote:

Hi,

I have a problem that I have just identified the cause but I really don’t understand WHY!
To be simple, I just wanted to cut in two parts my GPS localisation : "-36.8461969;174.7694556"
I used this code :
let coord = this.profilInfo.Last_GPS_position.split(";");
But I don’t know what this solution work everywhere including on android device AND ios Emulator BUT not on REAL IOS devices!

To arrive at my conclusion that is the “split” function that doesn’t work, I had tried with this code and it’s working on IOS devices :

    let coord = [];
    coord[0]='-36.8461969';
    coord[1]='174.7694556';

If someone knows why, I really want to know why.
However if you have a good alternative, I am also OK to learn?

Thank you for your answers.

Posts: 1

Participants: 1

Read full topic

Images from assets disappearing on Ionic View/IOS

$
0
0

@Drahuks wrote:

Hello everybody,

I am encountering a strange issue while testing my app in ionic view on IOS. I have an ionic pro account & ionic view 'blue version’
I have static images stored in the assets folder (also in www/assets). Image are displayed like this

<img src="assets/icon/arrow_left_big.png">

On first load app works fine and all images are displayed. But if I put the device on ‘stand-by’ (hitting power button) and reactivate it, then the images don’t load anymore.

This happens for all static images, inside pages (header, content, lists) and app menu. Happens also for css ‘background-image’

The display of external images (http://…) works fine

Happens on iphone 7 (ios 11.0.3) and ipad 2 (ios 10.3.3)
Everithing works well under android

Any idea?

Thanks for your help

PS : Anyway, great product!

Posts: 1

Participants: 1

Read full topic

Trigger at firebase data time matches with current time

$
0
0

@usufalrais wrote:

Just I am trying to create an todo application with local notification on time ionic 3. I have a stored data in firebase realtime with taskname and time which i shown in below attachment. I want to get notification from firebase when it meet the current time.tasktiming
this case i have initiated cloud function using firebase tools
I am new to server side.
I need to know how to write function for matching current time to time in server. please help me with the code. if time matches it need to give local notification.
i will attach my index.js

 const functions = require('firebase-functions');exports.timetrigger= functions.database.ref('/tasklist/{taskId}/')ontrigger(event=>{

const taskKey=event.data.key;

const taskValue=event.data.val();

const taskTime=taskValue.time;

const currentTime=moment(new Date).format();});

Posts: 1

Participants: 1

Read full topic

Code Signing Error

$
0
0

@Nouf wrote:

So I am trying to run my application on my iPhone but I got these errors, I would like to mention one thing I am using a template that I have bought and it showing in
my error “com.csform.ionic.yellow” and I was wondering have to fix this problem and how to add my profiles and app ID

Code Signing Error: Failed to create provisioning profile. The app ID “com.csform.ionic.yellow” cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
Code Signing Error: No profiles for ‘com.csform.ionic.yellow’ were found: Xcode couldn’t find any iOS App Development provisioning profiles matching ‘com.csform.ionic.yellow’.
Code Signing Error: Code signing is required for product type ‘Application’ in SDK ‘iOS 11.1’

Posts: 1

Participants: 1

Read full topic


Node modules get deleted while installing new plugins

$
0
0

@akr_rajkumar wrote:

Hi,
I’m using Ionic 3 for developing an application. Whenever I try to download any plugins, the node modules are getting deleted. I’m facing the issue after updating the Node version from 8.5.0 to 9.1.0

What may be the cause for this?

Posts: 1

Participants: 1

Read full topic

Animation for ion-item - not quite right

$
0
0

@pliablepixels wrote:

Hi, I am trying to animate an <ion-item> to slide up and down based on a toggle (tapping the globe button). The problem I am facing is that while the item does slide up and down properly, a large space is left while the item slides down and up and the rest of the view abruptly moves up after the slide up is over, or abruptly moves down before the slide down is over.

My goal is to ensure that ‘John Appleseed’ and below slide up or down along with the map animation

Demo of the problem: (I’ve slowed down the animation to demonstrate the issue better)

My code:

Animation:

export const MapAnimation =   trigger
  (
    'mapAnim', [
      transition(':enter', [
        style({transform: 'translateY(-100%)', opacity: 0.5}),
        animate('3000ms ease-in-out', style({transform: 'translateY(0%)', opacity: 1}))
      ]),
      transition(':leave', [
        style({transform: 'translateY(0)', opacity: 1}),
       // slow down to 3 seconds to demo problem better
        animate('3000ms ease-in-out', style({transform: 'translateY(-100%)', opacity: 0}))
      ])
    ]
  );

My template:

<ion-item [@mapAnim] no-padding class="fullItem" *ngIf="showWorldMap">
    <div>
        <ion-spinner *ngIf="!mapLoaded"  name="bubbles"></ion-spinner>
        <img  src="http://api.usno.navy.mil/imagery/earth.png?date=today" width="100%" (load)="mapLoadedCallback()" />

    </div>
</ion-item>
<ion-list>
  <!--- John Appleseed and rest follow here -->
</ion-list>

FYI, pushing the <ion-item> with the map inside the <ion-list> doesn’t make a difference.

Any ideas on how to fix this? thanks.

Posts: 1

Participants: 1

Read full topic

Theme: customizing built-in styles lke .item-ios-light

$
0
0

@michaelkariv wrote:

I am customizing my upcoming app.
I set the colors in variables.scss as documentation requires.
I changed some sass variables.
This takes me 80% down the road. But I have stumbled with this.
I want to customize some ion-items. I want them to have color(colors, light) background and color(colors, dark) foreground color.
And yet, there seem to not be variables that allow to do that.
Looking at node_modules\ionic-angular\css\ionic.css, one finds that the stile bearing standard palette color name does not take the value of that color
line 7447

.item-ios-light,
.item-divider-ios-light {
  color: #000;
  background-color: #f4f4f4; }

so I could have redefined the class in variables.scss, or create my own class, but that, IMHO, would go against the grain of ionic. What would you suggest I do?

Posts: 1

Participants: 1

Read full topic

Padding top on ion-navbar for lab iOS

$
0
0

@sergiofigueras wrote:

Hello guys,

I’m trying to build a very simple navbar here, but the padding-top of it on iOS is by far very different from what I’m planning.

What I need is:

What I currently have is:

Despite the fact that there’re still some style missing, for buttons / font, as you can see in my sample my navbar is currently overriding iOS default bar.

So, the source code that I currently have is quite simple:

<ion-navbar>

  <ion-buttons end>
    <button ion-button icon-only>
        <ion-icon name="menu"></ion-icon>
    </button>
  </ion-buttons>

  <ion-title>
    {{ titulo }}
  </ion-title>

  <ion-buttons end>
    <button ion-button icon-only (click)="openModal()">
      <ion-icon name="options"></ion-icon>
    </button>
  </ion-buttons>

</ion-navbar>

It sounds like a very simple stuff, but as I’m newbie on ionic I would like to rely on your expertise, folks :slight_smile:

Could anyone please in advice me why its happening or if its only some bug with Lab that won’t happen in real world?

Thanks!

Posts: 1

Participants: 1

Read full topic

[localStorage] - module for angular 5

$
0
0

@MarinoRaul wrote:

Hi!

I need to install some module for localStorage (angular 5 - ionic last version) because not detect localStorage.getItem, etc functions …

Someome know any lib about it???

Thanks a lot!

Posts: 1

Participants: 1

Read full topic

How do I include typescript from an external folder?

$
0
0

@user5555 wrote:

Idea:
So my plan was to move the code, that i use to comunicate with my server out into a seperate plain typescript module, to have an universal clientside-“backend” that I can not only use for my Ionic app, but also for a electron app or a app with other frameworks like maybe nativescript later on, when my app is finished.

But curently I can’t get it to work properly:

  • First I tried to make a npm module that i compiled with tsc -w it kind of worked but ervery time I made a change ionic serve had also to be triggered to recompile with a change in the app- src files and even then i had to restart ionic serve a couple of times,because it didn’t used the new version of my module always right away.
    But it worked for the most part, so I was happy.
    Until it said that a type from my module wasn’t the same as the same type used in a function that I accessed from that module.
    After some investigation I found out this was because angular had added some internal properties to my type.
    So I started to make a dirty workaround by adding the optional propertys to my type that angular wanted to have. After 5 of them I quickly realized that this was a bad decission so I tried the next thing.

  • I remembered that ionic had demo and source in two different folders, so I decided i wanna try to do sth. in that direction.
    So here am I, I already modified my tsconfig.json and changed all imports to relative ones instead of my custom module.

my simplified file structure:

┬ Core
├─ node_modules // left over from the time this was a independent module
└┬ src
 ├─ {...} // all other ts files that index.ts exports parts of
 └─ index.ts // this is the module I want to import, it exports all the different vars, classes and function from the other files that I may want to use in the Ionic app.
┬ IonicApp
├─ node_modules
├─ src
├─ {...} // much more
└─ tsconfig.json

my tsconfig.json

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
  },
  "include": [
    "src/**/*.ts",
    "../Core/src/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

But I get an error:
Module build failed: Error: ENOENT: no such file or directory, open 'C:\#######\Core\src\index.js.map'

Question:
What did I do wrong? And what is the right way to do it?

Posts: 1

Participants: 1

Read full topic

Using SQLite

$
0
0

@khalilben wrote:

Hi,

I need to use sqlite or tinydb in my project and don’t know how to use it.

I need to save the data and show it from the database
I now have this code

ngOnInit(){
    this.newsProvider.getnewsbycat().subscribe(
      data=>{
        console.log(data);

        this.articles = data;
      }, error => {
        console.log(error);
      }
    )
  }

Posts: 5

Participants: 3

Read full topic


Cannot run or emulate android app

$
0
0

@HerrVey wrote:

I’m new on Ionic and I’m having trouble with running or emulating an basic app through ionic cordova run android or ionic cordova emulate android.
Creating a new app and adding android platform works fine, as well as previewing it on my browser. But when I connect my Samsung (in developer mode) and run ionic cordova run android, it doesn’t detect it and doesn’t succeed either to load the emulator.

No target specified and no devices found, deploying to emulator
Error: No emulator images (avds) found.
1. Download desired System Image by running: /home/herve/Android/Sdk/tools/android sdk
2. Create an AVD by running: /home/herve/Android/Sdk/tools/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver

However, when I run android avd list, I get the avd I installed through Android Studio :

Available Android Virtual Devices:
   Name: Nexus_5X_API_26
 Device: Nexus 5X (Google)
   Path: /home/herve/.android/avd/Nexus_5X_API_26.avd
 Target: Google Play (Google Inc.)
         Based on: Android 8.0 (Oreo) Tag/ABI: google_apis_playstore/x86
   Skin: nexus_5x
 Sdcard: 100M

Here is my ionic info

cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.0
    npm               : 5.5.1
    OS                : Linux 4.10

Environment Variables:

    ANDROID_HOME : /home/herve/Android/Sdk

Misc:

    backend : pro

Does anyone has any idea why I can’t run or emulate ionic apps ? Any help will be appreciated !

Posts: 2

Participants: 2

Read full topic

Show login data on another page

$
0
0

@khalilben wrote:

Hello,

In my login page i have this code

 connexion(){
  var headers = new Headers();
  headers.append('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');

  var params = 'email='+this.userData.email+'&passe='+this.userData.passe;
  this.http.post(apiUrl, params , {headers: headers})
  .subscribe(
    data => {
      this.responseData = data,
      //console.log(this.responseData),
      localStorage.setItem('userData', JSON.stringify(this.responseData));
      this.navCtrl.push('ProfilPage');
    },
    err => {
      console.log(err);
    },
    () => console.log('Call Complete')
  );

}

What i want to do, is once login success, it push me to Profil Page and show informations.
The problem is that my code supposed to do that doesn’t work

 userPostData = {"user_id":"","token":""};
  constructor(public navCtrl: NavController, public navParams: NavParams, public authService:AuthServiceProvider, public app: App) {
    const data = JSON.parse(localStorage.getItem('userData'));
    this.userDetails = data.userData;

    this.userPostData.user_id = this.userDetails.id;
    this.userPostData.token = this.userDetails.remember_token;
  }

And the HTML Part

  <h2>Welcome to {{userDetails.first_name}} {{userDetails.last_name}}</h2>
  <h3>Email: {{userDetails.email}}</h3>

Posts: 1

Participants: 1

Read full topic

Storage, where my data is saved in a device?

$
0
0

@MicroAdo wrote:

Hi everyone,
i’m using Ionic from several weeks and it’s amazing! But now i have a question about where my data is actually saved using for example Ionic Storage (cordova-sqlite-storage) so let’s say that my Android phone always uses SQLite.

I tried to search with a file manager but i don’t have a folder for my app but the storage works very well! I tried also /data/data/<your_app_package_name>/databases/<database_name> without success. Can the files be hidden by OS?

My app is saved in internal memory, Android 6.

Thank you!

Posts: 1

Participants: 1

Read full topic

Uber Api in Ionic 3

Service IONIC 3

$
0
0

@danillo10 wrote:

ionViewWillEnter(){
this.presentLoadingDefault()
this.webservice.buscaVersiculo()
.then((data) => {
this.mensagem = data.mensagem;
this.versiculo = data.versiculo;
this.imagem = data.imagem;
this.youtubeid = data.youtube;
this.mensagemdoservo = data.mensagemdoservo;
this.urlapp = data.urlapp;
this.presentToast("Santifique-se o Senhor Jesus Cristo está voltando… ")
this.dismissLoadingDefault()
},(e) => {
this.presentToast(JSON.stringify(e))
this.dismissLoadingDefault()
})
}

return url: null type 3 error

Posts: 1

Participants: 1

Read full topic

Viewing all 49087 articles
Browse latest View live