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

Ionic 3 Build Error with WebIntent

$
0
0

@samgcosta wrote:

Hi, i’m getting build errors when i’m install native “WebIntent” plugin in my app on Ionic v.3

BUILD FAILED in 15s
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\gradlew: Command failed with exit code 1 Error output:
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\com\ionicframework\cordova\webview\IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\io\github\pwlin\cordova\plugins\fileopener2\FileProvider.java:28: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\nl\xservices\plugins\FileProvider.java:4: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\com\ionicframework\cordova\webview\IonicWebViewEngine.java:122: error: cannot find symbol
    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
     ^
  symbol:   class RequiresApi
  location: class IonicWebViewEngine.ServerClient
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\io\github\pwlin\cordova\plugins\fileopener2\FileOpener2.java:114: error: cannot find symbol
                                                path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
                                                                   ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\io\github\pwlin\cordova\plugins\fileopener2\FileOpener2.java:122: error: cannot find symbol
                                        Uri path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
                                                               ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\nl\xservices\plugins\SocialSharing.java:169: error: cannot find symbol
                fileUri = FileProvider.getUriForFile(webView.getContext(), cordova.getActivity().getPackageName()+".sharing.provider", new File(fileUri.getPath()));
                                      ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
C:\Users\Developer\Desktop\UaiDoc problema\platforms\android\app\src\main\java\nl\xservices\plugins\SocialSharing.java:285: error: cannot find symbol
                fileUri = FileProvider.getUriForFile(webView.getContext(), cordova.getActivity().getPackageName()+".sharing.provider", new File(fileUri.getPath()));
                                      ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

If i don’t use this plugin the build run with no problems, but i need a web intent plugin to receive data from another apps

Posts: 1

Participants: 1

Read full topic


NavController#pop without animation

$
0
0

@TLBSoftware wrote:

Looks like in the new Ionic v4 the options for disabling animation when using

this.navController.pop()

has unfortunately been removed. However in the source code of the StackController in its implementation of pop which is called via NavControllers pop the framework will eventually use navigateBackward and will pass in the view.savedExtras which should allow someone to disable this pop animation. However these RouteViews are created via this controller and are not given an option to be created with these savedExtras

AND unfortunately I am unable to directly inject the StackController into my class to perform this logic myself. Does anyone have a solution here to perform this? I am unable to directly use navigateBackward because in edge cases another view is navigated to from this page and added to the history and I don’t want to go back in the history but back in the stack.

Thanks.

Posts: 1

Participants: 1

Read full topic

Ionic 4 + vue + capacitor. Filesystem writeFile. Base64 file decode error

$
0
0

@fristyr wrote:

Hi there!
First of all thx for reading this.

So I have this piece of code where I’m trying to save a pdf file from my API, which is encoded in base 64

downloadFile() {
      let fileTo = null;
      this.getProjectPd.project.files.forEach(file => {
        if (file.id == this.getProjectPd.idDocument) fileTo = file;
      });
      let link = document.createElement("a");
      link.href = fileTo.file;
      link.download = fileTo.name;
      link.target = "_blank";
      link.click();

      //Everything is written above not really important, it's related to the browser version
      // I have issues for the code below

      console.log( atob(fileTo.file.substr(28)) )
   
      try {
        Filesystem.writeFile({
          path: `test1/${fileTo.name}`,
          data: atob(fileTo.file.substr(28)),
          directory: FilesystemDirectory.Documents,
          encoding: FilesystemEncoding.UTF8
        });
      } catch (e) {
        console.error("Unable to write file", e);
      }
    },

so here is my attempt to encode file and save it

data: atob(fileTo.file.substr(28)),

this is result

and this what I get in the console

Posts: 1

Participants: 1

Read full topic

Ionic React - Can I use speech recognition plugins in project?

$
0
0

@emeritvs wrote:

I am looking for a way to use speech recognition plugins in my project, but all I have found is for Angular / ReactNative projects. Is it possible to use this feature in Ionic React?

Posts: 1

Participants: 1

Read full topic

Mapping and Setting State

$
0
0

@FangerZero wrote:

My Code snippet says it all I have a state variable, that I’m trying to set with img URLs from Firebase but it doesn’t keep the array of them, it only keeps one. I’m using firebase storage to store images. And I get the urls, but I can’t seem to set it to the State Variable, I’ve also tried many other methods but nothing seems to work right.

const [ imgs, setImgs ] = useState([]);
imagesRef.listAll().then(res => {
      let imgArray = [];
      res.items.forEach(itemRef => {
        itemRef.getDownloadURL().then(url => setImgs([...imgs, url]))
      })
    }).catch(function(error) {
      console.log('error: ', error);
    })

Posts: 2

Participants: 2

Read full topic

Does anyone had successful wait for Platform ready using APP_INITIALIZER?

$
0
0

@distante wrote:

I have a migration code that I want to run or startup. For this I want to use APP_INITIALIZER but I have a problem that looks like does not have any fix. Platform ready never triggers there so the app never loads.

Does anyone had success with this or knows a workaround?

Posts: 1

Participants: 1

Read full topic

How to create ionic 4/5 capacitor browser without header bar?

$
0
0

@helenakohan wrote:

Hi:

I want to make a capacitor browser (formerly inappbrowser) without header bar.

Don’t see it in the api.

How to do it?

Posts: 1

Participants: 1

Read full topic

Problem with plugins of cordova

$
0
0

@Juan186 wrote:

I’ve cloned my project from git, and then I run the command npm install, but now I’ve all these warnings from the plugins I had installed.

I’ve compiled the project using cordova.

image

Posts: 3

Participants: 3

Read full topic


Is there a way to change datetime template?

$
0
0

@dinaflies wrote:

Simply put, the default ion-datetime component is too awkward for web pages as it sticks to the bottom of the page, in large screens it hurts good UI. Is there any way to change this layout? Btw, I’ve tried to implement angular material datepicker, but it brought more problems and nonconformities to the rest of my form items that I gave up using it.

Posts: 1

Participants: 1

Read full topic

Ionic input ngmodel is not changed after set Time out

$
0
0

@pdj wrote:

<ion-input style=“padding:6px;” [(ngModel)]=“abc” >

the problem is that on constructor, I changed value abc and changed well ( to www as below code), but on setTimeout, it’s not applied. (www22 as mentioned below code)

what may be the problem?

 this.abc="www"

    setTimeout(()=>{
      console.log("change to www22")
    this.abc="www22"
    },3000)

Posts: 3

Participants: 3

Read full topic

Ionic Status bar, phone Components not showing

$
0
0

@abdosaeed wrote:

Hello, i have a question, in ionic app why phone header components like phone watch hidden when opening the app?

Posts: 3

Participants: 2

Read full topic

Stencil build with Bazel

$
0
0

@n0vik wrote:

Hi
I’m trying to call stencil build with bazel. For this reasons I’ve made a skylark rule-wrapper, but main problem is that bazel requires explicit inputs and outputs.
So question is there any way to predict which files stencil build command will produce?

I’ve looked into compiler’s sources and not sure if it possible at all, because looks like summary gathered after file system commit here

Thanks for any info

Posts: 1

Participants: 1

Read full topic

SSL on Cordova and prevent man in the middle attack

$
0
0

@robindee wrote:

I’m making a app. This app communicate with a API, and I would like to be this communication a secure communication. (The code I post here is in pure cordova because that’s easy)

Some background information

  • My API has a SSL Certificate created by letsencrypt.
  • In my app I’m useing the cordova-plugin-advanced-http
  • To check the trafic between the app and the api I use Packet Capture link
  • Only working for android

Want do I want

  • Encrypted traffic
  • Prevent man in the middle attack ( If this has been detected, there will be no traffic)
  • If I look at Packet Capture log’s I don’t wanna find any information

What did I tryed

  1. try the ssl link =
    cordova.plugin.http.sendRequest('https://domain.tk/API/some/endport/', function(response) {
        // prints 200
    }, function(response) {
        // prints 403
    })

Data is not encrypted , I can see everything in Packet Capture

  1. Made a CER file, put it in my project and pinned my connection
cordova.plugin.http.setServerTrustMode('pinned', function(e) {
        console.log('success!');
    }, function() {
        console.log('error :(');
    });

When I starting Packet Capture TLS is not established (so no data find in Packet Capture). When I Packet Capture doesn’t running traffic is working fine (GREAT)

Problem

The pinned methode is working “fine” the problem is if my certificat will be renewal , I always have to update my CER file in my app, and this is the problem. I’m not able to find the solution by myself.

I talked to the support of my host, and I can’t see the details in there certbot (for the --reuse-key option link).

Can anyone give me tips for a encrypted traffic, that prevent man in the middle attack in a cordova app? Thanks !

Posts: 2

Participants: 2

Read full topic

Mobile browser testing from serve

Trying of loading contact on ios its not working

$
0
0

@Faraon wrote:

Hi, im using corodva plugin contacts and ionic-native/contacts to load all phone contacts. Its working in android but in ios is asking the permission but not load anything

Posts: 1

Participants: 1

Read full topic


Http clear text traffic not permitted

$
0
0

@OSY wrote:

Hi everyone,
I have a serious problem with http native in android 9 and 10 i have clear text traffic not permitted error even i have this command true on my network security config, should i do special thing more or where is my fault?
Best regard

Posts: 1

Participants: 1

Read full topic

Ionic 5: new project - update package-dependencies

$
0
0

@Incubbus wrote:

So i did just install ionic 5 and did create a new project and ran npm outdated.

Result:

@angular-devkit/build-angular      0.803.25  0.803.25  0.900.3  myvelo
@angular/cli                         8.3.25    8.3.25    9.0.3  myvelo
@angular/common                      8.2.14    8.2.14    9.0.2  myvelo
@angular/compiler                    8.2.14    8.2.14    9.0.2  myvelo
@angular/compiler-cli                8.2.14    8.2.14    9.0.2  myvelo
@angular/core                        8.2.14    8.2.14    9.0.2  myvelo
@angular/forms                       8.2.14    8.2.14    9.0.2  myvelo
@angular/language-service            8.2.14    8.2.14    9.0.2  myvelo
@angular/platform-browser            8.2.14    8.2.14    9.0.2  myvelo
@angular/platform-browser-dynamic    8.2.14    8.2.14    9.0.2  myvelo
@angular/router                      8.2.14    8.2.14    9.0.2  myvelo
@types/jasmine                       3.3.16    3.3.16    3.5.6  myvelo
@types/node                           8.9.5     8.9.5   13.7.4  myvelo
core-js                              2.6.11    2.6.11    3.6.4  myvelo
jasmine-core                          3.4.0     3.4.0    3.5.0  myvelo
karma                                 4.1.0     4.1.0    4.4.1  myvelo
karma-chrome-launcher                 2.2.0     2.2.0    3.1.0  myvelo
karma-coverage-istanbul-reporter      2.0.6     2.0.6    2.1.1  myvelo
karma-jasmine                         2.0.1     2.0.1    3.1.1  myvelo
ts-node                               7.0.1     7.0.1    8.6.2  myvelo
tslint                               5.15.0    5.15.0    6.0.0  myvelo
typescript                            3.4.5     3.4.5    3.8.2  myvelo
zone.js

Once i read that since ionic 4, ionic was supposed to be framework agnostic and one could update leverage the latest typescript and angular features.

So my question is: does this still stand? Can i upgrade all those packages and will it still run?.. Or was this just false advertising? (Actually, i’m only interested in updating typescript and angular)

Posts: 1

Participants: 1

Read full topic

Firebase analytics with Ionic4, which plugin to choose?

Problem producing my app

$
0
0

@Juan186 wrote:

My app works perfect if I run it with the command ionic cordova run browser --l but I try to make the app with ionic build --prod, I get the following error:

ERROR in : Cannot determine the module for class UiComponent in E:/ionic/myApp/src/app/common/ui/ui.component.ts! Add UiComponent to the NgModule to fix it.
Cannot determine the module for class LocationPipe in E:/ionic/myApp/src/app/location.pipe.ts! Add LocationPipe to the NgModule to fix it.

My app.module.ts

import { NgModule } from ‘@angular/core’;

import { BrowserModule } from ‘@angular/platform-browser’;

import { RouteReuseStrategy } from ‘@angular/router’;

import { Globalization } from ‘@ionic-native/globalization/ngx’;

import { IonicModule, IonicRouteStrategy } from ‘@ionic/angular’;

import { SplashScreen } from ‘@ionic-native/splash-screen/ngx’;

import { StatusBar } from ‘@ionic-native/status-bar/ngx’;

import { AppRoutingModule } from ‘./app-routing.module’;

import { AppComponent } from ‘./app.component’;

import { HttpClient, HttpHandler, HttpClientModule } from ‘@angular/common/http’;

import { TranslateHttpLoader } from ‘@ngx-translate/http-loader’;

import { TranslateModule, TranslateLoader, TranslateService } from ‘@ngx-translate/core’;

import { AuthGuardService } from ‘./services/auth-guard.service’;

import { AuthService } from ‘./services/auth.service’;

import { NativeStorage } from ‘@ionic-native/native-storage/ngx’;

import { GooglePlus } from ‘@ionic-native/google-plus/ngx’;

import { LocationPipe } from ‘./location.pipe’;

import { Map, latLng, tileLayer, Layer, marker } from ‘leaflet’;

import { PopovercomponentPageModule } from ‘./popover/popovercomponent/popovercomponent.module’;

import { AngularFireModule } from ‘angularfire2’;

import { environment } from ‘…/environments/environment’;

import { AngularFirestoreModule } from ‘angularfire2/firestore’;

import { UiComponent } from ‘./common/ui/ui.component’;

export function HttpLoaderFactory(http: HttpClient) {

return new TranslateHttpLoader(http, “./assets/i18n/”, “.json”);

}

@NgModule({

declarations: [AppComponent],

entryComponents: ,

imports: [

BrowserModule,

IonicModule.forRoot(),

AppRoutingModule,

HttpClientModule,

AngularFireModule.initializeApp(environment.firebase),

AngularFirestoreModule,

TranslateModule.forRoot({

  loader: {

    provide: TranslateLoader,

    useFactory: (HttpLoaderFactory),

    deps: [HttpClient]

  },

}),

PopovercomponentPageModule],

providers: [

GooglePlus,

NativeStorage,

AuthGuardService,

AuthService,

TranslateService,

HttpClient,

HttpClientModule,



StatusBar,

SplashScreen,

{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },

Globalization

],

bootstrap: [AppComponent]

})

export class AppModule { }

I’ve tried also to add it to providers or imports.

Posts: 1

Participants: 1

Read full topic

Cordova is not available in PWA

$
0
0

@Juan186 wrote:

I’ve produced my app and I’ve desplegated on firebase, but I’ve the following warnings, and plugins doesn’t work.

image

Compiling in local with command ionic cordova run browser --l works perfect

Posts: 1

Participants: 1

Read full topic

Viewing all 71012 articles
Browse latest View live