Merge pull request #3212 from medici/moengageUpdate

Update MOENGAGE sdk
This commit is contained in:
Abhinav Gupta
2022-06-28 11:31:25 +05:30
committed by GitHub Enterprise
2 changed files with 8 additions and 7 deletions

View File

@@ -44,9 +44,10 @@ dependencies {
// Gson
implementation 'com.google.code.gson:gson:2.8.5'
// for moengage sdk
implementation 'com.moengage:moe-android-sdk:11.4.02'
implementation 'com.moengage:rich-notification:2.4.0'
implementation 'com.moengage:push-amp-plus:4.0.1'
implementation 'com.moengage:moe-android-sdk:12.2.02'
implementation 'com.moengage:rich-notification:3.1.1'
implementation 'com.moengage:push-amp-plus:5.1.1'
implementation 'com.moengage:inapp:6.2.0'
// Firebase SDK for Push Notification
implementation 'com.google.firebase:firebase-analytics-ktx:18.0.0'
// Firebase SDK for Google Analytics (Kotlin)

View File

@@ -16,6 +16,7 @@ import com.moengage.core.config.FcmConfig
import com.moengage.core.config.InAppConfig
import com.moengage.core.config.LogConfig
import com.moengage.core.config.MiPushConfig
import com.moengage.core.config.NotificationConfig
import com.moengage.core.model.AppStatus
import com.moengage.firebase.MoEFireBaseHelper
import com.moengage.inapp.MoEInAppHelper
@@ -34,14 +35,13 @@ object MoengageUtil {
) {
try {
val moEngage = MoEngage.Builder(appContext, moengageData.moengageKey)
.setNotificationSmallIcon(moengageData.smallIconId)
.setNotificationLargeIcon(moengageData.largeIconId)
.configureNotificationMetaData(NotificationConfig(moengageData.smallIconId, moengageData.largeIconId))
.configureLogs(LogConfig())
.configureFcm(FcmConfig(isRegistrationEnabled = true))
.configureInApps(InAppConfig(true, inAppOptOutScreens))
.configureInApps(InAppConfig(inAppOptOutScreens))
.configureMiPush(MiPushConfig(moengageData.xiaomiPushAppId, moengageData.xiaomiPushAppKey, true))
.build()
MoEngage.initialise(moEngage)
MoEngage.initialiseDefaultInstance(moEngage)
} catch (e: Exception) {
Timber.e(e)
}