Driftt / drift-sdk-ios

Drift for iOS, for integrating Drift into your iOS application.
http://www.drift.com
MIT License
12 stars 17 forks source link

Conversations dont load on first open, Display just 1 conversation even #110

Open REPTILEHAUS opened 4 years ago

REPTILEHAUS commented 4 years ago

In my app I want to use drift to display a single thread rather than multiple - when drifts view is first opened it just displays a loader for ages unless you click to create a new conversation.

Is it possible just to load the same conversation over and over in 1 single thread

eoinoconnell commented 4 years ago

Hi, I'm afraid thats not supported with the SDK. In order to do this we would need to have the conversation before showing the drift sdk within your app which is not supported.

Im unsure as to why the loader is showing for so long for you, do you have a lot of conversations?

REPTILEHAUS commented 4 years ago

No usually no conversations at all, I am using it in the context of an ionic application so I am calling it like so from a custom class

    @objc func openDriftSupportChat(_ call: CAPPluginCall) {
        DispatchQueue.main.async {    

             let userId = call.getString("userId") ?? "fallbackid"
             let userEmail = call.getString("userEmail") ?? "fallback@gmail.com"             
                Drift.registerUser (userId, email: userEmail)
                Drift.showConversations()
        }
    }  

It has been initialised in the AppDelegate like so in didFinishLaunchingWithOptions

     Drift.setup("IDHERE")
eoinoconnell commented 4 years ago

Strange, does the same thing happen when you use the sample app? Should be quick enough to use the same embed and credentials to check