Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ apply plugin: 'com.google.devtools.ksp'


println "Gradle uses Java ${Jvm.current()}"

// apply MoEngage SDK for NMC
apply from: "$rootProject.projectDir/nmc_moengage-dependencies.gradle"
configurations {
configureEach {
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
Expand Down Expand Up @@ -430,6 +431,9 @@ dependencies {

// splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate
implementation 'androidx.core:core-splashscreen:1.0.1'

// NMC: dependency required to capture Advertising ID for Adjust & MoEngage SDK
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
}

configurations.configureEach {
Expand Down
6 changes: 6 additions & 0 deletions app/src/gplay/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
</intent-filter>
</service>

<!-- NMC: MoEngage Activity to handle the Rich Landing page -->
<activity
android:name="com.moe.pushlibrary.activities.MoEActivity"
android:exported="false"
android:parentActivityName=".ui.activity.FileDisplayActivity" />

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import com.google.firebase.messaging.Constants.MessageNotificationKeys;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.moengage.firebase.MoEFireBaseHelper;
import com.moengage.pushbase.MoEPushHelper;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.jobs.BackgroundJobManager;
import com.nextcloud.client.jobs.NotificationWork;
Expand Down Expand Up @@ -82,6 +84,12 @@ public void handleIntent(Intent intent) {
@Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
Log_OC.d(TAG, "onMessageReceived");
// NMC: check and pass the Notification payload to MoEngage to handle it
if (MoEPushHelper.getInstance().isFromMoEngagePlatform(remoteMessage.getData())) {
MoEFireBaseHelper.getInstance().passPushPayload(getApplicationContext(), remoteMessage.getData());
return;
}

final Map<String, String> data = remoteMessage.getData();
final String subject = data.get(NotificationWork.KEY_NOTIFICATION_SUBJECT);
final String signature = data.get(NotificationWork.KEY_NOTIFICATION_SIGNATURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.nextcloud.client.core.Clock
import com.nextcloud.client.preferences.AppPreferences
import com.nextcloud.common.NextcloudClient
import com.owncloud.android.MainApp
import com.nmc.android.marketTracking.MoEngageSdkUtils
import com.owncloud.android.R
import com.owncloud.android.datamodel.ArbitraryDataProvider
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl
Expand Down Expand Up @@ -142,6 +143,8 @@ class AccountRemovalWork(

if (userRemoved) {
eventBus.post(AccountRemovedEvent())
// NMC: track user logout
MoEngageSdkUtils.trackUserLogout(context)
}

return Result.success()
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/nextcloud/utils/ShortcutUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.core.content.pm.ShortcutManagerCompat
import androidx.core.graphics.drawable.IconCompat
import androidx.core.graphics.drawable.toBitmap
import com.nextcloud.client.account.User
import com.nmc.android.marketTracking.MoEngageSdkUtils
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.datamodel.SyncedFolderProvider
Expand Down Expand Up @@ -91,6 +92,9 @@ class ShortcutUtil @Inject constructor(private val mContext: Context) {
pinShortcutInfo,
successCallback.intentSender
)

// NMC: track pin to home screen event
MoEngageSdkUtils.trackPinHomeScreenEvent(mContext, file)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Your Name <your@email.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.nmc.android.marketTracking

enum class EventFileType(val fileType: String) {
PHOTO("foto"),
SCAN("scan"),
VIDEO("video"),
AUDIO("audio"),
TEXT("text"),
PDF("pdf"),
DOCUMENT("docx"),
SPREADSHEET("xlsx"),
PRESENTATION("pptx"),
OTHER("other"), // default
}

enum class EventFolderType(val folderType: String) {
ENCRYPTED("encrypted"),
NOT_ENCRYPTED("not encrypted")
}
Loading