Error with IAV example flow


I’m very new to Dwolla so please excuse me if this question is basic. I’m trying to implement the IAV flow using example code provided on the website but am getting the following error message:

Error: {“code”:“UnexpectedPage”,“message”:“IAV navigated to an unexpected page and was cancelled.”} – Response: undefined

It happens in my call to dwolla.iav.start. I copied over the example code on this page to get started: but have obviously had no luck yet getting it to work.

Any help at all would be much appreciated.

(Stephen Ausman) #2

Hey swigstrom,

I’m having trouble reproducing the error you’re getting. Are there any other errors being logged to the console?


Hi Stephen!

This is the complete error message:

Uncaught SyntaxError: Failed to execute ‘postMessage’ on ‘Window’: Invalid target origin ‘null’ in a call to ‘postMessage’.

Error: {“code”:“UnexpectedPage”,“message”:“IAV navigated to an unexpected page and was cancelled.”} – Response: undefined

(Stephen Ausman) #4


Are you viewing testIAV.html in your browser using the file protocol? (e.g. at file:///Users/sausman/Desktop/testIAV.html). It should work if you view the page over HTTP instead.

You can use a simple web server like if you have npm installed:

npm install -g http-server
http-server /Users/sausman/Desktop
# open http://localhost:8080/testIAV.html in your browser


Got it, thanks! Also, does IAV work for mobile apps or is it currently limited to desktop applications? And is there a way to do instant verification without going through the standard IAV flow (e.g., entirely through a back-end server)?

(Stephen Ausman) #6

IAV should work for mobile apps inside of a WebView. At the moment there is no way to do it entirely through a backend server.

(Roberto Tijerino) #7

I’m having the same issue. I’m trying to load the IAV script into a jQuery UI dialog.

open: function() {
dwolla.iav.start(‘iavContainer’, iavToken, function(err, res) {
alert(‘dwolla.iav.start’) ;
alert(JSON.stringify(err)) ;

Here is what I get:

{“code”:“UnexpectedPage”,“message”:“IAV navigated to an unexpected page and was cancelled.”}

(PJ Caraher) #8

I too am getting the same error.

Note the following:

  1. When I open the IAV HTML file on my desktop’s browser, the IAV process runs fine.
  2. When I open the IAV HTML via a UIWebView within my app it:
    a) WORKS when running in the Simulator
    b) FAILS with the UnexpectedPage code when running on device

Has anyone been able to get the IAV script running in an app’s UIWebView while running on device?

(Stephen Ausman) #9

@roberto_tijerino @PJ_Caraher Are any errors being logged to your console?

(PJ Caraher) #10

Unfortunately, I am seeing no errors in my console.

Also, my simulator is now consistently failing with the same error, as well. Previously, I would only see this error intermittently on the simulator.

(Roberto Tijerino) #12

By the way this worked for me for a few times but it stopped working for some reason. I do see the bank list flashing but it then throws the error as follows:

I get no errors on the console other than the ones I’m logging.

if (typeof err != “undefined”) {
console.log(“Dwolla error:”);
if (typeof res != “undefined”) {
console.log(“Dwolla result:”);
Dwolla error:
Object { code=“UnexpectedPage”, message=“IAV navigated to an unex…page and was cancelled.”}

(Roberto Tijerino) #13


I have removed all the Javascript “alerts” and instead using console.log for debugging. Now the bank selection shows and the flow works.

Every time it moves to the next step it still throws the error and at the end I dont get a result just the error.

CORRECTION: I do get a result back. The problem is how do I know when the errors are valid or not. I guess once I get a result back will do the trick but not ideal.

(Stephen Ausman) #14

@roberto_tijerino @PJ_Caraher Thanks for the info, that helps a lot! I think I may know what’s going on. I’m working on reproducing the issue locally to make sure. If it is what I think it is I will push a fix later today and it shouldn’t require any code changes on your behalf. I will post here with updates.

(Stephen Ausman) #15

@roberto_tijerino @PJ_Caraher

Let me know if that works when you get a chance.

(Roberto Tijerino) #16

Now is working as expected.

Thank you!!!


(Stephen Ausman) #17

Awesome! We released the fix in production so you can switch back to Thanks for helping us get that fixed!

(PJ Caraher) #18

@stephen Thanks!

(Youdar) #19

Hi, I’ve encountered this problem, again.

The code I wrote is fairly common as I was just copied them from Dwolla official document, any help would be appreciate :slight_smile:

The code:

(function () {
        var iavToken = 'YQQcYLQg2PDf6b4AXdhXxhZVfdaXi4iZvGkbYboHsEXhpCsEBd';
        dwolla.iav.start(iavToken, {
            container              : 'iavContainer',
            stylesheets            : [],
            fallbackToMicrodeposits: true
        }, function (err, res) {
            if (err) return window.alert(['ERROR!', err.message]);
            if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
                // iOS callback to app
                window.location.href = "iOSGiivv://?data=success";
            } else if (/(Android)/i.test(navigator.userAgent)) {
                // Android callback to app
            } else {
                window.location.href = "iOSGiivv://?data=success";

            console.log('Error: ' + JSON.stringify(err) + ' -- Response: ' + JSON.stringify(res));

(Stephen Ausman) #20

Hey youdar,

Do you get an “UnexpectedPage” error every time or only sometimes?

(PJ Caraher) #21

I am seeing this error again.

The exact same html code that works within a WebView on my iOS app fails when running from a web browser.

I am seeing the “IAV navigated to an unexpected page and was cancelled” error in my Console.

Any thoughts?