Flutter: open_file package does nothing - flutter

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.

Related

How Can You Open Android Application Property Pages in 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

Facebook/Meta: "Error Found while validating app-ads.txt, can't find valid App ID in file" (Android App)

I cannot figure out what I am doing wrong, I've been going around in circles for hours. I have a website, I copied the code provided by Admob for the app-ads.txt file, for example:
google.com, pub-1234512345, DIRECT, f987698769876
The app is active in the Google Play Store. I placed the txt file at the root of my domain for the app's website. I'm pretty sure the file itself is uploaded correctly because the error is not stating it cannot find the file, the error states the following via Facebook's App Dashboard:
Error found while validating app-ads.txt. com.companyName.gameName: We couldn't find a valid App ID in your app-ads.txt file
This is confusing because I copied the ID straight from Admob. Is there another App ID I should be copying from? I uploaded the file to root directly maybe 6 hours ago, is there time needed for something to take effect? I can't confirm ownership of my app with Facebook until I figure this out. No matter what I do I get the same error.

Google AdSense ERR_ADDRESS_INVALID

My website has just been approved by AdSense, and I tried to put some basic display ads on the site.
I've set up the ad, and pasted the HTML Code in my project.
When I visit the website, the console says:
Failed to load resource: net::ERR_ADDRESS_INVALID (at adsbygoogle.js:1)
I thought it was a problem of my website, but when I try to manually open the adsbygoogle JS, my browser also says ERR_ADDRESS_INVALID.
Anyone knows what to do?
Thanks in advance
Never mind, it was because of my Windows hosts file... Some program I've used earlier, blocked a lot of Hosts through 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.

Facebook AS3 api log in box did work, a day later it does not

Yesterday I successfully got my flash project to log in with the facebook as3 api.
Today I tried using the application again, and now its not working. I didn't change any code... Does anyone know how I should approach debugging this or has this happened to anyone else?
Thanks
A friend created a solution for this issue. I fixed my flash sites and their facebook connect with AS3 SDK.
We're from Mexico so it's in spanish:
Facebook AS3 Fix
Traduction:
1.- If you're using GraphAPI_Web_1_8_1.swc, delete it.
2.- Download the modified api from Here
3.- Copy the folder in your libraries, if you already had the facebook folder, overwrite.
4.- Compile the project.
The problem happened because facebook modified its http://connect.facebook.net/en_US/all.js file in a way in which the FacebookJSBridge.as file from the as3 api made some calls to "FB.JSON". Now they should be made to "JSON" instead.
1.- If you are using GraphAPI_Web_1_8_1.swc delete it.
2.- Download the modified graph api from here
3.- Paste those folders on your librarys, if you had the facebook folder overwrite it.
4.- Publish your project.
This problem started when facebook changed its file connect.facebook.net/en_US/all.js in a way that all the calls made from the as3 file "FacebookJSBridge.as" must be changed from "FB.JSON" to just "JSON".
src: http://ederchrono.com/blog/2012/05/09/fixing-fb-graph-api-for-as3/
The facebook connect functionality on all flash sites made at work have also stopped working. When clicking on the facebook connect button nothing happens. And we’ve made no changes. Now everyone’s working frantically to find a solution.
I hope someone finds a solution soon. Facebook has posted no changes, though they should look into this. I bet tons a flash sites have just stopped working.