-
-
Notifications
You must be signed in to change notification settings - Fork 124
Setup
Note You need to have a Magento Website, in order to run the app
-
goto System > integrations
-
Click on
Add New integration
button to display the New Integration page. -
Enter a unique name for the integration in the Name field. Then enter your admin password in the Your Password field.
-
Select Resource Access to 'All' under 'API' tab
(NOTE: it is only for a quick start, for production you have to allow only resources required by the app)
-
Click Save to save your changes and return to the integrations page.
-
Click the Activate link in the grid that corresponds to the newly-created integration.
-
Click Allow
-
A dialog similar to the following displays:
-
Copy the
Access Token
value and click onDone
button.
-
goto Content > Blocks
-
Click on
Add New Block
button -
Put your config inside
Content
section (config sample)
Note: The images
wysiwyg/home/home-main.jpg
,wysiwyg/home/home-t-shirts.jpg
,wysiwyg/home/home-eco.jpg
were upload in magento manually before this step and category id30
and31
are actual category id from the website
-
save your block
-
Remember the id of this newly created CMS block
-
Get the code
git clone https://github.com/alexakasanjeev/magento_react_native.git && cd magento_react_native
-
Install dependencies
npm install # only for iOS cd ios pod install
-
Change Magento base url to your magento website url in
config/magento.js
-
Replace
access_token
parameter inmagento.js
to Access Token from Integration you created. -
Replace cms
home_cms_block_id
parameter inmagento.js
with the cms id you created -
Run the project
# for iOS react-native run-ios
# for android react-native run-android
By default, customer token generated when user login is valid for 1 hour. You can change these values from Admin by selecting Stores > Settings > Configuration > Services > OAuth > Access Token Expiration.
Set it to 168 hours(7 days)