Skip to main content
Answered

Intercom react native with MainApplication.kt

  • 19 December 2024
  • 1 reply
  • 64 views

Hi, recently updated to react native 0.76, so using MainApplication.kt instead of java. The react native docs only have guidance on .java version of react native. This is my stab at initializing the module. In app when I try to present the intercom messenger it errors out with “Content could not be loaded” with no error message or logs.

```

import com.intercom.reactnative.IntercomModule

```

```

override fun onCreate() {

super.onCreate()

SoLoader.init(this, OpenSourceMergedSoMapping) // Initialize SoLoader first

// Initialize Intercom after SoLoader

IntercomModule.initialize(this,

"apikey",

"appkey"

)

if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {

load()

}

}

```

 

This setup is unfortunately not working, but works perfectly on iOS. Any ideas?

 

Best answer by Jacques Reynolds

Hey ​@Jurgita Skersytė 👋 Jacques here from Support Engineering!

It seems like you've followed the correct steps for initializing Intercom in a React Native project. The error could be due to a missing or incorrect API key and App ID. Ensure that the apiKey and appId you are using are correct and can be found in your workspace settings. Also note that Intercom should be initialized after SoLoader.init.

Make sure that your minSdkVersion is set to 21 or greater and that you're using the correct version of com.android.tools.build:gradle in your build.gradle file.

If you’ve signed off on the above, and you're still facing issues, this could be a bug. Since the setup works on iOS, it's less likely to be an issue with your React Native code and more likely to be an issue with the Android-specific configuration or Intercom Android SDK.

I’d recommend reaching out to our Support Team regarding this issue so that they can dig a bit deeper into your implementation.

View original
Did this topic help you find an answer to your question?

1 reply

Jacques Reynolds
Intercom Team
Forum|alt.badge.img+4

Hey ​@Jurgita Skersytė 👋 Jacques here from Support Engineering!

It seems like you've followed the correct steps for initializing Intercom in a React Native project. The error could be due to a missing or incorrect API key and App ID. Ensure that the apiKey and appId you are using are correct and can be found in your workspace settings. Also note that Intercom should be initialized after SoLoader.init.

Make sure that your minSdkVersion is set to 21 or greater and that you're using the correct version of com.android.tools.build:gradle in your build.gradle file.

If you’ve signed off on the above, and you're still facing issues, this could be a bug. Since the setup works on iOS, it's less likely to be an issue with your React Native code and more likely to be an issue with the Android-specific configuration or Intercom Android SDK.

I’d recommend reaching out to our Support Team regarding this issue so that they can dig a bit deeper into your implementation.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings