Skip to content

Commit

Permalink
feat: Add Support For FB App ID (#96)
Browse files Browse the repository at this point in the history
* feat: Add Support For FB App ID
  • Loading branch information
BrandonStalnaker authored Apr 12, 2024
1 parent d3aa3e1 commit 04350ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ android {

dependencies {
testImplementation files('libs/java-json.jar')
api 'com.adjust.sdk:adjust-android:4.33.3'
api 'com.adjust.sdk:adjust-android:4.38.3'
}
5 changes: 5 additions & 0 deletions src/main/kotlin/com/mparticle/kits/AdjustKit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class AdjustKit : KitIntegration(), OnAttributionChangedListener, ActivityLifecy
config.setLogLevel(LogLevel.VERBOSE)
}
config.setEventBufferingEnabled(false)
val fbAppId = getSettings()[FB_APP_ID_KEY]
if (fbAppId != null) {
config.setFbAppId(fbAppId);
}
Adjust.onCreate(config)
setAdidIntegrationAttribute()
(context.applicationContext as Application).registerActivityLifecycleCallbacks(this)
Expand Down Expand Up @@ -117,6 +121,7 @@ class AdjustKit : KitIntegration(), OnAttributionChangedListener, ActivityLifecy
companion object {
private const val APP_TOKEN = "appToken"
private const val ADJUST_ID_KEY = "adid"
private const val FB_APP_ID_KEY = "fbAppId"
private const val KIT_NAME = "Adjust"

var deeplinkResponseListenerProxy: OnDeeplinkEventListener? = null
Expand Down
8 changes: 8 additions & 0 deletions src/test/kotlin/com/mparticle/kits/AdjustKitTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class AdjustKitTests {
val kit = kit
val settings = HashMap<String, String>()
settings["fake setting"] = "fake"
val appToken = AdjustKit::class.java.getDeclaredField("APP_TOKEN")
appToken.isAccessible = true
val token = appToken.get(AdjustKit.Companion) as String
settings[token] = "test1"
val fbAppId = AdjustKit::class.java.getDeclaredField("FB_APP_ID_KEY")
fbAppId.isAccessible = true
val fbId = fbAppId.get(AdjustKit.Companion) as String
settings[fbId] = "test2"
kit.onKitCreate(settings, Mockito.mock(Context::class.java))
} catch (ex: Exception) {
e = ex
Expand Down

0 comments on commit 04350ea

Please sign in to comment.