on 01-10-2021 12:58 PM
Hi Team,
I have created a UI5 app in WEB IDE Full stack, enabled it as Hybrid Mobile App. App is working fine now I want to implement the logout functionality for Hybrid App, after registration the user logins to the app using the logout button the user has to be logout from the App.
Please suggest your thoughts.
Regards,
Mamatha
Hi,
Following code can be used for logout functionally in fiori based Hybrid mobile applications , after successful execution of this method , navigate the screen to login page.
sap.Logon.core.deleteRegistration(jQuery.proxy(
this.onDeleteRegistrationSuccess, this), jQuery.proxy(
this.onLogonError, this));
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gowtham,
Thanks for your Response. I have tried the code that you had suggested it is not navigating to the login page so I have made some modifications to your code as shown below:
Logout: function() { if(sap.hybrid.kapsel.appContext) { sap.Logon.core.deleteRegistration( function(result) { console.log("unregister result: " + JSON.stringfy(result)); sap.hybrid.kapsel.appContext = null; sap.Logon.core.loadStartPage(); }, function(errObj) { console.error("doDeleteRegistration() Error"); }); } else{ console.log("Cannot delete Context"); } }
This code works when I click on logout it is navigating to the login page and at the same time the registered user count has decreased by 1 in SMP under User Registrations for the App.
But the problem here is after logout when I login again I am getting the below error:
By clicking on "ok" getting no data in some screens metadata is not getting loaded in online mode.
Any ideas with this error. Can you please help me out.
Regards,
Mamatha
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.