Mexico is developing a cellphone app that will allow migrants to warn relatives and consulates if they think they are about to be detained by U.S. immigration officials.