You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have multiple React-Native apps for iOS or Android and want them to be able to share data in a centralized location on the user's device.
The settings should be accessible from every app, right?
However on Android, when i use options { useAndroidSharedPreferences: true } that unfortunately does not work. I saw in your code, that you set MODE_PRIVATE for the shared preferences:
Unfortunately all other modes except private are deprecated now. But this results in not being able to get preferences in multiple apps. Even though its deprecated... as long as it still works would you consider to make the other modes configurable?
May i ask about the state of the content-provider implementation? I'm actually interested in that variant as well, as it would not be necessary anymore to use SharedPreferences.
BR
Samuel
The text was updated successfully, but these errors were encountered:
I believe android's SharedPreferences are poorly named, because it's data that isn't shared anywhere else except within a single app. So maybe at one point it wasn't, but now it is.
When I first created this module, I used public storage. A few months later, someone modified my code to use SharedPreferences instead. I'm not sure why exactly, but they wanted me to add an option for that. It worked for an extension or something like that if I remember correctly (or some sort of sub component of the parent app). And that is all they needed.
Anyways, my apps never used SharedPreferences, and I didn't write the code for it (other than accepting an option to use that instead of public storage). So I can't explain that part of the code since it was a pull request that I accepted without testing personally. I'm also not a very good Java programmer, nor Android, so I don't know much of the intricacies compared to RN or iOS.
As far as the content provider implementation, I started writing a bit of it. You can see I commented it all out in my last commit. I stopped because I figured out I could continue using this module as per the norm until this summer. So I'll probably start working on this again in... let me guess 2-4 months. In the meantime, if you want to figure it out yourself, I'd be quite happy with that :) I'm not even sure if this is the correct path, but it seems to have potential (again, I'm not very familiar with Android, so this might not even work).
Hi,
from the description
The settings should be accessible from every app, right?
However on Android, when i use options
{ useAndroidSharedPreferences: true }
that unfortunately does not work. I saw in your code, that you setMODE_PRIVATE
for the shared preferences:react-native-shared-group-preferences/android/src/main/java/com/poppop/RNReactNativeSharedGroupPreferences/RNReactNativeSharedGroupPreferencesModule.java
Line 39 in 0ff5669
Unfortunately all other modes except private are deprecated now. But this results in not being able to get preferences in multiple apps. Even though its deprecated... as long as it still works would you consider to make the other modes configurable?
May i ask about the state of the content-provider implementation? I'm actually interested in that variant as well, as it would not be necessary anymore to use SharedPreferences.
BR
Samuel
The text was updated successfully, but these errors were encountered: