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

How to resolve BABEL error when installing geolocation in ionic app

$
0
0

@Sweg wrote:

I’m trying to install geolocation in my ionic app using these commands:

ionic cordova plugin add cordova-plugin-geolocation
npm install @ionic-native/geolocation

Then I try to run the app on my device (ionic cordova run android), but I’m getting this error message:

Can someone please tell me how to resolve this?

Posts: 1

Participants: 1

Read full topic


Click Event

$
0
0

@thaysg wrote:

Hi, sorry my english, but I’m in Ionic, I’m studying in college, and I have to create an app with a button with this message: ‘Insert your informations’, and after that must have a cancel and a send button, and when click in send, the information that you insert should have appear in a new page. But I’m trying to do that but not succes.

tab2.page.html```

<ion-header [translucent]=“true”>


Cadastro


<ion-content [fullscreen]=“true”>
<ion-button (click)=“showAlert()”
expand=“block”
shape=“round”
class=“my-action-button”>
Informe seus dados


tab2.page.ts

export class Tab2Page {

constructor(private alertCtrl: AlertController) {

}

async showAlert(){

let alert = await this.alertCtrl.create({
  header: 'Cadastro',
  inputs: [        
    {
      name: 'email',
      placeholder: 'Email'
      
    },
    {
      name: 'telefone',
      placeholder: 'Telefone',
      
    }
  ],
  buttons: [
    {
      text: 'Cancel',
      role: 'cancel',
      handler: data => {
        console.log('Cancel clicked');
      }
    },
    {
      text: 'Enviar',
      role: 'enviar',
      handler: data => {
        console.log('Enviar clicked');
        
      }
    }
  ]
});
alert.present();

}

}


[buttoninformation|690x387](upload://pYO3ulwBd5hwg8ZkZ9ifvO7gs5X.png) ![input|690x387](upload://AbiQJFZ4X5Y37PQoRM2wmFOUeH6.png)

Posts: 1

Participants: 1

Read full topic

Some device unable to view images from firebase

$
0
0

@soo wrote:

I have an app using firebase database, showing some external link images and text in the app.

This app has been published for three years, until recently I update new version then some went wrong.

Some of the users mobile can’t detect the image from the firebase database and shown the default image instead.(I use the image-loader plugin which can set default image)

My android and iphone is working fine, images shown correctly, so it is not the code problem.

I don’t know what’s wrong? Somebody helps!!

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

IONIC 4 ---- ERROR Failed to load: 8100/svg/md-location-outline.svg

$
0
0

@elvy1111 wrote:

Good evening i have a problem…when I load the page with the map this error comes out =>
Failed to load 8100/svg/md-location-outline.svg:1
resource: the server responded with a status of 404 (not found).

Greetings

Posts: 2

Participants: 2

Read full topic

Could not find plugin "proposal-numeric-separator"

$
0
0

@rahulsharma841990 wrote:

Create a fresh project of ionic with angular framework and cordova. Project created server successfully but when I am creating the build for android or ios it’s showing me an error, even in fresh project.

An unhandled exception occurred: [BABEL] /Users/apple/Desktop/sgni/www/3-es2015.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/Users/apple/Desktop/sgni/node_modules/@babel/preset-env/lib/index.js")
See "/private/var/folders/gx/h8s_w4k104x884fbdw8fsjq80000gn/T/ng-qDOkA1/angular-errors.log" for further details.
[ERROR] An error occurred while running subprocess ng.

IONIC Version: 6.3.0
NPM: 6.14.1
Angular CLI: 9.0.4
OS: MAC
Node: v10.16.2
Cordova: 9.0.0

but its strange thing when I replaced node_modules from my old project it works perfectly and creating a build successfully.

Can anyone tell me, is there any way to solve this issue?

Posts: 1

Participants: 1

Read full topic

Javascript starter example

$
0
0

@Castagnoli wrote:

Hi!
I’m very new here, sorry.
Is it possible to access all functionality about Ionic and Capacitor using Javascript instead or React or Angular? Can You suggest me a link to start?

Cheers!
SC

Posts: 2

Participants: 2

Read full topic

Content of indexedDB in human readable format

$
0
0

@LousyJohnny wrote:

Hi,

I have to retrieve and process data from the indexedDB of a running app on an Android device
I managed to extract it via adb :
adb exec-out run-as io.ionic.starter tar c app_webview/Default/IndexedDB/file__0.indexeddb.leveldb/ > extracted.tar

I got a bunch of .ldb files which seem to contain what I need, but they are compressed in an unknown format
How can I read those file ?

thanks !

Posts: 1

Participants: 1

Read full topic

Is Ionic React Like React Original Project?


Touchscreen desktops detected as mobile

$
0
0

@shepard wrote:

Anyone have advice for detecting touchscreen desktops?
Currently, using getPlatforms returns it as a mobile device.
Apparently this was not addressed with v5 as was suggested it might be earlier.

Posts: 1

Participants: 1

Read full topic

How to ensure one method is executed before executing another?

$
0
0

@Sweg wrote:

I am reading in my current location using Geolocation correctly, & now want to render a Leaflet map which centers around those co-ordinates.

The problem that I’m facing is that both getLoc() & initMap() are being called in ngAfterViewInit().
Even though I’m calling getLoc() first, it looks as my longitude & latitude variables aren’t being populated before the map is initiated.

Can someone please tell me how I can ensure my current location is read in before the map is initiated, so I can use those co-ordinates to center the map?

Here is ngAfterViewInit():

ngAfterViewInit(): void {
        this.getLoc();
        this.initMap();
    }

Here is getLoc():

getLoc() {
    this.geolocation.getCurrentPosition(
      {
        maximumAge: 1000, timeout: 5000,
        enableHighAccuracy: true
      }
    ).then((resp) => {
      this.lat = resp.coords.latitude
      this.lng = resp.coords.longitude
    }, er => {
      alert('Can not retrieve Location')
    }).catch((error) => {
      alert('Error getting location - ' + JSON.stringify(error))
    });
  }

And here is initMap():

private initMap(): void {
    console.log(this.lat + " : " + this.lng);
    this.map = L.map('map', {
      center: [this.lat, this.lng],
      zoom: 3
    });
    const tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      maxZoom: 19,
      attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
    });
    tiles.addTo(this.map);
  }

Posts: 2

Participants: 2

Read full topic

Ionic4 Unity3d integration

$
0
0

@GerardSimpson wrote:

Hi,

I am trying to integrate a unity3d project into an ionic4/react project.

I think I’m pretty close, I have a repo here: https://github.com/node-gs/UnityCapacitorIntegration

I can get to the point where I click a button to open the intent, but then I get this error, which I can’t figure out:
24091-24091/io.ionic.starter E/chromium: [ERROR:aw_browser_terminator.cc(125)] Renderer process (24173) crash detected (code -1).

I’ve looked at the unity example projects here:

I’ve tried lots of different variations of copying that project, but using ionic instead, but I can’t seem to get it to work.

Please could someone help me?

Posts: 1

Participants: 1

Read full topic

Ionic uses an older version of my home.page.ts file

$
0
0

@alexmehler wrote:

no matter how many times i save it , itll always use the old code which is already rewitten… ionic serve , ionic run , everywhere the same problem

Posts: 5

Participants: 3

Read full topic

Gradle complile sdk version

$
0
0

@boel21 wrote:

Hello!! ionic automatically compile the gradle version in 28. can i change to 29 just writing in the build.gradle

Posts: 1

Participants: 1

Read full topic

Ionic React Static web site?

$
0
0

@joself wrote:

Is it possible to export a project made with Ionic React to a static website?
I’m using my project in firebase, but I need to run it on my Apache server, and I didn’t understand this part in the documentation.

Posts: 1

Participants: 1

Read full topic

Implementing side menu routing and tabs routing on the crossplatform app

$
0
0

@sinergyamx wrote:

Hi there, I’m trying to create a cross-platform application and I have created a Desktop view with a working side menu with several pages and I want to implement some tabs so the navigation on the desktop view can work with an implementation of ion-tabs that I created as a component

I’m wondering is someone can. put me in the right direction

Here is my app-routing.module.ts

import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';


const routes: Routes = [
  {
    path: '',
    redirectTo: 'home',
    pathMatch: 'full'
  },
  {
    path: 'home',
    loadChildren: () => import('./pages/home/home.module').then( m => m.HomePageModule)
  },
  {
    path: 'login',
    loadChildren: () => import('./pages/login/login.module').then( m => m.LoginPageModule)
  },
  {
    path: 'register',
    loadChildren: () => import('./pages/register/register.module').then( m => m.RegisterPageModule)
  },
  {
    path: 'profile',
    loadChildren: () => import('./pages/profile/profile.module').then( m => m.ProfilePageModule)
  },
  {
    path: 'pagos',
    loadChildren: () => import('./pages/pagos/pagos.module').then( m => m.PagosPageModule)
  },
  {
    path: 'trabajos',
    loadChildren: () => import('./pages/trabajos/trabajos.module').then( m => m.TrabajosPageModule)
  },
  {
    path: 'anuncios',
    loadChildren: () => import('./pages/anuncios/anuncios.module').then( m => m.AnunciosPageModule)
  },
  {
    path: 'galeria',
    loadChildren: () => import('./pages/galeria/galeria.module').then( m => m.GaleriaPageModule)
  },



];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}

Here my navtabs.component.html

<div class="tabs">
  <ion-tabs slot="bottom">
    <ion-tab-bar slot="bottom">

      <ion-tab-button tab="anuncios">
        <ion-icon name="notifications"></ion-icon>
        <ion-label>Anuncios</ion-label>
        <ion-badge>6</ion-badge>
      </ion-tab-button>
      <ion-tab-button tab="liturgias">
        <ion-icon name="albums"></ion-icon>
        <ion-label>Liturgias</ion-label>
      </ion-tab-button>
  
      <ion-tab-button tab="trabajos">
        <ion-icon name="briefcase"></ion-icon>
        <ion-label>Mis Trabajos</ion-label>
      </ion-tab-button>
  
      <ion-tab-button tab="galeria">
        <ion-icon name="images"></ion-icon>
        <ion-label>Galeria
        </ion-label>
      </ion-tab-button>
    </ion-tab-bar>
  </ion-tabs>
</div>


Any help is most appreciated.

Posts: 1

Participants: 1

Read full topic


Cannot showing my source page

$
0
0

@raisadr wrote:

Hi, I am having a problem showing my source page.
This is my tabs-routing.module.ts



and this is my sources.page.html

this is my source.page.html

and this is my sources page

if I want to click one of the news, for example, the ABC news, it should go to the source page, but it does not show anything, and I do not know what the error.
this is my source page after I click the abc news

Posts: 1

Participants: 1

Read full topic

defaultHref don't go

Why google custom search is not showing in an ionic project?

$
0
0

@iktanim wrote:

I am want to use Google Custom Search in an Ionic project which is built using Angular . But when I paste code according to the documentation but the google custom search is not showing. I have pasted the script in the head tag. And paste code <div class="gcse-searchbox"></div> in an Ionic page but nothing is showing. Please help me solve this problem.

Posts: 1

Participants: 1

Read full topic

Call function from another page / controller

$
0
0

@dragonivell wrote:

I searched here on the forum for some solution but I found some complicated.
I am learning to use the angular / ionic.

I have a function that updates a list through an event, and I would like to call another function on another page to update that counts the total items in the list.

I will be grateful to anyone who can help me ^^

page1:

 doRefresh(event)
 {
    setTimeout(() => {
     this.sTxt = null;
     this.sTipo = 0;
      this.ngOnInit();
      event.target.complete();
      this.start = 0;
    }, 500);
 }

page2:

carregar()
   {
       let dados = { requisisao: 'hTotal' };
 
       this.provider.Api(dados, 'api.php').subscribe(async data => {
 
         if(data['success'])
         {
           this.hTotal = data['total'];
           console.log(data);
         }
         else { this.hTotal = 0; }
       });
   }

Posts: 1

Participants: 1

Read full topic

How to display 3 buttons at end of leaflet map in ionic app?

$
0
0

@Sweg wrote:

I am trying to display a selection of buttons onto of my leaflet map in my ionic app.

Currently, I’m able to display a button at the bottom of the map:

Here is the HTML & CSS:

<div class="map-container">
    <div class="map-frame">
      <div id="map"></div>
      <ion-button id="refreshButton" color="primary" (click)="findMe()">Find me</ion-button>
    </div>
  </div>

And here is the CSS:

.map-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 30px;
}

.map-frame {
  border: 2px solid black;
  height: 100%;
}

#map {
  height: 100%;
}

#refreshButton {
  position: absolute;
  bottom: 20px;
  right: 2px;
  padding: 10px;
  z-index: 400;
}

But I want to be able to display 3 buttons like so:

Can someone please tell me what changes I need to make so that I can display something like this?

Posts: 1

Participants: 1

Read full topic

Viewing all 49526 articles
Browse latest View live