I am using the latest GCM Push Notification plugin with Cordova. The notifications are working great, but I want the application to come to the foreground when the user receives a push notification.
I have tried several solutions from many places but I still cannot make the application come to the foreground when a notification is received.
It seems that someone managed to do something similar here, but no matter what I do I cannot replicate success:
Bring cordova application to foreground when push arrives
The codes for the GCMIntentService.java in his question are different to what's available now.
How can I get this to work?
Incorporate following lines in onMessageReceived method in GCMIntentservice.java file.
And make sure you import the MainActivity.java