Best way to present alternate view to user - watchkit

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.

Related

Flutter/Dart/Firebase - Reduce unnecessary data loading

I tried searching my specific problem but I could not find any suitable solution.
I would like to thank everybody in advance for your help.
I am currently developing an iOS app.
The App represents a user profile which can be updated by the user.
Everything from the authentication, registration and the possibility to update your user data works fine with the help of Firebase. Now I would like to optimize some code.
So the application has 2 Screens, HomeScreen and EditScreen.
(Besides the Screens needed for registration and login).
To keep my question short:
How can I reduce the amount of data which is loaded from firebase?
Example:
1. User is on the HomeScreen, to build the view his image loads from Firebase Storage
2. He wants to edit his Image and therefore switches to the Editscreen, where his image will be loaded again
3. After changing his image, the new image will be uploaded to Firebase Storage and he can see his new image on the Editscreen
4. If he now switches back to the HomeScreen his new image will be loaded again from Firebase
Is there a good way to reduce the amount of loading?
Like caching the image between step 1 and 2?
As there is always a little delay in displaying his image.
Thanks!
Sadly I am not allowed to share any code.
You can check out the flutter_advanced_networkimage package. It will cache your photo upon load. For everything else, you should just move your profile object (or whatever it is that calls for the firebase user's information) above those routes and pass it down through your widget tree through arguments or state management.

What's the approach to coding navigation driven by a universal link?

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.

Attempting to implement share action intent on webpage

As stated in title. MDL cards/templates etc come with fancy looking share buttons. How exactly do we make them work how we see they do on phones apps? I want a user to be able to press the share button and have the list of apps to share via to show up.
Is this possible?
This is not possible with current web technology. The only API that was in progress to allow it was Web Intents but this has since been abandoned.
The share button could open up a dialog or something that has a Reddit share, Digg button, Facebook share, Google Plus shares, etc within them. That way they are only initialized when called. But you need to specifically program what you want to share out to.

Different URL paths in different tabs depending on id

Let's say a user has a list of projects, and each project has it's own set of various collection items of charts, reports, tags, etc associated by project._id
When a user selects a project, all the associated collection items are viewable by route, for example /project/<projectId>/chart/<chartId>
Currently, a user can only view one project at a time. If he opens up a new tab or a new browser, he can still only view the one project. If he switches the project, all the other tabs/windows reactively change to the new project. This is because currently the project is tied to Meteor.user.profile.projectId (but I am looking for a better way).
I would like to change this behaviour so that tabs and windows are independent of each other. If a user pastes project\project1 into a new window it should load that and it's associated collections even if his current tab is in project\project2. I hope that makes sense.
I'm not sure how to accomplish this. I am looking for suggestions and solutions. Thanks.
I believe that this can easily be accomplished using session variables:
set a default somewhere in your client code, Session.setDefault('project', 1) (or make sure that project being undefined is handled gracefully)
when a user selects a project, set the variable:
Session.set('project', [selectedProjectId])
Wherever you need to decide which project to show: Session.get('project')

Possible to destroy a running game and then rerun it or run a different game

I noticed that the PlayN doc says that you can only call Playn.run once. Here is my scenario and I'm looking for advice on how to tackle it.
Let's say I have a list of games to choose from in a menu on my web page. Upon clicking a game, I call PlayN.run on that game and it runs on my web page inside the playn-root div. Now lets say I want the user to be able to stop and load a new game by selecting a different one in the game list and load that into the div and play that.
How would I go about tackling that? Do I need to re-register the HtmlPlatform all over again and the play the new game? Or is there a way to destroy the current game and then play the new game using the existing platform which is already registered in PlayN?
The easiest route would be to just use normal HTML links and have each PlayN game be on its own web page (which could be in an iframe if you don't want the URL to change at the top of the browser).
Trying to clear out and reinitialize everything internally is just a big waste of effort when the web browser will take care of all of that for you when you reload the web page.

Resources