You can apply for a Swedish passport at the Consulate General in Shanghai only by appointment. If you apply at the Embassy in Beijing or another passport authority, you can choose to retrieve the passport in Shanghai.
Book an appointment online for application or retrieving passport.