ZXing and Xamarin - xamarin.forms

I've got a question for anyone who's worked with the ZXING barcode scanner in Xamarin.
I've got an app that has one page with the following code:
<zxing:ZXingScannerView x:Name="TicketScanView"
OnScanResult="Ticket_OnScanResult"
IsEnabled="False"
IsScanning="False"
WidthRequest="350"
HeightRequest="300"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"/>
Everything works great on Android and IPhone.
However when I add a second page with the same ZXing definition but change the name, the app runs on the iPhone and crashes on Android.
Any ideas/suggestions/input would be appreciated.
Thanks!

Related

CrossFirebasePushNotification.Current.RegisterForPushNotifications(); throwing NullReference iOS

to do push notifications in my Xamarin Forms App, I am using the CrossGeeks FirebasePushNotification Plugin. My android setup is working alright, but for the iOS app, when I try to run the app, the line
CrossFirebasePushNotification.Current.RegisterForPushNotifications();
is causing a NullReference Exception. What I have done to set up:
Set "FirebaseAppDelegateProxyEnabled" to "No"
Changed the GoogleService plist to Bundle Resource
Added the FirebasePushNotificationManager.Initialize(options, true); in the App Delegate (and it is saying it is unreachable?"
I am testing on a simulator but I believe this should only prevent the receiving of notifications, not the registering?
How would I solve this problem? In the documentation, it states that these are the steps needed for iOS setup.

Prism Navigation is not working correctly

I just created a sample Android-XAMRIN project using Prism Template Pack. My base project in dot net standard 2.0 and I am using Prism.Unity.Forms 7.2.0.1367. While launching application it is showing blank page. I am attaching all images of project pages. AndroidProjProp.png
App_xaml App_xaml_cs
App_Proj_Prop MainActivity_cs MainPageViewModel Nuget_Installed ViewModelBase
You can follow Brian Lagunas's tutorial to create your app.
I followed his tutorial to createa a sample project, and run on my device, the result is showing a text Welcome to Xamarin Forms and Prism! .
The code of MainPage.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BlankApp2.Views.MainPage"
Title="{Binding Title}">
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Label Text="Welcome to Xamarin Forms and Prism!" />
</StackLayout>
</ContentPage>
Note
1.The difference is that we choose the value of container is Unity,just as follows:
Since it is a Xamarin Forms app,so we create user interfaces in XAML with code-behind in C#. and these interfaces are rendered as performant native controls on each platform. So the project pages is coded with format of XAML,not Activity(MainActivity) just as you mentioned.
For more information about Xamarin Forms, you can check: https://learn.microsoft.com/en-us/xamarin/get-started/what-is-xamarin-forms
Actually this was happening due to the current version of VS2017. I was using. I updated visual studio and it is working fine. Thanks

Replace WebView with WKWebView in Xamarin Forms application

I have a webview inside my Xamarin Forms application which opens report downloaded from server in html format. Today I uploaded my archived application to app store and get information about ITMS-90809: UIWebView API Deprecation.
The problem is that I have no idea how to replace UIWebView with WKWebView in cross platform application. I've tried several solutions:
1) Creating Custom renderer for WebView - but this is no solution really because I need to inherit my new class by WebView superclass. So Apple warn me again with the same message.
2) Creating dependency service and use custom renderer in ios project only. But this is the same problem - there is still WebView reference in shared project.
So, is there any way to inject WKWebView directly to StackLayout in iOS? I know that WKWebView is iOS only and StackLayout is Xamarin.Forms component but really I don't have any idea how to do this.
Can anyone help me?
There is an issue in Github you can follow: Deprecated API Usage UIWebView
WebViewRenderer in iOS implements UIWebView, and the file stays even if you switch over the WkWebViewRenderer. That's why you get the error message.
Xamarin team is working on it and it will fixed sometime in the future.
Also, there is an Apple statement says:
The App Store will no longer accept new apps using UIWebView as of
April 2020 and app updates using UIWebView as of December 2020.
So you can still submit app with UIWebView right now and the error messgae is just a warning.
Relevant links: Make WkWebViewRenderer default for iOS WebView

Xamarin AppUriHandler

I've been struggling with the APPUriHandler to work correct using Xamarin.Forms for building a multi platform app. I am not getting the AppHandler to work correct using the "Shared pages"
Following https://learn.microsoft.com/en-us/windows/uwp/launch-resume/web-to-app-link i have managed to open the appif i launch the app manual, when using a link I get stuck on the SplashScreen
which throws an error :
Its just when using the handler that it fails. I have identified that if I add a new page on the UWP project, and navigate to that page, it works fine. My problem is using the .Net standard (Old PCL) method as it is using multi platform. Is there a way to get past this or call the LoadApplication a different way from UWP MainPage as that is where it breaks
or anything that can steer me in the right direction?

Xamarin Forms - Xamarin.Forms.Platform.UWP.ImageRenderer.UpdateAspect()

I saw some post about it but, unlike them, me it only happens since the update of VS2015 to VS2017, any idea?
at Xamarin.Forms.Platform.UWP.ImageRenderer.UpdateAspect()
at Xamarin.Forms.Platform.UWP.ImageRenderer.<OnElementChanged>d__3.MoveNext()
End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()"
My project is a Forms Portable Project, tell me if you want any details, I'll edit the question ! Also, I use a renderer for Android, but not for UWP, it works on android, but it shouldn't be the problem since it worked before
Thank in advance
It's probably a bug in Xamarin Forms: https://bugzilla.xamarin.com/show_bug.cgi?id=37022
Updating Xamarin Forms should do the trick. I installed Xamarin.Forms version 2.3.5.239-pre3, which solved my problem.

Resources