App installation callback failures

Our app components based app uses the Asana documented method of rendering a button to close the popup window to signal installation success with the supplied js snippet:

window.opener.postMessage("success", "https://app.asana.com");
window.close();

We continue to have users for whom window opener is null, so they receive the error:
“Cannot read properties of null (reading ‘postMessage’)”

We have them try with different browsers and it doesn’t solve the issue for them. Is there a known workaround for this? In general, various browser extensions and settings seem to break this ‘signal success by closing a popup window’ mechanism, so if there’s an alternate mechanism we’d be happy to switch to it. Thx!

1 Like

Hi @pmatern,

Are you calling it within window.onload?

    window.onload = function () {
        window.opener.postMessage("success", "https://app.asana.com");
        window.close();
    };
1 Like

Hi @Phil_Seeman!
We’re actually using that snippet as the body of a function used as the click handler of a button:

Click here to finish the integration

Looks like the forum at my code snippet :slight_smile: but you get the idea

I don’t know why window.opener wouldn’t be available in a click handler, but I’d suggest you try it in the onload per my example - not to use as a solution, but just to confirm that it works there and then you can focus on why it’s null in the handler. If it doesn’t work in the onload then something else very odd is going on.

It turns out this issue is cropping up with folks using the Asana desktop app. Redirecting folks to add the app via the web circumvents the issue.

1 Like

Ahhh, OK, thanks @pmatern for posting that update - good to know for the future!

Hi Everyone,

Just wanted to give an update. We’ll be implementing a step in our app publishing process to allow apps to be installable on the desktop application.

2 Likes

Hi John, is there any updates on it?

Hi @igor_flash_test, we’ve implemented a step in our app publishing process to allow apps to be installable on desktop applications.

2 Likes

Hi @John_Vu Thank you for a quick reply! That’s a great news. Could you share a link please? I check all the docs, but probably missed it. Thank you in advance!!

Hi @igor_New, we don’t have any documentation on this since it’s an internal process change. You don’t have to do anything on your end to get it to work on desktop.

1 Like

Hi @John_Vu but what about auth flow? I’ve tested app in different browsers and it works fine, but desktop app is failed to authenticate - (it works fine if your authenticate in browser though)

@igor_flash_test what app are you trying to install? Perhaps the app you were trying to install was reviewed and approved prior to our process change.

Hi @John_Vu I’m a technical consultant in Asana partner company. We are about to release a small app requested by one of Asana enterprise customers. I did managed to test all the functionallity and auth flow for browsers, but can’t figure out how to make it work in desktop app. I’d really appriciate any suggestions and guideness.

Thank you!

Hi @igor_flash_test, thank you for the clarity, this makes more sense. We don’t offer a way for you to test desktop app installation as you are developing your application. After your app has been reviewed and approved we enable/add your app to an allow list to be installable on the desktop application. It seems your installation flow works on web so I would go ahead and submit for review once you are ready.

2 Likes