Skip to main content
Answered

Initialize Android Mobile SDK


Hi,

In our product we want to start using the Android Mobile SDK, but for only a set of users. When the app opens we don’t know if the user needs Intercom, we only have that information later in the process.

In the iOS Mobile SDK we used the SDK without any issue but in Android we found a warning: 

Intercom must be initialized inside the application onCreate() method. Initializing anywhere else will result in Intercom not behaving as expected and could even result in the host app crashing.

 

Calling the initialize in the onCreate will add this user to the pricing plan? It’s safe to call this method and later when we are sure that this user has intercom enabled call loginIdentifiedUser?

Intercom.initialize(this, "your api key", "your app id")

Thanks

Best answer by Diogo Alves

Hi, Mat

Already got my answer from support thanks
I will leave the answer for future reference

 

Hi Diogo, Jacques here from the Support Engineering Team in Dublin 👋 ☘️ Happy to jump in here and offer some clarity on this!

Initializing Intercom in the onCreate() method of your application class is, in fact, necessary for the proper functioning of the Android Mobile SDK. If you initialize Intercom later in the process, it could cause things to break.

However, initializing Intercom does not automatically add a user to the pricing plan. You can safely call

Intercom.initialize(this, "your api key", "your app id")

in the onCreate() method and then later, when you have determined that a user should have Intercom enabled, you can call loginIdentifiedUser to register the user with Intercom.

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

4 replies

mateusz.leszkiewicz
Intercom Team
Forum|alt.badge.img+5

Hi, Diogo Alves, It’s Mat from the Support Engineering Team 😀

I’d say it's a feature, not a bug. You can identify the user and then restrict Messenger's visibility in your app if it does not have a sufficient plan.

To answer your question, it will add it to the plan that you’ve specified in your database. Providing that you send this data to Intercom.


  • Author
  • New Participant
  • 2 replies
  • July 23, 2024

Hi, Mat
By calling Intercom.initialize(this, "your api key", "your app id") without calling loginIdentifiedUser and loginUnidentifiedUser it will count for to our pricing plan? 

Thanks


mateusz.leszkiewicz
Intercom Team
Forum|alt.badge.img+5

Diogo Alves can you elaborate what do you mean by: will count for to our pricing plan? 

 


  • Author
  • New Participant
  • 2 replies
  • Answer
  • July 29, 2024

Hi, Mat

Already got my answer from support thanks
I will leave the answer for future reference

 

Hi Diogo, Jacques here from the Support Engineering Team in Dublin 👋 ☘️ Happy to jump in here and offer some clarity on this!

Initializing Intercom in the onCreate() method of your application class is, in fact, necessary for the proper functioning of the Android Mobile SDK. If you initialize Intercom later in the process, it could cause things to break.

However, initializing Intercom does not automatically add a user to the pricing plan. You can safely call

Intercom.initialize(this, "your api key", "your app id")

in the onCreate() method and then later, when you have determined that a user should have Intercom enabled, you can call loginIdentifiedUser to register the user with Intercom.


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