In SwiftUI App where can I call Intercom.setAPIKey? | Community
Skip to main content
Answered

In SwiftUI App where can I call Intercom.setAPIKey?

  • April 17, 2024
  • 1 reply
  • 80 views

Forum|alt.badge.img

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

 

Best answer by bernice

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

1 reply

bernice
Expert User ✨
Forum|alt.badge.img+2
  • Expert User ✨
  • Answer
  • April 23, 2024

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