dimaportenko / magento-react-native

React Native mobile app for Magento 2.x
MIT License
297 stars 158 forks source link

Getting issue after the app has started #160

Closed kanhucd closed 3 years ago

kanhucd commented 4 years ago

Getting the below errors after the app has stared. Not sure if its because of Magento. If you could help. The content I have put in the MobileHomePage is only "HomePage". Still getting a JSON parse error. And the content of Block "19" doesnot get displayed on the App may be because of the JSON parse Error may be.

[Thu Nov 19 2020 18:11:37.112] LOG {"active": true, "content": "Homepage", "creation_time": "2020-11-19 05:22:18", "id": 19, "identifier": "MHP", "title": "Mobile Homepage", "update_time": "2020-11-19 12:30:59"} [Thu Nov 19 2020 18:11:37.113] LOG {"active": true, "content": "Homepage", "creation_time": "2020-11-19 05:22:18", "id": 19, "identifier": "MHP", "title": "Mobile Homepage", "update_time": "2020-11-19 12:30:59"} [Thu Nov 19 2020 18:11:37.114] LOG [SyntaxError: JSON Parse error: Unexpected identifier "Homepage"]

image image

Steps to Reproduce Please provide detailed steps for reproducing the issue.

  1. After running the command react-native run-android

Smartphone (please complete the following information):

dimaportenko commented 4 years ago

@kanhucd your cms block content should be valid JSON data, check more in the setup instructions https://github.com/troublediehard/magento-react-native#-setup

kanhucd commented 4 years ago

@troublediehard Have updated the JSON as suggested by you and getting few other errors now. The banner page is visible now but the other Errors are still appearing. Have followed the steps and have given the access to ALL for the INtegration user as given in the documentation. image image image

dimaportenko commented 4 years ago
  1. Here is wrong value for icon name ios-arrow-dropright.

    CleanShot 2020-11-21 at 00 29 55@2x
  2. You are trying access API endpoint which you don't have access to.

    CleanShot 2020-11-21 at 00 30 24@2x
dimaportenko commented 4 years ago
  1. The banner page is visible now but the other Errors are still appearing. I don't see a banner on your screenshots.
kanhucd commented 4 years ago

Hi,

The categories are not showing up though may be because the category Ids filter doesnot work for me some how. Have marked them in yellow in the below screenshot. I have set the Categories 11 and 20 to be displayed in the Homepage under the Banner. And I have access to ALL in the Integration settings.

image image image

dimaportenko commented 4 years ago

and what is the response to the following requests?

CleanShot 2020-11-21 at 20 25 30@2x
kanhucd commented 4 years ago

Thanks for the insight, I was giving the root category ids. Its loading all the images for me now.

However, the icons donot load for my properly. the arrows on the navigation and the icon at the bottom. Could you please guide me on this.

image image image

dimaportenko commented 4 years ago

I've cloned the project from Github and try to build on the android. I don't see this issue on my end.

The error you see on the screenshot points you that something wrong with react-native-vector-icons library. Check if you have the same version as in the git repository "react-native-vector-icons": "6.6.0",

Screenshot_2020-11-28-16-33-09-029_com magento_mobile_app

kanhucd commented 4 years ago

@troublediehard Thanks for the icons version. It worked.

I am getting Authorization error while signup mostly for the "/rest/default/V1/customers/me" it seems. Could you please help me on this. But the Integration API created has got access to ALL. image image image

dimaportenko commented 4 years ago

hi @kanhucd this is API endpoint used customer token, not the admin token that you created for integration. Check it's lifetime settings https://docs.magento.com/user-guide/configuration/services/oauth.html. You have to increase lifetime settings or create reuath logic for the logged customers.

kanhucd commented 4 years ago

Hi @troublediehard ,

I tried to increase the lifetime settings but no luck. Hope I am not missing anything.

image

dimaportenko commented 4 years ago

@kanhucd it's hard to say without actual debugging code, but just in case

  1. Did you clear the Magento cache?
  2. Did you relogin customer after?
kanhucd commented 3 years ago

@troublediehard I am getting this issue while I signup as a new customer.

dimaportenko commented 3 years ago

@kanhucd also issue can be on the Magento side. And the most straightforward way to find out why the issue happened to debug the backend and see why customer token isn't authorized.