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
Manish Kumar 61Manish Kumar 61 

Native iOS app - set custom Host as default value

Hello,

I am building a iOS app using Mobile SDK 3.1. I want to initialise the login page to a custom URL that I have created rather than pointing to login.salesforce.com

I am able to do it by switching the URL by app Setting as a user but can I set it as a default programatically so users will not need to change for it?
Best Answer chosen by Manish Kumar 61
Gaurav KheterpalGaurav Kheterpal
You can set it in your plist file as follows
 
<key>SFDCOAuthLoginHost</key>
<string>your_community_login_url_minus_the_https://_prefix</string>
The Mobile SDK native app template looks for this key and then sets this URL as the default login URL instead of loading the default production URL.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.

 

All Answers

Gaurav KheterpalGaurav Kheterpal
You can set it in your plist file as follows
 
<key>SFDCOAuthLoginHost</key>
<string>your_community_login_url_minus_the_https://_prefix</string>
The Mobile SDK native app template looks for this key and then sets this URL as the default login URL instead of loading the default production URL.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.

 
This was selected as the best answer
Manish Kumar 61Manish Kumar 61
Thanks, that did it!
Dhiraj BhujbalDhiraj Bhujbal

'Hi,
I have created one react native app (iOS Platform) with SF SDK When I ran the app it loaded default Salesforce login page (login.salesforce.com) now I have to load the one custom URL https://xyz.com/xyz1/xyz2

When Edit the info.plist by changing  SFDCOAuthLoginHost value as 'xyz.com/xyz1/xyz2'
it's just loading up to 'xyz.com'  extracting part after the '/'.

this works fine for android platform