We are currently trying to replace an existing working code with another "future proof" one.
Basically we have a stand alone app that's invoked whenever a user clicks on a button within a lightning component.
A new window is open and the stand alone app loads just fine.
Here is the snapshot of the code opening the app:
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": '/c/myApp.app?recId=' + component.get('v.recordId') +
'&Rows=' + component.get('v.Rows') + '&Bytes=' +
component.get('v.Bytes')
});
urlEvent.fire();
The app (called myApp) is invoked and we have a couple variables been passed to it.
We tried using the new lightning:navigation component, but it didn't work.
The goal was to try building a pageReference instead or parsing/creating a URL directly. Which could help us by avoiding broken navigation if Salesforce changes the URL format in the future.
The first problem we encountered was, the availabe pageReference Types (which is required) are:
• Lightning Component (must implement lightning:isUrlAddressable) • Knowledge Article • Named Page • Navigation Item Page • Object Page • Record Page • Record Relationship Page
There was no reference to an App.
The documentation states: "These navigation resources are supported only in Lightning Experience and the Salesforce mobile app. They’re not supported in other containers, such as Lightning Components for Visualforce, Lightning Out, or Communities. This is true even if you access these containers inside Lightning Experience or the Salesforce mobile app."
Since the app is running on his own (not within the Lightning Experience or Salesforce1), am I correct to say that our current solution is the only possible way of doing it?
If not, what would be other approach so we don't need to worry future URL changes on Salesforce side?