Open slajalin opened 7 years ago
This is happening to me as well, any Luck?
I'm getting the same thing when running from Android. It appears to come from SalesforceClient.cs in its OnAuthenticationCompleted method:
CurrentUser = (ISalesforceUser)args.Account
args.Account is of type Account as defined in the external Xamarin.Auth library, while CurrentUser is of type ISalesforceUser which is defined in the Salesforce.Android library of the SalesforceSDK. The Account class does not derive from ISalesforceUser, therefore this throws an exception as an invalid cast.
I was able to create a workaround for this particular line of code, however there are numerous other instances of ISalesforceUser and Account being cast back and forth which throw similar exceptions. Does anyone have a solution for this?
@jimmynguyen17 I only ran into this error when creating a custom build. I couldn't find a way to cast to ISalesforceUser correctly so I just ripped it out along with SalesforceUser. I now use the Xamarin.Auth.Account class throughout the project instead with the RequiresReauthentication property added.
Hello!
We're currently trying to setup Salesforce authentication in iOS using SalesforceClient. We had set it up such that we're using a Sandbox authentication path with a callback path to go back into the app.
The login works fine until the user taps on the 'Allow' button in the 'Allow Access?' prompt and the app throws a 'Specified cast is no valid error' within the OnAuthenciationCompleted method.
Below is the log:
Is there any other setup that could be missing or have you seen this issue before? Any insight on this would be greatly appreciated! Thanks.