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

Unique device id android

$
0
0

@Vartex05 wrote:

Hi, in my app, iam using android uuid for licensing, and i get it via device plugin. Is this Id reliable, or it can change? There are some mixed answers on this topic, so i would like to clarify this. Ir is there any other plugin, that i can use for getting really unique id device id, that doesnt change?

Posts: 1

Participants: 1

Read full topic


Strange behavior of my ionic app

$
0
0

@blondie63 wrote:

I’m developing a new app, i create build for ios and android working fine
When i make some chnages i increase version number that i see on setting page
The strange thing is this:
on device i run app, i go to setting page and see version 0.9.2 (latest)
i kill app and reopen
now version is one very old (0.8.9) and really my app is old because i see some feature missing
if i unistall app and reinstall is the same
iso & android with same behavior

Someone has found similar problem ?
Thanks

Posts: 1

Participants: 1

Read full topic

iOS Https GET POST issue return 0

$
0
0

@dmlkl wrote:

Hello all,

I am new to Ionic. I am facing the problem when calling the API (https), it returns 0. After doing some research, I think it’s related to CORS.

The API requires to send Bearer token authorization in the header, thus, it causes the failure.

The API return success in both android phone and web browser, however, in the iOS device, it return 0, I had tried using ionic v4, ionic-native, HTTP, XMLHttpRequest and so on. All are working well in both android phone and web browser except iOS device. I had whitelisted the IP address, adding these kinds of header

headers.append('Access-Control-Allow-Origin' , '*');
headers.append('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT');
headers.append('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
headers.append('withCredentials', 'true');
headers.append('Access-Control-Allow-Credentials', 'true'); 
headers.append('Accept','application/json');
headers.append('Content-Type', 'application/json');

no luck at all. Spending two days on this, no result I can get. Anyone can provide a suggestion?

Thanks.

Posts: 1

Participants: 1

Read full topic

Ionic v4 dynamic images url doesn't work

$
0
0

@MaryCooperGD wrote:

In my app I’m doing this:

<ion-col *ngFor ="let place of intentList, let photo of photoList">
        <ion-card>
          <ion-card-content>
          <img class="img" src = "{{photo}}" (click)="clickedImage(place.intent)">
          <div>{{place.val}}</div>
          </ion-card-content>
        </ion-card>
      </ion-col>

the array photoList contains strings with different photo url. This is the array:

this.photoList = ["./assets/images/001-breakfast.png", "./assets/images/002-brunch.png", "./assets/images/003-sandwich.png",
      "./assets/images/004-food.png", "./assets/images/005-dinner.png", "./assets/images/006-cake.png", "./assets/images/007-cocktail.png"]

But this is what my app looks like:

23

Posts: 1

Participants: 1

Read full topic

Is there any solution for not to create en.json file and translate each word

$
0
0

@sdhupe19 wrote:

I want to make a multi-language app .i am using @ngx-translate but it needs each word to be translated separately.is there any solution for not to write translation of each word?

Posts: 1

Participants: 1

Read full topic

Where to install dependencies when creating a Module

$
0
0

@Kyrax80 wrote:

Hello, I am creating an Ionic project and I’m wondering what dependencies I should set for productions and which for development in the package.json

Do I need to put dependencies such as @ionic-native-… ionic-angular, @angular- in production dependencies of my module? If so, why? Or why not?

As I understand it if I put it in the production dependencies my module will always work in any Ionic version, for example?

Thanks.

Posts: 1

Participants: 1

Read full topic

Is VirtualScroll and Filtering finally working in Ionic 4?

$
0
0

@shiziluosidao wrote:

Does migrating from Ionic 3 to 4 make sense here?
Our app uses VirtualScroll for lists and allows filtering by substring.
In Ionic 3 this never really worked, to reproduce just scroll down and then filter.
The VirtualScroll list just goes all white instead of showing the filtered elements.
When scrolling manually in Chrome desktop it worked again but this is not good for production use.

Has anyone tried this in Ionic 4 successfully?
Thanks for any hints!

Posts: 1

Participants: 1

Read full topic

Polyline are not draw in the map in ionic3?

$
0
0

@kapilsoni wrote:

Hi guys this is my first post in this site, I’m working in a App in Ionic 3 that shows current position in the map . as well click start track button we have to add polyline between the lat and lang. I want to draw a Polyline between this markers but i haven’t succeed yet. i know there are some ways to draw polylines my idea is to extract the lat, long coordinates of the marker, save them in a array and then set that as a “path” to draw the Polyline but im having problems with the creation of the array like in the comment below. here is my code:


  startTracking() {

    this.isTracking = true;
    this.trackedRoute = [];
 
    this.positionSubscription = this.geolocation.watchPosition()
      .pipe(
        filter((p) => p.coords !== undefined) //Filter Out Errors
      ).subscribe(data => {
        setTimeout(() => {
          this.trackedRoute.push({ lat: data.coords.latitude, lng: data.coords.longitude });
          this.redrawPath(this.trackedRoute);
        }, 0);
      });
  }
 
  redrawPath(path) {
    if (this.currentMapTrack) {
      this.currentMapTrack.setMap(null);
    }
 
    if (path.length > 1) {
      this.currentMapTrack = new google.maps.Polyline({
        path: path,
        geodesic: true,
        strokeColor: '#ff00ff',
        strokeOpacity: 1.0,
        strokeWeight: 3
      });
      this.currentMapTrack.setMap(this.map);
    }
  }```


Html section 
``` <div #map id="map"></div>

Posts: 1

Participants: 1

Read full topic


PARSE response into ion-item

$
0
0

@tomeskrt1 wrote:

I have this Response from an http get and I need it to be parsed and displayed only the body row per row for each wifi name.

Response {_body: “iPhone di Traian,-27;RGI-Guest,-75;SYSMAN,-61;OneP…F,-82;iPhone de Monsieur SASSI,-82;PinkFloyd,-65;”, status: 200, ok: true, statusText: “OK”, headers: Headers, …}

WIFI NAME AND SIGNAL for each line, this is my code:

wifiScan() {
    this.http.get('http://192.168.4.1/scan')
    .subscribe(data => {
        console.log(data);
    });
  }

And my html looks like this:

<ion-content padding>
  <ion-item *ngFor="let wifi of wifiList">
    {{wifi.wifiList}}
</ion-item>
</ion-content>

How can I solve this?

Posts: 1

Participants: 1

Read full topic

Picture in picture mode in ionic

$
0
0

@immersegolf wrote:

HI, I have created a WhatsApp like app in ionic which allows the user to chat, video call and share files. I would like to add the feature where the user can minimize the video calling screen to a corner of the screen and do the regular chat. Like we can do in WhatsApp. My question is, is it possible to create a picture in picture mode in the ionic app? Any guidance would be of great help.

Posts: 1

Participants: 1

Read full topic

Pull to refresh on Ionic algolia instant search

$
0
0

@newbiefireboy wrote:

implemented an Angular Algolia Instant Search on Ionic 4 and wanted to use the ion refresher to new list of items. Is it possible to update a certain div element? for example update the ng-template again?

I already tried location.reload() but i dont want to reload the whole page.

This is on my HTML:

 <ais-hits>
        <ng-template let-hits="hits">
          <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
            <ion-refresher-content
              pullingIcon="arrow-dropdown"
              pullingText="Pull to refresh"
              refreshingSpinner="circles"
              refreshingText="Refreshing..."
            >
            </ion-refresher-content>
          </ion-refresher>

          <div *ngFor="let item of hits">
            <ion-card (click)="displayItem(item)">
              <ion-item>
                <ion-label>{{ item.name}}</ion-label>
              </ion-item>
            </ion-card>
          </div>
        </ng-template>
      </ais-hits>

On my Ts:

doRefresh(event) {
    location.reload();
    event.target.complete();
  }

Posts: 1

Participants: 1

Read full topic

Unexpected token < in JSON at position 0

$
0
0

@kadi60 wrote:

Hi everybody , I hope everything is Ok
I have a probleme sendind and updating data to sql satabase , I use I ionic3 and php and http post method , when I send data I get the error

ERROR SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at Response.Body.json (http.js:1091)
at MapSubscriber.project (sos.ts:90)
at MapSubscriber._next (map.js:79)
at MapSubscriber.Subscriber.next (Subscriber.js:93)
at XMLHttpRequest.onLoad (http.js:1591)
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.js:4751)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)

my codes are like that :

the provider code

sendData(DATE,lat,LNG,ETATALERT_ID,idUser){

this.url  = "http://192.168.1.182/SOSMobile/GestionAlertes.php?action=envoyerAlerte";

let param = {DATE:DATE,lat:lat,LNG:LNG,ETATALERT_ID:ETATALERT_ID,idUser:idUser}

let type: string = “application/x-www-form-urlencoded; charset=UTF-8”,
headers: any = new Headers({‘Content-Type’: type}),
options: any = new RequestOptions({headers: headers});

return this.http.post(this.url, param,options).map(res => res.json());

}

home.ts

sendData(){

let date = new Date();

this.time =this.datepipe.transform(date, 'yyyy-MM-dd HH:mm');
console.log(this.time.toLocaleString());

//this.sosProvider.LancerAlerte('',this.time,this.latitude,this.longitude,1,'',localStorage.getItem('id'))


console.log(this.longitude);

console.log(this.latitude);

  this.sosProvider.sendData(this.time.toLocaleString(),this.latitude,this.longitude,1,localStorage.getItem('idUser'))
    .subscribe((data) => {
      // If the request was successful notify the user
      this.ResultatAlerte =data
      if (this.ResultatAlerte.CreationKO != null) {

        this.presentToast("Echec d'envoi d'Alerte") ;

        // this.presentToast("Login ou Mot de Passe Non Correct , Merci de résseyer");

      }

      else {
        console.log('here is the error')
        this.AlerteID=this.ResultatAlerte.CreationOK
        console.log( this.AlerteID) ;
        this.getListUrgences();
        this.etape2=true;


      }


    });

}

php file

rest_json = file_get_contents("php://input"); _POST= json_decode($rest_json, true);

$COMMENTAIRE=$_POST["COMMENTAIRE"] ;	
$DATE=$_POST["DATE"] ;
$lat=$_POST["lat"] ;
$LNG=$_POST["LNG"] ;
$ETATALERT_ID=$_POST["ETATALERT_ID"] ;
$URGENCE_ID=$_POST["URGENCE_ID"] ;
$idUser=$_POST["idUser"] ;		
$gravite_alerte=$_POST["gravite_alerte"] ;	
$AutreAlerte=$_POST["AutreAlerte"] ;	
    $PiecesJointes=$_POST["PiecesJointes"] ;

	
//	$stmt = $db->prepare("INSERT INTO alerte (COMMENTAIRE, DATE, LAT, LNG, ETATALERT_ID, URGENCE_ID, UTILISATEUR_ID) 
	//VALUES(:COMMENTAIRE, :DATE, :lat,:LNG,:ETATALERT_ID,:URGENCE_ID,:idUser)");
	
	
	$stmt = $db->prepare("INSERT INTO alerte (COMMENTAIRE, DATE, LAT, LNG, ETATALERT_ID, URGENCE_ID, UTILISATEUR_ID,gravite_alerte,AutreAlerte,PiecesJointes) 
	VALUES(:COMMENTAIRE, :DATE, :lat,:LNG,:ETATALERT_ID,:URGENCE_ID,:idUser,:gravite_alerte,:AutreAlerte,:PiecesJointes)");

 $stmt->bindParam(':COMMENTAIRE', $COMMENTAIRE);
 $stmt->bindParam(':DATE', $DATE);
 $stmt->bindParam(':lat', $lat);
 $stmt->bindParam(':LNG', $LNG);
 $stmt->bindParam(':ETATALERT_ID', $ETATALERT_ID);
 $stmt->bindParam(':URGENCE_ID', $URGENCE_ID);
     $stmt->bindParam(':idUser', $idUser);
 $stmt->bindParam(':gravite_alerte', $gravite_alerte);
     $stmt->bindParam(':AutreAlerte', $AutreAlerte);
     $stmt->bindParam(':PiecesJointes', $PiecesJointes); 
 
 
 
 $status= $stmt->execute();
 
 $id="";
 if( $status===true)
 {
	
$stmt1 = $db->prepare("SELECT MAX(ID) as AlerteID FROM alerte");	
$row= $stmt1->execute();
$row=$stmt1->fetchAll();

 echo '{"CreationOK": ' . json_encode($row[0]["AlerteID"]) . '}';

 }

else{
	
	 echo '{"CreationKO": ' . json_encode("Erreur d'envoi d'Alerte") . '}';

	
}	

when I change map(res => res.json()); to map(res => res); the error disapear but data aren’t sent to the database , so data are not updated
when I use http get method it ok , everything is working .

can you please help it’s urgent

Posts: 1

Participants: 1

Read full topic

In-app purchasing!

$
0
0

@AlexTiga wrote:

Необходима помощь для установки внутренних покупок в готовом приложении сделанном на ionic v3 , желательно на русском. In-app purchasing!

Posts: 1

Participants: 1

Read full topic

Draw a rectangle on Image

$
0
0

@LOTFIGIPSY wrote:

i want a build a app for face detection in IONIC, i’am using Cloud vision API to detect faces, it returns four points for each face (x,y), present the vertex boundingpoly vertices.

now i want to draw a rectangle on each face.

can someone help.

this is my code :

const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.PNG,
mediaType: this.camera.MediaType.PICTURE
};

this.camera.getPicture(options).then((imageData) => {
this.base64Image = ‘data:image/png;base64,’ + imageData;
this.vision.getLabels(imageData).subscribe((result) => {
this.response = result.json().responses[0];
console.log('cloud vision response : ’ + JSON.stringify(this.response));

}, error2 => {
	console.log(' Error API : ' + error2);
});

}, (err) => {
// Handle error
console.log(’ Camera Error’);
});

<img [src]=“base64Image”/>

Posts: 1

Participants: 1

Read full topic

How to clear cache to make a "logout"?

$
0
0

@Manel00 wrote:

Hello everyone,

I’m doing a tutorial of Ionic but cannot get ride from my cache (im always logged in), but i want to do some “clear()” function at console on browser but it doesnt work, how to do that to play between the pages Login and Register? Thank you so much

Regards

Posts: 1

Participants: 1

Read full topic


Encrypting Data for Offline Use

$
0
0

@Eric_Horodyski wrote:

Since the last relevant (or at least similar) thread concerning encrypting user-data is from May '16, I thought it would make sense to revisit this subject 3 years later (coincidentally, it just so happens that I have a new security requirement!).

Background Info

The apps my organization builds have an offline mandate, dictating that as much of the app can be accessed offline as possible. To facilitate this, as part of the user’s initial authentication response, along with a long-lasting session token, we pass over user profile information needed for logic/UI and other app “secrets”, such as API keys.

This data needs to be encrypted when stored for offline use, as per my organization’s policy. We had achieved this using Intel’s Security plugin, which required no setup, came from a reputable source, and even was (still) endorsed by Microsoft.

This plugin is now dead. The Github repo has been taken down, so we need an alternative.

Encrypting/Decrypting User Profile Data in 2019?

I already have the decryption key value in my head, and understand that it will be stored as plaintext. This has been OK’d as an acceptable necessity.

That said, I’ve evaluated a few options but have concerns for each:

  1. WebCrypto – Complex to use, and would require a shim for iOS 10 which we still support.
  2. Native Plugins – No “big name” contributors, lots of plugins that haven’t been updated in ages or have side-effects that I can’t enforce with my app crowd, such as forcing an Android user to enable a lock screen to use an app.
  3. Javascript Libraries – Wondering if I can use Node’s crypto library, and if not, what is the overhead associated with them?

All three options share the same concern – performance. Since we encrypt API keys, they constantly need to be decrypted within the app. We do not keep API keys decrypted in memory for long, the biggest scope being a local method variable.

I can definitely use some advice, and see if anyone has any opinions/tips/experiences they can share.

TL;DR

  1. I need to encrypt certain values in my app so they work offline yet still meet our protocols.
  2. My current encryption plugin is dead. It didn’t require any setup and magically encrypted/decrypted values without needing keys.
  3. What options exist in 2019 that are performant to continuously encrypt/decrypt from device storage?

– thanks for reading

Posts: 1

Participants: 1

Read full topic

Google maps error v3

$
0
0

@lunneyd wrote:

defined is not an object (evaluating ‘new WEBPACK_IMPORTED_MODULE_2_google_maps[“google”].maps’) PlacesPage

I am getting this error when trying to go to places page.

First google was not recognised so I did npm install --save @types/googlemaps
Import

import {} from ‘googlemaps’;

but now getting this problem do not know what the problem is.

Posts: 2

Participants: 2

Read full topic

No console log output when running on device using Ionic 4?

$
0
0

@franzisk4sis wrote:

Hey all,

What happened that now when I run the app on debug mode on the the device I cannot see output on console anymore?

I just run:
% ionic cordova run android -lc

The apps runs on my Samsung device but none of my debug outputs are displayed on my terminal console (Mac computer), what I see is just Ionic outputs, something like:

...
[ng] Date: 2019-02-15T17:31:26.394Z
[ng] Hash: ae25cfd2ee8089660e5e
[ng] Time: 55056ms
[ng] chunk {common} common.js, common.js.map (common) 20.6 kB  [rendered]
[ng] chunk {cordova} cordova.js, cordova.js.map (cordova) 71.1 kB [entry] [rendered]
[ng] chunk {main} main.js, main.js.map (main) 72.1 kB [initial] [rendered]
[ng] chunk {pages-about-about-module} pages-about-about-module.js, pages-about-about-module.js.map (pages-about-about-module) 5.93 kB  [rendered]
[ng] chunk {pages-cards-cards-module} pages-cards-cards-module.js, pages-cards-cards-module.js.map (pages-cards-cards-module) 22.9 kB  [rendered]
[ng] chunk {pages-chats-chats-module} pages-chats-chats-module.js, pages-chats-chats-module.js.map (pages-chats-chats-module) 6.35 kB  [rendered]
[ng] chunk {pages-contacts-contacts-module} pages-contacts-contacts-module.js, pages-contacts-contacts-module.js.map (pages-contacts-contacts-module) 6.14 kB  [rendered]
[ng] chunk {pages-groups-details-details-module} pages-groups-details-details-module.js, pages-groups-details-details-module.js.map (pages-groups-details-details-module) 6.13 kB  [rendered]
[ng] chunk {pages-groups-groups-module} pages-groups-groups-module.js, pages-groups-groups-module.js.map (pages-groups-groups-module) 6.42 kB  [rendered]
[ng] chunk {pages-home-home-module} pages-home-home-module.js, pages-home-home-module.js.map (pages-home-home-module) 23.6 kB  [rendered]
[ng] chunk {pages-login-login-module} pages-login-login-module.js, pages-login-login-module.js.map (pages-login-login-module) 7.56 kB  [rendered]
[ng] chunk {pages-nearby-nearby-module} pages-nearby-nearby-module.js, pages-nearby-nearby-module.js.map (pages-nearby-nearby-module) 6.42 kB  [rendered]
[ng] chunk {pages-profile-profile-module} pages-profile-profile-module.js, pages-profile-profile-module.js.map (pages-profile-profile-module) 6.49 kB  [rendered]
[ng] chunk {pages-register-register-module} pages-register-register-module.js, pages-register-register-module.js.map (pages-register-register-module) 6.59 kB  [rendered]
[ng] chunk {pages-settings-settings-module} pages-settings-settings-module.js, pages-settings-settings-module.js.map (pages-settings-settings-module) 6.56 kB  [rendered]
[ng] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 236 kB [initial] [rendered]
[ng] chunk {runtime} runtime.js, runtime.js.map (runtime) 9.49 kB [entry] [rendered]
[ng] chunk {styles} styles.js, styles.js.map (styles) 400 kB [initial] [rendered]
[ng] chunk {tabs-tabs-module} tabs-tabs-module.js, tabs-tabs-module.js.map (tabs-tabs-module) 9.38 kB  [rendered]
[ng] chunk {vendor} vendor.js, vendor.js.map (vendor) 6.23 MB [initial] [rendered]
[INFO] ... and 173 additional chunks
[ng] ℹ 「wdm」: Compiled successfully.
[cordova]  LAUNCH SUCCESS

I really need to see those outputs, what can I do?

Posts: 1

Participants: 1

Read full topic

Adding platforms later in development (with Cordova)

$
0
0

@GrahamW wrote:

Hello!

I was just wondering if it was possible to add additional platforms later in development. An example of this would be, I just finished developing a UI outline for my application and have been testing it on android and the browser. Would I then be able to use a command such as ‘ionic cordova platform add ios’ to add iOS as a new platform? Or do the platforms of an app need to be determined at the beginning of development?

Thanks!

Posts: 2

Participants: 2

Read full topic

Ionic 4. How to programmaticaly navigate back with Angular Router

$
0
0

@EugeneVB wrote:

Hi, i’m making PWA, and I need navigate back (with back transitions) to custom route (not parent).
With button all works

<ion-button [routerLink]="['','someroute']" routerDirection="back">
        <ion-icon slot="icon-only" name="arrow-back"></ion-icon>
</ion-button>

But how can I do it with router.navigate()?
There is Location.back(), but it’s not good when current route was first (users can open my app not at root route, and Location.back() will return them to their history)

Posts: 1

Participants: 1

Read full topic

Viewing all 48980 articles
Browse latest View live


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