Skip to content

Commit 3456a69

Browse files
committed
Fix: incorrect activity path for NotificationOpenedActivityHMS
1 parent 9c01a40 commit 3456a69

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

OneSignalSDK/onesignal/notifications/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@
6565
</intent-filter>
6666
</service>
6767

68+
<!-- CAUTION: OneSignal backend includes the activity name in the payload, modifying the name without sync may result in notification click not firing -->
6869
<activity
69-
android:name="com.onesignal.notifications.activities.NotificationOpenedActivityHMS"
70+
android:name="com.onesignal.NotificationOpenedActivityHMS"
7071
android:noHistory="true"
7172
android:theme="@android:style/Theme.Translucent.NoTitleBar"
7273
android:exported="true">
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
* THE SOFTWARE.
2626
*/
27-
package com.onesignal.notifications.activities
27+
package com.onesignal
28+
// OneSignal backend includes the activity name in the payload, modifying the namespace may result in notification click not firing
2829

2930
import android.app.Activity
3031
import android.content.Intent
3132
import android.os.Bundle
32-
import com.onesignal.OneSignal
3333
import com.onesignal.common.threading.suspendifyBlocking
3434
import com.onesignal.notifications.internal.open.INotificationOpenedProcessorHMS
3535

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.onesignal.notifications
2+
3+
import io.kotest.core.spec.style.FunSpec
4+
import org.junit.jupiter.api.assertDoesNotThrow
5+
6+
class ClassPathTests : FunSpec({
7+
test("ensure the class path for NotificationOpenedActivityHMS.kt is in consistent with that returned by the backend service") {
8+
// The test will fail if the classpath is changed by accident.
9+
// If the change is intentional and corresponds with the backend update, modify or remove this test accordingly.
10+
val fullClassName = "com.onesignal.NotificationOpenedActivityHMS"
11+
assertDoesNotThrow {
12+
Class.forName(fullClassName)
13+
}
14+
}
15+
})

0 commit comments

Comments
 (0)