Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Firemonkey Kinvey Notifications after closing App


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Last Post: Sep 21, 2016 7:27 AM Last Post By: José Morango
László Mlnvszky

Posts: 106
Registered: 10/21/09
Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 4, 2016 12:02 AM
I am using GCM and Kinvey to send remote notifciations, it works great.

The notifications are received and shown if the user puts the app to background.

1. The problem is that if he closes it (intentionally) the notifications are not received.
2. If the user start the app in the afternoon, then puts it to the background, next morning, the remote notifications are not received, only if he starts the APP again.

Is it how it is supposed to work?
Anybody have a solution for that?
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 5, 2016 6:46 AM   in response to: László Mlnvszky in response to: László Mlnvszky
László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 8, 2016 1:47 AM   in response to: Eli M in response to: Eli M
OK, i see, that after force closing it doesn't get the notifications.
But as it turns out, after hours of inactivity from the app (the user doesn't open up the app), the notifications also stop.

Does android stop the app if it is not used?

László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 11, 2016 2:52 AM   in response to: Eli M in response to: Eli M
If the user logs in to the APP, then start using something else, after 1-2 hours, he stops getting the notifications, because the app stops running.

Is there a way to keep the app running at the background so that kinvey stays logged in?
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 11, 2016 4:34 AM   in response to: László Mlnvszky in response to: László Mlnvszky
You already have this in your app?

http://docwiki.embarcadero.com/RADStudio/Seattle/en/Creating_Android_Services

Also if the user uses the hardware back button on your main form it will close your app.

http://www.fmxexpress.com/handle-hardware-back-button-in-delphi-xe5-firemonkey-on-android/

László Mlnvszky

Posts: 106
Registered: 10/21/09
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2016 8:16 AM   in response to: Eli M in response to: Eli M
I have the same problem with Services!
It keeps running for 20-30 minutes, and then stops the service, and the host app freezes.
I use it with start sticky, so it should run ... forever, right?

Eli M wrote:
You already have this in your app?

http://docwiki.embarcadero.com/RADStudio/Seattle/en/Creating_Android_Services

Also if the user uses the hardware back button on your main form it will close your app.

http://www.fmxexpress.com/handle-hardware-back-button-in-delphi-xe5-firemonkey-on-android/

José Morango

Posts: 19
Registered: 10/2/14
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2016 6:09 AM   in response to: László Mlnvszky in response to: László Mlnvszky
I have the same problem with Kinvey.
If I close the application backgroud not receive notifications.
How to solve this problem ?
José Morango

Posts: 19
Registered: 10/2/14
Re: Firemonkey Kinvey Notifications after closing App  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2016 7:27 AM   in response to: José Morango in response to: José Morango
How to solve this problem ?

add next lines in manifest:

(.......)
</activity>
<%activity%>
<%receivers%>

<!-- Nao sei - embarcadero -->
<receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" />

<!-- even if the application itself is not running while the remote notification comes in. If you don’t need or want items in the Notification Center, you can skip this step.-->
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />

<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
</application>


</manifest>
<!-- END_INCLUDE(manifest) -->

Edited by: José Morango on Sep 21, 2016 7:27 AM

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02