This worked for me:
oShell.attachLogout(function(){
jQuery.ajax({
url: '/sap/public/bc/icf/logoff',
async: false
}).success(function(){
alert('You have been logged out');
}).complete(function(){
location.reload();
});
});
Considering oShell is an sap.ui.ux3.Shell() object.
I'm using NetWeaver 7.4.