I have set all capabilities for background even i get notification when app is in foreground mode and also in background from fcm console.But when i send notification from my server it do not work for background.This is my php code
$msg = array
(
'message' => $post_sms,
'date' => $date,
'value' => '1',
'usrkey' => $admin_id,
'msgcount' => $countid
);
$fields = array(
'registration_ids' => array($sid),
'priority' => 'high',
'data' => $msg
);
$headers = array(
'Authorization: key=' . $key,
'Content-Type: application/json'
);
i also have tried this one
$msg['aps'] = array(
'alert' => array(
'title' =>$post_sms,
'body' => $countid,
'usrkey' => $admin_id,
),
'sound' => 'default'
);
But still not working for background.Please let me known any solution regarding this.