All unknown defendants shall be served by publication as provided for in Section 415.50 of the Code of Civil Procedure, but it must appear by affidavit that the plaintiff used reasonable diligence to ascertain the identity of the unknown defendants and to ascertain the identity of any persons sued as heirs and devisees.