Prism detecting if page is modal programmatically and go back - xamarin.forms

I am implementing a feature using "connectivity" from essentials that when the app goes "offline" no wifi etc.. it navigates to a specific page.
It works in most cases however if I set the phone on "Airplane Mode" when I am on a modal page it does not navigate to my page.
In Prism is there a way to detect if the current page "IsModal" and either goback or kill it so that I can navigate to my specific Page?
THanks

You'd have to write some crazy lookup logic to figure it out. Unfortunately the helper for that doesn't currently exist. However the latest Prism 7.2 preview has some enhancements that specifically attempt to eliminate the need to figure out whether you require Modal Navigation and automatically use the proper type of Navigation. I would encourage you to try the preview. If you come up with a scenario where GoBack isn't working correctly please open an issue.

Related

Google Optimize: Unable to preview experience. Please make sure to enable cookies and restart the browser

I can't preview my Google Optimize experience. Google optimize throws below error:
This happens to me quite often too. The suggestion Google gives is wrong. Clearing cookies and restarting the browser does not fix it. Sometimes rebooting does, but that's a huge disruption.
What I found to work pretty reliably is to end the preview (dropdown), then click the EDIT button to go to the editor. Come back to the setup page, then try Debug again. Debugger should work again.
This is how it worked for me:
In Chrome go to Clear Browsing Data (chrome://settings/clearBrowserData).
Make sure you select checkboxes Cookies and Cached images and files.
Submit the form by hitting the button "Clear data".
Go to preview experience.
For me it started working when I gave the Google Optimize plugin access to all pages (not just the page running the experience).
I think I've found a fix for this. Go to the top right corner of chrome (the three dots) Settings > Privacy & Security > Cookies & other data > and add the url in the bottom section called "sites that can always use cookies"
Example
There can be multiple reasons.
Most obvious: enabled cookies like mentioned by others. should help
If it does not work even when cookies are enabled and you have restarted the browser then more chances are that the issue is in the Experience/Test that you are trying to preview. This can be due to:
A preview is already running in another tab. Turn off preview
2.You have set the experience to run on certain URL patterns and you are trying to preview on a page that does not qualify the criteria.
You have set some Audience rules which are not being met fully. For example: You have set the Audience Device type to mobile and you are trying to preview on a Desktop. Although Optimize will load the preview in a mobile mode but it will not be able to run the experience properly.
In my case the issue was due to wrong device type. I hope it helps.
It's also possible to get this "Unable to preview experience. Please make sure to enable cookies and restart the browser" error message if the content you're trying to modify doesn't exist when Optimize tries to modify it.
I had Optimize set to modify on page load, but the page I was working with was a form, where the text I wanted to modify didn't exist until I clicked through to the second step of the form (still on the same URL).
I was able to just run the study instead on another similar page that had all the text loaded at the start. I'd guess that setting Optimize to trigger from a custom event triggered upon loading the second step of the form instead of "on page load" would also have resolved the issue.
If you are using chrome then:
Click the context menu in the browser toolbar to the right of the
address bar.
Choose Settings.
Select/Search the "Security and Privacy" section.
Choose "Cookies and Other Site Data" Ensure that "Allow all cookies" is selected.

bypass tab click in tabbed page

My application is using a tabbed page to separate 2 main areas. Using Xamarin.Forms 4.x and Prism.
The first tab basically hosts a set of linear navigated views modelling a workflow. It's been identified that when a user has progressed through the workflow, and accidentally taps on the current tab, the user is popped back to the start of the navigation.
Is there any way to bypass this event?
This only seems to happen on iOS.
I just discovered the answer. Works perfectly.
https://forums.xamarin.com/discussion/144478/ios-stop-tab-re-select-pop-to-navigation-page-root

Visual response for loading pages in pwa

Is there a way to let PWA users know that a clicked link is being loaded. Usually in the browser we see the blue progress line indicating this but in the pwa the user is left to assume the page is loading except there is a pseudo effect on the buttons programmed by the developer. I understand the idea behind pwa includes giving users immersive visuals and if pages load faster, the users will not bother about the blue line but sometimes it's needed.
Going through the same thing but i think i found a way.
We can use bootstrap spinners to animate this. We can use javascript to detect a link click and show the spinner. We can also add this on submit button click.

Drupal Views code error

Every time I try to apply a change in Views (or even cancel a dialogue window for that matter), I get a massive page of code, like this:
!http://reubenlara.com/blog/codeerror.png
When I refresh the page or go use the browser's back button to get to the views panel, everything's fine and the changes are applied. This only happens with Views. Is this happening to anyone else?
Drupal 7.22.21
I had similar issue because I was using some javascript plugins required some other modules. Please make sure you are not using entityreference views. If you do, you should disable the javascript on your browser using web develop tool bar or similar.
OK i just figured it out! I had the jQuery Update installed and had it set to jQuery 1.8. Views did not like that, so I set it to jQuery 1.7 and views is working fine.

How do I make a mobile-friendly popup on my website?

Is there a simple way to trigger a mobile OS's native pop-up/alert/etc. from some form of web code? I'm writing an ASP.NET mobile web page and I'd like to, for example, have the iPhone's UIAlertView appear.
EDIT: What I'm looking for is not the method with which to detect which mobile browser is accessing the site (I already know how to do that). If the code to trigger a pop-up that will look nice in an Android browser is different than the code to trigger a pop-up that will look nice in an iPhone browser, I can simply throw in a switch statement that redirects the user to the pop-up that corresponds with their browser. I'm trying to find the html/javascript/asp.net code which will create a mobile-friendly pop-up, either in general or for the various popular mobile web browsers specifically.
Don't know whether there is any pre-built functionality in .NET that can achieve this, but you can surely write one yourself.
You can write a method, that returns the code for your popup, based on the user OS (simple switch statement should do).
EDIT after taking a short nap:
I believe you should reconsider using popups. They are quite annoying even on desktop browsers and many people block them automatically. Probably every blog about accessibility will tell you, that you should keep mobile version of your website as simple as possible because of various compatibility issues that you can run into.
Instead, try to think about some interesting way to incorporate messages for users in a different and appealing way, that won't disturb anybody.
What I do is use a div popup (that floats ontop of the page) and eighter make a big close button or set at timeout to remove it.
jquery mobile is a good place to start.

Resources