We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello!
I am trying to set up subscriptions on a react-native app but i am receiving the following error:
This is the subscription handler which works perfectly on the web side:
const SubscriptionSocket = async (url, logger) => { const API_TOKEN = await AsyncStorage.getItem('API_TOKEN'); return AbsintheSocket.create( new Socket(`${WS_URL}/socket`, { logger, params: { jwt: API_TOKEN } }) ); } function subscriptionHandler(subscriptionConfig, variables, cacheConfig, observer) { const socket = new SubscriptionSocket(WS_URL, (kind, msg, payload) => { if (typeof payload !== 'undefined' && payload.subscriptionId) { observer.onNext({ data: payload.result.data }); } else { if (process.env.NODE_ENV === 'development') { console.log(`${kind.toUpperCase()} ${msg}`, payload); } } }); AbsintheSocket.send(socket, { operation: subscriptionConfig.text, variables }); return { dispose: () => socket.phoenixSocket.disconnect(() => { if (process.env.NODE_ENV === 'development') { console.log(`DISPOSE \n${subscriptionConfig.text}`); } }) }; }
This is currently a blocker for us so any help would be appreciated.
The text was updated successfully, but these errors were encountered:
I was returning a promise from the SubscriptionSocket constructor, sorry for posting the issue.
Sorry, something went wrong.
No branches or pull requests
Hello!
I am trying to set up subscriptions on a react-native app but i am receiving the following error:
![screen shot 2018-02-06 at 16 49 00](https://user-images.githubusercontent.com/20557383/35865659-c24dc866-0b5d-11e8-88eb-bafc791a9b45.png)
This is the subscription handler which works perfectly on the web side:
This is currently a blocker for us so any help would be appreciated.
The text was updated successfully, but these errors were encountered: