iOS 14 Widget cannot be updated from Notification Service Extension - widget

I have an iOS application + a Notification Service Extension + a Widget. Whenever I update in the app something in UserDefaults, that is read by the widget and I call WidgetCenter.shared.reloadTimelines, the widget does update instantly.
If I try to update the widget from the Notification Service Extension using WidgetCenter.shared.reloadTimelines, it does not work, throwing the following error:
[widget] reloadTimelines(ofKind:) - remoteObjectProxy error: Couldn’t communicate with a helper application.
Has anyone had this problem? Any input is much appreciated.

As a follow-up, I've tried to call WidgetCenter.shared.reloadTimelines from my application right after receiving a silent push notification, but it does not update the widget if the app is not running in the foreground.
It does seem to perform the WidgetCenter.shared.reloadTimelines right after starting up the app again, as if it was blocked somehow.

Related

Handle FileNotFoundException thrown by ImageResizer.AzureReader2 (BlobNotFound)

I'm running an MVC app on Azure. I use the AzureReader2 plugin. It's been working fine for years.
But when this hits missing images, it throws FileNotFoundException exception and this apparently breaks down user authentication, causing user to be redirected to login page.
Is there a way to prevent this? How can I catch and handle this exception for the URL API?
I am considering the Image404 plugin. But I am not sure it works with AzureReader2 plugin (?)
Exception handling would be best for me as I could take some other actions.
Thanks
You can see the Image404 plugin source code on GitHub. There is a Config.Current.Pipeline.ImageMissing event that it handles - you can plug into the same event to do your own logic.
It should work fine with AzureReader2.
Note that most likely your 404 page is set to require authentication, which is why it is redirecting.

Exception when I use Googleplayservices v71 with Xamarin Forms Maps v4.3

When I want to show google Maps I'm getting a:
Java.Lang.NoClassDefFoundError: 'Failed resolution of: Lcom/google/android/gms/dynamic/zza;'
It was working fine before I installed:
xamarin.GooglePlayServices.Base 71.1610.0 and xamarin.GooglePlayServices.Basement 71.1620.0
I need these two plugins because Com.OneSignal requires them.
When I uninstall Com.Onesignal it also doesn't work, but when I also uninstall xamarin.GooglePlayServices.Base and xamarin.GooglePlayServices.Basement again, I don't get the exception again and it shows the map. But then no notifications :(
I using Xamarin Forms 4.3.0.947036 and using a shell project.

Angular 6 PWA -- The PWA functionality is interefering with Azure Adal Authentication, not sure how to bypass it

I have a PWA built with Angular 6 and the #angular/pwa npm package and authenticating using adal-angular4 npm package (but could just rebuild that from scratch if needed -- the issue isn't a bug in the package I think)
When attempting to authenticate, although it does work, users are very often greeted with this message of not found (screenshot of console but its the same).
This especially seems to be the case if you are already authenticated to another (or itself) Azure AD product. Where it normally should only load for a while and then let the user in.
Service worker error transcript:
Failed to load 'link.com/#LONGTOKEN' A serviceWorker passed a promise
to FetchEvent.respondWith() that rejected with 'Error: Response not Ok
(fetchAndCacheOnce): request for LINK.com/index.html returned response 404 Not Found'.
It seems that writing a function to check for new version of the PWA has cleaned up everything. Because it's a PWA, when replacing files with a new version -- the cache will still be there and shift+reloading won't necessarily clear it, causing a lot of unwanted behaviour.
The code for the cleanup looks like this:
First, inject in the constructor the following: updates: SwUpdate
import { SwUpdate } from "#angular/service-worker"
Then, inside ngOnInit, I have the following:
updates.available.subscribe(event => {
updates.activateUpdate().then(() => document.location.reload());
})
It will force a complete refresh 2-3 seconds in if there's a new version available but all works well afterwards.

GoogleWebAuthorizationBroker sometimes crashes the app

I have a Windows Phone 8.1 app with Google login, which uses the
GoogleWebAuthorizationBroker.AuthorizeAsync
method. 90 % of the time, the authentication works, however, occasionally, the app just crashes on this line (I am logging right before it, so I am sure). I have the call wrapped inside try - catch, but that doesn't seem to work - exception is never caught.
I am also sure I am calling the method on a UI thread, I am using the DispatcherHelper from MVVMLight for that.
The fact that I am not able to reproduce the crash complicates this a lot, I have not experienced it with debugger attached, only in Release mode, on target device, run locally.
Do you guys have any ideas / clues / pointers? I know I'm not providing a lot of information, but I don't have any..
EDIT> So the error now happened with debugger attached - and the app just froze, last message in Ouput window was
"WinRT information: Cannot get credential from Vault"
But that's normal behavior..

Windows Phone Custom URI

in my windows phone 8 application i am using custom uri association to launch another application through my phone.
i.e
await Windows.System.Launcher.LaunchUriAsync(new Uri("sixtag:"));
but my app is not able to get certified for store because of this. the testing team tells that you app terminates unexpectedly while executing this.
now, i don't know how to deal with this.
is there any way to throw exception if the app which i am launching is not installed on phone ?
or i should try something else so my task gets accomplished and app gets certified for store as well.
You do not need to wrap your launch in try/catch or check for success as described in the other answers. As soon as you call LaunchUriAsync, the platform takes over and will automatically handle the possibility of no app being installed by asking the user if she wishes to search in the store.
A couple of things to double-check:
1) Ensure that you can successfully back into your app following the navigation to sixtag.
2) Ensure that your call to LaunchUriAsync is the direct result of a user action (eg. tapping a button)
try
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("sixtag:"));
}
catch
{
MessageBox.Show("please install Sixtag from the app store","AppMissing", MessageBoxButton.OK);
}
you can perhaps display another button and on clicking directly navigate to the app store. See if this solves your problem. Do vote it up if it does :)
You are needed to handle that as shown here . Also Read out Remarks given there.