Xamarin.Auth doesn't persist data after closing the app - ios - xamarin

I have built an application through Xamarin.Forms, I am using xamarin.auth to save sensitive (login) data on each platform, Android app works correctly, I login to the app, save the data, close the app, re-open it and no need to login, the app goes directly to the home page, but in ios every time I open the app I need to login, and after that I close it and re-open it again I need to login again, I think there is something missed, I am debugging on a real iPhone 7 plus device, any help please?

Related

iOS WKWebView won't access iPhone XR camera

I created an iOS WebView app and wanted to display the following website: https://qrcodescan.in/ within this app through WkWebView in fullscreen. Opening it up on safari works perfectly fine and before I can use it I get the message regarding granting camera access.
Opening the same URL up on my app though won't give me any pop up asking for camera permission and therefore the app is not usable. The console show this message: Connection to daemon was invalidated.
I even asked someone to look for the problem and he deployed the same project without any configuration on his iPhone 8 running iOS 13.5.1 and it works perfectly fine. I use an iPhone XR and iOS 13.5.1 as well but it seems. like that I can't get any camera access.
Is there anyone who eventually knows how to fix this problem?
Try asking for camera permission before the web view is created in your app. Request these permissions as if your app was using the camera, not the web view. The web view should then be able to request permission.

Where to save app info to survive reinstallation after building?

I currently use App.Current.Properties dictionary to save some basic data needed for the app to connect to a database.
Unfortunately, when building and reinstalling the app on the Android simulator (didn't tried on the iOS one), app data seems to be wiped, so every time I test the app I've to re-enter connection info.
How can I avoid that?
Does it work if you start the app without redeploying it? If you just click the app icon on the emulator. If it does not you have propbarly forgot to call the save method.
Application.Current.SavePropertiesAsync();

Android Application minimize issue

I have developed an Xamarin forms application. In Android devices, Lenovo K6(v7.0) and Nexus 6 (v7.1.1), when the app is minimized and opened by clicking the app icon the opening page of the application is reset to default instead of showing the part in the page where the user has minimized the application. But, when the app is minimized and re-opened using the recently opened tabs it is resumed correctly.
This problem arises only in the mentioned two devices in all other devices the page is resumed from where it is minimized when the user re-opens the application on using both recent tabs or App icon click. If the close application then reopens it and application starts from Splash screen. In above scenario, the app starts with the home page and reset as default launch. I have started the download of my app and progressing the download. I have minimized the app and click app icon from the installed app on the device. Now, progress is reset and file stays as download file.
Please suggest on this to resolve it.
Regards,
Cheran

How to identify some particular app is installed or not in my device using xamarin forms (Android and ios)

How to identify whether some particular application is already installed in my device or not through xamarin forms? (I want to achieve in android and ios).
Explanation :
In native windows application I have used one service which give me following data (App Name, App Icon Image, App Id, Publisher Id, Version name).
I have checked whether particular application is already installed in my device or not through App Name, App Id, Publisher Id.
Suppose app is installed then I checked version of the application if its fully updated then "Launch" button display and if it is not then "Update" button display.
If application is not installed then "Install" button display and this button redirect me directly through play store.
Same thing I want achieve in android and ios through xamarin forms.
which things are required through service for android and ios?
How to redirect directly to play store in android and ios?
Method 1:
Try using App Links. You need to install the Rivets component from the Component Store. You can handle the navigation to play store if not installed and else browser based on your URL.
Rivets.AppLinks.Navigator.Navigate("http://any.old.url");
Your app will now attempt to Navigate to another installed app for the URL using App Links, or will fall back to usingUIApplication.OpenUrl in ios/or will fall back to using an intent with a view action in Android, if no App Link meta data is found, or no apps for the metadata are installed.
Method 2:
For example I have handled the situation for facebook app to open a page from my xamarin app but not by using App Links.
Device.OpenUri(new Uri("fb://page/page_id")); // Launch the page in facebook app (if facebook app is installed) from my application.
The above code line when executed, will open the specified facbook page in facebook app. Notice "fb://page/page_id" this is the intent with specific uri provided from facebook. You can read more about it here.
Use Plugin.Share to use CrossShare to open a browser cross-platform from your xamarin app. This I have used below.
The above code will throw an exception if facebook app is not installed, then you probably need to redirect to the play store of Android or the app store of Apple.
For Android:
CrossShare.Current.OpenBrowser("https://play.google.com/store/apps/details?id=com.facebook.katana");
Here com.facebook.katana is the package name of facebook app in android. You can replace with your application's package name if registered on playstore. This will automatically launch in playstore not in browser.
In case of IOS redirect to App store:
CrossShare.Current.OpenBrowser("https://itunes.apple.com/us/app/facebook/id284882215/");
Here id284882215 is the app id of facebook on Apple's app store.

Cloudkit error when querying public database from simulator

I'm working on an app where I recently decided to go with CloudKit and am now at the point where I need to implement the backend functionality. In a nutshell, this app will use a collectionview to display images retrieved from a CK database. Up until now, I just dumped some images in a folder on my desktop and retrieved/parsed the images from there to render the collectionview. I then used the CK dashboard to create some records and wrote an initialization method to try and retrieve them. I was getting various CKErrors, such as network failure, error completion without receiving a response from the server, could not send a valid signature, etc. I immediately assumed the issue was with my code since it was my first attempt with CloudKit. However, I ran the latest code on my device before posting on SO and it worked! I got a successful response with the number of records in the results array that I was expecting.
So now I know longer need help with fetching CKRecords like I initially thought. But how do I resolve this issue with the simulator? I saw some other post about making sure you're signed into iCloud on the simulator. I believe I am, but do not know how to check to be sure. Also, I'm running Yosemite and Xcode 6.1.
Any help is appreciated!
on the simulator go to the settings app. You can do that with menu hardware, home and then open the settings app, select iCloud and make sure that you are logged in.
To use your Apple ID on iCloud on the iPhone Simulator, make sure you turn off Two-way authentication. It should then work on the simulator.

Resources