Okta login and xamarin forms prism - xamarin

I am getting this error message while calling await OktaContext.Current.SignInAsync(); this method of plugin okta.xamarin.
Its working fine with normal mvvm but giving following issue with prism.
Attempt to present <SFSafariViewController: 0x7fe6e396f600> on <Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x7fe6e1926e60> (from <Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x7fe6e1926e60>) which is already presenting <Xamarin_Forms_Platform_iOS_ModalWrapper: 0x7fe6e4920ad0>

Related

Xamarin Forms with Xamarin Player OAuth2 NInterpretException

I'm currently on developing some little application for iOS and Android. Therefore I need an OAuth2 authentication.
How I proceeded (from here)
Create a new Xamarin.Forms project from the templates with the default Item and About page
Add Dependency for Xamarin.Auth
Use the button on the about page to trigger a function with the following:
var authenticator = new OAuth2Authenticator(
"CLIENTID"
,
"SCOPE",
new
Uri("AUTH_URL"),
new Uri("REDIRECT_URL)
null,
true);
Add the iOS initializer in the AppDelegate.cs global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();
Add the URL Types in Info.plist
I'm using the Xamarin Live Player to deploy this on my iPhone 7. When I'm triggering the button, I get the following error message:
Uncaught Exception: Bad convert with overflow instruction 'IL_0001: conv.ovf.i.un' (NInterpretExcetion)
Some ideas how to fix this?

Xamarin Forms OAuth2 Error Target of Invoke is null

After solving this problem I ran into another.
I changed the NuGet-package and implemented everything as described here.
I also added the initialization code in the AppDelegate.cs. But if I push the button to login I get the following error message: Uncaught Exception: Target of Invoke is null (NullReferenceException).
What I've done so far:
Create OAuth2Authenticator with appropriate values
Add Event handler authenticator.Completed += OnAuthCompleted;`
Initialized platform specific login UI with global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init(); and global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, bundle);
Triggered the login with:
var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
presenter.Login(authenticator);`
I'm using the Xamarin Live Player to deploy this on my iPhone.
Some ideas how to fix this?
UPDATE:
I was able to test the app with a Android emulator and there is everything working. So my assumption is that it's because of the Xamarin Live Player.

ABP BoilerPlate: i cant see my exception message when i'm using UserFirendlyException

i'm using ABP ASP boilerplate .net core / angular client side frame work.
i want to show specific message when some condition exists in server side by raising UserFriendlyException("myMessage") but in client side only showing popup window
my end point API signature is like this async Task<BDto> CalcBodies(ADto input)
my problem solved by specifying LocalizationSourceName property of Service instance base on this post : GitHub link

Closing Android Activity opened from Forms.Context.StartActivity

I am working on facebook authentication in a Xamarin forms app and want to use "native" login on each device.
The Facebook SDK (by Xamarin) is not designed for forms since it requires passing in an Android activity that implements some specific interfaces.
However; I was able to get the UI to display using a custom page renderer and then in that renderer calling StartActitivty with an activity that uses the exact implementation described in the Facebook SDK getting started. https://components.xamarin.com/view/facebookandroid
So far everything works perfect. The android app starts, xamarin forms kicks in, the custom page renderer is loaded the login android activity starts and the user logs in with facebook and we get to the console.writeline below.
So, how do I dismiss this intent or otherwise get back to xamarin forms?
Do I:
Dismiss this intent? - if so then what?
Inject something to "reset" the main page?
Other?
public void OnCompleted (Xamarin.Facebook.Model.IGraphUser user, Response response)
{
//TODO: show user details with welcome and button that takes them to main app.
//TODO: switch back to xam forms from here on out.
//TODO: figure out how to change the `main` activity to xam forms.
// 'Me' request callback
if (user != null) {
//How do I get back to Xamarin forms from here?
Console.WriteLine ("GOT USER: " + user.Name);
} else {
Console.WriteLine ("Failed to get 'me'!");
}
}
You should call Finish();
Anyway, if you want to see exactly how I did it, you can check it here:
https://github.com/IdoTene/XamarinFormsNativeFacebook

angularjs and phonegap on windows phone 7

I'm having trouble getting angularjs working on windows phone 7 with phonegap. The simple stiff works, but as soon as I try to add page include or a view (route) it doesn't do anything. In the function matchUrl(url,obj) in angular.js (1.0.3) there is a regex that fails because Windows Phone use an unusual URL format.
What happens is angular is expecting a url like 'http://localhost/www/index.html' but in windows phone it will look like: 'x-wmapp0:app/www/index.html' instead.
Has anyone run across this and is there a solution?
This issue is as of now still unresolved and tracked here
https://github.com/angular/angular.js/issues/2303
EDIT:
The mentioned issue is still open although fix was submitted.
I managed to get a basic angular app running in phonegap WP7 by
applying the mentioned fix
including jquery (2.0.3) above angular.js
changing line of code in angular from
var xhr = new XHR();
to
var xhr = new XMLHttpRequest();
manually bootstrapping angular app after cordova deviceready event fired
I reported it here
Using angularjs-1.1.5 and changing line 5612 with
var SERVER_MATCH = /^([^:]+):[\/\/]*(\w+:{0,1}\w*#)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
should fix the problem

Resources