2

I'm writing an Android app that receives push notifications using Delphi in RAD Studio 11.0 (Alexandria). But I've got a very strange problem preventing me from going any further than a blank app!

The problem can be easily reproduced by creating a blank Multi-Device application with an Android target. I can run the app (with or without debugging) on my connected (USB or wireless) Android phones without a problem. But if I enabled "Receive push notifications" (setting to TRUE) in the Entitlement List, the app will just close immediately after it's loaded on the phones.

I'm not sure whether it is a bug of Delphi or I'm just missing something. Could any experts please shed some light on me?

Thanks a lot.

MW3226
  • 53
  • 5
  • Have you correctly followed all steps from https://docwiki.embarcadero.com/RADStudio/Sydney/en/Firebase_Android_Support Also, you should use debugging tools to help you pinpoint exact exception that happens on Java side. – Dalija Prasnikar Feb 17 '22 at 11:28
  • Hello Dalija. Thanks for your help first. For the Firebase_Android_Support, I will try following the steps (unfortunately the docwiki site is down right now). But for debugging, in fact, I've tried putting a breakpoint in the FormCreate procedure. But the app is just closing too quickly and the breakpoint seems not able to catch. So is there any better suggestion?Thanks a lot. – MW3226 Feb 17 '22 at 11:45
  • If there is no exception in Delphi code that means exception is happening in Java code before Delphi part runs. This is why you need to capture logcat that is happening in that code outside Delphi's reach. You can use Android Studio for that, or some other tools - Google for Android logcat. – Dalija Prasnikar Feb 17 '22 at 13:30
  • Finally, after following the steps in the Firebase Android Support doc, I can now receive push notifications on my mobile app using FCM. Thank you very much for that. – MW3226 Feb 18 '22 at 06:54
  • But I also got another related question. How does this newer approach of getting push notifications fit into the framework of RAD Server? In other words, can we still use TPushEvents (and TEMSProvider) in the mobile app when using this new approach (FCM)? If not, does it mean the built-in Push resource of RAD Server will not be working anymore? – MW3226 Feb 18 '22 at 07:18
  • I never used TPushEvents so I cannot answer that question. – Dalija Prasnikar Feb 18 '22 at 11:56
  • Anyway, sincerely thanks for your help. – MW3226 Feb 18 '22 at 16:10

0 Answers0