- 👋 Hi, I’m @KjellConnelly
- 👀 I’m interested in ... stuff
- 🌱 I’m currently learning ... stuff
- 💞️ I’m looking to collaborate on ... stuff
- 📫 How to reach me ... hand
react-native-shared-group-preferences's Introduction
react-native-shared-group-preferences's People
Forkers
arianne-detorres cdn34 mtzfactory emadhajjar tchangang rarebitsio chilinh mizunokazumi viction nghi-nv vtserman nargov galikvalkin radualbastroiu 738 vivek8079 komorebi-hub jc4p 6degreelabs taylor123 lamnn1807 leonardoserio kevlud rclai hengkx csumrell minhthu-bic seneteam react-top-dev-no1 psyrenpark zergiocosta aross geoffrey63 matejnevlud imyuanx ahmedelsayed11 spicy-sparks xiaoleiooo triple-whale id0sch swetatanwar gaishimo trizin fusionplus5 oivoodoo kraaft-co timi-duban commencement-technologyreact-native-shared-group-preferences's Issues
pod install not working / null is not an object (evaluating 'RNReactNativeSharedGroupPreferences.getItem')
So I'm getting
"null is not an object (evaluating 'RNReactNativeSharedGroupPreferences.getItem')"
So after seeing the closed issues I found that I should
Link the library properly under 'Link binary with Libraries' (libRNReactNativeSharedGroupPreferences.a) #3
The problem is that even after react-native link
and pod install
libRNReactNativeSharedGroupPreferences.a is not popping up in the workspace libraries. What am I missing?
Unable to build in IOS
While building, getting below error:
node_modules/react-native-shared-group-preferences/ios/RNReactNativeSharedGroupPreferences.m:78:59: Use of undeclared identifier 'key'
Please fix it.
TypeError: Cannot read property 'setItem' of undefined
TypeError: Cannot read property 'setItem' of undefined
at blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87762:55
at tryCallTwo (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3524:7)
at doResolve (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3688:15)
at new Promise (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3547:5)
at Function.setItem$ (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87757:51)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16924:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16794:23)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at invoke (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16827:22)
react native info:
Environment:
OS: macOS High Sierra 10.13.4
Node: 9.8.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4697961
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3
package.json:
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-shared-group-preferences": "^1.0.6",
NativeModule is null
It seems that the native module fails building because the source_files path points to the wrong directory
https://github.com/KjellConnelly/react-native-shared-group-preferences/blob/master/ios/RNReactNativeSharedGroupPreferences.podspec#L15
Changing it to s.source_files = "**/*.{h,m}"
solves the issue for me.
Shared preferences do not work with multiple apps on Android and { useAndroidSharedPreferences: true }
Hi,
from the description
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
Android issue
Hello,
I have an issue with android when I try to set up multiple items like this :
this._setStorageA('Avalue');
this._setStorageB('Bvalue');
Then when I try to get my values, on IOS, everything is fine, but on Android, everything is overrided by the last value
SharedGroupPreferences.getItem always return error 1 in Share Extension
Hi guys,
I'm working on react native app with share extension. For share extension, I'm using react-native-share-extension.
In share extension, I need to get the tokens which I stored in the Main app.
"react-native": "0.67.5",
"react-native-shared-group-preferences": "^1.1.23",
"react-native-share-extension": "2.0.0",
From Main App, I'm storing like
SharedGroupPreferences.setItem(
'userDetail',
JSON.stringify(userDetail),
'group.com.projectName'
);
In Share Extension,
const userDetail = await SharedGroupPreferences.getItem(
'userDetail',
'group.com.projectName'
);
console.log(userDetail)
I have already added the 'group.com.projectName' in target -> App Groups.
Still I'm getting the 'error 1' when I'm trying to get the data in share extension But I'm getting the expected userDetail in Main app.
Unable to Retrieve Stored Data from App Group in iOS Native App
I hope you're all doing well.
I've integrated this library to store data in the app group and successfully used SharedGroupPreferences.setItem and SharedGroupPreferences.getItem.
However, when attempting to fetch the stored data on the iOS native side, it returns nil values.
Could you please provide guidance on whether there are any extra configurations needed?
I've created a widget extension, but I'm unsure if additional code needs to be written inside the extension file.
Anyone can guide me what's can be the issue??
I did integrations with the help of this document:
https://www.cristiangutu.pro/share-data-between-react-native-and-ios-widgets/
Not shared data between react native and widget
I have made widget extension with app and tried to share data between them. but It is not working. I can't get data on widget.
Can you tell me about issues?
App terminating with uncaught exception of type NSException
I started a new RN project today so most current version of stable RN. When I am running the app and trying to pull in data from the defaults I get this error
Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle fileDescriptor]: Invalid argument'
terminating with uncaught exception of type NSException
The data actually is coming correctly when the app is first ran and prints out the data from react native in the iOS app group (swift), but eventually hits this exception either right at startup, or after a minute or two.
react-native-shared-group-preferences Link for android
Currently in the document shows how to link manually to integrate the library into android, since when making the link with the command:
react-native link react-native-shared-group-preferences
mark error and the link is not made.
Not able to detect app installation in higher android version
I'm not able to detect app installation in higher android version only "Google Maps" is working, while all the other apps are detectable in lower android version.
Please help me to fix this error.
Thank you
isAppInstallAndroid always returns False
Hello all,
Much thanks for creating this package.
I'm having some issues with the example code for the isAppInstalledAndroid
, for some reason it always returns false for me.
I have tested this out with the following code with the instagram app and always get false for an unknown reason.
const versionNumber = parseInt(Platform.Version, 10);
if (versionNumber >= 30) {
const facebookPackageName = "com.instagram.android";
// const facebookPackageName = "com.facebook.android";
try {
const installed = await SharedGroupPreferences.isAppInstalledAndroid(
facebookPackageName
);
console.log("Facebook is installed on this device");
osCompatible = true;
} catch (err) {
console.log("Facebook is not installed");
osCompatible = false;
}
}
Any idea what I'm doing wrong? My final use case for this is to check if ArCore is installed on an Android device and I wanted to use this package to achieve that.
Thanks in advance
couldn't reset the property of an already set value
couldn't reset the property of an already set value, i'm getting the previous value only
iOS原生获取的值,控制台打印出来会多出来一个符号,字符串外面包裹着双引号
RN 端去存储
...other code
this.saveUserDataToSharedStorage('userData');
......
async saveUserDataToSharedStorage(data) {
try {
await SharedGroupPreferences.setItem(
'savedData',
data,
Config.APP_GROUP_IDENTIFIER_FOR_IOS,
);
this.loadUsernameFromSharedStorage();
} catch (errorCode) {
// errorCode 0 = There is no suite with that name
console.log(errorCode);
}
}
async loadUsernameFromSharedStorage() {
try {
const loadedData = await SharedGroupPreferences.getItem(
'savedData',
Config.APP_GROUP_IDENTIFIER_FOR_IOS,
);
console.log('loadedData===', loadedData);
console.log('loadedData===', 'userData');
} catch (errorCode) {
// errorCode 0 = no group name exists. You probably need to setup your Xcode Project properly.
// errorCode 1 = there is no value for that key
console.log(errorCode);
}
}
ios 原生去获取
if let userData = userDefaults?.value(forKey: "savedData") as? String {
let string = "普通string"
print("userData===", userData)
print("普通string===", string)
}
userData=== "userData"(理论上应该打印的结果是:userData,然而它的结果是:"userData",多了一对符号)
普通string=== 普通string
我现在必须多写如下代码:let token = tokenStr.trimmingCharacters(in: CharacterSet(charactersIn: "\""))
,否则我就拿不到正确的token
Wrong npm link
In the Getting started of the readme you display the wrong link
it should be npm install react-native-shared-group-preferences --save
not npm install react-native-react-native-shared-group-preferences --save
IOS error with getItem
Hi there
I'm using react-native-share-extension
await SharedGroupPreferences.getItem('sample', appGroupIdentifier, { useAndroidSharedPreferences:true });
I get this error when I trying to get value from Shared Extension
[TypeError: undefined is not an object (evaluating 'RNReactNativeSharedGroupPreferences.getItem')
TypeError: One of the sources for assign has an enumerable key on the prototype chain
Hey,
I will appreciate if you can help me to understand what does the error bellow means
Thanks,
TypeError: One of the sources for assign has an enumerable key on the prototype chain. Are you trying to assign a prototype property? We don't allow it, as this is an edge case that we do not support. This error is a performance optimization and not spec compliant.
cannot find symbol android.support.v4.app.ActivityCompat
Hi!
First of all I want to thank you for creating this package! Today I went to work on my project using this package and suddenly the build on android started failing with this error:
> Task :react-native-shared-group-preferences:compileReleaseJavaWithJavac FAILED
/path/to/my/project/node_modules/react-native-shared-group-preferences/android/src/main/java/com/poppop/RNReactNativeSharedGroupPreferences/RNReactNativeSharedGroupPreferencesModule.java:12: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
1 error
I found out, that after replacing
import android.support.v4.app.ActivityCompat;
with
import androidx.core.app.ActivityCompat;
I am able to run the builds again. Can you have a look at this issue please?
Thanks!
apk by release, build error
Task :react-native-shared-group-preferences:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':react-native-shared-group-preferences:verifyReleaseResources'.
Solution:
node_moudles/react-native-shared-group-preferences/android/build.gradle:
compileSdkVersion 23 → compileSdkVersion 28
targetSdkVersion 22 → targetSdkVersion 28
compile → implementation
release build generation fails
I am getting no idea at all why release build is failing.
i think something is wrong with this folder-
node_modules\react-native-shared-group-preferences\android\build\intermediates\res\compiled\release\
a lot of files under this folder gets printed in the console. The log doens't even fit in the console.
stacktrace -
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doLink(Aapt2DaemonImpl.kt:177)
at com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Daemon.kt:103)
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.link(Aapt2DaemonManager.kt:176)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:823)
at com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable$run$1.invoke(Aapt2ProcessResourcesRunnable.kt:34)
at com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable$run$1.invoke(Aapt2ProcessResourcesRunnable.kt:28)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
at com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable.run(Aapt2ProcessResourcesRunnable.kt:33)
at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:39)
... 46 more
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.