China and the Philippines have pledged to work together to deepen bilateral ties and resolve their differences peacefully over the South China Sea.