Can a page param be added to global canvas or initial page and, if so, is there a clear answer on how to check if the initial page url has a param and if so, get the value of it?

Web and mobile. I need to allow users to share a link to their book as the url of the web app and mobile app with the param bookId=[firebase doc id] and on initial page load, check to see if there is a param key in url and, if so, get the value of it. I have combed through all the forums and docs and cannot find a clear answer on this. Any help would be much appreciated.

I´m not sure how this would work for a mobile app, but on a web app there are a few links on how to do this.

So on my initial page I have a page parameter of “Scores”, then an if statement of: params.Scores==“Yes”

So then https://App.adventure-hunt.com/?Scores=Yes is directed to a defined page.

But I don´t know how you launch a mobile app via a URL, so therefore I have no idea how to include the URL and launch to the desired page.

Thank you that gets me a little closer. In my case, I do not know what the value of the param would be and need to check if there is a key “bookId” and if so, get the value and redirect to a page.

You can only pass text values in Page.Params.

https://yourapp.com/?bookId=123 will pass the value 123 into PageParam bookId. You can test on PageMounted for PageParam bookId value and route the flow to correct page or show required content.

On mobile it is similar but instead of URL you can use URI for deep linking. Left section before :// depends on the your registered app scheme. For example: myapp://bookId/123

1 Like

Thank you. How do I test to see if there is a param in the url with the key “bookId”?

You create PageParam bookId and then in the flow you test if this pageParam is undefined or has some value.

if(bookId === undef){ } else { }

Do you want an example from Composer or is this enough?

That’s perfect. I will give it a shot. Thank you.