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

Ionic 4 BehaviorSubject gettting ionic storage

$
0
0

@saravananthemesoft wrote:

Hi i would like access ionic storage module inside be BehaviorSubject .

My Code below currently am using local storage i want to replace ionic storage

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { UserService } from "./user.service";

import { Token } from '../_models';

import { environment } from "../../environments/environment";

import { Storage } from "@ionic/storage";

@Injectable({ providedIn: "root" })
export class AuthenticationService {
  private currentTokenSubject: BehaviorSubject<Token>;
  public currentToken: Observable<Token>;

  constructor(
    private http: HttpClient,
    public storage: Storage,
    public user_ser: UserService
  ) {
    this.currentTokenSubject = new BehaviorSubject<Token>(
      JSON.parse(
        localStorage.getItem("currentUser") //Need to replace with ionic storage 
      )
    );
    this.currentToken = this.currentTokenSubject.asObservable();
  }

  public get currentTokenValue(): Token {
    return this.currentTokenSubject.value;
  }

  login(username: string, password: string) {
    return this.http
      .post<any>(`${environment.url}/oauth/token`, {
        username,
        password,
        grant_type: "password",
        client_id: environment.passport.client_id,
        client_secret: environment.passport.client_secret
      })
      .pipe(
        map(token => {
          if (token && token.access_token) {
            this.storage.ready().then(() => {
              this.storage.set("currentToken", token);
            });
            this.currentTokenSubject.next(token);
          }
          return token;
        })
      );
  }

  logout() {
    this.storage.remove("currentToken");
    this.currentTokenSubject.next(null);
  }
}

Posts: 1

Participants: 1

Read full topic


Contact Loading Issuse

iOS import files into ionic 3 app?

$
0
0

@UDTDR wrote:

Hello, how I can import a PDF File from Mail into my ionic App?

Or I have to save the pdf file via native mail app.

Big thanks!

Posts: 1

Participants: 1

Read full topic

Local notification in ionic 4

$
0
0

@CreativeArtDesign wrote:

I trying to use local notification for ionic 4, but can not get it to work.

Is there anybody who got it to work? or is there other notification that is better than this?

If there is anybody that have an example please send me.

I have tried everything, tested on the device on the emulator pie 9.0 … webbrowser (Not work i know), compiled and used it on my phone android. not working.

Is it a bug? or not a good plugin.

Please help.

Posts: 1

Participants: 1

Read full topic

Image viewer img size issue

$
0
0

@safaAlshaarri wrote:

hi every one, i have gallery where display buliding map and i need to zoom the img i used imageViewer to do the zoom it works but i have 2 issues when i zoom it zoom first to the center
the second issue that the img show like that from the top


any one can help :hibiscus::hibiscus::hibiscus::hibiscus:

Posts: 1

Participants: 1

Read full topic

Ionic mobile app on existing angular 6 app

$
0
0

@bluetech1 wrote:

Hi,

We have an existing complex angular 6 app with media queries for mobile , tablet and desktop browsers.
I’m looking to create a native mobile app based on this existing angular application but still keep existing design and styles on desktop browsers and (maybe) mobile browsers.

  1. What is the correct strategy in such use case ?
    How would you structure the project or build process?

As i understand to default way is to merge ionic into the existing angular app and convert all elements into ionic components. the problem is that means ionic components will be shown for web desktop users as well.

  1. Is there an official native app to demonstrate all of ionic awesome UI Components? I couldn’t find one…

Thanks
Jack

Posts: 1

Participants: 1

Read full topic

Tabs for v4

$
0
0

@flotilla wrote:

Hey there,

i want to make a design like that.

image

but i cant the put the LOGO on the center like on the pic. and i cant put tabs in ionic 4. can you please help me about that?

THX .

Posts: 1

Participants: 1

Read full topic

Ionic 4 Starter

$
0
0

@Lona wrote:

I want to convert an old V1 application to the latest (and greatest aka ionic4).

I started with
ionic start myApp sidemenu

Then, “ionic info” gives me “ionic-angular 3.9.2”

Why not 4.* ?

I want to start a Ionic 4 application basically…

Posts: 1

Participants: 1

Read full topic


Ionic v3 - Convert local image to base64

$
0
0

@Sadus wrote:

I need to use an image taken with Camera and/or Library and send it to Firebase, I made use of the following native plugins in order:

After that I use the “putString” function of angularfire2 and works perfectly on Android, but in IOS the execution for the Base64 plugin, either with camera image or Bibioteca does not return any error.

I tried the common conversion by JS but it is not allowed by CORS, is there any alternative to base64 plugin?

Posts: 1

Participants: 1

Read full topic

Using backwards and forwards to navigate through dynamic tabs

$
0
0

@jwoodward86 wrote:

Hello,

I am trying to navigate through dynamic ion tabs using a backwards and forwards tab.

In my tabs.ts page constructor:

      this.tabs = [
        { root: TabRootZones, tabTitle: values['TAB_TITLE_ZONES'], show: true, index: 0, tabIcon: 'home' },
        { root: TabRootMetering, tabTitle: values['TAB_TITLE_METERING'], show: true, index: 1, tabIcon: 'speedometer' },
        { root: TabRootLights, tabTitle: values['TAB_TITLE_LIGHTS'], show: true, index: 2, tabIcon: 'bulb' },
        { root: TabRootIntruder, tabTitle: values['TAB_TITLE_INTRUDER'], show: true, index: 3, tabIcon: 'lock' },
        { root: TabRootAccess, tabTitle: values['TAB_TITLE_ACCESS'], show: true, index: 4, tabIcon: 'key' },
        { root: TabRoomBooking, tabTitle: values['TAB_TITLE_BOOKING'], show: false, index: 5, tabIcon: 'time' },
        { root: TabRootSensors, tabTitle: values['TAB_TITLE_SENSORS'], show: false, index: 6, tabIcon: 'thermometer' },
        { root: TabRootZigbee, tabTitle: values['TAB_TITLE_ZIGBEE'], show: false, index: 7, tabIcon: 'wifi' },
        { root: TabRootLocation, tabTitle: values['TAB_TITLE_LOCATION'], show: false, index: 8, tabIcon: 'globe' },
        { root: TabRootSpeech, tabTitle: values['TAB_TITLE_SPEECH'], show: false, index: 9, tabIcon: 'chatbubbles' }
      ];

      this.tabTitleMoreBack = values['TAB_TITLE_MORE'];
      this.tabTitleMoreForward = values['TAB_TITLE_MORE'];

tabs.html:

<ion-tabs color="dark">
  <ion-tab [tabTitle]="tabTitleMoreBack" [show]="false" tabIcon="arrow-back" (ionSelect)="tabBack()"></ion-tab>
  <ion-tab *ngFor="let tab of tabs" [root]="tab.root" [tabTitle]="tab.tabTitle" [show]="tab.show" [tabIcon]="tab.tabIcon"></ion-tab>
  <ion-tab [tabTitle]="tabTitleMoreForward" [show]="true" tabIcon="arrow-forward" (ionSelect)="tabForward()"></ion-tab>
</ion-tabs>

If I remove the ion-tab “tabTitleMoreForward” and “tabTitleMoreBack” then it will display but with it there I just get a white page and no error?

Posts: 1

Participants: 1

Read full topic

Ioni 4 open external app

$
0
0

@Clickaplicaciones wrote:

Hi,
I’m trying to open an application from a button in my app, I’ve read in several posts that using the InAppBrowser plugin like ( this.iab.create (‘com.app_package’, ‘_system’) ) should open the application, however the only thing I get with this is the browser answering localhost/com.app_package.

Any idea how I can open for example twitter?
I have also tried the url schema like ( twitter:// ) but I can not open the app on android, on iOS I have not tried it yet.

Posts: 1

Participants: 1

Read full topic

Does the ionic Cli has a command for update ionic?

$
0
0

@distante wrote:

Ionic 4.0.1 is out. I have not yet seen what has changed in the psckagr.json. If more than one dependency is updated is there a Cli command that updates it or should I edit manually the package json?

Posts: 1

Participants: 1

Read full topic

Payment cannot be processed because don’t have secure connection.SSL certificate

$
0
0

@pettrin wrote:

Payment cannot be processed because don’t have secure connection.SSL certificate

I’m using ionic 3 with the plugin mercadopago with Js and when I complete the purchase it returns me this error, everything takes into account to be an error caused by Ionic running on a webView.

ionic info (if anyone need that)

Ionic:

   ionic (Ionic CLI)  : 4.8.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 9 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/Pettrin/Library/Android/sdk)
   ios-deploy        : 1.9.2
   NodeJS            : v8.11.3 (/usr/local/bin/node)
   npm               : 2.15.12
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000

The error occurs because it is running in an HTTP address (Ex: http://localhost.com), I would like to know if I would be able to run the ionic in an HTTPS address (Ex: https://localhost.com).

Note : In production, the same error persists

Posts: 1

Participants: 1

Read full topic

List of data by google map place

$
0
0

@hanan150 wrote:

hello
I want to create a list of all the restaurants in my city
how can collect the data about it,
I know I will use google map place API, but I need more detail
anyone have an idea

Posts: 1

Participants: 1

Read full topic

Senior Ionic freelancer (Only US based)

$
0
0

@reviewallthecode wrote:

We’re looking for a Senior Engineer freelancer in the US for ongoing code review (Ionic and other languages/frameworks).

You’ll need to be highly proficient in reviewing code quality for multiple programming languages/technologies.

It’s flexible, remote, and part-time, but you’ll need to be based in the United States.

Please send me a DM to learn more :slight_smile:

Posts: 2

Participants: 2

Read full topic


IonicModule.forRoot on Ionic v4

$
0
0

@kishorekumaru wrote:

Ionic v3 documentation says IonicModule.forRoot function can have two different arguments 1. root Component and config (optional) (https://ionicframework.com/docs/v3/api/IonicModule/)

While running ionic V4 project, by default there is no value passed on forRoot static function, I have found only config can be passed, when I try to pass ‘Platforms’ its throwing an error

Object literal may only specify known properties, and 'platforms' does not exist in type 'IonicConfig'. [2345]

Any replacement for Platforms?

Posts: 1

Participants: 1

Read full topic

Ionic 4: looking for example of `` together with angular routing

$
0
0

@mixuala wrote:

Nav is a standalone component for loading arbitrary components and pushing to new components on to the stack. Unlike RouterOutlet, Nav is not tied to a particular router. Meaning that if we load a Nav component, and push other components to the stack, they will not affect the apps overall router.
https://ionicframework.com/docs/api/nav

How do you use this component together with angular routing? For example, how would you add html markup to push a page/module from ion-menu. I can’t find any examples with markup

Posts: 1

Participants: 1

Read full topic

Ionic 3 Background mode crashes

$
0
0

@sapnudaric wrote:

Hi Ionic Users,

May I seek your help on how to handle background service on ionic. We have an app with background service for local notifications then after I switch into the other apps the ionic app sometimes crashes or keeps on restarting. Thanks for the help!.

Posts: 1

Participants: 1

Read full topic

Ionic 4 how to create $variable in variable.scss?

$
0
0

@demokumar wrote:

hello team,
in ionic 3 we create a color variable like $headerColor and use it for a color of the header in our app.css class but in ionic 4 it not work, so how it use in ionic 4 …?

Posts: 1

Participants: 1

Read full topic

Ionic 4: not working as expected

$
0
0

@zmmalik wrote:

Hi, I’m facing a problem with ion-reorder.

Capture

As you can see in the image. I drag Item, works fine, I drop item, it doesn’t get reordered properly. Reorder works for the first time only. After this everything freezes.

Here’s my code

<ion-list lines="none">
      <ion-reorder-group disabled="false" (ionItemReorder)="reorder($event)">
        <ion-reorder>
          <ion-item>
            <ion-thumbnail no-margin item-start>
              <img src="../assets/images/5.jpg">
            </ion-thumbnail>
            <div class="pl-2">
              <h5 no-margin>Multan</h5>
              <p no-margin>Historical place...</p>
            </div>
            <ion-buttons slot="end">
              <ion-button>
                <ion-icon slot="icon-only" name="close"></ion-icon>
              </ion-button>
            </ion-buttons>
          </ion-item>
        </ion-reorder>
        <ion-reorder>
          <ion-item>
            <ion-thumbnail no-margin item-start>
              <img src="../assets/images/5.jpg">
            </ion-thumbnail>
            <div class="pl-2">
              <h5 no-margin>Multan</h5>
              <p no-margin>Historical place...</p>
            </div>
            <ion-buttons slot="end">
              <ion-button>
                <ion-icon slot="icon-only" name="close"></ion-icon>
              </ion-button>
            </ion-buttons>
          </ion-item>
        </ion-reorder>
        <ion-reorder>
          <ion-item>
            <ion-thumbnail no-margin item-start>
              <img src="../assets/images/5.jpg">
            </ion-thumbnail>
            <div class="pl-2">
              <h5 no-margin>Multan</h5>
              <p no-margin>Historical place...</p>
            </div>
            <ion-buttons slot="end">
              <ion-button>
                <ion-icon slot="icon-only" name="close"></ion-icon>
              </ion-button>
            </ion-buttons>
          </ion-item>
        </ion-reorder>
        <ion-reorder>
          <ion-item>
            <ion-thumbnail no-margin item-start>
              <img src="../assets/images/5.jpg">
            </ion-thumbnail>
            <div class="pl-2">
              <h5 no-margin>Multan</h5>
              <p no-margin>Historical place...</p>
            </div>
            <ion-buttons slot="end">
              <ion-button>
                <ion-icon slot="icon-only" name="close"></ion-icon>
              </ion-button>
            </ion-buttons>
          </ion-item>
        </ion-reorder>
      </ion-reorder-group>
    </ion-list>

Any help…?

I’m using:
Ionic 4.10.2
Angular 7.3.0

Posts: 1

Participants: 1

Read full topic

Viewing all 70435 articles
Browse latest View live


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