I have been struggling a bit to find the right documentation to accomplish a seemingly easy task.
Deeplinking: FSL App to Salesforce App
Now for starters, I have found a very easy way to deep link the FSL app to the Salesforce app:
- Go to Field Service Mobile Settings>App Extensions, and add an App Extension.
- Simple enter in the values as given below.
The bottom example works for android, and made a similar one with type iOS:
And its that easy. Once you go into your FSL app, these app extensions will redirct you to the Salesforce App. Now for the reverse, which is not so easy...
Deeplinking: Saleforce App to FSL App
So this is a little trickier...requires a global action...
Create a visualforce page, called Open_FSL
<apex:page controller="Open_FSL" action="{!urlRedirection}" > </apex:page>
Create an Apex Class for this page:
public class Open_FSL { public PageReference urlRedirection() { string url = 'com.salesforce.fieldservice://v1/sObject/'; PageReference page = new PageReference(url); page.setRedirect(true); return page; } } Now pay close attention to the string url = 'com.salesforce.fieldservice://v1/sObject/'
this comes directly from Salesforce FSL URI schema here:
Which says it works for both iOS and Android. More on this soon. 3) Create a custom Global Action Basically you want to look at your visual force page with this global action: Now with Custom actions, you must also add your custom action to the Publisher Layout, and make sure that the "Available for Lightning, Mobile, etc." is checked on the Visualforce page.
And Hooray! You now can deep link back to your FSL app by pressing this Global Action...but only on Android. Once I was able to ask a work buddy to try it on iOS, an error appears: "You can't view this page, either because you don't have permission or because the page isn't supported on mobile devices."
And here are some extra links to docs on this, in case someone finds this question in the future:
https://resources.docs.salesforce.com/sfdc/pdf/salesforce1_url_schemes.pdf
But despite looking all over these docs, I am still not sure I get it... So no love for iOS? I digged a bit deeper, and Apple likes to use what is called "Universal Links". And the documentation for Salesforce and Universal Links is limited, but it seems instead of using the "Salesforce1://" or in the case of FSL, "com.salesforce.fieldservice://v1/sObject/", which works perfectly for Android, we need to add https:// for Universal Links. So trying "https://com.salesforce.fieldservice://v1/sObject/", well Android doesnt like it, and iOS still isnt working properly. So now to my Question: What am I missing? Does anyone have a good example using iOS with Salesforce Deeplinking? Do I need to have the apex class look to 2 different addresses in order to have it work for both Android and iOS? based off the Salesforce1 for iOS Mobile schemes document, why doesnt my https address work? Has anyone else done this? Any hints, tidbits, or overall solutions would be greatly appreciated.