Google Drive UI Integration Issue: "Open with ..." suggestion is missing for my app's files

Viewed 148

I recently launched a Marketplace app with a Google Drive UI Integration.

And I'm experiencing an issue where Google Drive fails to give users, who don't have my application installed in their Drive, a suggestion to "Open with ..." when previewing our third-party shortcut file.

A file's mimeType is used by Drive to make suggestions for applications compatible with the mimeType. Therefore it seems that Google Drive is unable to connect the mimeType that I am setting on my app's files to the mimeType in it's internal records.

The mimeType I set on my app's files is application/vnd.google-apps.drive-sdk (third party shortcut file) as instructed by docs [1]. Upon inspecting the html of the page, we see that Drive does in fact have the correct mimeType

<span class="a-q-Jc-wg" data-tooltip="application/vnd.google-apps.drive-sdk.6964198....." aria-label="application/vnd.google-apps.drive-sdk.6964198....." data-tooltip-align="b,c" data-tooltip-delay="500" data-tooltip-unhoverable="true">my app</span>

Those numbers (6964198.....) appended at the end make up my Google Cloud Project Id. Upon inspecting another marketplace app, Lucidchart, their mimeType is application/vnd.google-apps.drive-sdk.7081045131. If someone shares a Lucidchart shortcut with another person that does not have lucidchart installed, upon opening, they get the "Open with Lucidchart suggestion" Their app is working as expected, my isn't, and comparing the third-party shortcut file properties shows no difference.

Looking at one of our file's properties via "Get Details" in Drive shows that Google Drive is able to recognize the fileType as my app's file.

Once the user does install my application, they are able to see "Open with..." upon previewing the file. This gives the impression that mimeType is set correctly and available to drive, but GDrive is not properly using it before installation.

I have spent quite a lot of time trying to figure out what could be causing this issue, but I am stuck. I triple checked my configuration and everything seems to be set up correctly as directed by the docs [2].

I have 2 tickets opened to Google support on this matter, I even got on a call with them, but eventually they said that it seems like I'm doing everything correctly, but they can't help me any further and suggested to post a question on StackOverflow... So I'm asking for your help here.

My app's backend is written in Node.js and uses googleapis:51.0.0 module.

Here is a piece of my code that saves a file:

const gDrivePayload = {
    requestBody: {
        name: presentation.name,
        mimeType: "application/vnd.google-apps.drive-sdk",
        parents: [folderId],
        properties: { presentationId }
    }
};

if (thumbnailData) {
    gDrivePayload.requestBody.contentHints = { thumbnail: { image: thumbnailData } };
}

const drive = google.drive({ version: "v3", auth: gAuthClient });
const gDriveResp = await drive.files.create(gDrivePayload);

gAuthClient is an instance of google.auth.OAuth2 with provided user tokens that were obtained via an oauth2 flow that was performed by the user.

thumbnailData is a base64 encoded jpeg image.

[1] https://developers.google.com/drive/api/v3/third-party-shortcuts

[2] https://developers.google.com/drive/api/v3/enable-sdk?hl=sk

0 Answers
Related