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

Ionic3 - LocalNotification onclick function

$
0
0

@KiMxne wrote:

Hello guys ! I’m trying to learn Ionic to make an app. At the moment I’m stuck with Local Notifications. So what I am trying is when you get a Notification and click on it, you should be redirected to another page. Only nothing is happening so far. I have searched the internet for a solution, yet nothing so far have helped…

I followed the docs for Local Notifications : https://ionicframework.com/docs/native/local-notifications/ .
Scheduling a notification is not a problem. Only Onclick.

  this.localNotifications.schedule({
    id: 1,
    title: msg.title,
    text: msg.body
  });

When I try this, nothing happens. No console Log, nothing…

  this.localNotifications.on('click').subscribe(notification => {
    // Logic here
    console.log("Notification Clicked");
    this.nav.setRoot(BerichtenPage);
  });

Other thing I tried, but with this one, I get an error :
‘Expected 1 arguments, but got 2.’

 this.localNotifications.on('click',(notification, state)=> {
    // Logic here
  });

So I’m completely clueless, I hope you guys can help me further with this problem :slight_smile:

Posts: 1

Participants: 1

Read full topic


[STRIPE/PAYMENT] - Understand security token design

$
0
0

@gawel02 wrote:

Hi,
I have simple question about security design with Ionic. For this question i used “Stripe” plugin as exemple :
For used Stripe you need to set a private api TOKEN on Ionic application. This token is very important because you can create new payments if you are succefully autenticated.
So, it’s very easy to decompile Ionic app and every body can read this token…
How resolve this security breach?

That all ^^
Thank you for your answer.

Resources :

  • Plugins exemple :

Posts: 1

Participants: 1

Read full topic

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

Ionic Native Geo Coder And Google API's

$
0
0

@ashokInceptive wrote:

Can ionic-native/geo coder asks for google API’s or payment after certain amount of time or daily quota is more for calling geo coder methods?

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: 2

Participants: 2

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: 1

Participants: 1

Read full topic

Viewing all 70440 articles
Browse latest View live


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