Expo SMS Crashing App Without Error

Please provide the following:

  1. SDK Version: 37.0.3
  2. Platforms(Android/iOS/web/all): IOS

Expo SMS package will cause my app to crash intermittently.

Here is the code I’m running:
for(let i = 0; i < numbersArr.length; i++){
await sendText(numbersArr[i]);
}


function sendText(num){
return new Promise((resolve, reject)=>{
let finalText = “Hello World”;
SMS.sendSMSAsync(
[num],
finalText
).then(({result})=>{
console.log(“SENT”, result);
resolve(result);
}).catch((e)=>{
console.log(“ERROR!”,e);
throw new Error(e);
})
})
}

The behavior I’ve seen is if you press send or cancel very quickly, you can fly through without any bug. However, if you linger (either by typing new things in, or simply not doing anything) it will eventually crash the entire app.
The issue I’m having is there is no error message, so I’m assuming the issue is happening beneath my code. If there’s an issue though, I’d love to know if the code I’m writing is too memory wasteful etc.

Doing a lot more digging, I found that the error was my iPhone was killing the app process. My code was inefficiently using the CPU, so it reached a threshold that iOS kills processes if they get above.
Best way to error check this is to go into your settings and find analytics. Gives you a whole stack trace.

Thanks for sharing the solution and your insight with the community, @matthewjgunton!