iOS GCMessengerSDKSample with SwiftUI

Hey I have followed the instructions here:

To use the a variation of the iOS GCMessengerSDKSample with SwiftUI and I am seeing this odd display when the keyboard is displayed:

Is the issue with our code or the View we receive from:

func shouldPresentChatViewController(_ viewController: UINavigationController!)

Any ideas how to solve this?

Thanks

Hello,

SwiftUI has built in keyboard avoidance (unlike UIKit) which moves the view up when the keyboard is visible. As this avoidance is already implemented internally by our SDK it needs to be disabled in SwiftUI, otherwise the chat view is moved up too much.
This can be done by using this view modifier:

chatHandler.chatView
    .ignoresSafeArea(.keyboard)

We will update the developer documentation to include this.

Best Regards,
Andras Solyom

Awesome, thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.