I've just found a way of doing this on Android. The fact is that Game Maker uses ShowMessage function to show the error popup windows on Android. The trick is simple: you have to modify that function to do whatever you want with the message every time it is called and you've got it. It is not used for anything else (if I'm not wrong), so its message will always be an error. Anyway you can also check if the message contains the word 'ERROR' to be sure.
I'm using Game Analytics in my game (there's a free extension on the Marketplace) and it's extremely easy sending the error reports to it. This way you can track your player's issues in real time. This is what I've done:
Once you have installed and configured the Game Analytics extension, go to 'C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-<your-version>\android\runner\ProjectFiles\src\main\java\com\yoyogames\runner\' and edit the file 'RunnerJNILib.java' with any plain text editor like notepad.
Add this line at the beginning of the file right below 'import ${YYAndroidPackageName}.RunnerActivity;':
Code:
import com.gameanalytics.sdk.*;
And now modify the ShowMessage function adding this line below 'final String sMesage = _message':
Code:
GameAnalytics.addErrorEventWithSeverity(GAErrorSeverity.Critical, sMessage);
The full ShowMessage function should look like this:
Code:
public static void ShowMessage(String _message ) {
Log.i( "yoyo", "ShowMessage(\""+_message+"\")");
final String sMessage = _message;
GameAnalytics.addErrorEventWithSeverity(GAErrorSeverity.Critical, sMessage);
final CountDownLatch latch = new CountDownLatch(1);
RunnerActivity.ViewHandler.post( new Runnable() {
public void run() {
AlertDialog.Builder builder = new AlertDialog.Builder(ms_context);
builder.setMessage( sMessage)
.setCancelable(false)
.setPositiveButton( "OK", new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dialog, int id ) {
latch.countDown();
}
});
AlertDialog alert = builder.create();
alert.show();
}
});
try {
latch.await();
} catch( InterruptedException e ) {
Thread.currentThread().interrupt();
} // end catch
} // end ShowMessage
And that's it! From now, all your error messages will go directly to your GA account, where you can track them. It's woth nothing that you'll have to modify 'RunnerJNILib.java' everytime you upgrade your GM, but they are just a couple of lines, so no worries...