segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
360 stars 185 forks source link

Could not receive settings from Segment. #979

Closed piyush-kukadiya closed 2 months ago

piyush-kukadiya commented 2 months ago

I am trying to test analytics-react-native-clevertap-plugin using device mode destination. However, it's not working and getting below log:

 WARN  An internal error occurred:  [Error: Cannot read property 'ok' of undefined]
 WARN  Could not receive settings from Segment. Device mode destinations will be ignored   unless you specify default settings in the client config.

After analysis i can see that fetch(settingsEndpoint) call in @segment/analytics-react-native/src/analytics.ts file is failing. However, same endpoint is working in the browser/postman/other clients. Please help fix this. Thanks!

  "dependencies": {
    "@segment/analytics-react-native": "^2.19.2",
    "@segment/analytics-react-native-plugin-clevertap": "^1.1.0",
    "@segment/sovran-react-native": "^1.1.1",
    "clevertap-react-native": "^2.2.1",
    "react": "18.2.0",
    "react-native": "0.74.4"
  },

Steps to reproduce

  1. Create new App
  2. integrate segment and clevertap react native dependencies
  3. create segment client and push event using track()

Important to NOTE is that things work fine in Cloud-mode without installing destination plugin.

alanjcharles commented 2 months ago

Hi @piyush-kukadiya please reach out to friends@segment.com with a copy of this report for futher assistance. They will be able to assist you with your Segment workspace and ensure the settings are configured correctly there. If there is a bug, they will escalate it accordingly. Thank you