Skip to content
Sanjeev yadav edited this page Sep 5, 2020 · 16 revisions

Note You need to have a Magento Website, in order to run the app

1. Create new integration token in Magento Admin to receive store data in API

  1. goto System > integrations

    Step 1

  2. Click on Add New integration button to display the New Integration page.

    Step 2

  3. Enter a unique name for the integration in the Name field. Then enter your admin password in the Your Password field.

    Step 3

  4. 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)

    Step 4

  5. Click Save to save your changes and return to the integrations page.

    Step 5

  6. Click the Activate link in the grid that corresponds to the newly-created integration.

    Step 6

  7. Click Allow

    Step 7

  8. A dialog similar to the following displays:

    Step 8

  9. Copy the Access Token value and click on Done button.


2. Setup new CMS block in Magento Admin which will be used in MageCart HomePage

  1. goto Content > Blocks

    Step 1

  2. Click on Add New Block button

    Step 2

  3. Put your config inside Content section (config sample)

    Step 3

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 id 30 and 31 are actual category id from the website

  1. save your block

    Step 4

  2. Remember the id of this newly created CMS block

    Step 5


3. Installing

  1. Get the code

    git clone https://github.com/alexakasanjeev/magento_react_native.git && cd magento_react_native
  2. Install dependencies

    npm install
    # only for iOS
    cd ios
    pod install
  3. Change Magento base url to your magento website url in config/magento.js

    Step 3

  4. Replace access_token parameter in magento.js to Access Token from Integration you created.

    Step 4

  5. Replace cms home_cms_block_id parameter in magento.js with the cms id you created

    Step 5

  6. Run the project

    # for iOS
    react-native run-ios
    # for android
    react-native run-android

4. Increase customer session expiry time

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)

Clone this wiki locally