I'm having troubles to use LiveCollections, more concretely to subscribe to a community

Each time I’m trying to subscribe to a community I get

Failed to subscribe to topic 61d573bf0e712d7b4ea2ce71/social/community/61d5741bfd40a2681c6d5cf9/post/+ O
error Error: Amity SDK (800000): Unexpected error
 at construct (native)
    at _createSuperInternal (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:262927:294)
    at call (native)
    at ASCUnknownError (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:263459:26)
    at callbackWrapper (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:279210:102)
    at cb (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:264824:31)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:265418:25)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:264600:36)
    at work (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:264509:39)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:264522:23)
    at doWrite (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:276679:159)
    at writeOrBuffer (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:276670:26)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:276603:38)
    at ondata (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:276022:39)
    at call (native)
    at emitOne (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:268821:35)
    at emit (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:268872:24)
    at addChunk (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:275798:30)
    at readableAddChunk (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:275785:33)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:275753:40)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:268615:44)
    at onreadable (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:268587:32)
    at call (native)
    at emitNone (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:268814:35)
    at emit (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:268869:25)
    at emitReadable_ (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:275946:30)
    at apply (native)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:275000:27)
    at drainQueue (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:274973:47)
    at apply (native)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:29257:26)
    at _callTimer (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:29196:17)
    at callTimers (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:29352:19)
    at apply (native)
    at __callFunction (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:2371:36)
    at anonymous (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:2132:31)
    at __guard (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:2322:15)
    at callFunctionReturnFlushedQueue (http://192.168.0.138:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=de.hlp.application:2131:21)

My test code is pretty much what is in the guide

const subscribePostTopic = (targetType: string, targetId: string) => {
		if (isSubscribed.current) return;

		// Community is currently the only target we are fetching posts now
		if (targetType === 'community' && community?.data) {
			const communityTopic = getCommunityTopic(
				community.data,
				SubscriptionLevels.POST,
			);
			console.log('here', community.data);
			disposers.current.push(
				subscribeTopic(communityTopic, e => {
					console.log('error', e.stack); // use callback to handle errors with event subscription
				}),
			);
			isSubscribed.current = true;
		}
	};

Was anyone else able to get live updates from the community posts?

Hi @dlartor ,

May we please confirm the platform and version?

Thank you,
Amity Support

Yes, im on the latest 6.1 version and using it on React Native IOS.
I also tested the same code on Android and it works.

You can only subscribe to communities that you are a member of.
Could you verify if the logged in user is a member of that community?

Thanks cijin,
I just added a little update. I was able to see it working on Android, and I’m also already member of the community. Any other ideas? I think it may be something related to the platform.

Daniel

Yes it might be. I’ll create a ticket and get back to you. I’m guessing you are using getPosts?
@dlartor

Update on this, I checked and I’m unable to reproduce the issue. Could you verify if the Mqtt connection was successful?

Failed to subscribe to topic 61d573bf0e712d7b4ea2ce71/social/community/61d5741bfd40a2681c6d5cf9/post/+ O

Also, is the 0 at the end part of the topic string? Or can be ignored?

The 0 is not part of the path, sorry it must have escaped me.
How can I check this more specifically. I’m getting logs about the subscription being successfully established to other subscription channels which I think are default when the user logs in.

Subscribed to topic 61d573bf0e712d7b4ea2ce71
Subscribed to topic 61d573bf0e712d7b4ea2ce71/smartfeed/63ebb619ec8f6fcd85941faa/channels
Subscribed to topic 61d573bf0e712d7b4ea2ce71/smartfeed/63ebb619ec8f6fcd85941faa/messagefeeds
Subscribed to topic 61d573bf0e712d7b4ea2ce71/smartfeed/63ebb619ec8f6fcd85941faa/messages
Subscribed to topic 61d573bf0e712d7b4ea2ce71/user/63ebb619ec8f6fcd85941faa

Also do you know if it’s necessary to establish additional permissions in order to IOS to use the MQTT protocol? Anyways, to me that doesn’t seem to be the case here?

Thanks
Daniel

@cijin Update: I deleted all the cached stuff from my IOS app and rebuild and this did the trick! Perhaps since we’re upgrading something cached was causing the issue.

@dlartor

Thank you for letting me know. I’m glad it’s working now.
Let me know if there’s anything else.

Kind Regards,
Cijin