robinpowered / react-native-android-shared-preferences

Access to Android's SharedPreferences

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to define the shared preferences namespace

atticoos opened this issue · comments

Temporarily hardcoded in at https://github.com/robinpowered/react-native-android-shared-preferences/blob/develop/src/main/java/com/robinpowered/react/SharedPreferencesModule.java#L19, this should be assignable in the JS context. Currently hardcoded to prevent BC in Rooms, but will be opened up to a custom assignment.

For now, I modified the code to pass it as a variable from MainActivity.java when adding the package.

.addPackage(new SharedPreferencesPackage(this, "customPackageName")

This seems most straightforward for now. What are you planning for this feature?

We were considering two approaches -- the one you describe and the ability to do this from the JS side to allow for more than one name.