Such services required you to add an SDK from theirs to provide crash reports. The SDK basically does two things:
- register various signal handlers, which intercepts BSD signals that trigger the app to exit because of some problem, e.g. a object tries to access a memory address which is outside of the apps address space.
- Register an uncaught exception handler, which intercepts (Objective-C) exceptions that are not caught by any code.
A crash of an app is usually triggered by one of those (there are exceptions, e.g. stack overflow errors, which can only be detected using Mach Exception Handlers which some SDKs support, or if the app is killed by the OS because of some violations e.g. blocking the main thread for too long).
Once those events happen, the SDK will try to safely (e.g. by not allocating new memory as this may cause more harm than good) get the stack trace (of all) threads at that time and write that data safely onto disk. On the next app start the SDK will find that data and tries to send it to the server (hopefully before another crash happens).
The way this works is independent of using Objective-C, Swift, C, C++.
The operation system also generates a crash report at crash time, but as that report is located outside of the apps sandbox, no 3rd party can get that and use it instead. That's why the SDKs need to get all the data on their own.