function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
koirakoira 

How to land on the same Visualforce page at re-login

I have an Hybrid (iPad) app which launches into a Visualforce page I speficied in bootconfig.js:

 

var startData = new SFHybridApp.RemoteAppStartData("/apex/myPage");

 The App which this page (myPage) belongs to, allows you to log out of your saleforce account and if you do so, on completion of log out you end up on salesforce login page 'https://login.salesforce.com/'.

 

Now here's the problem: When I re login, I want to land again on '/apex/myPage' but this time i end up on default salesforce page with 'Home' tab selected.

 

I kind of know what's going on, the first time you launch the iPad app, bootconfig.js controls where you land on, however on re login it's like you login from a browser, hence end up on a default page (with 'Home' tab selected)?

 

How do I work around this? Any help will be much appreciated.

 

kiranmutturukiranmutturu
i am just throwing my thoughts for this...one think you can do is.. create vf page tab and set the default landing tab as the page tab for that App.. then it will always land on that page only...
Kevin HawkinsKevin Hawkins

I take it for your logout scenario that you're not using the logout functionality of the OAuth plugin, but just targeting a Salesforce logout page?

 

The proper way to log out of the container is to use the logout method of the SalesforcOAuthPlugin.  To do this:

 

1. Make sure to include cordova-2.3.0.js, SFHybridApp.js, and SalesforceOAuthPlugin.js in your VF page.

2. Hook up your logout functionality to this JS code snippet:

 

 

var oauthPlugin = cordova.require("salesforce/plugin/oauth");
oauthPlugin.logout();

 

 That will take the user back to the app-driven login page, and put you ultimately back on the landing page of your app.