My code doesn’t work in the app.

Maybe you haven’t officially published your field trip? However in the back-end, when working on your trip, you have to click the button ‘Save field trip’ below on the page. As a result the excursion will be published and your code will work.