how to view and edit manually the sharedpreference of a Flutter macos app? - swift

In Android, it is possible to view or modify the shared preference using Android Studio.
How can I view the shared preferences file using Android Studio?
How can the same be achieved with MacOS apps when I used the SharedPreference Library?
Where is the date even stored in the computer ?
Edit:
I found how to read it:
defaults read uk.co.mytestapp Where can I find the shared_preferences raw json file when running as a MacOS desktop application?
But I still don't know how to write to it.

The preferences file is
~/Library/Preferences/uk.co.mytestapp.plist
or if sandboxed
~/Library/Containers/uk.co.mytestapp/Data/Library/Preferences/uk.co.mytestapp.plist
You can open it with the Xcode.

In addition to the accepted answer, I found we could use
defaults write com.example.app flutter.keyname -string "$(cat ./temp2.txt)"
and to read:
defaults read com.example.app flutter.keyname
where keyname is the preference key

Related

How to store files in directory that will be accessible to user in flutter?

I have encountered a problem that the app needs to save pdf files downloaded from the internet in the downloads folder in both ios and android, but after searching for solutions on the internet I have not found anything that would help in this implementation. I would appreciate if someone could share their experience in implementing such functionality.
It would be better if you can add more details to your questions. It is preferred that you should attach some code or screenshots of your code so that you can get better help.
every app in android or ios has its own folder in the device storage, android apps will be in the android directory.
you can use the path_provider plugin to get the directory of your app, all the information you need will be in this link

Is it possible to generate .watchface for apple watch, without iphone's default watch app or apple watch itself?

I want to generate a .watchface file from my xcode project. Is there any way to create .watchface file from outside of the default Watch app?
I have found a website Facer, where they are offering customizing options and generating .watchface from their website. What approach they are following?
name.watchface -> name.zip
Unzip it and make it into that structure
Create watchface file programmatically and execute CLKWatchFaceLibrary().addWatchFace API

What is the difference between getApplicationSupportDirectory and getLibraryDirectory?

As an Android developer, I am pretty familiar with native getFilesDir function, which is provided by path_provider's getApplicationSupportDirectory. I noticed for iOS there is another function called getLibraryDirectory with pretty similar description in path_provider's docs. But the docs are not much clear about it. What is its purpose and when to use this instead of getApplicationSupportDirectory (or getApplicationDocumentsDirectory)?
getLibraryDirectory function is used when the application is supposed to store the persistent data like backup files or database. It is used in iOS devices as in android it is not supported and throws exception.
getApplicationSupportDirectory function is used for application data which probably resides inside Android folder in android devices. It can be used for both iOS and Android devices. If the path doesn't exists it will create the directory. All the data will be wiped out if application is uninstalled/removed.

How to do Remote Updates On Flutter

I have a flutter chat app. Companies like Whatsapp & Facebook update their app without forcing users to uninstall or manually uploading the APK again to google play. Is this possible with futter i tried using firebase remote config but it didn't work as i expected ( Changing UI on the go ). Any answer will be appreciated.
WhatsApp and Facebook use React Native with CodePush (if I'm not wrong).
You can't update an app without forcing a user somehow to update the app from a store with Flutter as it compiles to binary and React Native – not
There are multiple things you can do and it is based on what you want to achieve. [From your question your goal is not clear.]
Change Something based on configuration.
If you have configurations defined then you can use Firebase remote config to pass on value to devices and devices should behave according to value that you have set on Firebase Remote config.
Limitation of this approach:
In this approach, don't expect your newly updated code will into existing app. Above approach works, if code is already there in the compiled binary and you just want to switch path.
Binary version update:
If you want to force new app version download then it would require a different approach,
Android: Yes it is possible.
iOS: In-App update is not possible. You can show prompt to user by saying that new version is available and redirect user to new version on Store.
If user has enabled auto-download in iPhone settings then there are chances that app version updated to new version when user come to app.
For implementation look at here: Binary version update
Flutter now has unofficial support for code push using Chimera Flutter Code Push.
Here is a full tutorial

Support custom file extension in a flutter app ( Open file with extension .abc in flutter )

So I am exporting a file created in my application with extension .abc
Now, if the user shares the file on whatsapp or telegram or any other platform and when other user tries to open the file, the "open with" dialog should appear with my application in the list.
I have tried following approach which does not work plus it is only for Android and I am looking for multi-platform solution to this.
Is it possible to register a Flutter app as an Android Intent Filter and to handle Incoming Intents?
I was able to compile the app using above method but could not populate "Open with" dialog with my app's name
Thank you for your time.
EDIT 1:
So I have successfully added this functionality for android but I am still trying to add the same functionality for my iPhone users.
Can someone please help me with swift code part in iOS ??
I am not familiar with swift language but I want my users to be able to use same functionality on both platforms.
I have found a solution for iOS:
You can use the Uni Links package to get the notifications into your Flutter app.
You then need to manually add the file types in the Info.plist for the XCode project. You can find an explanation for example here.