Skip to content

Commit

Permalink
Merge pull request #2243 from OneSignal/huawei-incorrect-notification…
Browse files Browse the repository at this point in the history
…-intent-path

Fix: incorrect activity path for NotificationOpenedActivityHMS
  • Loading branch information
jinliu9508 authored Jan 21, 2025
2 parents 9c01a40 + 3456a69 commit 821bf86
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@
</intent-filter>
</service>

<!-- CAUTION: OneSignal backend includes the activity name in the payload, modifying the name without sync may result in notification click not firing -->
<activity
android:name="com.onesignal.notifications.activities.NotificationOpenedActivityHMS"
android:name="com.onesignal.NotificationOpenedActivityHMS"
android:noHistory="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.onesignal.notifications.activities
package com.onesignal
// OneSignal backend includes the activity name in the payload, modifying the namespace may result in notification click not firing

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.onesignal.OneSignal
import com.onesignal.common.threading.suspendifyBlocking
import com.onesignal.notifications.internal.open.INotificationOpenedProcessorHMS

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.onesignal.notifications

import io.kotest.core.spec.style.FunSpec
import org.junit.jupiter.api.assertDoesNotThrow

class ClassPathTests : FunSpec({
test("ensure the class path for NotificationOpenedActivityHMS.kt is in consistent with that returned by the backend service") {
// The test will fail if the classpath is changed by accident.
// If the change is intentional and corresponds with the backend update, modify or remove this test accordingly.
val fullClassName = "com.onesignal.NotificationOpenedActivityHMS"
assertDoesNotThrow {
Class.forName(fullClassName)
}
}
})

0 comments on commit 821bf86

Please sign in to comment.