-
Notifications
You must be signed in to change notification settings - Fork 2
Store properties injected by the native app #31
Conversation
yarn.lock
Outdated
@@ -4,27 +4,27 @@ | |||
|
|||
"@ampproject/remapping@^2.2.0": | |||
version "2.2.1" | |||
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" | |||
resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm uncertain if it was an intended change - I think we should decide on using npm
or yarn
. I think we should keep with yarn
to keep the current setup and consistency.
So, what I've noticed, is that npm
would change yarn.lock
to its coordinates if used. I'd suggest reverting changes from yarn.lock
and use yarn add @react-native-async-storage/async-storage --save
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I allowed myself to address this comment here: 99e0359
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @wzieba. My bad, I did npm install ...
and didn't think much about it. I'll use yarn
from now on.
@Ecarrion which app have you been using to test this change? iOS or Android? I have some difficulties with the Android build and I don't know how to link React Native to the WooCommerce-iOS app. |
I think that #27 tries to address it, but for now, the Android app won't build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good! 👍
After merging #27 and adding changes in woocommerce/woocommerce-android#9225 , I was able to successfully run the app and storing credentials works well.
Under the hood, when it comes to Android, values are stored in SQLite database:

I wonder why the authors of async-storage
decide to do this, instead of SharedPreferences
.
closes #28
Why
This PR locally stores the
BlogIf
andtoken
properties that are injected by the native app. This in order to avoid having to pass these properties as parameters through all the react app functions.How
Adds
AsyncStorage
react dependency.Adds
storeDependency()
readDependency()
functions to store the properties injected from the native app.Update
index.tsx
to store the injected properties in the local storage.Update the
jetpackFetch()
function to read theblogId
andtoken
properties from the local storage.Testing steps