transistorsoft / background-geolocation-lt

Advanced Background Geolocation & Geofencing SDK for iOS & Android
Other
48 stars 19 forks source link

No action performs on both buttons in android sample app. #33

Closed iVcardo closed 4 years ago

iVcardo commented 5 years ago

Your Environment

Actual Behavior

When app opens then first i click on add geofences button then i only see toast with the message geofences added. after 5 to 10 minute I click on remove geofences button again toast display with geofences removed, nothing happened.

christocracy commented 5 years ago

My demo app has no "add geofences button".

iVcardo commented 5 years ago

I'm confused now, can you please share code of geofencing because in this demo app only geolocation and i eagerly waiting for geofencing. And one more question I have sample geofencing project with the package name com.test.geofencingdemo, and i can't able to find this project on GitHub is it yours?

christocracy commented 5 years ago

And one more question I have sample geofencing project with the package name com.test.geofencingdemo

Not mine.

iVcardo commented 5 years ago

Okay, So can you please share code of geofencing because in this demo app only geolocation and i eagerly waiting for geofencing.

christocracy commented 5 years ago

See docs:

iVcardo commented 5 years ago

Hello Chris,

I have added Geofence code in demo application, also run app. but not get any enter and exit boundary message (Toast), and i also try to check my locations entry through below url but no records are there.

http://tracker.transistorsoft.com/locations/1test

I have also added java file can you please check and let me know is there any issue? MainActivity.txt

christocracy commented 5 years ago

Minimum radius is 200 meters. 10 won't work.

christocracy commented 5 years ago

And why are you adding the geofence twice??

// Create a Geofence.
                TSGeofence geofence = new TSGeofence.Builder()
                        .setIdentifier("Office")
                        .setLatitude(21.237357)
                        .setLongitude(72.877497)
                        .setRadius(10)
                        .setNotifyOnEntry(true)
                        .setNotifyOnExit(true)
                        .setExtras(extras)
                        .build();

bgGeo.addGeofence(geofence);

// You may optionally supply a TSCallback to be notified of insert errors
                bgGeo.addGeofence(geofence, new TSCallback() {
                    @Override
                    public void onSuccess() {
                        Log.i(TAG, "[addGeofence] success");
                        Toast.makeText(MainActivity.this, "You'r in geofence", Toast.LENGTH_LONG).show();
                    }

                    @Override
                    public void onFailure(String error) {
                        Log.i(TAG, "[addGeofence] FAILURE: " + error);
                        Toast.makeText(MainActivity.this, "You'r out of geofence", Toast.LENGTH_LONG).show();
                    }
                });
iVcardo commented 5 years ago

Hi Chris, I have removed addgefence method and also set radius to 200 meters, but still no any update. Can you please check java & log file? so that i can understand where is the actual problem.

MainActivity.txt Log.txt

iVcardo commented 5 years ago

Hello Chris, I have added comment above 5 days ago and still not any response from your side. Can you please help me to sort out this problem so I can implement in my app. Thanks.

christocracy commented 5 years ago

Your logs don't show a geofence being monitored.

The callback to addGeofence is executed when a geofence was successfully added and monitored, not when the geofence is fired..

You LISTEN to geofence via onGeofence method. You code is totally wrong.

You have a chicken / egg problem.

iVcardo commented 5 years ago

Hello Chris,

Forgot all things. Now, let me know how app geofencing actually working?. and if it is working fine then please provide me actual code or demo project that is using geofencing in app and also working. so, i can implement that functionality in my android and iOS app. but, first please provide me the actual code that really working in android app.

I think i wasted so much time and money for geofencing that is not working and no one is able to give proper solution. I think there are no technical guys to response client on time.

For response in GitHub communication I have to wait for many hours or days. here it totally time waste of mine. so, kindly give me access to slack as you promise in premium membership, I paid for premium membership.

christocracy commented 5 years ago
  1. Listen to the onGeofence event.
BackgroundGeolocation bgGeo = BackgroundGeolocation.getInstance(getApplicationContext(), getIntent());

bgGeo.onGeofence(new TSGeofenceCallback() {
    @Override
    public void onGeofence(GeofenceEvent event) {
        TSLocation tsLocation = event.getLocation();
        Location location = tsLocation.getLocation();
        TSGeofence tsGeofence = event.getGeofence();
        GeofencingEvent geofencingEvent = event.getGeofencingEvent();

        Log.i(TAG, "[geofence] " + event.toJson());
    }
});
  1. Create a Geofence instance.
    
    TSGeofence geofence = new TSGeofence.Builder()
                        .setIdentifier("Office")
                        .setLatitude(21.237357)
                        .setLongitude(72.877497)
                        .setRadius(10)
                        .setNotifyOnEntry(true)
                        .setNotifyOnExit(true)
                        .setExtras(extras)
                        .build();

bgGeo.addGeofence(geofence);

// You may optionally supply a TSCallback to be notified of insert errors bgGeo.addGeofence(geofence, new TSCallback() { @Override public void onSuccess() { Log.i(TAG, "[addGeofence] success"); Toast.makeText(MainActivity.this, "You'r in geofence", Toast.LENGTH_LONG).show(); }

                @Override
                public void onFailure(String error) {
                    Log.i(TAG, "[addGeofence] FAILURE: " + error);
                    Toast.makeText(MainActivity.this, "You'r out of geofence", Toast.LENGTH_LONG).show();
                }
            });

3.  **Start monitoring** the geofence with `#addGeofence`.

```java
bgGeo.addGeofence(geofence, new TSCallback() {
                    @Override
                    public void onSuccess() {
                        Log.i(TAG, "[addGeofence] success");
                        Toast.makeText(MainActivity.this, "You'r in geofence", Toast.LENGTH_LONG).show();
                    }

                    @Override
                    public void onFailure(String error) {
                        Log.i(TAG, "[addGeofence] FAILURE: " + error);
                        Toast.makeText(MainActivity.this, "You'r out of geofence", Toast.LENGTH_LONG).show();
                    }
                });
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.