0

We require FCM with image,title, and description in notification drawer if app is not in foreground we have try by sending following notification request :

{"priority" : "high", 
  "to": "/topics/movies",   
   "data": {   
        "image":"image ur",       
       "title":"App name",
       "text":"Image with Text"
   },"notification":{"title":"App Name","body":"description"}   
}

But, in android if app is in background then on messge receive not called however if app is in foreground then notification will generate with image and title

@Override
    public void onMessageReceived(final RemoteMessage remoteMessage) {        
        super.onMessageReceived(remoteMessage);
        Log.d("onMessageReceived-->", "getData ->" + remoteMessage.getData());
}

However if we send by removing notification key then android work if app is in background or foreground. but iOS did not receive if we remove notification key. Please help us and Thanks in advance.

Sudip Podder
  • 830
  • 11
  • 25
  • Check this link and follow the Method 2. http://stackoverflow.com/a/39330797/5829624 – Sudip Podder Sep 12 '16 at 12:08
  • I know it is retarded that they have made it like this... Even i am stuck. It is of utmost importance that all my notifications get delivered with images whether the app is in foreground or background. Sending data deals with android but kills ios as they only allow this push when app is in foreground. If i send a notification payload with data it kills android images ... It's moronic – Kushan Jan 16 '17 at 12:15

0 Answers0