Answered

In SwiftUI App where can I call Intercom.setAPIKey?

  • 18 April 2024
  • 1 reply
  • 20 views

The documentation and sample app show Intercom.setAPIKey being called from a Scene delegate.  I would prefer not to configure that for my SwiftUI App if I don’t have to.  In addition, we normally do not compile keys like this into our App, instead preferring to fetch them from the server.

Are there any restrictions on when I call Intercom.setAPIKey? Does it have to be called on the main thread? Do I have to call setAPIKey from the Scene delegate?  Can I wait to call it until after the user has logged in and communicated with our server to fetch the API key as long as I don’t call any other Intercom calls before that?

 

Thanks,

Tom

 

icon

Best answer by bernice 23 April 2024, 15:37

View original

1 reply

Userlevel 3
Badge +4

Hi @Tom Wagner 👋  There should be no restrictions, as long as it is done before you initialise Intercom.

Reply