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

Persistence/Redirect for Tabs

$
0
0

@Stubbsie1 wrote:

Hi there,

I am working on an app using tabs and a firebase login system. The issue I am having is on the “profile” tab you have the login page which when you login redirects that page to a profile page. The issue lies when I click on either of the other 2 tabs then return to the “profile” tab. That tab will then display the login page again even though I am already logged in.

What I am trying to figure out is if there is a way that when I click another tab and come back, it will display the profile page and not the login. Sort of like a redirect that if logged in display the profile page or if not logged in display the login page.

Posts: 1

Participants: 1

Read full topic


Top 12 60-inch Duffel Bag

$
0
0

@Masonate wrote:

All discussion about the duffel bags and we have found the most durable 60-inch duffel bags which have been designed with the sole purpose of making travelling easier for you. Be it strapless, extra-large, carry-on or bags with wheels we have all kinds to bags right here for you to explore. Learn more

Posts: 1

Participants: 1

Read full topic

How to change background of radio button group in Ionic app?

$
0
0

@Sweg wrote:

I am trying to create a Sign Up form in my ionic app below.

It includes a group of radio buttons with 2 options.

I am having trouble formatting the row that includes the radio group to match the others.

I’ve attached a screenshot of the existing behaviour below.

signUp

Can someone please tell me how I can get the background of the radio buttons to match the other rows (white)?

Also, I’m not sure if I’m putting the label for the radio-group in the correct place.

Please find my code below, thanks a lot in advance!

<ion-grid style="width: 75%">

    <ion-label>Account Type:</ion-label>

    <ion-row class="rowStyle">
      <ion-radio-group>
        <ion-row>
          <ion-item>
            <ion-label>Customer</ion-label>
            <ion-radio value="customer"></ion-radio>
          </ion-item>

          <ion-item>
            <ion-label>Supplier</ion-label>
            <ion-radio value="supplier"></ion-radio>
          </ion-item>

        </ion-row>
      </ion-radio-group>

    </ion-row>

    <ion-row class="rowStyle">

      <ion-icon name="person" color="secondary"></ion-icon>

      <ion-input type="text" placeholder="Your Name" [(ngModel)]="name"></ion-input>

    </ion-row>

    <ion-row class="rowStyle">

      <ion-icon name="mail" color="secondary"></ion-icon>

      <ion-input type="email" placeholder="Your Email" [(ngModel)]="email"></ion-input>

    </ion-row>

    <ion-row class="rowStyle">

      <ion-icon name="key" color="secondary"></ion-icon>

      <ion-input type="password" placeholder="Your Password" [(ngModel)]="password"></ion-input>

    </ion-row>

  </ion-grid>

Here is the CSS:

ion-content {
    --ion-background-color:#3dc2ff;
  }

  .logo { 
    font-size: 25vh;
    margin-top: 40px;
    margin-bottom: 20px;
  }

  h1, h6 {
    color: white;
    font-size: 1em;
    background-color: danger
  }

  .rowStyle {
    background-color: white;
    padding-left: 10px;
    border-radius: 30px;
    margin-bottom: 10px;
 
    ion-icon {
      margin-top: 13px;
      margin-right: 10px;
    }
  }

Posts: 1

Participants: 1

Read full topic

Why have ion events?

$
0
0

@lhk wrote:

I’m trying to figure out the roadblocks in using ionic with vue or preact.
From your ionic/vue codebase:

Create a wrapped input component that captures typical ionic input events
and emits core ones

Is there a reason (beside historical) to have your own event system?

It looks to me as if these custom events are basically the only thing that require special workarounds before using a framework with out-of-the-box support for web components (like preact or vue). Is that correct?

Posts: 1

Participants: 1

Read full topic

[HTTP.POST] How to resolve 'preflight is invalid (redirect)?

$
0
0

@vsued wrote:

Test send post with postman, work fine:

Hi, im send post for an url and return message:

Failed to load https://xxxxxx.xxxxxx.com.br/arcgis/rest/services/Hosted/assignments_4f20dc57d59b4f27af25ca4bb519ce27/FeatureServer/0/query: Response for preflight is invalid (redirect)
log-helper.ts:15
core.es5.js:1020 ERROR Error: Uncaught (in promise): [object Object]
at c (polyfills.js:3)
at polyfills.js:3
at polyfills.js:3
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:3890)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.es5.js:3881)

ionic.config.json

environment.base.ts

Method for get token work fine… look not send headers…

async getTokenWorkForce(){
    return this.loginWorkForce();
}

    async loginWorkForce(): Promise<any> {
        return new Promise(async (resolve, reject) => {
            const username = Environment.username_workforce;
            const password = Environment.password_workforce;

            let formData: FormData = new FormData();

            formData.append('referer', this.apiServiceProvider.URL_OS_ORDEMSERVICO_WF_TOKEN);
            formData.append('username', username);
            formData.append('password', password);
            formData.append('client', 'referer');
            formData.append('f', 'pjson');

            this.http.post(this.apiServiceProvider.URL_OS_ORDEMSERVICO_WF_TOKEN, formData)
                .subscribe((response) => {
                    const json = response.json();
                    this.loggedUserTokenWF = `${json.token}`;
                    resolve(this.loggedUserTokenWF);
                });            
        })
    }

This method return error, with header…

    public async postWorkForceFindAssigmentOS(nroOS: number, outFields: string): Promise<any> {
        return new Promise(async (resolve, reject) => {
            const url = this.apiServiceProvider.URL_OS_ORDEMSERVICO_WF_GET_ASSIGNEMENTS;

            const formData = new FormData();
    
            formData.append('outFields', `${outFields}`);
            formData.append('where', `workorderid='${nroOS}'`);
            formData.append('Units', 'Feet');
            formData.append('returnGeometry', 'pjson');
            formData.append('f', 'false');
            await this.authProvider.getTokenWorkForce();

            let header = new HttpHeaders();

            console.log('Token WF: ' + this.authProvider.loggedUserTokenWF);
            header = header.set('Authorization', `Bearer ${this.authProvider.loggedUserTokenWF}`);

            this.httpServiceProvider
                .postWorkForce(header, url, formData)
                .subscribe(response => {
                    console.log(response);
                    resolve(response);
                }, (err) => {
                    LogHelper.logError(err);
                    reject(err)
                });
        });
    }

    postWorkForce(
        headers: HttpHeaders,
        url: string,
        model: any,
        times: number = 3
    ) {
        return this.http.post(
            url,
            model,
            {
                headers: headers
            }
        ).pipe(retry(times));
    }

Posts: 1

Participants: 1

Read full topic

Ionic 4 protocol buffer

$
0
0

@iozer wrote:

Hello, for my project I need to use protocol buffers instead of json. However I could not find any tutorial or resources for that. Is it possible to use protocol buffers in ionic 4. Also is there any documentation or tutorial for that ? Thank You.

Posts: 1

Participants: 1

Read full topic

net::ERR_CONNECTION_REFUSED when building with android studio

$
0
0

@saarboledazia wrote:

I get that message when building the debug apk with Android Studio. Seems that the app is still trying to build referencing localhost:8100. Steps to reproduce:

  • npm run build
  • npx cap copy android
  • npx cap open android
  • Hit the Build Apk on Android Studio

Posts: 1

Participants: 1

Read full topic

Capacitor Where Are My Files On Android?

$
0
0

@aaronksaunders wrote:

I am trying to find the actual paths on device for files when writing them with the Capacitor File Plugin?

The code I am using is directly from the sample, but the documentation is not as detailed as the old cordova-file-plugin.

So what does “/EXTERNAL_STORAGE” translate to on device

  const testFileWrite = async () => {
      try {
        const result = await Filesystem.writeFile({
          path: 'secrets/text.txt',
          data: "This is a test",
          directory: FilesystemDirectory.ExternalStorage,
          encoding: FilesystemEncoding.UTF8
        })
        let stat = await Filesystem.stat({directory: FilesystemDirectory.ExternalStorage, path:'secrets/text.txt'})
        let l = await Filesystem.getUri( {directory: FilesystemDirectory.ExternalStorage, path:'secrets/text.txt'});
        
        console.log('file uri', Capacitor.convertFileSrc(l.uri));
        console.log('stat', stat);
        console.log('Wrote file', result);
      } catch(e) {
        console.error('Unable to write file', e);
      }

      try {
        let ret = await Filesystem.readdir({
          path: 'secrets',
          directory: FilesystemDirectory.ExternalStorage
        });
        console.log(JSON.stringify(ret.files));
      } catch(e) {
        console.error('Unable to read dir', e);
      }
  }

Posts: 3

Participants: 2

Read full topic


Iframe and phone notch

$
0
0

@akbeyond wrote:

I am using Intercom in my application and it works fine, however, since the messenger pops up in an iframe it does not account for the notch for iPhone X or similar devices and it covers the status bar. I have tried adjusting the iframe CSS for this several ways and I can’t get it to work.

Posts: 1

Participants: 1

Read full topic

watchOS indipendente application

Cannot find module “.” on release build

How to display an image captured with media capture

$
0
0

@ysrikanth2017 wrote:

Hello Everyone,

I am using Ionic 4 and Cordova Media Capture plugin to capture photos for Android .

(https://ionicframework.com/docs/native/media-capture)

As soon as I use the basic Image capture method

this.mediaCapture.captureImage(options) .then(
(data: MediaFile) => {

I am receiving this data for media file :-
[{“name”:“1585411855340.jpg”,“localURL”:“cdvfile://localhost/sdcard/Pictures/1585411855340.jpg”,“type”:“image/jpeg”,“lastModified”:null,“lastModifiedDate”:1585411864000,“size”:889041,“start”:0,“end”:0,“fullPath”:“file:///storage/emulated/0/Pictures/1585411855340.jpg”}]

But don’t know how can I display this image in the device directly right after capture.
I have tried using the base64 plugin to convert it to base 64 format and tried displaying.
It doesn’t work. It gives me a Not “NOT_FOUND_ERR”.

I later tried to use webview and it’s method :-
const img = this.webview.convertFileSrc(filePath)
The path I get is :
http://localhost/app_file/storage/emulated/0/Pictures/1585411855340.jpg",

But this time I get this error :-
E/WebViewAssetServer: Unable to open asset URL: http://localhost/app_file/storage/emulated/0/Pictures/1585411855340.jpg

I have tried this solution to enable permissions also but not worked .

If anyone has achieved this . Please let me know.

Thanks in Advance.

Posts: 1

Participants: 1

Read full topic

İonic Json Data Search Select how can I do it

$
0
0

@bilalbakirci44 wrote:

İonic Json Data Search Select how can I do it

Home.ts

import { Component, Provider } from '@angular/core';
import { NavController } from 'ionic-angular';
import { ApiProvider } from '../../providers/api/api';
import { Observable } from 'rxjs/Observable';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { DetailPage } from '../detail/detail';
import SearchPage from '../search/search';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  datas: any;
  public get http(): HttpClient {
    return this._http;
  }
  public set http(value: HttpClient) {
    this._http = value;
  }
  
  public items:any = [];
  constructor(public navCtrl: NavController, 
              public api:ApiProvider, 
              private _http: HttpClient) {
     this.api.get().subscribe((stringToJsonObject)=>{
       console.log(stringToJsonObject);
       this.getData();
     });
   }
  
  getData(){
    let url = 'https://www.clinicbuzlazer.com/wp-json/wp/v2/alsp_listing?_embed';
    let data: Observable<any> = this.http.get(url);
    data.subscribe(result =>  {
      this.items = result;
    });
  }

  openDetail(item){
    this.navCtrl.push(DetailPage, {post:item});
  }

  openSearchPage(){
    this.navCtrl.push(SearchPage);
    }


  

}

Detail.ts

import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Observable } from 'rxjs/Observable';

/**
 * Generated class for the DetailPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */


@Component({
  selector: 'page-detail',
  templateUrl: 'detail.html',
})
export class DetailPage {
  
  public items:any = [];
  post: any;
  http: any;
  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.post = (navParams.get('post'));
  }

  getData(){
    let url = 'https://www.clinicbuzlazer.com/wp-json/wp/v2/alsp_listing?_embed';
    let data: Observable<any> = this.http.get(url);
    data.subscribe(result =>  {
      this.items = result;
    });
  }

}

Posts: 1

Participants: 1

Read full topic

Keyboard overlaps on Ion-footer

$
0
0

@aditya_1027 wrote:

Hello Experts,

I have a textarea in ion-footer and when keyboard open… textarea hide behind keyboard.

Anyone here who can help with this issue?

Posts: 1

Participants: 1

Read full topic

Master - Detail View with two responsive columns like ion-split-pane

$
0
0

@mburger81 wrote:

We try to do a responsive MASTER DETAIL VIEW in two columns, something like the ion-split-pane.

The problem is, you can not use ion-split-pane in a subpage. What we have tried is to use two divs and style them with flexbox. But on the other side there are many problems with the ion-content and the scroll behavior.

It should look like this, which is working with some workaround but the problem is also the hight of the detail view, which we have to set to an absolute value which is not good.

So my question is, how can we resolve something like this. Which is the best practice, has someone an idea or some piece of code example?

Posts: 1

Participants: 1

Read full topic


Ionic Cordova Geolocation - picks a wrong location first and later picks the correct location

$
0
0

@vigamage wrote:

I have been working on my very first Geolocation ionic application. My ionic version is 6.2.1 and the cordova version is 9.0.0.

My question is, when I get the current position using geolocation.getCurrentPosition() it shows a strange behavior. When the getCurrentPosition is invoked for the first time, it usually picks a location which is like 2 km away from my actual location. However, it tends to pick the correct location in usually 5th or 6th(roughly) attempt.

Why is this?

As a workaround for this, I thought of getting the accuracy value, compare it with a threshold, re-pick the location if the accuracy is not enough. This goes until it picks a good enough location.

Is that a good way to achieve what I need? Or is there any way to fix the error in the first place.

Thank you…!

Posts: 1

Participants: 1

Read full topic

Geolocation/ngx folder is not shown

$
0
0

@pdj wrote:

I imported geolocation as below

import { Geolocation } from ‘@ionic-native/geolocation/ngx’;

ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"
 npm install @ionic-native/geolocation

I installed it as above. but when I go to node_modules - @ionic/native folder - geolocation
but ngx folder is not shown.

without using /ngx, Object(…) is not function error is shown…

anyone can tell me how to get ngx folder of geolocation ?

Posts: 1

Participants: 1

Read full topic

Ionic capacitor some questions

$
0
0

@jordangio wrote:

I have some questions and I hope you can shed some light on all of those. Right now, I have a PWA written. No cordova or anything. Pure PWA with service worker, workbox and offline support.

Requirements:
a) I need to have a PWA website so that users can see my website via url.
b) I need my app to be on play store and app store.
c) I need the website and my apps to support push notifications.

Question 1) As you know, It’s possible to publish PWA on google play store and somehow app store(not sure yet). But if I do that, I won’t be able to have push notifications for IOS. so the only way if I want to provide push notifications for ios too is to use cordova or capacitor. Am I right?

Quesiton 2) If I use capacitor , then publishing PWA to playstore and appstore isn’t worth it because by using capacitor i already can publish them as almost native apps. Is that right? is this how you would do it?

Question 3) I tried to use capacitor for the first time today and here is the code I’ve written for push notifications.

import {
    Plugins
} from '@capacitor/core'
const { PushNotifications } = Plugins;
PushNotifications.register();
PushNotifications.addListener('registration', function(e){
    console.log("eee ", e);
})
PushNotifications.addListener('registrationError', function(e){
    console.log("err ", e);
});

the thing is, when building this through xcode after I use npx add ios and npx cap copy , I can see that push notifications work on ios now. The bad thing is that now, If I run this via my website url, let’s say chrome, it says that Uncaught (in promise) PushNotifications does not have web implementation.. So Now, I’m really stuck. Does this mean that I have use if else statements to first check what target user uses and if it’s web, I should use browser's PushAPI ? and if the target is ios or android , I’d use the above code. Because of the fact that I use service worker because my app is PWA, I can simply put push listener in service worker and now, I’d make push notifications for all platforms. Is this if else and checking platform and using PushAPI or capacitor's push notifications a great practice? or what other idea can you provide?

Question 4) It turns out that if I use capacitor i have to include @capacitor/core which will make the bundle size bigger for web. Now, the thing is if user goes to web version, My website size will be bigger, but the thing is size is bigger, but i don’t use capacitor's plugin at all. Is this unavoidable?

I’d really appreciate your sincere answers since there’s not many people who can help.

Posts: 1

Participants: 1

Read full topic

Erro ao instalar o ionic

$
0
0

@HerbertPereira wrote:

Ao instalar ionic
C:\Users\Guabiraba> npm install -g ionic ou npm install -g @ionic/cli
aparece o erro:
npm WARN deprecated ionic@5.4.16: The Ionic CLI now uses :sparkles: @ionic/cli :sparkles: for its package name! :point_right: https://twitter.com/ionicframework/status/1223268498362851330
npm ERR! Unexpected end of JSON input while parsing near ‘…4N5FdhiNtQRG\nhWomw5f’

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Guabiraba\AppData\Roaming\npm-cache_logs\2020-03-29T15_57_51_342Z-debug.log

Posts: 1

Participants: 1

Read full topic

Cordova build android: Internal error: unknown identifier

$
0
0

@Codedev wrote:

I can’t build my app for pro-release

here is my info

Ionic:

   Ionic CLI                     : 5.2.5
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.2.3

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.3, (and 8 other plugins)

Utility:

   cordova-res : 0.11.0
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (F:\sdk)
   NodeJS            : v10.17.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.11.3
   OS                : Windows Server 2016

I got this error

ERROR in : Error: Internal error: unknown identifier []
    at Object.importExpr$$1 [as importExpr] (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:24170:27)
    at D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:18100:37
    at Array.map (<anonymous>)
    at InjectableCompiler.depsArray (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:18066:25)
    at InjectableCompiler.factoryFor (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:18130:36)
    at InjectableCompiler.injectableDef (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:18149:44)
    at InjectableCompiler.compile (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:18159:106)
    at D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:24015:90
    at Array.forEach (<anonymous>)
    at AotCompiler._emitPartialModule2 (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:24015:25)
    at D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:24008:48
    at Array.reduce (<anonymous>)
    at AotCompiler.emitAllPartialModules2 (D:\ionic\fax\node_modules\@angular\compiler\bundles\compiler.umd.js:24007:26)
    at AngularCompilerProgram._emitRender2 (D:\ionic\fax\node_modules\@angular\compiler-cli\src\transformers\program.js:300:31)
    at AngularCompilerProgram.emit (D:\ionic\fax\node_modules\@angular\compiler-cli\src\transformers\program.js:201:22)
    at AngularCompilerPlugin._emit (D:\ionic\fax\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:879:49)

[ERROR] An error occurred while running subprocess ng.

        ng.cmd run app:ionic-cordova-build:production --platform=android exited with
        exit code 1.

Posts: 1

Participants: 1

Read full topic

Viewing all 70434 articles
Browse latest View live


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