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

How works with react ionic native elements

$
0
0

@jhoncbernal wrote:

I had problems with react in ionic to use de File transfer someone can help me?

import { FileTransfer, FileUploadOptions, FileTransferObject } from ‘@ionic-native/file-transfer’;
export class FileFormPage extends React.Component<{},
{ http:HTTP,
file: any,
showToast1: boolean,
loginMessage: string,
hiddenbar: boolean,
}> {
constructor(props: any,private http: HTTP,private transfer: FileTransfer) {
super(props);
this.state = {
http:http,
file: ‘’,
showToast1: false,
loginMessage: ‘’,
hiddenbar: true,
}
}
async handleSubmit(e: FormEvent) {
e.preventDefault();
try {
const fileTransfer: FileTransferObject = this.transfer.create(); “Cannot read property ‘create’ of undefined”
or if i change the import

TypeScript error in /Users/jhoncasallas/Documents/OwnCode/VecinoIonic/src/components/FileForm.tsx(22,69):
Cannot find module ‘@ionic-native/file-transfer/ngx’. TS2307
20 | import { execFile } from ‘child_process’;
21 | import { File } from ‘@ionic-native/file’;

22 | import { FileTransfer, FileUploadOptions, FileTransferObject } from ‘@ionic-native/file-transfer/ngx’

Posts: 1

Participants: 1

Read full topic


How to use mode="ios" for a single component in Ionic 5?

$
0
0

@j-carignan wrote:

Hello, I want to use ion-router-outlet with mode=“ios” to have the horizontal page transition. It worked well in Ionic 4 but now in Ionic 5, the mode is applied to every children of ion-router-outlet which means all my components get shown in a ios style, even on Android or Web.

How can use the mode attribute like it was on Ionic 4, for the current component only?

Thanks

Posts: 1

Participants: 1

Read full topic

Auth Persistence using Ionic/Vue and Firebase

$
0
0

@tkclark wrote:

I’ve written an PWA that uses Ionic/Vue and Firebase. What I’d like is to keep the user logged in even after a browser refresh or the app relaunches if they’ve successfully authenticated once and not logged out. I’ve found this page on Firebase about Auth State Persistence. The code example makes it seem like I need to use firebase.auth.Auth.Persistence.LOCAL but it doesn’t talk much about querying this persistence later. Anyone ever done this before?

@aaronksaunders I know I pester you enough as it is! lol… But I’m getting close to the finish line! Have you ever wrote an app that’ll leave users logged in?

P.S. I should also note that I do want to store additional information for persistence and that I’m using Vuex. Not sure if these things should be considered the same or different.

Posts: 1

Participants: 1

Read full topic

Error TS2304: Cannot find name 'Let' ,'headers', 'options'

$
0
0

@lily28 wrote:

I am a beginner, I try to follow a tutorial and end up getting these errors:

Cannot find name ‘Let’
Cannot find name ‘headers’. Did you mean ‘Headers’?
Cannot find name ‘options’. Did you mean ‘Option’?

Below is my code for access-providers.ts

import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/timeout';
import { fileURLToPath } from 'url';

@Injectable()
export class AccessProviders {
    //url backend api json
    server: string ='http://localhost/login-register-home/api';

    constructor(public http: HttpClient){}

    postData(body, file){
        Let headers = new HttpHeaders({
            'Content-Type' : 'application/json; charset=UTF-8'
        });
        Let options = {
            headers: headers
        }

        return this.http.post(this.server + file,JSON.stringify(body), options)
        .timeout(59000)// 59 sec timeout
        .map(res => res);
    }
}

Extra info:
Angular CLI & Angular: 9.0.7
Node: 12.16.1
rxjs : 6.5.4
typescript : 3.7.5

Can anyone help me out, thank you.

Posts: 1

Participants: 1

Read full topic

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

$
0
0

@kennRoss88 wrote:

Any of you guys encouter this issue when building for android?

ionic: 6.3.0

Android Studio project detected
ANDROID_HOME=/Users/kenneth/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
studio
Subproject Path: CordovaLib
Subproject Path: app
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
/Users/kenneth/Documents/Ionic/testAndroid/platforms/android/gradlew: Command failed with exit code 1 Error output:
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Posts: 1

Participants: 1

Read full topic

WMIC problem, Ionic 5

$
0
0

@landsfiskalen wrote:

In later versions of Windows 10 WMIC seems to be deprecated. For example, if i try ionic info I get an error message:

Error: Command failed: wmic os get Caption

ERROR:
Description = Unspecified error


at makeError (C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\execa\index.js:174:9)
at Function.module.exports.sync
(C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\execa\index.js:338:15)
at windowsRelease
(C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\windows-release\index.js:34:24)
at osName (C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\os-name\index.js:39:18)
at Environment.getInfo (C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js:45:20)
at async InfoCommand.run (C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\commands\info.js:29:24)
at async Promise.all (index 0)
at async InfoCommand.execute (C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\lib\command.js:79:9)
at async Executor.run (C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\lib\executor.js:53:9)
at async Executor.execute
(C:\Users\andersp\AppData\Roaming\npm\node_modules\@ionic\cli\node_modules\@ionic\cli-framework\lib\executor.js:69:13)

This means I can no longer compile or do anything with my project.

I’m using Ionic 4 and Cordova 9. I’m pretty stumped as what to do now.

Regards,
Anders

Posts: 1

Participants: 1

Read full topic

Cannot get '@ionic-native/file/ngx' to work

$
0
0

@alexmehler wrote:

my app always fails with in the console :

Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[CustomersPage -> File]:
StaticInjectorError(Platform: core)[CustomersPage -> File]:
NullInjectorError: No provider for File!

i dont even use the file in any function right now , just importing ‘@ionic-native/file/ngx’

already makes teh app fail … no matter if serve, run browser , cordova run android or capacitor run android …

holy shit its really hard to get into ionic with the fractured knowledgebase … ionic 3 , ioic 4 , cordova , capacitor … every tutorial is different , every example code on github or stack overflow is different , i now tried several methods just to implement a file api at all , not even doing anything with it

Posts: 2

Participants: 1

Read full topic

Haw do i change the font size of all pages using ion-range in ionic 4

$
0
0

@kawarien wrote:

Hello,

How can i change font size of all pages using ion-range. this code work only in my home page
home.component.html

<ion-range min="1" max="6" snaps="true" [(ngModel)]="fontSize"> </ion-range>

home.component.ts

fontSize: number;

thank in advance for your help

Posts: 1

Participants: 1

Read full topic


Not allowed to load local resource: file:///

$
0
0

@codiqa100079737 wrote:

I have to update and publish an Ionic V1 app. Due to UIWebView issue with Apple, I followed Ionic instructions - Updated to cordova-ios 5.1.0, installed the WKWebView plugin and updated each Cordova plugin to the latest version.

However, after that it’s throwing error for displaying images:
[Error] Not allowed to load local resource: file:///Users/Prasoon/Library/Developer/CoreSimulator/Devices/A834F73C-A3A1-4B66-B922-8450F9CBEA21/data/Containers/Data/Application/AD7D56B7-B702-4C08-B7F2-4F41D1C28588/Documents/S12000033_logo.png

I tried updating URL manually by string manipluation like
/Users/Prasoon/Library/Developer/CoreSimulator/Devices/A834F73C-A3A1-4B66-B922-8450F9CBEA21/data/Containers/Data/Application/AD7D56B7-B702-4C08-B7F2-4F41D1C28588/Documents/S12000033_logo.png

But, that changes the URL internally and throws error:
ionic://localhost/Users/Prasoon/Library/Developer/CoreSimulator/Devices/A834F73C-A3A1-4B66-B922-8450F9CBEA21/data/Containers/Data/Application/AD7D56B7-B702-4C08-B7F2-4F41D1C28588/Documents/S12000033_logo.png
Failed to load resource: the server responded with a status of 404 ()

Then I tried implementing convertFileSrc/normalizeURL - however, not getting any help on Ionic V1 for using that.

Posts: 1

Participants: 1

Read full topic

Please help me with native file

$
0
0

@alexmehler wrote:

this.file.readAsText(this.file.externalRootDirectory + “xtracker”, filename).then(???)

i want to read a json from android sdcard/xtracker and then JSON.parse it.

but i dont know how the promise resolves

writing the file works , but i dont know how to read it correctly please replace the ??? in the code so i get the filecontent as text

thanx !

Posts: 1

Participants: 1

Read full topic

QrCode and Barcode scanner with Ionic5 and Capacitor

$
0
0

@ioclaudio wrote:

Hi,
I have to update an App from Ionic3 to Ionic5.
It is a small app, with a few pages and uses some Cordova plugins to read Barcodes, to read QR codes and to take photos.
I think the best thing is to create a new Ionic5 app and copy the features to from the Ionic3 app to the Ionic5 app.

I can see that it is suggested for the new apps to use Capacitor instead of Cordova.
I’ve never used it and I can’t see a plugin to read Barcodes nor a plugin to read QR codes.
I’m using these plugins:

Will I still be able to use these plugins with Capacitor?

Thank you very much

Claudio

Posts: 1

Participants: 1

Read full topic

ScreenOrientation problems

$
0
0

@etarom wrote:

Hi,
I can’t make to work a @ionic-native/screen-orientation/ngx

@ionic-native/screen-orientation”: “^5.23.0”,

module.ts:

import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';

  providers: [
    EventHandlerService,
    FabricShapeService,
    ScreenOrientation
  ]

AppComponent.ts:

export class AppComponent {
  constructor(
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar,
    private screenOrientation: ScreenOrientation
  ) {

I got this error:

AppComponent -> ScreenOrientation]: NullInjectorError: No provider for ScreenOrientation!

Ionic:

   Ionic CLI                     : 5.4.16 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.11.10
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 5 other plugins)

thanks in advanced

Posts: 1

Participants: 1

Read full topic

Rxjs add/remove timeout operator dynamically

$
0
0

@Vartex05 wrote:

hi, in my app, iam working with on a service, which i use to communicate over udp. Responses from udp communication are sent through subject which i created. Here is the method, for getting observable:

getUdp(){
return this.udpSubject.asObservable().pipe(
      switchMap((response: any) => {
        return response.timeoutNeeded
          ? of(response).pipe(timeout(5000))
          : of(response);
      }),
      take(1),
      map((response: any) => {
        return {
          result: response.result,
        };
      }),
      catchError(err => {
        this.closeUdpConnection(socketId, udpResponseHandler);
        return of({ result: "0", text: "Communication error" });
      })
    );
}

The problem is, that i want to apply timeout operator only if there is timeoutNeeded property on response object true. I used switchmap for that and it works great, but only for cases, when some response is emitted. But when there is no emit, the switchmap operator doesnt run, so it waits forever. For these cases i want to apply 5s timeout. How can i do this? Is it possible to reset timeout operator or remove it dynamically?

Posts: 1

Participants: 1

Read full topic

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Cordova Ionic

$
0
0

@Himanshurahi wrote:

when i run ionic cordova run android am getting this error
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\Himanshu Rahi\AppData\Local\Android\Sdk\tools\bin (recommended setting)
ANDROID_HOME=C:\Users\Himanshu Rahi\AppData\Local\Android\Sdk (DEPRECATED)

BUILD SUCCESSFUL in 4s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
‘Angular\videoapp-demo\platforms\android’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
C:\Users\Himanshu Rahi\Downloads\Node&Angular\videoapp-demo\platforms\android\gradlew: Command failed with exit code 1 Error output:
‘Angular\videoapp-demo\platforms\android’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

How to Fix this
platform -list
Installed platforms: android 8.1.0 Available platforms: browser ^6.0.0 electron ^1.0.0 ios ^5.0.0 osx ^5.0.0 windows ^7.0.0
Ionic version 5.4.16
cordova version 9.0.0 (cordova-lib@9.0.1)

Posts: 1

Participants: 1

Read full topic

Ion-popover missing enter animation (bug?)

$
0
0

@AlenDK wrote:

Hey,

I am currently using ion-popovers in my application, but i noticed that there is not an enter animation. It just starts up with the popover on top. I looked at the source and found out there is a animation for enter: https://github.com/ionic-team/ionic/blob/c68160ecd3fb0c4d791e034e88f97ebf7f98de70/core/src/components/popover/animations/md.enter.ts .
I tried to copy the code into a custom animation and it worked (sort of, the popover was not pointing at the right place). So i am not really sure why it is not working while the leave/dismiss animation does…

Anyone got the same problem or maybe a solution?

Posts: 1

Participants: 1

Read full topic


Trying to pass Id value from this component to price component, but it's seems i couldn't display it or access the Id value

$
0
0

@samdawit wrote:

// LotItem Component

const LotItem = props => {

const { lotName, id } = props.lot;

return (

<IonGrid>

  <IonRow>

    <IonCol size-md='6' offset-md='3'>

      <IonList>

        <IonCard>

          <IonItem

            routerLink={`/lot/${id}`}

            button

            onClick={() => <Prices id={id} />}

          >

            <IonIcon slot='start' name='car-sport'></IonIcon>

            <IonLabel>{lotName}</IonLabel>

          </IonItem>

        </IonCard>

      </IonList>

    </IonCol>

  </IonRow>

</IonGrid>

);

};

export default LotItem;

// Price Component

const Prices = props => {

return (

<IonGrid>

  <IonRow>

    <IonCol size-md='6' offset-md='3'>

      <IonList>

        <IonButton onClick={() => {}}>

          <IonLabel>The Id is :{props.id}</IonLabel>

        </IonButton>

      </IonList>

    </IonCol>

  </IonRow>

</IonGrid>

);

};

export default Prices;

Posts: 1

Participants: 1

Read full topic

Button relative to scroll-content background

$
0
0

@stefani0 wrote:

I have a background image and have set this image at scroll-content class.
I want to make a button that stand always in the end of background.
Until know with some css is possible to postion but when change from pc to mobile it change.
I want something that work for all platforms.

<ion-col col-2></ion-col>
<ion-col col-8 style="text-align: center;">     
    <button class="btn" ion-button block large (click) = login()>ENTRA</button>   
</ion-col>
<ion-col col-2></ion-col>

.scroll-content {
background: url("…/imgs/Sfond.svg") no-repeat center center / cover;
margin-top: -6px;
bottom: 55px;
margin-right: -100px;
margin-left: -100px;
margin-bottom: -3px !important;
position: absolute;
}

Thank you in advance.

Posts: 1

Participants: 1

Read full topic

Ionic 5 does not work on android 4.4

$
0
0

@missoufou63 wrote:

good evening
I create my ionic application but its does not work on version 4.4
my ionic info
Ionic:

Ionic CLI : 5.4.5 (C:\Users\ISSOUFOU Moussa\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.0.4
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : not available
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 1.2.1, (and 12 other plugins)

Utility:

cordova-res : 0.9.0
native-run : 0.3.0

System:

Android SDK Tools : 26.1.1 (C:\Users\ISSOUFOU Moussa\Documents\Apowersoft\Android\android-sdk)
NodeJS : v12.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.2
OS : Windows 10

help me please

Posts: 1

Participants: 1

Read full topic

Ionic 4: HttpClient is giving me a “http error response 0 unknown error”

$
0
0

@feliperiverot wrote:

I am working with Ionic 4 developing and hybrid app. I am trying to consume an API URL. I am calling the API with the below code.

import { HttpHeaders, HttpErrorResponse, HttpClient  } from '@angular/common/http';

  constructor(private http: HttpClient, private androidPermissions: AndroidPermissions, private uid: Uid, private device: Device,  public platform: Platform, public formBuilder: FormBuilder, private router: Router, private nativeStorage: NativeStorage,private fb: Facebook,   private googlePlus:GooglePlus ) {


  platform.ready().then(() => {
      this.onDeviceReady();
    });


  }

    let urlSearchParams = new URLSearchParams();
urlSearchParams.append('brand', this.myManufacturer );
urlSearchParams.append('model',  this.myModel);
urlSearchParams.append('androidid', this.myUuidt);
urlSearchParams.append('serialsim', this.myUuidt);
urlSearchParams.append('imei', this.myIMEI);    

     this.httpOptions = {
    headers: new HttpHeaders(
    {
      'Content-Type': 'application/json',
      'Authorization': this.tobas64string
    })
  }



    this.http.post("some url", urlSearchParams.toString(),  this.httpOptions).subscribe(
        data  => {
        alert(JSON.stringify(data));
        },
        error  => {

        alert(JSON.stringify(error));

        }
    );

And I get this result:

enter image description here

I am testing in my cell phone, is android 9 model.

Any ideas why this is happening?

Posts: 1

Participants: 1

Read full topic

Badge count does not increase (Capacitor-PushNotification-Plugin)

$
0
0

@Catweazle101 wrote:

Hi all

I made following tutorial to integrate the PushNotifications plugin into my app.
https://capacitor.ionicframework.com/docs/guides/push-notifications-firebase/

Everything worked so far. I can now test push notifications from the Firebase Console to my app
running on my iPhone.

But my general question is:
Do I have to set the badge-count(to show for the app-icon manually?
If yes, how can I set and manage the badge-count of the app-icon?

Thanks for any tip
Oliver

Posts: 1

Participants: 1

Read full topic

Viewing all 70433 articles
Browse latest View live


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