How Can You Open Android Application Property Pages in MAUI - maui

I have a MAUI app that uses Contacts; this feature was added after the initial release. People that upgrade the app didn't grant permissions to Contacts when the app was first installed because we weren't asking for it then (since we weren't using it). I can capture the fact that they're getting denied access, but is there a way in MAUI that I can navigate through the Android settings (like I've seen other apps do) to open the Permissions page for our app so users can more easily grant us permissions to Contacts?

I don't know if I understand correctly.
is there a way in MAUI that I can navigate through the Android
settings (like I've seen other apps do) to open the Permissions page
for our app so users can more easily grant us permissions to Contacts?
First, add this permission in AndroidManifest.xml
<uses-permission android:name="android.permission.READ_CONTACTS" />
Then open Setting->Apps&notifications-> Select App ->Permissions->Contacts
For more information, you can check Contacts - .NET MAUI | Microsoft Learn and Permissions - .NET MAUI | Microsoft Learn.

It took a bit of bumbling around, but I found a solution that will open the app's settings page, and you can click on Permissions from there. I got mixed result in researching this, but it sounded like you can't open the Permissions page directly. In any case, here is the code in case it is helpful to you:
#if ANDROID
//from: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/provider/Settings.java
string APP_DETAIL_SETTINGS = "android.settings.APPLICATION_DETAILS_SETTINGS";
var act = Microsoft.Maui.ApplicationModel.Platform.CurrentActivity;
Android.Net.Uri appUri = Android.Net.Uri.Parse("package:" + act.PackageName);
Android.Content.Intent tent = new Android.Content.Intent(APP_DETAIL_SETTINGS, appUri);
tent.AddCategory(Android.Content.Intent.CategoryDefault);
tent.SetFlags(Android.Content.ActivityFlags.NewTask);
act.StartActivity(tent);
#endif

Related

Flutter: open_file package does nothing

I'm developing a Flutter application. I've been using the open_file package for quite a while now to open files, but suddenly it doesn't work. I tried altering the code to print out the result of envokeMethod, and this is what shows up in the terminal.
I/flutter (13494): Result: {"type":-3,"message":"Permission denied: android.Manifest.permission.MANAGE_EXTERNAL_STORAGE"}
I tried adding the permission MANAGE_EXTERNAL_STORAGE in AndroidManifest.xml but it didn't work. I checked my app permission, it has access to file and media.
Any help would be greatly appreciated. Thanks.
After looking for some stuffs, I finally found the problem. When I checked my app's permission, for some reason there are only 2 options in File and Media section, which are Media only and Deny. For some reason file isn't included there, so I looked it up and found out that you need a specific permission starting from Android 11, which is called manageExternalStorage. So I had to ask for storage permission, then manageExternalStorage permission, and only then I could see a third option in the File and Media permission, which is All Files. After applying and asking for that permission, open_file works perfectly fine. BUT, it turns out that ManageExternalPermission is a pretty sensitive permission, which in my case, my application doesn't fulfill the requirement to ask for that permission, and was rejected due to that when I published it to Play Store. So I ended up forking the open_file package, changed it so that it doesn't require ManageExternalStorage permission, and it all works fine after that.

Share my objects using a link - ionic3

I'm imagining this situation: I have my app opened on my device. I've just created a new element (object) in my app, for example a new Film like this
film = {
title: 'Shark 3',
subtitle: 'the revenge',
date: '12-11-2019',
plot: '...'
};
and I've saved it in my local storage. Now I want to share it on socials (WhatsApp, Facebook...) generating a link to this object. By clicking on this link I want my app (or the app store if it is not installed) to open. In case my app is installed, it should display a page with the film's information.
Is it possible? How to do this in ionic?
The data you want to present is stored within the app and so available on every device your app is installed, I guess? Or is it data loaded from a backend?
What you want to do is called a Deep Link. This means clicking on a links opens your app and redirects the user to a specific page depending on the link.
This is possible with Ionic and the DeepLink native plugin.
But there need to be done other things outside your app to make it work. You need to register and verify your domain with Google and/or Apple.
And be aware testing this is very uncomfortable. It will only work with signed packes. So just running ionic cordova run android won't work, you will have to go the whole way creating a signed package as you need to do when you're going to publish it.
Here is a Blog article describing the functionality.

How do I open any app from my web browser (Chrome) in Android, automatically?

I am struggling a little bit. I have a common url like www.domain.com/test.html
and i want Android users to get my app open if "test" is included, otherwise if they don't have the app their should be directed to the play store. I got everything implemented and it works with mozilla browser. But using chrome on Android it should be forbidden to automatically open the app if it is available!?. Now if the user enters www.domain.com/test.html and i recognize he is using Android and Chrome i tried the intent stuff in a script in a redirected www.domain.com/android_chrome.html:
<script> window.open("intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;S.browser_fallback_url=http%3A%2F%2Fzxing.org;end","_self")
</script>
But the App won't open automatically. If i use a regular Link:
Take a QR code
it works. But i want to let it open automatically!
Google restricted starting intents from javascript apps, that's why it isn't working. Security reasons I guess. You should just display nice big link to let user switch to your app instead of website - or let him continue if he doesn't want to launch the app.
Forcing users into using app is bad, IMO. Splash screen suggesting to use it is okay, but don't push it.

How to add facebook-ios-sdk in app for login and fetch user data

I want to integrate the facebook login dialog in my app. For that i have checked the facebook developer page to integrate it.
1 - Downloaded facebook sdk package and installed it
2 - added facebook.framework and FBUserSettingsViewResources.bundle in my app
3 - and use its SessionLoginSample
Its running and user can do login using facebook but its open in safary instead of that i want to open it in dialog box.
Answer in here says that do change in facebook.m file but my project does not have it. for that i have downloaded facebook-ios-sdk project from the GITHub and in that project from src folder i have copied all file in my project. Its non arc so added flag fno-objc-arc.
But facebook.m file does not contain that code which answer suggested to change. And also i have implemented graph GraphApiSample but it display error in FBLoginView.
So plz help on this topic any code or tutorial will be highly appreciable.
If you want to open the login page within your app you have to use the FBGraphAPI .
If you want to force the web dialog, you need to specify the login behavior.
If you look in FBSession, there are many methods to open a Session, many of which will take an FBSessionLoginBehavior parameter. If you pass in FBSessionLoginBehaviorForcingWebView for the login behavior, it will force the web view dialog.

How to integerate Facebook chat in iPhone using xmpp framework

I am trying to integrate Facebook chat in iPhone, when I searched related stuff I found xmpp framework. I download it and run but it is not showing anything. Is there any tutorial available for this? can anyone help me to how to integerate facebook chat in iPhone?
Inam
Check this out: http://code.google.com/p/xmppframework/wiki/FacebookChatHowTo
Now the project has moved to git hub, the same page can ben found on http://github.com/robbiehanson/XMPPFramework/wiki/FacebookChatHowTo
https://github.com/robbiehanson/XMPPFramework
how to compile is on this link.
https://github.com/robbiehanson/XMPPFramework/wiki/GettingStarted_iOS
which is also on the same git page.
download xmppframework and unzip it.In the unzip folder contains xcode folder open it and again it contains iphoneXMPP folder ans open it click on xcode proj and run it.
login page will be displayed before that open appdelegate.m file there is delegate method:
(void)xmppStream:(XMPPStream *)sender willSecureWithSettings:(NSMutableDictionary *)settings
{
}
Replace server domain from "talk.google.com" to "chat.facebook.com" and virtualDomain from "gmail.com" to "facebook.com"
You must login with your facebook username and password.Remember username is differ from regular username,
for example
my regular username is:" venkat.varra#gmail.com" but if i provide this wouldnot login intead of this i will provide username as: "venkat.reddy.73157203#chat.facebook.com"
password is asusual.
Toget your username like this go to facebook account and click your display name then observe address bar of the browser.
I tried this way and i get my facebook friends.You try this.
Facebook seems to have deprecated XMPP Chat API. Should no longer work After April 30th, 2015.
More here : https://developers.facebook.com/docs/chat#platauth