The smart button for canvas apps is a cool tool. Once a canvas app is added to a solution it gets a unique name. The unique name remains constant for each install (e.g. dev, test, prod). I would suggest that you consider building the launch URL using the specific canvas app unique name. This makes everything way more simple. No need to create environment vars or having to populate them on install. No need to deal with a "play" URL.
In my designs I am currently launching canvas apps from the ribbon using a script built by magician developer Rick Wilson. The script opens a new tab and passes the "current environment" data to the app. This script also works from sitemap which is great.
When you launch via sitemap, you can include the current model app info so the canvas app can be interactive. When you launch from a ribbon, there is no way to know which model app the user is currently in.
None of the canvas apps work outside of a model app because there is no way (that I have found) for the canvas app to know which environment it was launched from. So a user of the app can't be provide a URL to "return" to the model app (e.g. area, view, record). The canvas app environment data (e.g. Current CRM URL) is available inside a long string, in the "Canvas Apps" entity during development. As soon as it is installed into another org, it is removed and never updated. So it is useless.
The smart button for canvas apps is a cool tool. Once a canvas app is added to a solution it gets a unique name. The unique name remains constant for each install (e.g. dev, test, prod). I would suggest that you consider building the launch URL using the specific canvas app unique name. This makes everything way more simple. No need to create environment vars or having to populate them on install. No need to deal with a "play" URL.
In my designs I am currently launching canvas apps from the ribbon using a script built by
magiciandeveloper Rick Wilson. The script opens a new tab and passes the "current environment" data to the app. This script also works from sitemap which is great.When you launch via sitemap, you can include the current model app info so the canvas app can be interactive. When you launch from a ribbon, there is no way to know which model app the user is currently in.
None of the canvas apps work outside of a model app because there is no way (that I have found) for the canvas app to know which environment it was launched from. So a user of the app can't be provide a URL to "return" to the model app (e.g. area, view, record). The canvas app environment data (e.g. Current CRM URL) is available inside a long string, in the "Canvas Apps" entity during development. As soon as it is installed into another org, it is removed and never updated. So it is useless.
You can check out Rick's
dark arts magicscript here: 💥 https://www.richardawilson.com/2020/06/launch-canvas-app-in-model-app-from.htmlHis
toy boxPCF ✨ controls are here: https://github.com/rwilson504/PCFControlsThe Smart Button and launch script offer great options to add the power of canvas app functionality to model apps.
-Art
Here is an example process/dialog style canvas app to install a license. It is loaded from the model app sitemap: