How do foreigners who have entered the country apply for health codes?

Legal analysis: according to local application: open mobile phone WeChat. Switch to my interface. Click the payment function. Click the city service function. Click the health code function to locate the location. Click OK to authorize the mobile phone number function. Fill in the information such as ID card and mobile phone number, and click the "Confirm Submit" function to get the health code.

Legal basis: Article 3 of the Law of People's Republic of China (PRC) on Exit and Entry Administration The state protects the lawful rights and interests of citizens of China to leave and enter the country. The lawful rights and interests of foreigners in China are protected by law. Foreigners in China shall abide by the laws of China, and shall not endanger China's national security, harm public interests or disturb public order.