Ionic App Onesignal Push Notification not able to redirect to specific page

I am trying to redirect to a specific job page when there’s a new applicant.

Here’s the code:$ionicPlatform, $location) {
$ionicPlatform.ready(function() {
if (ionic.Platform.isWebView()) {
.startInit(“xxxxxxxxxxxxxx”, “xxxxxxxxxxxx”)
.handleNotificationReceived(function(jsonData) {
console.log("/app/upcoming/" + jsonData.payload.additionalData.url);
$location.path("/app/upcoming/" + jsonData.payload.additionalData.url);
The console shows the correct address but it does not redirect or have any errors.