Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ public class TransitionReceiver extends BroadcastReceiver {

Android, iOS only

onNotificationClicked is fired only when notification is configured passing ```data: Object``` Otherwise, it does not fire!

Copy link

@sageknives sageknives Dec 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it out. Basically you need to add the field data with whatever you want to get passed back

window.geofence.addOrUpdate({
id: "69ca1b88-6fbe-4e80-a4d4-ff4d3748acdb",
latitude: 50.2980049,
longitude: 18.6593152,
radius: 3000,
transitionType: TransitionType.ENTER,
notification: {
id: 1,
title: "Welcome in Gliwice",
text: "You just arrived to Gliwice city center.",
openAppOnClick: true,
data: "this is what is sent back" //this
}
}).then(function () {
console.log('Geofence successfully added');
}, function (reason) {
console.log('Adding geofence failed', reason);
})

window.geofence.onNotificationClicked = function(notificationData){
console.log(notificationData); //notificationData = "this is what is sent back"
}

```javascript
window.geofence.onNotificationClicked = function (notificationData) {
console.log('App opened from Geo Notification!', notificationData);
Expand Down