Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios in react-native and notification #4579

Open
kovkev opened this issue Apr 4, 2022 · 0 comments
Open

Axios in react-native and notification #4579

kovkev opened this issue Apr 4, 2022 · 0 comments

Comments

@kovkev
Copy link

kovkev commented Apr 4, 2022

Describe the bug

Upon opening a notification of the react-native app, calling axios.get returns an error

To Reproduce

This works:

var axios_main = require('axios')
const axios = axios_main.create({ baseURL: 'https://app.mywebiste.com/', });
var { success } = (await axios.get('/login', { ...store.currentUser, device_id })).data

However, when the app produces a notification (on iOS), and I click on the notification, then, this same code does not work. I get

ReferenceError: Can't find variable: document

Expected behavior

I expect to be able to send a get request (on react-native, because it does work usually)

Environment

Axios Version ^0.24.0
Adapter ?
Browser NA
Browser Version NA
Node.js v16.13.2
OS: iOs 15.3.1
React Native 0.67.2
React 17.0.2

Additional context/Screenshots

NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants