Im trying to listen to realtime changes in my react-native app from a supabase table called "profiles". Whatever i try, i can't get it to subscribe to change son the table. Even when copying the code snippet from the generated docs in Supabase:
const profiles = supabase.channel('custom-all-channel') .on('postgres_changes', { event: '*', schema: 'public', table: 'profiles' }, (payload) => { console.log('Change received!', payload) } ) .subscribe()
Nothing happens when updating the table. When i pass a callback function to the subscribe method, it listens to events trigger on the subscription:
const profiles = supabase.channel('custom-all-channel') .on('postgres_changes', { event: '*', schema: 'public', table: 'profiles' }, (payload) => { console.log('Change received!', payload) } ) .subscribe((event) => { console.log(event) })
However, the only event to trigger is the TIMED_OUT
event.
I have enabled realtime changes to the "profiles" table in Supabase".
I've also tried changing the timeout to a longer amount of time, still doesn't work.
All other things like auth and normal fetching from the DB works fine.
I'm not using the local supabase Docker image for developing.
Am i missing something?