react-native-shared-group-preferences icon indicating copy to clipboard operation
react-native-shared-group-preferences copied to clipboard

SharedGroupPreferences.getItem always return error 1 in Share Extension

Open Vijayakumarktm opened this issue 2 years ago • 0 comments

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.

Vijayakumarktm avatar Jul 21 '23 13:07 Vijayakumarktm