Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Specified cast is not valid Exception on Reauthenticate #419

Open
hareshkalyani opened this issue Jun 11, 2020 · 3 comments
Open

Specified cast is not valid Exception on Reauthenticate #419

hareshkalyani opened this issue Jun 11, 2020 · 3 comments
Projects

Comments

@hareshkalyani
Copy link

hareshkalyani commented Jun 11, 2020

Currently Using Xamarin.Auth 6.5.1.

We have functionality of delete account.

So before performing to delete account user have to verify the phonenumber as we have used phone auth.

When we are trying to verify number with Reauthenticate, its throwing Invalid Cast Exception.

Here is some code snippet

Auth.DefaultInstance.CurrentUser.Reauthenticate(credential, (error) =>
                    {
                        if (error == null)
                        {
                            ///
                        }
                    });

Here credential is created by this.

PhoneAuthCredential credential = PhoneAuthProvider.DefaultInstance.GetCredential(authId, otpCode);

And Exception is

(wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution)
Runtime.GetNSObject[T] (System.IntPtr ptr)
Trampolines+SDUserProfileChangeHandler.Invoke (System.IntPtr block, System.IntPtr error)
(wrapper native-to-managed) ObjCRuntime.Trampolines+SDUserProfileChangeHandler.Invoke(intptr,intptr)
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIApplication.cs:86
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIApplication.cs:65
Application.Main (System.String[] args) /Users/haresh-mac-mini/VisualStudioProjects/Blerb_iOS_V2/Main.cs:12
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIApplication.cs:86
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.1.31/src/Xamarin.iOS/UIKit/UIApplication.cs:65
Application.Main (System.String[] args) /Users/haresh-mac-mini/VisualStudioProjects/Blerb_iOS_V2/Main.cs:12

As per my understanding there is some confilct between SDUserProfileChangeHandler and NIDUserProfileChangeHandler, as SD having 2 param and NID having 1 param in block.

Looking for some help here.

@Redth Redth added this to Needs triage in Triage Jun 12, 2020
@hareshkalyani
Copy link
Author

Any solution to this.

I see similar type of issue happen at another function.

#213

@rjhind
Copy link

rjhind commented Jul 27, 2021

I'm seeing this also. Any solution/work-arounds yet?

@AdamEssenmacher
Copy link

Fixed by #591

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Triage
  
Needs triage
Development

No branches or pull requests

3 participants