In my Android app i used Geoloqi API for geofencing https://developers.geoloqi.com/android/getting-started .I ve created triggers using some latitude,longitude.now when user enter into those regions i ve to notify him.i ve created Receiver class implementing LQBroadcastReceiver. when i executed app all events are getting called and i m not getting which event to catch.please help me. Note:One way is setting type:callback and URL has to be provided for that purpose i need to create server program which i dont want. I created trigger with current location. GeoReceiver.java
public class GeoReceiver extends LQBroadcastReceiver {
@Override
public void onLocationChanged(Context arg0, Location arg1) {
Toast.makeText(arg0, "Location Changed", Toast.LENGTH_LONG).show();
}
@Override
public void onLocationUploaded(Context arg0, int arg1) {
Toast.makeText(arg0, "Location Uploaded", Toast.LENGTH_LONG).show();
}
@Override
public void onPushMessageReceived(Context arg0, Bundle arg1) {
Toast.makeText(arg0, "PushMessage Received", Toast.LENGTH_LONG).show();
}
@Override
public void onTrackerProfileChanged(Context arg0, LQTrackerProfile arg1,
LQTrackerProfile arg2) {
Toast.makeText(arg0, "TrackerProfile Changed", Toast.LENGTH_LONG).show();
}
}
If you set up C2DM push notifications, you can modify your onPushMessageReceived
method to handle the trigger directly instead of displaying a notification. Then you can set up a trigger in the Geoloqi API using type=message
and your method will be called.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With