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

Unsupported APIs warning in play store for ionic 5

$
0
0

Hi Team,
I am getting below unsupported API error from google play store how to resolve the issue.
Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z
I am getting below error

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredMethodInternal(Native Method)
at java.lang.Class.getMethod(Class.java:2064)
at java.lang.Class.getDeclaredMethod(Class.java:2047)
at aLZ.a(PG:11)
at aMw.a(PG:11)
at aMa.a(PG:43)
at cBg.(PG:4)
at cAx.run(PG:9)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)

Thanks in advance.

Regards,
Ramji

1 post - 1 participant

Read full topic


IonSlides with useState

$
0
0

Hi, i have this code.

<IonSlides key="elSlide" pager={true} options={slideOpts}>
                    {infoDeportista.imagenes.map((imagen) => {
                      return (
                        <IonSlide
                          onClick={() => {
                            setInfoDeportista({
                              ...infoDeportista,
                              imagenes: infoDeportista.imagenes?.filter(
                                (foto) => foto.id !== imagen.id
                              ),
                            });
                          }}
                          key={String(imagen.id)}
                          style={{ position: "relative" }}
                          className="ion-padding"
                        >
                          <img className="bordeRedondo" src={imagen.url}></img>
                        </IonSlide>
                      );
                    })}
                  </IonSlides>

I want that when i click on the slide, the slider disappear. but im getting this error.
Uncaught DOMException: Node.removeChild: The node to be removed is not a child of this node
Only happens with the ionSlide… if i remove it works fine… greetings

1 post - 1 participant

Read full topic

iPhones Notch

$
0
0

Notch on iphones is partially obstructing the app. Whats the best way of handling this?

I tried this but no luck

Screenshot 2020-10-14 at 12.43.36

1 post - 1 participant

Read full topic

Error in iOS Build with cordova-plugins

$
0
0

I’m trying to build my app with the latest cordova-ios version 6.1.1 to include the latest status-bar plugin to overcome the issue where the status bar overlays the cordova app after returning from the camera, however I am getting a build error due to what appears to be old plugin code for the file transfer plugin:

[12:34:24]: ▸ Compiling CDVFileTransfer.m
[12:34:24]: ▸ :warning: /Users/ionic/builds/schlackl/MyFieldApp/platforms/ios/My Field App/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m:98:36: ‘stringByAddingPercentEscapesUsingEncoding:’ is deprecated: first deprecated in iOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid. [-Wdeprecated-declarations]
[12:34:24]: ▸ pathComponent = [pathComponent stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[12:34:24]: ▸ ^
[12:34:24]: ▸ :x: /Users/ionic/builds/schlackl/MyFieldApp/platforms/ios/My Field App/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m:107:49: no known instance method for selector ‘userAgent’
[12:34:24]: ▸ NSString* userAgent = [self.commandDelegate userAgent];

I have found posts online stating this issue was fixed in a plugin update however I am not sure how to force appflow to use the latest plugin version during the build.

I’ve tried with latest build stack in AppFlow:
| Node.js version | v12.18.3 |
| Cordova CLI version | 10.0.0 |
| npm version | 6.14.6 |
| macOS version | 10.15.6 |
| Xcode version | Xcode 12.0 |

However, no luck as I get the same build error regardless of what build stack I use. Any thoughts on how to ensure the latest plugins are fetched and used for my build? Can I force this in config.xml perhaps?

1 post - 1 participant

Read full topic

FCM Push notification redirect/navigate not working when App Killed

$
0
0

Hi All,

I am using Push notification with Firebase using cordova-plugin-fcm-with-dependecy-updated taking examples from documentation https://ionicframework.com/docs/native/fcm

I have also created Rest API using Firebase. Below is the code for rest API

$msg = array
		(
			'body' 	=> "Body Message",
			'title'	=> "Title",
			'icon'	=> 'myicon',/*Default Icon*/
			'sound' => 'mySound',/*Default sound*/
		       'click_action' => 'FCM_PLUGIN_ACTIVITY'		
		);
		
		$data1=array
		(
			'dataorderid' => 'Order Number'
		 );
		
		
		$fields = array
		(
			'registration_ids' => 'FCM Token',
			'notification'	=> $msg,
			'data' => $data1
		);
		
		$headers = array
		(
			'Authorization: key=' . API_ACCESS_KEY,
			'Content-Type: application/json'
		);
#Send Reponse To FireBase Server	
		$ch = curl_init();
		curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );
		curl_setopt( $ch,CURLOPT_POST, true );
		curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
		curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
		curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
		print_r(curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) ));
		$result = curl_exec($ch );
		curl_close( $ch );

Above code is working fine and sending notification to APP. However, when app is killed and i tap on notification message it does NOT redirect to the intended screen.
It is working fine and redirecting to intended screen if APP is in background or foreground.

Below is the code in my app.component.ts where it’s subscribing.

initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();
	  this.fcm.getToken().then(token => {
		//sending to fcm
	  });
	  
	this.fcm.onNotification().subscribe(data => {

    if (data.wasTapped) {

      console.log('Received in background');
	 this.router.navigate(['/location',{locationdata:data.dataorderid}],{ replaceUrl: true });

    } else {

         console.log('Received in foreground');
	 this.router.navigate(['/location',{locationdata:data.dataorderid}],{ replaceUrl: true });
    }

  });  
	  
	  
    });
  }

Only problem, i am facing is that when App is killed and receive notification, i tap on that notification, it’s just opening the App and showing home screen but it has to navigate to some other screen. When app is closed in background or in foreground, its working perfectly.
What can be the problem here? Please help.

Below is my Ionic’s environment details.

Ionic:

   ionic (Ionic CLI)             : 4.11.0 (C:\Users\USERNAME\AppData\Roaming\nvm\v10.16.3\node_modules\ionic)
   Ionic Framework               : @ionic/angular 5.3.2
   @angular-devkit/build-angular : 0.1000.8
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 2.3.3

Cordova:

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

System:

   NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 7

Please guide or help me to sort out this problem App navigate to intended screen even it’s killed.

Thanks,
Zack

1 post - 1 participant

Read full topic

Capacitor Error when building Cordova App

$
0
0

I want to build an App on Appflow as Cordova Project, but its beeing detected as Capacitor Project, can you tell me how I can change it? I only used “ionic integrations add cordova” and “ionic integrations disable capacitor”

1 post - 1 participant

Read full topic

Searchbar display problems

$
0
0

Hi guys,

i have a problem with the searchbar i made. Somehow it can search and filter elements, but when I delete the data in the searchbar, it doesn’t show anything anymore. However, I want to display the elements that are there at the beginning (see picture 1).

here you can see that it basically works:
searchba2r

my .ts

export interface ProjProperties {
  id: number;
  applicants: string;
  title: string;
  numParticipants: number;
  description: string;
  modified: number;
  enrol: string;
  // email: string[];
}
  items: ProjProperties[] = [];

  searchProjectData(projEvent: any){
    const projVal = projEvent.target.value;
    if (projVal && projVal.trim() !== '')
    {
      this.items = this.items.filter(item => {
        return item.title.toLowerCase().indexOf(projVal.trim().toLowerCase()) > -1;
      });
    } 
}

my .html

<ion-searchbar (ionChange)="searchProjectData($event)" placeholder="Search an Title"></ion-searchbar>

if you need some more Information please tell me.

1 post - 1 participant

Read full topic

Ion-toggle's ionChange is triggered on page load (ionic 5)

$
0
0

Hi there,

I believe ion-toggle’s ionChange is triggered on page load on ionic 5, if the page is opened on a second time. I saw another bug report on ionic 3 which occurred while the form was populated. Likely it’s related.

Steps to reproduce:

  1. Open the page
  2. Click back
  3. Open the page again (bug occurs here).

The code

<ion-list *ngIf="settingsData">
	<ion-item *ngFor="let s of settingsData.getKeys()" detail="false">
		<ion-label>{{s}}</ion-label>
		<ion-toggle [(ngModel)]="settingsData[s]" (ionChange)="settingChanged(s)"></ion-toggle>
	</ion-item>
</ion-list>
public async ngOnInit(){
	this.settingsData = await timer(100).toPromise().then( () => ({ 
		label_1: true,
		label_2: true,
		label_3: true 
	}) );
}
public settingChanged(settingKey: string) {
	console.log("changed: "+settingKey);
}

The environment

$ ionic info

Ionic:

   Ionic CLI                     : 6.11.0 (/home/vagrant/.config/yarn/global/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.3.1
   @angular-devkit/build-angular : 0.1000.6
   @angular-devkit/schematics    : 10.0.6
   @angular/cli                  : 10.0.6
   @ionic/angular-toolkit        : 2.3.0

Capacitor:

   Capacitor CLI   : 2.4.0
   @capacitor/core : 2.4.0

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.1.0) : 1.0.0

System:

   NodeJS : v12.18.3 (/home/vagrant/.nvm/versions/node/v12.18.3/bin/node)
   npm    : 6.14.6
   OS     : Linux 4.9

1 post - 1 participant

Read full topic


Problem with loading my API service on the phone

$
0
0

I am using Angular with my IONIC application, but I have a problem.
Create a service to request data to my API, everything works fine on my computer it does it great. But when compiling for android, when I install the APK and test my application the service does not work. What should I do? I’ve been searching but I can’t find the solution.

Now that same service is loaded in another component and if it works, what is happening because I have no idea.

My component where I try to load the service but it works on PC but not on mobile device:

"Usuario" It is my service where I establish the connection with my API.
"datausr" Where I save the data that the API returns, for example “Nombre”.

import { Component, OnInit } from '@angular/core';
import {ModalController} from '@ionic/angular';
import {Usuario} from '../service/user.service';
import { TokenService } from '../service/token.service';
import {EditperfilComponent} from '../editperfil/editperfil.component';
@Component({
  selector: 'app-perfil',
  templateUrl: './perfil.component.html',
  styleUrls: ['./perfil.component.scss'],
  providers:[Usuario]
})

export class PerfilComponent implements OnInit {
  usuario:any;

  datausr:any;

  constructor(

    public user:Usuario,

    public tokenService:TokenService,

    private modalController: ModalController

  ) { }

  ngOnInit() {
   this.loaddata();
  }
  loaddata(){
    this.usuario =this.tokenService.getUserName();
    this.user.getuserdetail(this.usuario).subscribe(
      result =>{
        if (result.Mensaje == 'ok') {
        this.datausr=result.Data;
        }else{
        }
      },
      error=>{
        console.log(<any>error);
      }
    );
  }
}

Now when I try to print that value in my ionic view, on PC it works normal, but on my device it does not load or does not execute the function “loaddata ()” or it may be that what it does not execute is "this.user.getuserdetail ( this.user) .subscribe () "

Can someone tell me what is happening or is it something I need to know or do before.

2 posts - 2 participants

Read full topic

Apostrophe in http request

$
0
0

Hi everyone, I’ve got a problem with my application developed with ionic 3.
When I send a string that contains apostophe to my server with ionic-native-http plugin get me back an error. My server was made in php and when it receives the data I use this function for accept the apostrophe:

mysqli_real_escape_string($conn,$_GET['param']); 

With postman it works fine, but if I send the string with the application throw me an exception.
The function in the application is this:

inviaDati(){
    this.http.get('https://domain.com', {req: 'regDitta', param: "the ' string"}, {})
    .then(data => { //not here
      if(data.data == 0){ 
        alert("registrazione effettuata")
      }else{
        alert("errore");
      }
    },
    error => alert("error")) // it always gives me back this error;
  }

I have to encode the string? How can I do that?
Thank you all,
Elia

2 posts - 2 participants

Read full topic

App ionic in web server

$
0
0

Hi.
I have an ionic / cordova app developed and distributed for mobile devices.
Is it possible to run that application inside a web server like Apache or ISS?
How?
Thank you.

1 post - 1 participant

Read full topic

Access Capacitor bridge from iOS App Delegate

$
0
0

Hey there,

I am integrating OneSignal native code into a capacitor app.
I’m using the Quasar Framework, which uses Capacitor.

I can receive notifications and process them on the swift side of things. My receive-notification-logic resides in AppDelegate file.

I now want to pass the notification data over to Capacitor. So when the user logs in, I can retrieve his/her/their OneSignal id and send it to my API.
Or the other way around: When AppDelegate knows the OneSignal ID, trigger an event so the bridge can listen to this and send it via event or in a window variable to the Vue code.

Is there any way to achieve this?
I would be very grateful for any help.

Best regards
Nick

1 post - 1 participant

Read full topic

UI Font breaks in Hybrid App

$
0
0

Hi,
We have developed a Hybrid App using Ionic5. For all the display of text, we have used PX (pixels) and vmin as the font units. When the Font is changed to XL or XXL in the device display / font settings, the sizes in the Hybrid App also changes and as a result, the UI is breaking giving a bad experience to the customer.

Please let us know any input for this.

Thanks in advance!

1 post - 1 participant

Read full topic

Top Gardening Tips Every Beginners Must Know in 2020

$
0
0
  1. MEASUREMENT OF AREA

Different people have different type of home like some people have small house but others have spacious home. At that time it is important to measure the space if you want to do best gardening in your home.

  1. TEST YOUR SOIL

To be a good gardener, soil test is must because planting without testing your soil is like you driving a car without having knowledge about the destination. If you do not know about the quality of soil then you will not able to know that what kind of plants is suitable for your zone.

  1. CHOOSE PLANTS CAREFULLY

Firstly, Select plants consciously are the best tips for gardening because although it is the choice of an individual still one should be aware of it. Choose plants according to the space and according to the quality of soil.

  1. PREFER SEASONABLE PLANTS

If you are new in gardening and looking for home gardening tips then it is highly recommended to you to make your first preference seasonable plants only. These plants are really comfortable to grow as it does not need that much care and attention.

  1. PERFECT PLANTS FOR BEGINNERS

There are some plants that do not take much effort to grow and people who have not any or little information about plan can also grow in their homes. For example: Mint, Cherry tomatoes, knockout Rose, Rosemary etc

for more details: pots for plants

1 post - 1 participant

Read full topic

HTML Injection in ion-input

$
0
0

Hello all, I develop a demo app where user can create a post by providing following inputs(ion-input type=“text”).

While testing some user will type some HTML scripting and the result you can see on attached image.

So my question is how can we prevent this type of inputs in ionic ?

1 post - 1 participant

Read full topic


Use a different package name because "io.ionic.starter" already exists in Google Play

$
0
0

after the build i see config.xml file in android/src/main/res/xml .
but there are no changes in the file. Also, do we expect changes in the androidManifest.xml file? I do not see changes in that?
I changed the config.xml file in the ionic root folder but no still after doing ionic build ,copy,sync i get same error in the google play store of the package name

1 post - 1 participant

Read full topic

Ionic & LambdaTest Integration

$
0
0

Would love to see ionic & LambdaTest integration in the same capacity that you offer with Sauce Labs & Browserstack.

1 post - 1 participant

Read full topic

Error while Building App with Appflow

$
0
0

I got this error when building the App with Appflow and I just dont know the mistake.

Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
  The number of method references in a .dex file cannot exceed 64K.

This happens before the Errorlog:

/root/.gradle/caches/transforms-1/files-1.1/firebase-perf-19.0.9.aar/5a9a6eb839fc4fee62e2cf36a5d2698d/jars/classes.jar: D8: Interface `org.apache.http.client.ResponseHandler` not found. It's needed to make sure desugaring of `com.google.firebase.perf.network.InstrumentApacheHttpResponseHandler` is correct. Desugaring will assume that this interface has no default method.
/root/.gradle/caches/transforms-1/files-1.1/play-services-analytics-impl-17.0.0.aar/ff27fabb63a110c28e81fc3acd2f44ff/jars/classes.jar: D8: Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.gtm.zztx$zza.zza(long, byte)`
> Task :app:transformClassesWithDexBuilderForDebug

/root/.gradle/caches/transforms-1/files-1.1/play-services-clearcut-17.0.0.aar/fceee3be57068b69cc11156ead9d65e7/jars/classes.jar: D8: Type `libcore.io.Memory` was not found, it is required for default or static interface methods desugaring of `void com.google.android.gms.internal.clearcut.zzfd$zzb.zza(long, byte)`
/root/.gradle/caches/transforms-1/files-1.1/core-1.3.0.aar/5a1332a3abef8d50fb24fad3cdb7afa9/jars/classes.jar: D8: Type `android.graphics.Insets` was not found, it is required for default or static interface methods desugaring of `android.graphics.Insets androidx.core.graphics.Insets.toPlatformInsets()`
/root/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.12.1/dc6d02e4e68514eff5631963e28ca7742ac69efe/okhttp-3.12.1.jar: D8: Type `org.conscrypt.Conscrypt` was not found, it is required for default or static interface methods desugaring of `java.security.Provider okhttp3.internal.platform.ConscryptPlatform.getProvider()`
/root/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/28.1-android/c2526f8fad32a65a6d7032dd8e9524eb276b108b/guava-28.1-android.jar: D8: Type `sun.misc.Unsafe` was not found, it is required for default or static interface methods desugaring of `void com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper.<clinit>()`

> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
D8: Cannot fit requested classes in a single dex file (# methods: 124045 > 65536)

1 post - 1 participant

Read full topic

Ionic 3 switching to WKWebView CORS time

$
0
0

Was hoping this would be smooth.
Because of remote working I was trying to find a way to test CORS just on the server side. The only thing that came up was run a Curl statement and see if headers are returned.

On a local version of the server added the following. (Some test code)

String origin = this.request.getHeader("Origin");
        
        log.debug("Mobile Origin is " + origin);
        
        this.response.setHeader("Access-Control-Allow-Origin", origin);
...

Ran curl against it and saw the headers returned.

Move the code up to a server that could access from an iphone. The iphone has the update web view code.

Problems I’m having:
In debugging the iphone through Safari
I get the error "“Origin ionic://localhost is not allow by Access-Control-Allow-Origin”
"XMLHttpRequest cannot load https://dev.example.com/jsonws/login due to access control checks. "

Bug checking the server log output the Origin that is showing up is “https://dev.example.com” not ionic:localhost ?
Confused what is going on or where to fix it.
Added in allow-navigation href=“ionic://localhost” in config.xml but seems like that isn’t needed.

Where to do from here?

Thanks

2 posts - 1 participant

Read full topic

Is it that hard to print in a thermal printer?

$
0
0

Hello,

I’m currently developing an app where you generate a label in format PDF (I store it in base64 on the database), and then I want to print directly that document in a thermal printer (Zebra D420).

I made a really hard research and I tried a lot, but nothing worked for me. I tried integrate with the API of Zebra but they don’t print PDFs throught the API, also tried a couple of cordova plugins but also never achieve to work… Currently I’m trying to print through bluetooth but I’m struggilng to print the PDF instead of plain text.

I just wanted to know if is that hard to print a PDF in a thermal print because when I do it on Chrome is so easy and also Zebra has an applicattion where you can print what ever you want. Why I can’t send a ByteArray or something to the printer through the IP and Port and print? Will be so easy and awesome.

Any ideas to print PDFs in the app to the thermal printer? The easiest way… also if you have any reference project or something.

1 post - 1 participant

Read full topic

Viewing all 71221 articles
Browse latest View live


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