-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: incorrect activity path for NotificationOpenedActivityHMS #2243
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also put a comment here and before the class definition too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good suggestion. I have added the comment for the change. Note that I added it below the first line as first line comment is not allowed in the coding standard. |
||
// 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 | ||
|
||
|
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) | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment here that we can't change the android:name, since the OneSignal backend incudes it in the payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. I have added the comment for the change.