We do have functionality for offline group push notification from server end.
Scenario is below :-
Application is open and go to the group message tab. Now send a message to the group so, other users of group will get message i sent.
By closing (kill or in background) the application from ios end they are setting users presence to offline. So once application is closed they will get push notification in mobile.
Issue is by closing the application still i am receiving push notification in mobile even though i read the same message.
From back-end i have set a cron job which runs on server at every 30 seconds and checks the user presence in the group and send push notificaiton to those users who are offline in their mobile.
So is there any way to get last logout timestamp using REST API so i can put condition and check if last user logged in time is less than current time accrodingly push notificaitons will send.
Not able to get last logout time using REST API http://example.com:9090/plugins/restapi/v1/sessions/yourUserName
which outputs :-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <sessions>
<session>
<sessionId>[email protected]/1ae2xq14da</sessionId>
<username>yourUserName</username>
<ressource>1ae2xq14da</ressource>
<node>Local</node>
<sessionStatus>Closed</sessionStatus>
<presenceStatus>Online</presenceStatus>
<priority>0</priority>
<creationDate>2017-01-18T08:58:01.611Z</creationDate>
<lastActionDate>2017-01-18T08:58:05.121Z</lastActionDate>
<secure>false</secure>
</session>
</sessions>
By executing above method getting creation date and last action date incorrect.
1) creationDate :- 2017-01-18T08:58:01.611Z
2) lastActionDate :- 2017-01-18T08:58:05.121Z
http://example.com:9090/plugins/restapi/v1/users/yourUserName
Which doesnot output last login timestamp
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<username>yourUserName</username>
<name>yourUserName</name>
<email>[email protected]</email>
<properties/>
</user>
We have used REST API Plugin
Any Help would be appriciate.