androidcordovapush-notificationinfobip

onOverrideUrlLoading doesn't allow me to change url in Infobip Push Notification Plugin for Cordova


I'm new to Android and Cordova. I think I have solved a problem, but I don't know if there's a better way to solve this question.

I have to send push notifications from a web service to cordova app. I'm using the infobip service and it works perfectly. This provider has a plugin for cordova, that plugin override the onOverrideUrlLoading method in push-plugin-cordova-phonegap/push-cordova/src/android/Push.java

@Override
public boolean onOverrideUrlLoading(String url) {
    Log.d(this.TAG, "onOverrideUrlLoading YEEEAAHH!!");
    return true;
}

When I start the push service this method doesn't allow me to change the url. My application is multipage and I need to change it.

My solution is poor and simple: change the plugin...

@Override
public boolean onOverrideUrlLoading(String url) {
    return false;
}

and that's it... it works! I can change the url in javascript.

What do you think?

Sorry for my English!

Thanks!


Solution

  • debiasej.

    onOverrideUrlLoading has to be overridden because of Media Push, which can cause problems if it is not overridden. But you are right - it may return false (onOverrideUrlLoading).

    As I am an Infobip employee connected with the Infobip Push project and I'll pass this remark to our development team for further discussion, so you may expect an update of our plugin with your suggestion if it's adopted.

    Thank you for your feedback.