My app is called to handle a universal link, but I'm a little unsure how to set my app to the desired view controller that is required by each universal link.
my app structure is
root vc -> tabbed vc -> page vc (with 4 pages)
The app could well be in a different 'branch' as required by a universal link or it could be displaying the exact vc required and just needs its content refreshing
how do I go about cleanly implementing a system to back-out of a current navigation end point and go to the correct vc?
The app supports Apple's Restoration framework. Does Apple iOS have another framework I can leverage?
For someone to have clicked on one of your universal links they will have had to either background or close your app. When the app becomes active, the entry point will be in the AppDelegate class: the didFinishLaunchingWithOptions fucntion, if this is a cold start, otherwise the continueUserActivity function.
The easiest thing to do is to simply push a new ViewController from within these functions (didFinishLaunchingWithOptions or continueUserActivity).
If you do need to close ViewControllers that were open in the previous session this is something you can do in the same code block that you are using to present the proper ViewController.
Related
Thanks for your time.
I am working on a complicated next project for work. I understand it to be a static site generator and the assets (icons for buttons) used on the page are gathered via a pre build script and stored in the public directory of this project. This next project then generates forms, which i am observing unexpected behaviour on.
When looking at the network tab and loading one of the forms the page requests the icons and loads / renders my page, at completion of the load a GraphQl request is made for background data.
This should now be the finished state, there is no change to the page and there is no need for re-render / the components these icons sit within are not updated and a re-render does not happen, however...
A new network request is made and the assets/icons in my components flicker/reload, by what i think is by the framework - why is this new request made? Is this something that the framework is doing? Initiator looks like this - so i think so, but can't see any reason / documentation for it.
_next/static/chunks/framework-2191d16384373197bc0a.js
Finally have a answer. Bad architecture in the application.
This was not simply limited to the images. We had a stateContext which we have been dispatching to for everything, that context is what is causing the re-render, its not state so each update re-renders everything at a global level so each button press / graphql query response caused a re-render.
The re-render was not paid any attention to until we throttled and noticed the flickering of these icons.
Recently installed the project noted here: https://developer.salesforce.com/blogs/2020/11/how-to-use-apex-natively-with-svelte-vue-and-preact-within-lwc.html to test a theory on using Preact in a Lightning Web Component. Observed that in the Preact component any click in the component fires the onclick function for the first element rendered in the component (with an onclick property), any additional clicks or clicking directly on other elements (with or without an onclick properties) only fire the function for the first element. This behavior tracks with a separate project I've been working on that includes Preact. Does anyone know what would cause this and/or have suggestions on ways to address?
I'm assuming this is related to the LWC wrapper and how it redirects browser events to be processed, but I'm out of my depth in terms of fully debugging that path.
I ran this by the author of the linked blog post and we confirmed this doesn't work in an actual org, though it works fine in a local dev sandbox. Likely culprit is locker service, but neither the author nor I was willing to try to verify that, and there wouldn't be a whole lot to be done about it even if it were confirmed.
Short answer, Preact doesn't work in LWC framework currently.
I'm trying to get a head start with the pre-releases of Xamarin.Forms 4 and I've hit a road block with some of the Navigation features that have been included. From the Microsoft Docs it states:
Shell includes a URI-based navigation experience. URIs provide an improved navigation experience that permits navigation to any page in the application, without having to follow a set navigation hierarchy. In addition, it also provides the ability to navigate backwards without having to visit all of the pages on the navigation stack.
I have been able to setup my Shell file and set my Route names. The following code works as expected and navigates me to the appropriate Page:
private async void NavigateToAbout_Execute()
{
await (App.Current.MainPage as Shell).GoToAsync("app://Testapp/Test/modal");
}
The Problem:
Once I have successfully navigated to this Page, it seems I have no way of navigating away from the Page. In the quote above it states that we should have the ability to navigate backwards (to the previous Page) but I can't see any way of achieving this. Has anyone had some experience with this yet? I appreciate it's a pre-release so I may not get a response but any thoughts would be helpful.
I had the same question. It seems now to be ok. This work for me :
await Shell.Current.Navigation.PopAsync();
You can also have a look at this variable :
Shell.Current.Navigation.NavigationStack
It's a list with all the detail pages that were pushed above/onto the pages defined in the shell. I've seen that the 0 index in this list is always null. It represents the last page of the shell. The "detail" pages added onto the shell with shell.Current.GotoAsync("detailpage") comes from index 1 to n in the NavigationStack.
Any way to hide the Page Navigator that appears on the top of every App Maker produced page? When you create your own custom menu system that navigates the site then there is no longer a need for the page navigator. Also, the naming convention on the pages are not exactly user friendly (not allowing spaces for example) so that makes the page navigator look more like a developer tool than an end-user one. And last but not least, the page navigator is redundant if you only have one page in your app.
You can show/hide page chooser by setting ?console= URL parameter to 1 or 0 correspondingly.
But as Morfinismo noticed, most likely you are looking for creating a deployment which you can share with your end users, configure permissions, etc., since only you can access your Preview deployment.
In my Apple Watch app, I need to have a way to be able to notify the user that they must first set something from within the iPhone version of my app before they can use the Watch App. Obviously, I need to do to this through a few labels and images, however the layout of these is different to the layout of the main views in my app.
How can I present the user with a different view based on the status of the iPhone app, that they cannot see unless required? The way I would do something similar in a normal app would be to just push to a different view controller, but obviously this is not possible in a watch app.
Any ideas?
You could always present a modal interface controller. Alternatively, you could create a separate group in your root controller's view and show/hide that as necessary.
To check the status of the iPhone app, the easiest solution would likely be to use a shared NSUserDefaults suite between the iPhone app and the Watch app. Set a value to true/YES when your criteria has been met and check that value in the Watch app.