2

Is it possible possible to receive Google Cloud Messages within an android service (TAndroidService)?
It works fine in an application, but when I try to do the same in an android service (local service) I always get the same error...

I have tried it with TKinveyProvider and TPushServiceConnection, but when I debug it, I get an "Activity not found, maybe you are in a service" error.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 2
    Many of the packaged FMX components fair poorly in a Delphi Android service. Take TLocationsensor for example, which needs to be replaced with calls to the Android LocationService api to achieve a similar function within a service. The same is probably true of TKinveyProvider, which would require extensive Delphi/Android API coding. Nobody except someone who absolutely needs to do that, is going to even start doing it because it really is hard to do. – Freddie Bell Apr 17 '16 at 17:48
  • 1
    @nolaspeaker yep, nothing changed in 2017. Drop component and hope it works in a service. Probably doesn't, because it depends on some UI loop. It would be nice if I could run whatever loop it wants manually somehow. – nurettin May 30 '17 at 15:11

0 Answers0