I agree that when the user clicks the notification and the app come back into the foreground the foreground boolean should be true. What I don't like is that the message callback get's called twice. So I'm going to fix it as follows when the user clicks the notification I'm going to set foreground to true, but not call the callback again. What do you think?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira