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

Add To Cart Example Using PHP, MySQL

$
0
0

@bharathirajatut wrote:

It is a simple example of add to cart using Ionic 4 with PHP, MySQL. It contains PHP REST-API. It had four different cart features. They are

  1. Save cart info
  2. Update cart info
  3. Delete cart info
  4. List cart info

You can use this to your projects.

Posts: 1

Participants: 1

Read full topic


Ionic 4, Angular 8, SQlite plugin IOS App

$
0
0

@rdbhagat999 wrote:

Dependencies

"@angular/core": "^8.2.0",
"@ionic-native/sqlite": "^5.21.6",
"@ionic-native/sqlite-db-copy": "^5.21.6",
"cordova-plugin-dbcopy": "^2.1.2",
"cordova-sqlite-storage": "^4.0.0",
  1. Create Sqlite connection
dbName = 'Admin_1.db';

  options = {
    name: this.dbName,
    location: 'default',
    createFromLocation: 1,
  };

try {

      const db = await this.sqlite.create({...this.options, name: this.dbName});

      if(db !== null) {
        this.database = db;
        this.dbReady.next(true);
      }

    } catch (error) {
      console.log('db_err');
      console.log(error);

    }
  1. Copy existing database to default db location
    this.sqliteDbCopy.copyDbFromStorage(dbName, 2, this.file.dataDirectory + ${user.userId}/, true)

  2. Works perfectly on Android but does not work on IOS.

What is the default location of SQlite database in IOS App? I think the problem is that I’m not being able to copy existing database to correct location in IOS app but I’m not sure about it.

Thanks for helping in advance.

Posts: 1

Participants: 1

Read full topic

Get of storage function not working on real device

$
0
0

@ocooldi wrote:

Here is my snippet code;
ex; following func, its in AAAService
async loadStorage() {
const val = await this.storage.get(‘appInfo’);
if (val == null || val == undefined) { return; }
let appInfo = JSON.parse(val);
console.log(appInfo);
}

const info = await this.aaaService.loadStorage();.

const val = await this.storage.get(‘appInfo’);
Actually above code works on browser but not working on real device such as Android and iOS. It`s so urgent and anybody help me ?

Thanks.

Posts: 1

Participants: 1

Read full topic

Ionic can start a project

$
0
0

@itosoft wrote:

hi i can not creat project got these errors:

 PS C:\Users\Arashsoft\Desktop\ionic\start_angular> ionic start

Every great app needs a name!

Please enter the full name of your app. You can change this at any time. To bypassthis prompt next time, supply name, the first argument to ionic start.

? Project name: test

Pick a framework!

Please select the JavaScript framework to use for your new app. To bypass this
prompt next time, supply a value for the --type option.

? Framework: Angular

Let's pick the perfect starter template!

Starter templates are ready-to-go Ionic apps that come packed with everything you
need to build your app. To bypass this prompt next time, supply template, the
second argument to ionic start.

? Starter template: blank
√ Preparing directory .\test - done!

Downloading and extracting blank starter

────────────────────────────────────────────────────────────

     Ionic CLI update available: 5.4.16 → 6.2.1
The package name has changed from ionic to @ionic/cli!

       To update, run: npm uninstall -g ionic
           Then run: npm i -g @ionic/cli
────────────────────────────────────────────────────────────

Error: Client network socket disconnected before secure TLS connection was
established

at connResetException (internal/errors.js:570:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1361:19)
at Object.onceWrapper (events.js:299:28)
at TLSSocket.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1183:12)

i upgrade ionic and here is info

Ionic:

   Ionic CLI : 6.2.1

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v12.16.1
   npm    : 6.13.4
   OS     : Windows 10

here is a a new errro:


Project name: testarash Let's pick the perfect starter template! Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your app. To bypass this prompt next time, supply template, the second argument to ionic start. ? Starter template: blank √ Preparing directory .\testarash - done! | Downloading and extracting blank starter Error: read ECONNRESET 

Posts: 2

Participants: 2

Read full topic

Ionic4- iOS build hangs on splash screen

$
0
0

@nishamane wrote:

I have created iOS build for my ionic4 app having Cordova version 9.0.0. I am using firebase authentication in app. For this, I have registered app with firebase and also added configuration file in project root directory.
But when I am trying to run it on Xcode(11.2.1), its doesn’t log any error message on console, but app consistently hangs at the splash screen. I have installed following plugins:

  • com-badrit-base64 0.2.0
  • cordova-admob-sdk 0.24.1
  • cordova-background-geolocation 3.5.1
  • cordova-open-native-settings 1.5.2
  • cordova-plugin-add-swift-support 2.0.2
  • cordova-plugin-admob-free 0.27.0
  • cordova-plugin-advanced-http 2.1.1
  • cordova-plugin-android-permissions 1.0.0
  • cordova-plugin-app-version 0.1.9
  • cordova-plugin-background-fetch 5.6.1
  • cordova-plugin-background-mode 0.7.3
  • cordova-plugin-camera 4.1.0
  • cordova-plugin-contacts 3.0.1
  • cordova-plugin-crop 0.3.1
  • cordova-plugin-device 2.0.3
  • cordova-plugin-fcm-with-dependecy-updated 4.1.1
  • cordova-plugin-file 6.0.2
  • cordova-plugin-file-transfer 1.7.1
  • cordova-plugin-firebase 2.0.5
  • cordova-plugin-geolocation 4.0.2
  • cordova-plugin-googlemaps 2.6.2
  • cordova-plugin-ionic-keyboard 2.2.0
  • cordova-plugin-ionic-webview 4.1.1
  • cordova-plugin-nativegeocoder 3.2.2
  • cordova-plugin-network-information 2.0.2
  • cordova-plugin-request-location-accuracy 2.3.0
  • cordova-plugin-splashscreen 5.0.3
  • cordova-plugin-statusbar 2.4.3
  • cordova-plugin-telerik-imagepicker 2.3.3
  • cordova-plugin-whitelist 1.3.4
  • cordova-plugin-x-socialsharing 5.6.0
  • cordova-promise-polyfill 0.0.2
  • cordova-sms-plugin 1.0.0
  • cordova-support-android-plugin 1.0.1
  • cordova-support-google-services 1.3.2
  • es6-promise-plugin 4.2.2
  • mx.ferreyra.callnumber 0.0.2

Anybody faced this issue and or have any idea to resolve this issue. I have tried every possible solutions.
Please help.

Posts: 1

Participants: 1

Read full topic

Ion-loading does not display

$
0
0

@kkhanhluu wrote:

I tried to create a loading spinner while making a http request, the ionic-loading is inserted to the DOM but it is invisible. Here is the code

from(this.loadingCtrl.create({ message: 'Loading...' }))
      .pipe(
        tap(loadingEl => {
          loadingElement = loadingEl;
          loadingEl.present();
        }),
        switchMap(() => self.dataService.getdata())
      )
      .subscribe(
        (response: any) => {
          console.log(response);
          loadingElement.dismiss();
        },
        error => {
          console.error(error);
        }
      );

Does anyone have the same problem?

Posts: 1

Participants: 1

Read full topic

Local host error when i try to update apk

İonic Wordpress Select City i want to do


IOS Camera

$
0
0

@ndblackandblue wrote:

For some reason at IOS 13, on IPHONE XR, when i use that code to get a picture:

 const options: CameraOptions = {
            quality: 50,
            targetWidth: 400,
            targetHeight: 400,
            destinationType: this.camera.DestinationType.DATA_URL,
            encodingType: this.camera.EncodingType.JPEG,
            mediaType: this.camera.MediaType.PICTURE,
            allowEdit: true
        }
        this.camera.getPicture(options).then((imageData) => {
          if(imageData){
             //Image data is coming null so he dont join here
             let base64Image = `data:image/jpeg;base64,${imageData}`;
          }
        }).catch((err) => {
          let alert = this.alertCtrl.create({
            title: 'error',
            subTitle: `Um erro foi encontrado: ${err}`,
            buttons: ['OK']
          });
          alert.present();
        });

For some reason IMAGEDATA is coming null, and i cant get image, only at iphone xr, but if i use code to get image from gallery works fine, its only with CAMERA at iphone XR

Posts: 1

Participants: 1

Read full topic

Inappbroswer doesn't show close(done) for images

$
0
0

@ctfrancia wrote:

I see the image, but not able to close the image once seen,
here are the options:

   32       const options: InAppBrowserOptions = {
   31         resizable: 'yes', //
   30         location: 'yes', // Or 'yes'
   29         footer: 'yes', // creates a 'close' in the footer
   28         hidden: 'no', // Or  'yes'
   27         clearcache: 'yes',
   26         clearsessioncache: 'yes',
   25         // zoom: 'yes', // Android only ,shows browser zoom controls
   24         hardwareback: 'no',
   23         mediaPlaybackRequiresUserAction: 'no',
   22         shouldPauseOnSuspend: 'no', // Android only
   21         closeButtonCaption: 'Cerrar', // iOS only
   20         disallowoverscroll: 'no', // iOS only
   19         toolbar: 'yes', // iOS only
   18         toolbarPosition: 'bottom',
   17         enableViewportScale: 'no', // iOS only
   16         allowInlineMediaPlayback: 'no', // iOS only
   15         presentationstyle: 'fullscreen', // iOS only
   14       };
   13.      this.iab.create(data, '_blank', options);

when using the target of _self the image shows but there is no close button, I have to close the application completely and then re open it.
when using _blank then the image doesn’t show with the button below but says Load Error.

Anyone encounter this before?

also: data is: ionic:///path...

Posts: 1

Participants: 1

Read full topic

In input type file is does not shows the option of camera in android platform

$
0
0

@developer-wovvtech wrote:

Hello,

 <input type="file" accept="image/*;capture=camera">

is does not showing the options of camera in android platform, it is working in ios platform. please help me to solve this issue .

i am using ionic version 4.1.2,

Thanks

Posts: 1

Participants: 1

Read full topic

Import ionic folder to XCode

$
0
0

@ayoimansor wrote:

Hye, i code my ionic in windows and now i want to transfer it to XCode because i want to transfer it into my iPhone.
Is there any tutorial on how to open up my ionic folder becasue it seems XCode can’t open the folder

Posts: 1

Participants: 1

Read full topic

Settings autoHeight true and dynamic updating of data within slide

$
0
0

@vishalsingh24 wrote:

I’m using Ionic slide and have set the following options {autoHeight: true}. The problem is if I am updating the current slide dynamically the content does not show up because of the height change. I’m using the update() function inside setTimeout() but the slide updates with slightly left positioned.

Posts: 1

Participants: 1

Read full topic

PayPal: Translation / Select language?

Geolocation service once called during runtime, it takes very long to respond normally, however whenever I go to some other tab or minimize and reopen the window, the geolocation responds way faster

$
0
0

@subhrangshu01 wrote:

import { Geolocation } from ‘@ionic-native/geolocation/ngx’;
imported this library and then called this following function:

async loadMapJS(i: number) {
this.geolocation.getCurrentPosition().then((resp) => {
const latLng = new google.maps.LatLng(resp.coords.latitude, resp.coords.longitude);
const mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};

 // this.getAddressFromCoordsJS(resp.coords.latitude, resp.coords.longitude);

  this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
  let marker =  new google.maps.Marker();
  // This line gets the coordinates of the clicked location
  google.maps.event.addListener(this.map, 'click', this.func = (event) => {
    marker.setMap(null);
    marker = new google.maps.Marker({
      position: {lat: event.latLng.lat() , lng: event.latLng.lng()},
      map: this.map,
      title: 'Your teaching location set here',
      snippet: 'Click on map to change location',
    });
    marker.setMap(this.map);
    this.classesArray[i].locationLatitude = event.latLng.lat();
    this.classesArray[i].locationLongitude = event.latLng.lng();
  });
}).catch((error) => {
  console.log('Error getting location', error);
});

}

If I call this function in constructor, it works immediately. But if I call this from button during runtime, geolocation takes too long, maybe few minutes to fireup. But if I go to some other tab and come back or minimize and reopen, it hits almost immediately. Can you suggest something for this?

Posts: 1

Participants: 1

Read full topic


Ionic 5 Menu is flickering

Issue: IonRouterOutlet - remove pages from history to improve navigation (ReactJS)

$
0
0

@Mnrock wrote:

Hi,

The issue is that ionic is continuing to cache every page as the user continues to push() new pages, which adds to memory and event listener heap. Eventually the app is taking 10 seconds to respond to events.

I need to reset the cache for app when IonRouterOutlet component save a lot of html and large amount of nav pushes through history. Is it possible as easily as in Ionic Angular issue?

Looking forward to your reply. Thank you for supporting React!

Posts: 1

Participants: 1

Read full topic

CORS Issue when sending request from ionic to firebase cloud function

$
0
0

@Sweg wrote:

I am trying to send a HTTP request to a firebase cloud function in my Ionic Angular app, but am facing a CORS issue.

Here is the function I am trying to execute:

import { HttpClient } from '@angular/common/http';
private http: HttpClient

like(post) {
this.http.post('cloudFunctionUrl', JSON.stringify(body), {
      responseType: 'text'
    }).subscribe((data) => {
      console.log(data);
    }, (error) => {
      console.log(error);
    });
}

To get over the CORS issue, I installed the Allow CORS: Access-Control-Allow-Origin chrome plugin. Below is a list of the whitelisted domains:

The like function above is executed on localhost:8100/profile

I’m experiencing two issueS:

  1. I navigate to localhost:8100/profile no problem, but when I execute like , I get this error message:

Access to XMLHttpRequest at ‘cloudFunctionUrl’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

  1. If I go to the firebase console, & I have the CORS plugin turned on, it says "There was an error loading your projects"

Can someone please tell me how I can resolve this?

I also tried to add the below headers to the request, but the error is still appearing:

let headers = new HttpHeaders({
      'Access-Control-Allow-Origin': '*'
    });
    this.http.post('cloudFunctionUrl', JSON.stringify(body), {
      headers: headers,
      responseType: 'text'
    }

Posts: 3

Participants: 2

Read full topic

Help with getting users from firestore & Ionic4

$
0
0

@nahuelreymundo wrote:

Hi
Im my register page i have a Register Form, and my .ts it’s like:

Register.ts

register(user:User){
this.auth.auth.createUserWithEmailAndPassword(user.email,user.password).then(()=>{
this.auth.authState.subscribe(auth =>{
this.db.collection(Empresas/${auth.uid}).add({
‘empresa’: user.empresa,
‘email’: user.email,
‘telefono’:user.telefono,
‘razon’:user.razon,
‘cuit’:user.cuit,
‘ciudad’:user.ciudad,
‘direccion’:user.direccion,
‘rubro’:user.rubro,
‘trabajadores’:user.trabajadores,
‘descripcion’:user.description
}).then(()=>{
this.storage.set(‘user’, user.empresa);
this.storage.set(‘loged’,true)
this.router.navigateByUrl(‘tabs’)
})
})
})
}

I want to get the user data stored in firestore to display it in my Profile Page
I thought filtering by mail in the firestore collection.
Can anyone help me with this?

Posts: 1

Participants: 1

Read full topic

Looking for comprehensive content-security-policy guideline

$
0
0

@ciekawy wrote:

Recently I was building a reusable places autocomplete module requireing to load script from googleapis.com. I quickly found that only for production iOS I need to add <meta http-equiv="Content-Security-Policy"> with proper content. While I have in my backlog to address CSP properly, this time I wanted to add minimum and start to think about it as was unable to found all the info I need…

  • what are particular equivalent CSP values when there is no <meta http-equiv="Content-Security-Policy">?
    eg for script-src is the default insecure-inline insecure-eval?

  • are there CSP equivalents of cordova whitelist plugin tags in config.xml?

  • if I want to introduce security - how to deal with inline and eval cases? are there any nonce/hash plugins available?

  • how to distinguish between development and production?

  • what should be default CSP values to start with bare ionic apps?

  • is the strict-dynamic supported? if so how it can be used?

  • should the Angular Meta service work to configure this dynamically? OR maybe some better ionic/capacitor/cordova plugin/module is missing to support management of access lists?

Posts: 1

Participants: 1

Read full topic

Viewing all 70432 articles
Browse latest View live


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