So the phone is shutting off or rebooting? If so maybe it's drawing more power than what it is charging so it runs out of juice. Or the app is buggy and causing the system to crash (in which case you'd need to submit the bug to the dev).
If you've enabled Developer Options in your device, there should be a Keep Screen On option so that the screen stays on while charging.