App works in simulator, breaks on actual iPhone

#1

Hi all,

I’m running into an issue and having trouble debugging it because I don’t personally own an iPhone. My app is an extremely basic podcast player. It just ingests one RSS feed and then allows the user to play a podcast from that feed (why I’m building this is a long story).

It works fine on the simulator on my MacBookPro - I’ve tested it on a simulated iPhone 6 and 10, and both behave as expected. However, when I package the app up and send it to a friend with Testflight, it runs fine until he tries to add an RSS feed, and then it immediately errors out. He’s on an iPhone X. I have a suspicion that the iPhone doesn’t like that I’m making XHR requests to ingest the feed … could it be a permissions issue? I looked into the Permissions API but it doesn’t seem to have anything for file fetching. Unfortunately the text isn’t giving much information, but it happens so fast it doesn’t seem like it could possibly be connecting to anything before it errors out.

If anyone’s run into anything like this or has any thoughts, please let me know. If I can’t get this solved quickly, I’m going to have to go buy a used iPhone, which I’d just as soon not do!

Thanks,

-Chris

#2

Generate a standalone ipa build for simulator testing and that will better approximate a true environment than using Expo. I was having the same problem with Google Maps not rendering its map in iOS, working fine in Expo but there is some bug with an actual install.

exp build:ios -t simulator

#3

Thanks. I appreciate the quick response! Unfortunately, I’ve done that (following the instructions here: https://docs.expo.io/versions/v25.0.0/distribution/building-standalone-apps), and no dice … the app works fine in the simulator, but the same code is still failing on an actual iPhone via TestFlight.

Side note: I’m on API version 25.0.0 … I’m considering upgrading to 28, but am a bit concerned about breaking everything.

#4

TestFlight apps provide crash logs via your Organizer window in XCode. And makes sure for any fetch statements you write a catch exemption situation for the user.

#5

The fetch is in a try/catch block and appropriately alerts the user to the error and allows them to dismiss it. Good call about checking XCode tho - I didn’t know about that feature (new to iOS dev). I’ll investigate. Thanks!

#6

Sadly, it’s not registering as a crash, I assume because the app continues to run and handles the error. I’ll see if there are other ways I can get the TestFlight build to report more information.

#7

Hi @cwbuecheler - sorry you’re running into this :confused: if you can post a repro case or at least the error message (however minimal) that might help us be able to diagnose this issue.

#8

Thanks @esamelson - unfortunately the error message is self-generated. Basically, I’m using fetch for XHR, and fetch is not throwing an error, but it seems to not be retrieving the data either, so when I get blank data, my code throws a generic “Could not download podcast feed” error message. It not even be the actual XHR call … could be a race condition, but I’ve been pretty careful with my awaits, and the code works elsewhere.

I’m going to rewrite the code to try and give more information, but that’ll mean recompiling and then waiting through Apple’s verification process before the build can go live on TestFlight, then waiting until my friend has time to test it.

I’ll try to find a way to reproduce what’s happening, but since it’s only happening on the physical device through TestFlight, it’s hard to give anyone a better look at it (side note: the code works fine not only on iOS simulators, but also on Android simulators and actual Android hardware).

I’ll see what I can do, but I think “fork over a couple hundred bucks for a refurbed iPhone” is probably the answer. :slight_smile:

closed #9

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.