Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228551 articles
Browse latest View live

Location is not being sent when app is closed. Can anyone point out what i am missing?

$
0
0

I am working on an Ionic app. I am trying to send location in background every 1 hour. I am using official Background Geolocation plugin. Location is being sent when the app is open either in foreground or background but as soon as i close the app my location is not being sent to database. Although my debug mode is active and i can see toast message and beep sound even after closing app. Can anyone point out where i am making mistake? Here is my code.

{
platform.ready().then(() => {
this.getLocation();
this.backgroundGeolocation.start();
});
}

getLocation() {
const config: BackgroundGeolocationConfig = {
  locationProvider: this.backgroundGeolocation.LocationProvider.ANDROID_DISTANCE_FILTER_PROVIDER,
  desiredAccuracy: 10,
  stationaryRadius: 5,
  startOnBoot: true,
  notificationIconColor: '#4CAF50',
  interval: 5000,
  fastestInterval: 5000,
  activitiesInterval: 5000,
  distanceFilter: 5,

  debug: true, //  enable this hear sounds for background-geolocation life-cycle.
  stopOnTerminate: false, // enable this to clear background location settings when the app terminates
  stopOnStillActivity: false
};


this.backgroundGeolocation.configure(config).subscribe((location) => {
  this.loc.push(location);
  this.storage.save('Location', this.loc).subscribe();
  console.log('Location :', location);
  this.sendLocation(location);
});

}

sendLocation(data) {
const url = 'my-url';
const payload = {
  date_added: moment(data.time).format('DD/MM/YYYY'),
  identity: '',
  ipaddress: '',
  latitude: data.latitude,
  longitude: data.longitude,
  mobile: 'phoneNo',
  network_name: '',
  status: '',
  time_added: moment(data.time).format('hh:mm A'),
}
this.http.post(url, payload).map(res => res.json()).subscribe(data => console.log('location inserted: ', data))

}


Ion-item-sliding option probem

$
0
0

My post was not the solution... what did you do to solve it?

While running "ionic cordova run android" command I am getting below error. Is there any way to get it fixed?

$
0
0

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` ("code fences") manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Error: Uncaught (in promise): TypeError: Cannot read property 'undefined' of undefined

$
0
0

Yes, it is. What do you think could be it?

ViewController, his main role is what? I do not know his role. Ion-picker-cmp, when he is used, the source code to see is not too much to understand

$
0
0

ViewController, his main role is what? I do not know his role. Ion-picker-cmp, when he is used, the source code to see is not too much to understand.

FCM Push notification handler

Infinite scroll is visible

$
0
0

Best create a new topic to ask how you can find out if an element was visible or not.

Announcing ionic native mocks!

$
0
0

Indeed it does.

So the mocks are basically "void"-ified copies of the normal implementation that makes sure all the methods work without Cordova and its plugins in place. Correct?

Can I also use the compiled version from npm, then "extend" your class and overwrite the "void"-ified methods you have that make sure not errors are thrown (with ones that "fake" some functionality? Or do I have to use the Typescript version and mess with it manually?


Ionic build android not signing debug build properly

$
0
0

Wow, what a strange case. Thank for reporting back!

Image not displaying while displaying contacts

$
0
0

how to do that,,I think it is some size issue,,,is it so..

Image not displaying while displaying contacts

$
0
0

it is trying to fetch the image as that box is visible only in contacts which have photo,but its not able to display that...

Is my html code correct??

Ionic android gradle build takes long time!

$
0
0

Run cordova build android and cordova build android --debug please.
Is the time needed the same (minus the ~35 seconds for the Ionic build of course)?
If so, this has nothing to do with Ionic but is a pure Cordova thing. You might want to post over at http://issues.cordova.io

How to check if the Server is Up or Down in ionic

$
0
0

Now you know the server is down for this device.

Image not displaying while displaying contacts

$
0
0

Hey,

Please use DomSanitizer , there is xss issues ur browser blocking the img src

Page wont refresh in Ionic

$
0
0

So

works all the time and updates the interface (I assume it sets a variable that is bound in the UI?) but only not in the case of "SCAN SUBSCRIBER: BLYNK FOUND! STOPPED SCANNING!"?


Image not displaying while displaying contacts

Image not displaying while displaying contacts

$
0
0

Yes, but look at what image it's trying to load:

Failed to load [object%02Object]

Does that look like a URL to you? Did you console.log the element that you use as URI to see what is inside?

ViewController, his main role is what? I do not know his role. Ion-picker-cmp, when he is used, the source code to see is not too much to understand

$
0
0

What are you talking about? Can you provide a link to whatever has this ViewController?

How to check if the Server is Up or Down in ionic

$
0
0

it can be up or down depends on server

Stripe native plugin

$
0
0

You use the plugin to convert some payment data (credit card or bank account data) to a token. A token can then be used to get money from that credit card - but that doesn't happen on the device but in your backend. So you send the token to your backend, where it is saved and used for communication with the Stripe API. Your backend doesn't hold the card data, so no danger of loosing your customers payments data.

Viewing all 228551 articles
Browse latest View live


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