It is not possible to purchase the Swiss Travel Pass in the SBB Mobile app. You must buy it from the SBB webshop, www.sbb.ch/en, or from the Switzerland Travel Center, https://switzerlandtravelcentre.com/en/che/ticket/swiss-travel-pass
If you buy it from the SBB webshop, authenticate yourself using the same credentials as you use to log in to the SBB Mobile app. The passes are later (after purchase) available in the SBB Mobile app. Additionally, with every purchase, you will receive a purchase confirmation by e-mail including a link, with it you can download the ticket as PDF. Or you download the PDF tickets from the webshop’s purchase history.
If you buy it from the Switzerland Travel Center, you can solely download it as PDF, it is not made available in the SBB app later.