iOS messagePreview is always nil

messagePreview suddenly stopped working. I was using 4.0.0-beta12 where it was working fine, did no changes to my code and it stopped working so you must’ve changed something on the backend side. Updated to the newest beta but it still doesn’t work.

let notificationToken = dependencies.amityChannelRepository
            .observe { [weak self] liveCollection, _, error in
                let chatChannels = liveCollection.snapshots.compactMap { snapshot -> ChatChannel? in

                    let messagePreview: ChatChannelLastMessagePreview?
                    if
                        let authorFullName = snapshot.messagePreview?.user?.displayName,
                        let sentAtDate = snapshot.messagePreview?.createdAt

messagePreview is nil

Tried to update to latest beta but it still doesn’t work

Hello @nadol, We’ve tested the messagePreview feature on our side, and it appears to be working fine. To assist you further, could you please confirm if the Message Preview feature is enabled?

@SocialPlus_Support are some extra steps required to enable the message preview since some update? It worked fine before and stopped working without any changes on my end

Hello @nadol , To enable the message preview, please refer to the following documentation: Message Preview Setup.

Let us know if you need any further assistance! :blush:

@SocialPlus_Support Where should I get the bearer to run the curl from?

Hello @nadol If secure mode is enabled, you’ll need to first obtain the authentication token using this endpoint:
Authentication Token Endpoint.

After that, you can register the session using this endpoint:
Register Session Endpoint.

If secure mode is not enabled, you can directly register the session and use the token for your cURL request. Let me know if you need further assistance!

@SocialPlus_Support And do I have to use this curl once or every time I register a new session?

That’s correct. Alternatively, you can call this function on iOS: Create User | Amity Docs.