Skip to content

Commit

Permalink
Pull request #42: Okoroleva MM-5499 Inbox
Browse files Browse the repository at this point in the history
Merge in MML/infobip-mobile-messaging-huawei from okoroleva_MM-5499_Inbox to release_3.0.0

Squashed commit of the following:

commit c969ac70e8028e366afe70f551422af2643bf6c2
Author: Olga Koroleva <[email protected]>
Date:   Thu Jan 26 13:57:57 2023 +0100

    minor fixes

commit f49d7a8555db389e57fb90cb8ba75e40ead8cc3c
Author: Olga Koroleva <[email protected]>
Date:   Thu Jan 26 11:18:16 2023 +0100

    minor changes

commit 19c9f3c11f556c38a760de7f8f1d3b3c20324a21
Author: Olga Koroleva <[email protected]>
Date:   Thu Jan 26 09:25:46 2023 +0100

    reverted to hms

commit 863f65c85de20294747d998e707822ee5394732f
Author: Olga Koroleva <[email protected]>
Date:   Wed Jan 25 15:50:38 2023 +0100

    Added inbox-ask, changed the CloudType for fetch request, android sdk version is 7.4.2

commit 19e6dc997287bb7de2c8fd298d3c1089bf5dc57f
Author: Olga Koroleva <[email protected]>
Date:   Tue Jan 24 15:30:52 2023 +0100

    minor fix

commit 1cd5ccd08b6628cae7fd6a6ee15a5dbd5c9a10af
Merge: f78a81f 3c504a0b
Author: Olga Koroleva <[email protected]>
Date:   Tue Jan 24 15:18:02 2023 +0100

    Merge remote-tracking branch 'android/master' into okoroleva_MM-5499_Inbox

commit 3c504a0be5d2b406b627af25b68e15ae4be9e809
Author: infobip-ci <[email protected]>
Date:   Tue Jan 24 12:46:15 2023 +0000

    [Gradle Release Plugin] - new version commit:  '7.5.0-SNAPSHOT'.

commit d3002833043cbde2a0ea0a688591f22f75c8e2da
Author: infobip-ci <[email protected]>
Date:   Tue Jan 24 12:46:09 2023 +0000

    [Gradle Release Plugin] - pre tag commit:  '7.4.0'.

commit cc81201f7d2b50e02679015dbf05515e9d02fc9d
Author: Olga Koroleva <[email protected]>
Date:   Tue Jan 24 12:50:26 2023 +0100

    added inbox-sdk to the build gradle

commit 694ad99b296dd0014b91657fffc390cc358a5293
Author: Olga Koroleva <[email protected]>
Date:   Tue Jan 24 10:35:18 2023 +0000

    Pull request #310: Okoroleva MM-5498 Inbox

    Merge in MML/infobip-mobile-messaging-android from okoroleva-MM-5498_Inbox to master

    Squashed commit of the following:

    commit 67f3d613fa26d2d8990c99b34ab559a0f8319277
    Author: Olga Koroleva <[email protected]>
    Date:   Tue Jan 24 09:47:08 2023 +0100

        changed signature of setSeen, + minor fixes after PR

    commit bd1322c1dd5183e4363974cfc8ff9a6fe5893af8
    Author: Olga Koroleva <[email protected]>
    Date:   Mon Jan 23 10:58:59 2023 +0100

        minor update of the Example app

    commit f71926bb4978f79c3b40e4a28f743bf26b7e4a8f
    Author: Olga Koroleva <[email protected]>
    Date:   Mon Jan 23 09:59:50 2023 +0100

        minor fixes for Inbox and Example

    commit 6a2ce5068a24b5ae396e3fdaba74bb0630c71992
    Author: Olga Koroleva <[email protected]>
    Date:   Wed Jan 18 10:15:52 2023 +0100

        build gradle fix

    commit 1c69a7294133b136a16db7eb5dd821c481923c95
    Merge: e599192a 2a57cc54
    Author: Olga Koroleva <[email protected]>
    Date:   Tue Jan 17 17:23:07 2023 +0100

        Merge branch 'inbox' into okoroleva-MM-5498_Inbox

        # Conflicts:
        #	README.md
        #	gradle.properties
        #	infobip-mobile-messaging-android-chat-sdk/src/main/assets/inappchat-widget.html
        #	infobip-mobile-messaging-android-chat-sdk/src/main/java/org/infobip/mobile/messaging/chat/core/InAppChatClient.java
        #	infobip-mobile-messaging-android-chat-sdk/src/main/java/org/infobip/mobile/messaging/chat/core/InAppChatClientImpl.java
        #	infobip-mobile-messaging-android-chat-sdk/src/main/java/org/infobip/mobile/messaging/chat/core/InAppChatWebViewManager.java
        #	infobip-mobile-messaging-android-chat-sdk/src/main/java/org/infobip/mobile/messaging/chat/core/InAppChatWidgetMethods.java
        #	infobip-mobile-messaging-android-chat-sdk/src/main/java/org/infobip/mobile/messaging/chat/view/InAppChatFragment.java
        #	infobip-mobile-messaging-android-resources/src/main/res/values-uk-rUA/strings.xml
        #	infobip-mobile-messaging-android-sdk/src/main/java/org/infobip/mobile/messaging/MobileMessaging.java
        #	infobip-mobile-messaging-android-sdk/src/main/java/org/infobip/mobile/messaging/MobileMessagingCore.java
        #	infobip-mobile-messaging-api-java/src/main/java/org/infobip/mobile/messaging/api/chat/WidgetInfo.java

    commit 2a57cc5409f40d2388ccfedc0c8032c61cb31e07
    Author: infobip-ci <[email protected]>
    Date:   Wed Nov 16 15:03:57 2022 +0000

        [Gradle Release Plugin] - new version commit:  '7.1.0-SNAPSHOT'.

    commit a42f74d5ca38b8866b919ea05e9238bf64398590
    Author: infobip-ci <[email protected]>
    Date:   Wed Nov 16 15:03:51 2022 +0000

        [Gradle Release Plugin] - pre tag commit:  '7.0.0-rc1'.

    commit c1f8b3edfeaa2cc462b72f073568af3a18511a14
    Author: Olga Koroleva <[email protected]>
    Date:   Wed Nov 16 13:38:22 2022 +0000

        Pull request #298: Okoroleva MM-5297 Android13

        Merge in MML/infobip-mobile-messaging-android from okoroleva-MM-5297_Android13 to inbox

        Squashed commit of the following:

        commit bf4e94c3a8f79be8e02a08c4f0f5b7d321f87966
        Merge: bdd9af93 18e467af
        Author: Olga Koroleva <[email protected]>
        Date:   Wed Nov 16 14:13:17 2022 +0100

            Merge branch 'master' into okoroleva-MM-5297_Android13

        commit 18e467aff4c3e3a2b68ff98eef6c1b2579815465
        Author: Ivan Krešić <[email protected]>
        Date:   Wed Nov 16 11:32:38 2022 +0000

            Pull request #291: Ikresic MM-5351 android sdk android 13 support chat and geo

            Merge in MML/infobip-mobile-messaging-android from ikresic-MM-5351-android-sdk-android-13-support-chat-and-geo to master

            Squashed commit of the following:

            commit 7d7b815966e3ca003f50bce85d4b848385b94523
            Author: Olga Koroleva <[email protected]>
            Date:   Wed Nov 16 11:18:46 2022 +0100

                minor enchancements

            commit f28e893881758b9aa9cae5ae132eacded594e80f
            Merge: a6767ea8 907f2ec3
            Author: Alexander Boldyrev <[email protected]>
            Date:   Tue Nov 15 16:25:48 2022 +0100

                Merge branch 'master' into ikresic-MM-5351-android-sdk-android-13-support-chat-and-geo

                # Conflicts:
                #	infobip-mobile-messaging-android-sdk/src/main/java/org/infobip/mobile/messaging/MobileMessagingCore.java
                #	infobip-mobile-messaging-android-sdk/src/main/java/org/infobip/mobile/messaging/interactive/MobileInteractiveImpl.java

            commit a6767ea882dea1502825a0d9bc3a31961e560993
            Author: Alexander Boldyrev <[email protected]>
            Date:   Tue Nov 15 16:24:22 2022 +0100

                - extracted isTiramisuOrAbove

            commit 4a4df5094544cb4ff5c03d119194d2bf468dd2f0
            Merge: f5320dfe a2e9a58e
            Author: Alexander Boldyrev <[email protected]>
            Date:   Thu Nov 10 15:44:42 2022 +0100

                Merge branch 'aboldyrev-MM-5354-android_13_support_notification_permissions' into ikresic-MM-5351-android-sdk-android-13-support-chat-and-geo

            commit a2e9a58ef51e4dbc1553c7097dd4eb2211fd11db
            Author: Alexander Boldyrev <[email protected]>
            Date:   Thu Nov 10 14:11:13 2022 +0100

                - fix from comments

            commit b11c49b5842533567586688a68af612dbe3a9684
            Author: Alexander Boldyrev <[email protected]>
            Date:   Thu Nov 10 13:40:42 2022 +0100

                - more methods extracted
                - baseUrl cleanup for MM-5392

            commit d3662fa33a55b7323295febcec1b45498b7d66f0
            Author: Alexander Boldyrev <[email protected]>
            Date:   Wed Nov 9 19:03:30 2022 +0100

                - methods extracted

            commit fd18ab6c752a8fb08a774de733027229404c017f
            Author: Alexander Boldyrev <[email protected]>
            Date:   Wed Nov 9 15:59:23 2022 +0100

                - added link to github

            commit d6d18c6f688183719881b8b82bd673ea3a133513
            Author: Alexander Boldyrev <[email protected]>
            Date:   Tue Nov 8 17:56:53 2022 +0100

                - fixes from PR comments

            commit 87ffc8ed65edaefce5e3b0931839b6829b9f22f3
            Author: Alexander Boldyrev <[email protected]>
            Date:   Mon Oct 17 10:49:51 2022 +0200

                - fixes from PR comments

            commit b5a8a22157ab4d5f059f0d80c47eb5ec3dd4b3b8
            Author: ikresic <[email protected]>
            Date:   Thu Oct 20 11:13:58 2022 +0200

                - fixes from PR comments

            commit d797f29feafc5e3fd4dafe9a3ddaf7ac5a622928
            Author: ikresic <[email protected]>
            Date:   Thu Oct 20 09:38:09 2022 +0200

                - fixes from PR comments

            commit d0bcc214267fabaa24a579f6007622913b252f30
            Author: ikresic <[email protected]>
            Date:   Wed Oct 19 17:12:31 2022 +0200

                - code cleanup

            commit 44b5477c8a8c28269de1b1ca7a9be2b7dba0b0e6
            Author: ikresic <[email protected]>
            Date:   Tue Oct 18 13:36:28 2022 +0200

                Code cleanup - removed Logs and view used for testing. Removed SDK initialization from MainActivity, and left it in Application class. Removed unused imports.

            commit 07ba286df9c4970cf71fa9033106b0ea60c24984
            Author: ikresic <[email protected]>
            Date:   Mon Oct 17 14:24:59 2022 +0200

                Fixed dialog not showing when another runtime permission is requested in app activity.

            commit 37dade3cc30ac020fa18b03bcb47a9845415914f
            Author: ikresic <[email protected]>
            Date:   Mon Oct 17 14:24:28 2022 +0200

                Fixed dialog not showing when another runtime permission is requested in app activity.

            commit fe7426885eff30dcd270c0e424449cd76ff225d3
            Author: ikresic <[email protected]>
            Date:   Mon Oct 17 10:49:51 2022 +0200

                Initial working solution for POST_NOTIFICATIONS.
                Note: Need to do code cleanup.

            commit f5320dfe9229be0ae84aa5476d6f09847043327a
            Author: ikresic <[email protected]>
            Date:   Wed Nov 2 22:11:03 2022 +0100

                - updated logged error message when permission not provided!

            commit 46843b6691cdb4fab56f8ec6854d80e4622abf14
            Author: ikresic <[email protected]>
            Date:   Thu Oct 27 22:37:10 2022 +0200

                - provided Android 13+ permissions for media

        commit 907f2ec3e21915cb40ce46952ea04fda7afc6694
        Author: Alexander Boldyrev <[email protected]>
        Date:   Tue Nov 15 15:18:45 2022 +0000

            Pull request #294: Aboldyrev MM-5354 android 13 support notification permissions

            Merge in MML/infobip-mobile-messaging-android from aboldyrev-MM-5354-android_13_support_notification_permissions to master

            Squashed commit of the following:

            commit a2e9a58ef51e4dbc1553c7097dd4eb2211fd11db
            Author: Alexander Boldyrev <[email protected]>
            Date:   Thu Nov 10 14:11:13 2022 +0100

                - fix from comments

            commit b11c49b5842533567586688a68af612dbe3a9684
            Author: Alexander Boldyrev <[email protected]>
            Date:   Thu Nov 10 13:40:42 2022 +0100

                - more methods extracted
                - baseUrl cleanup for MM-5392

            commit d3662fa33a55b7323295febcec1b45498b7d66f0
            Author: Alexander Boldyrev <[email protected]>
            Date:   Wed Nov 9 19:03:30 2022 +0100

                - methods extracted

            commit fd18ab6c752a8fb08a774de733027229404c017f
            Author: Alexander Boldyrev <[email protected]>
            Date:   Wed Nov 9 15:59:23 2022 +0100

                - added link to github

            commit d6d18c6f688183719881b8b82bd673ea3a133513
            Author: Alexander Boldyrev <[email protected]>
            Date:   Tue Nov 8 17:56:53 2022 +0100

                - fixes from PR comments

            commit 87ffc8ed65edaefce5e3b0931839b6829b9f22f3
            Author: Alexander Boldyrev <[email protected]>
            Date:   Mon Oct 17 10:49:51 2022 +0200

                - fixes from PR comments

            commit b5a8a22157ab4d5f059f0d80c47eb5ec3dd4b3b8
            Author: ikresic <[email protected]>
            Date:   Thu Oct 20 11:13:58 2022 +0200

                - fixes from PR comments

            commit d797f29feafc5e3fd4dafe9a3ddaf7ac5a622928
            Author: ikresic <[email protected]>
            Date:   Thu Oct 20 09:38:09 2022 +0200

                - fixes from PR comments

            commit d0bcc214267fabaa24a579f6007622913b252f30
            Author: ikresic <[email protected]>
            Date:   Wed Oct 19 17:12:31 2022 +0200

                - code cleanup

            commit 44b5477c8a8c28269de1b1ca7a9be2b7dba0b0e6
            Author: ikresic <[email protected]>
            Date:   Tue Oct 18 13:36:28 2022 +0200

                Code cleanup - removed Logs and view used for testing. Removed SDK initialization from MainActivity, and left it in Application class. Removed unused imports.

            commit 07ba286df9c4970cf71fa9033106b0ea60c24984
            Author: ikresic <[email protected]>
            Date:   Mon Oct 17 14:24:59 2022 +0200

                Fixed dialog not showing when another runtime permission is requested in app activity.

            commit 37dade3cc30ac020fa18b03bcb47a9845415914f
            Author: ikresic <[email protected]>
            Date:   Mon Oct 17 14:24:28 2022 +0200

                Fixed dialog not showing when another runtime permission is requested in app activity.

            commit fe7426885eff30dcd270c0e424449cd76ff225d3
            Author: ikresic <[email protected]>
            Date:   Mon Oct 17 10:49:51 2022 +0200

                Initial working solution for POST_NOTIFICATIONS.
                Note: Need to do code cleanup.
commit e599192ab423efac8bb603d10d44466b97d7af9b
Author: infobip-ci <[email protected]>
Date:   Fri Dec 23 11:18:59 2022 +0000

    [Gradle Release Plugin] - new version commit:  '7.4.0-SNAPSHOT'.

commit 7cce2eac30b6b1b66626eb6d1f3f5c3da6d360ba
Author: infobip-ci <[email protected]>
Date:   Fri Dec 23 11:18:55 2022 +0000

    [Gradle Release Plugin] - pre tag commit:  '7.3.1'.

commit ba4a5dec6682892c97b95782d87b5860585786e0
Author: Ivan Krešić <[email protected]>
Date:   Fri Dec 23 10:34:09 2022 +0000

    Pull request #307: Ikresic MM-5461 android post notifications request loops

    Merge in MML/infobip-mobile-messaging-android from ikresic-MM-5461-android-post-notifications-request-loops to master

    Squashed commit of the following:

    commit 7eb4a8035590ff7af8dc2ba3280356708dfd7e2c
    Author: ikresic <[email protected]>
    Date:   Fri Dec 23 10:39:55 2022 +0100

        - changed Activity type in PermissionHelper

    commit bdbd59c76d1051028ae59ddf3b9a15b939442fb9
    Author: ikresic <[email protected]>
    Date:   Thu Dec 22 18:13:10 2022 +0100

        - code cleanup

    commit 46063258ce4fe88f42b96deba767ee9ba887ee13
    Author: ikresic <[email protected]>
    Date:   Thu Dec 22 18:12:32 2022 +0100

        - code cleanup

commit b9257b8b61fb432f707fb54a61c4131c704d2b4f
Author: infobip-ci <[email protected]>
Date:   Thu Dec 22 14:26:37 2022 +0000

    [Gradle Release Plugin] - new version commit:  '7.4.0-SNAPSHOT'.

commit f04a0b8e768b924ff5a7404115a3206045cfde8d
Author: infobip-ci <[email protected]>
Date:   Thu Dec 22 14:26:29 2022 +0000

    [Gradle Release Plugin] - pre tag commit:  '7.3.0'.

commit b453f0ebaa4633ea2022a0e2dc117050bab2da4b
Author: Ivan Krešić <[email protected]>
Date:   Thu Dec 22 12:38:37 2022 +0000

    Pull request #304: Bugfix/ikresic MM-5461 android post notifications request loops to the infinity and beyond

    Merge in MML/infobip-mobile-messaging-android from bugfix/ikresic-MM-5461-android-post-notifications-request-loops-to-the-infinity-and-beyond to master

    Squashed commit of the following:

    commit 939b2491bdc5bd7297b9696c79b09ac04293db3f
    Author: ikresic <[email protected]>
    Date:   Thu Dec 22 13:34:01 2022 +0100

        - code cleanup

    commit 2471aaa29679ffb0e24cba5b52c202f7ae16e08b
    Author: ikresic <[email protected]>
    Date:   Wed Dec 21 17:25:22 2022 +0100

        - code cleanup

    commit 3a22e2acf63f073df14b24c7ccf2db17870e2ffb
    Author: ikresic <[email protected]>
    Date:   Wed Dec 21 16:47:47 2022 +0100

        - code cleanup

    commit a4f153574fd67d6e737960c4c58cc4ece36fdb6a
    Author: ikresic <[email protected]>
    Date:   Wed Dec 21 16:38:34 2022 +0100

        - code cleanup

    commit a27af0eb247091f47ca4da8d23698719b30a1e59
    Author: ikresic <[email protected]>
    Date:   Wed Dec 21 12:06:41 2022 +0100

        - code cleanup

    commit 24da661f6648f0d4930c2b73b55bf64715c14d58
    Author: ikresic <[email protected]>
    Date:   Wed Dec 21 12:02:43 2022 +0100

        - code cleanup

    commit 4460b8fb62c655efb30d3392f8d04a1d37d0ed0f
    Author: ikresic <[email protected]>
    Date:   Wed Dec 21 11:51:58 2022 +0100

        - code cleanup

    commit 5c2bf8db7eb67d05ffdd75503d7cec09ff408578
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 18:35:29 2022 +0100

        - replaced AppCompatActivity with ComponentActivity

    commit 5354975e509f2456a52bda4924fbb862ea2f4355
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 17:45:44 2022 +0100

        - translation fix

    commit 5a88d0c753b158ad781f5990dfe69f4d24e4db1d
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 17:08:50 2022 +0100

        - code cleanup

    commit 3177adfe60f0e687de392342edd418cb50f91af7
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 17:05:52 2022 +0100

        - updated string keys and files

    commit cfb03a02a44ed50e01c95cce9b306f0136011f0b
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 16:59:09 2022 +0100

        - removed property on cleanup, added annotation for version

    commit f3975a03e43e8c13ff0e546cc76a6c9b6d9feebc
    Merge: 323e7c1b 09da1308
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 16:38:04 2022 +0100

        Merge remote-tracking branch 'origin/bugfix/ikresic-MM-5461-android-post-notifications-request-loops-to-the-infinity-and-beyond' into bugfix/ikresic-MM-5461-android-post-notifications-request-loops-to-the-infinity-and-beyond

    commit 323e7c1b20ea095db930b914b7c88e3ca3be5dcc
    Author: ikresic <[email protected]>
    Date:   Tue Dec 20 16:37:22 2022 +0100

        - provided missing translations for new strings

    commit 09da1308f023984b3c4a1b53af12c47511aecbff
    Author: Olga Koroleva <[email protected]>
    Date:   Tue Dec 20 15:37:21 2022 +0100

        minor fix

    commit ec64398ca49132b4d1135d299d4c09afc3056cc8
    Author: ikresic <[email protected]>
    Date:   Mon Dec 19 15:58:14 2022 +0100

        - provided fix for Post Notifications Permissions Request by using PermissionRequestManager
        - removed old implementation

    commit 187e97798e399e5b2a9bf401e5252859b7a860f2
    Author: ikresic <[email protected]>
    Date:   Mon Dec 19 01:42:45 2022 +0100

        - provided fix for Post Notifications Permissions Request by using PermissionRequestManager
        - removed old implementation

    commit 443d077689155060cca7306b1b6242356a94ab1d
    Author: ikresic <[email protected]>
    Date:   Thu Dec 15 19:14:51 2022 +0100

        - provided fix for Post Notifications Permissions Request by using PermissionRequestManager
        - removed old implementation

    commit 4bfd9082e18da28d6ab344be2cd416a9d4730c0e
    Author: ikresic <[email protected]>
    Date:   Tue Dec 13 18:08:44 2022 +0100

        - quickfix for infinite loop when user Declines POST_NOTIFICATION permission request twice

commit e347fb7151a0df4c3188e4ee7b838dc4c229f1db
Author: infobip-ci <[email protected]>
Date:   Tue Dec 6 10:50:45 2022 +0000

    [Gradle Release Plugin] - new version commit:  '7.3.0-SNAPSHOT'.

commit 4900a6f22198ebfc9502382d1362f956269f4a48
Author: infobip-ci <[email protected]>
Date:   Tue Dec 6 10:50:34 2022 +0000

    [Gradle Release Plugin] - pre tag commit:  '7.2.4'.

commit 336efb1d6ef1366907e0d9bc78eb10430799538c
Author: Olga Koroleva <[email protected]>
Date:   Tue Dec 6 10:02:24 2022 +0000

    Pull request #303: activityLauncher instead of deprecated startActivityFor Result

    Merge in MML/infobip-mobile-messaging-android from okoroleva-PZ-474_startActivityForResult to master

    Squashed commit of the following:

    commit fa4a60321556b69a4fcbd74ad09b3e6121c2b73b
    Author: Olga Koroleva <[email protected]>
    Date:   Tue Dec 6 09:33:40 2022 +0100

        changes after review

    commit f5cb025469aa394e95efbbc8e84f29bb6df35d33
    Author: Olga Koroleva <[email protected]>
    Date:   Mon Dec 5 13:26:17 2022 +0100

        activityLauncher instead of deprecated startActivityFor Result

commit 5921b57535b4f08459f2b0ba42ea4fb757dbff96
Author: infobip-ci <[email protected]>
Date:   Wed Nov 30 21:20:23 2022 +0000

    [Gradle Release Plugin] - new version commit:  '7.3.0-SNAPSHOT'.

... and 122 more commits
  • Loading branch information
riskpp committed Jan 26, 2023
1 parent f78a81f commit d147884
Show file tree
Hide file tree
Showing 46 changed files with 2,400 additions and 29 deletions.
12 changes: 2 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ ext {
mm_compileSdkVersion = 33
mm_targetSdkVersion = 33
mm_buildToolsVersion = "33.0.0"
mm_androidSdkVersion = "7.3.1"
}

allprojects {
repositories {
google()
mavenCentral()
// huawei maven
maven { url 'https://developer.huawei.com/repo/' }
}
mm_androidSdkVersion = "7.4.2"
}

//It's required to be applied here, to have `subprojects.publish` task available
Expand Down Expand Up @@ -62,6 +53,7 @@ task build {}

build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-chat-sdk:build')
//build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-geo-sdk:build')
build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-inbox-sdk:build')
build.dependsOn tasks.getByPath('infobip-mobile-messaging-huawei-cryptor-migration:build')
build.dependsOn tasks.getByPath(':infobip-mobile-messaging-huawei-sdk:build')

Expand Down
2 changes: 1 addition & 1 deletion infobip-mobile-messaging-huawei-chat-sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories {
mavenCentral()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
Expand Down
9 changes: 7 additions & 2 deletions infobip-mobile-messaging-huawei-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ android {
// geofencing {
// dimension "default"
// }
inbox {
dimension "default"
}

}
}

Expand All @@ -104,14 +108,15 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'

implementation project(':infobip-mobile-messaging-huawei-chat-sdk')

// current version of SDK doesn't support geo
// implementation project(':infobip-mobile-messaging-huawei-geo-sdk')
implementation ("com.infobip:infobip-mobile-messaging-android-resources:${mm_androidSdkVersion}@aar")
implementation project(':infobip-mobile-messaging-huawei-sdk')
implementation project(':infobip-mobile-messaging-huawei-inbox-sdk')

implementation "com.infobip:infobip-mobile-messaging-api-java:${mm_androidSdkVersion}"
implementation ("com.infobip:infobip-mobile-messaging-android-resources:${mm_androidSdkVersion}@aar")

// push kit
implementation 'com.huawei.hms:push:6.3.0.302'

implementation 'androidx.appcompat:appcompat:1.3.1'
Expand Down
25 changes: 25 additions & 0 deletions infobip-mobile-messaging-huawei-demo/src/inbox/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.infobip.mobile.messaging.demo">

<application>
<activity
android:name=".InboxActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.infobip.mobile.messaging.demo;

public class Constants {
public static final String BUNDLE_KEY_DEMO_INBOX = "DEMO_INBOX";
public static final String BUNDLE_KEY_EXTERNAL_USER_ID = "DEMO_EXTERNAL_USER_ID";
public static final String SHARED_PREF_KEY = "InfobipDemoPrefs";
public static final String SHARED_PREF_INBOX_VALUE = "INFOBIP_DEMO_INBOX_VALUE";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package org.infobip.mobile.messaging.demo;

import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import org.infobip.mobile.messaging.inbox.InboxMessage;

import java.util.List;

public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> {
private List<InboxMessage> messageTexts;
private OnMessageListener onMessageListener;

public CustomAdapter(List<InboxMessage> inboxMessages, OnMessageListener onMessageListener) {
this.messageTexts = inboxMessages;
this.onMessageListener = onMessageListener;
}

public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private final TextView messageText;
private final TextView messageTopic;

OnMessageListener onMessageListener;

public ViewHolder(View view, OnMessageListener onMessageListener) {
super(view);
this.onMessageListener = onMessageListener;
view.setOnClickListener(this);

messageText = view.findViewById(R.id.tv_message_details);
messageTopic = view.findViewById(R.id.tv_message_topic);
}

@Override
public void onClick(View view) {
onMessageListener.onMessageClick(getAdapterPosition());
}

public TextView getMessageTextView() {
return messageText;
}

public TextView getMessageTopicView() {
return messageTopic;
}
}

@Override
@NonNull
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.message_details, parent, false);

return new ViewHolder(v, onMessageListener);
}

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
InboxMessage message = messageTexts.get(position);
String text = "Text: " + message.getBody();
String topic = "Topic: " + message.getTopic();

holder.getMessageTextView().setText(text);
holder.getMessageTopicView().setText(topic);
holder.getMessageTextView()
.setTypeface(null, message.isSeen() ? Typeface.NORMAL : Typeface.BOLD);
}

@Override
public int getItemCount() {
return messageTexts.size();
}

public interface OnMessageListener {
void onMessageClick(int position);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
package org.infobip.mobile.messaging.demo;

import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.google.android.material.tabs.TabLayout;

import org.infobip.mobile.messaging.MobileMessaging;
import org.infobip.mobile.messaging.inbox.Inbox;
import org.infobip.mobile.messaging.inbox.InboxBundleMapper;
import org.infobip.mobile.messaging.inbox.InboxMessage;
import org.infobip.mobile.messaging.inbox.MobileInbox;
import org.infobip.mobile.messaging.inbox.MobileInboxFilterOptions;
import org.infobip.mobile.messaging.mobileapi.MobileMessagingError;
import org.infobip.mobile.messaging.mobileapi.Result;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class InboxActivity extends AppCompatActivity implements CustomAdapter.OnMessageListener {

private SwipeRefreshLayout swipeLayout;
private TextView counts;
private Button btnBack;
protected RecyclerView mRecyclerView;
protected RecyclerView.LayoutManager mLayoutManager;
protected CustomAdapter mAdapter;

private Inbox inbox;
private List<InboxMessage> inboxMessages;
private MobileInbox mobileInbox;
private String externalUserId;
private String topic;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inbox);

mRecyclerView = findViewById(R.id.recyclerView);
counts = findViewById(R.id.tv_counts);
swipeLayout = findViewById(R.id.swipeContainer);
swipeLayout.setOnRefreshListener(fetchInboxOnSwipeListener());

btnBack = findViewById(R.id.button_second);
btnBack.setOnClickListener(onBackPressedListener());

TabLayout tabs = findViewById(R.id.tabs);

mobileInbox = MobileInbox.getInstance(this);
topic = null;

Intent intent = getIntent();
if (intent != null) {
externalUserId = intent.getStringExtra(Constants.BUNDLE_KEY_EXTERNAL_USER_ID);
inbox = Inbox.createFrom(intent.getBundleExtra(Constants.BUNDLE_KEY_DEMO_INBOX));
}

inboxMessages = new ArrayList<>();
if (inbox != null && inbox.getCountTotal() > 0) {
inboxMessages.addAll(inbox.getMessages());
updateCounterText();
} else {
counts.setText(R.string.inbox_empty);
}

mAdapter = new CustomAdapter(inboxMessages, this);

mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.scrollToPosition(0);

tabs.addTab(tabs.newTab().setText(R.string.tb_all));
tabs.addTab(tabs.newTab().setText(R.string.tb_promo));
tabs.addTab(tabs.newTab().setText(R.string.tb_notifications));
tabs.addOnTabSelectedListener(tabSelectedListener());
}

@Override
public void onMessageClick(int i) {
String messageId = inboxMessages.get(i).getMessageId();
if (inboxMessages.get(i).isSeen()) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setMessage(R.string.mark_as_seen)
.setPositiveButton("YES", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
inboxMessages.get(i).setSeen();
mobileInbox.setSeen(externalUserId, new String[]{messageId}, new MobileMessaging.ResultListener<String[]>() {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onResult(Result<String[], MobileMessagingError> result) {
if (result.isSuccess()) {
updateCounterText();
mAdapter.notifyDataSetChanged();
}
}
});
}
}).setNegativeButton("NO", (dialog, which) -> {});
builder.show();
}

private void updateCounterText() {
String countsText = String.format("%s messages, %s unread", inbox.getCountTotal(), inbox.getCountUnread());
counts.setText(countsText);
}

private TabLayout.OnTabSelectedListener tabSelectedListener() {
return new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
Map<Integer, String> topicNameMap = new HashMap<>();
topicNameMap.put(0, null);
topicNameMap.put(1, "promo");
topicNameMap.put(2, "notifications");

if (inbox != null && inbox.getCountTotal() > 0) {
topic = topicNameMap.get(tab.getPosition());
updateInboxList();
}
}

@Override
public void onTabUnselected(TabLayout.Tab tab) {

}

@Override
public void onTabReselected(TabLayout.Tab tab) {

}
};
}

@SuppressLint("NotifyDataSetChanged")
private void updateInboxList() {
inboxMessages.clear();
for (InboxMessage message : inbox.getMessages()) {
if (topic == null || message.getTopic().equalsIgnoreCase(topic)) {
inboxMessages.add(message);
}
}
mAdapter.notifyDataSetChanged();
}

private SwipeRefreshLayout.OnRefreshListener fetchInboxOnSwipeListener() {
MobileInboxFilterOptions filterOptions = new MobileInboxFilterOptions(null, null, topic, null);
return () -> mobileInbox.fetchInbox(externalUserId, filterOptions, new MobileMessaging.ResultListener<Inbox>() {
@Override
public void onResult(Result<Inbox, MobileMessagingError> result) {
if (result.isSuccess()) {
inbox = result.getData();
if (inbox.getCountTotal() > 0) {
updateInboxList();
updateCounterText();
} else {
Toast.makeText(InboxActivity.this, R.string.inbox_empty, Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(InboxActivity.this, R.string.cannot_update_inbox, Toast.LENGTH_SHORT).show();
}
swipeLayout.setRefreshing(false);
}
});
}

private View.OnClickListener onBackPressedListener() {
return new View.OnClickListener() {
@Override
public void onClick(View view) {
Bundle arguments = new Bundle();
arguments.putBundle(Constants.BUNDLE_KEY_DEMO_INBOX, InboxBundleMapper.inboxToBundle(inbox));

Intent intent = new Intent(InboxActivity.this, MainActivity.class);
intent.putExtras(arguments);
InboxActivity.this.startActivity(intent);
}
};
}
}
Loading

0 comments on commit d147884

Please sign in to comment.