Android post to server intent when hitting geofence
₹1500-12500 INR
Dibayar saat pengiriman
Since it's not possible for Android to run javascript in a background service, I'd like to propose the following extra configuration.
I was thinking to use the TransitionReceiver ([login to view URL]) to post to a server and only trigger the notification when the server responds with true. This can be true/false, 1/0, {"notification":true} or whatever is semantically correct and in line with this project. Of course there might be a better solution than the TransitionReceiver, that's up to the developer.
Additionally I'd like to be able to post extra data when adding the geofence. This extra data is optional, parsed with [login to view URL] and also posted to the server. A possible way to add the geofence could be (see "post" object):
[login to view URL]({
id: String, //A unique identifier of geofence
latitude: Number, //Geo latitude of geofence
longitude: Number, //Geo longitude of geofence
radius: Number, //Radius of geofence in meters
transitionType: Number, //Type of transition 1 - Enter, 2 - Exit, 3 - Both
notification: { //Notification object
id: Number, //optional should be integer, id of notification
title: String, //Title of notification
text: String, //Text of notification
smallIcon: String, //Small icon showed in notification area, only res URI
icon: String, //icon showed in notification drawer
openAppOnClick: Boolean,//is main app activity should be opened after clicking on notification
vibration: [Integer], //Optional vibration pattern - see description
data: Object //Custom object associated with notification
},
post: { //Post to server in background when hitting geofence (optional, Android only)
url: String, //The url which is posted to
timeout: Integer, //Defaults to 0. Milliseconds the Java code waits with executing the notification after the post is done (if server responded with true)
notificationOnError: Boolean, //Defaults to false. Should the notification be triggered when the server responds with an error (404, 500)?
data: Object //Optional custom object associated with post, parsed with [login to view URL] and sent to server with "data" parameter
}
}).then(function () {
[login to view URL]('Geofence successfully added');
}, function (reason) {
[login to view URL]('Adding geofence failed', reason);
});
Required skills: a little bit hybrid development (Js, Cordova, Ionic/Phonegap) and Java
ID Proyek: #12538387
Tentang proyek
7 freelancer rata-rata menawar ₹18730 untuk pekerjaan ini
Dear Client, Greeting of the day ahead !!! Thanks for providing us opportunity to place bid over the project and communicate with you. I am a serious bidder here and i have already worked on a similar project befor Lebih banyak
I have already done inhouse project of my company related to geofencing using the data from server..so i can complete this project in time