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

Update README.md #147

wants to merge 1 commit into from

Conversation

Stiveknx
Copy link

I took me a lot of time to figure this out, should be documented

I took me a lot of time  to figure this out, should be documented
@@ -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"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants