Skip to main content

Grouplink init using JSON file

This page describes how to initiate and register the Grouplink SDK using a JSON file with the grouplink token.

1. Check if your project already has the assets directory.

1.1. Be sure to navigate to your application directory (usually located at app/src/main) and verify that the assets directory exists.

1.2 Create the assets directory if it does not exist in your project.

  • Right click on the app folder and select new > directory.
  • Select the asset directory with the following path app/src/main.

2. Create the JSON file.

Inside the assets directory, right-click and select new > file.

Name the file grouplink-services.json.

{
"token": "YOUR_GROUP_LINK_TOKEN"
}

Replace YOUR GROUP LINK TOKEN with the token received from our team.

Initialize the library with the following line, inside the Application class of the app

package com.example.your_app
...
class App : Application() {
override fun onCreate() {
super.onCreate()
...
//Grouplink must be initialized inside
//onCreate of the core Application registered.
//add the following line

GroupLink.register(
context.applicationContext,
false //true if you want to test if the implementation is working.
)
}
...
}