I am trying to open the selected file from google drive picker in incognito mode, but it is asking to sign in accounts. I want that file as a public file. Without logging in our account, we should access it.
My picker function in typescript,
createPicker(): void {
var uploadView = new window["google"].picker.DocsUploadView();
const view = new window["google"].picker.View(
window["google"].picker.ViewId.DOCS
);
const picker = new window["google"].picker.PickerBuilder()
.enableFeature(window["google"].picker.Feature.SIMPLE_UPLOAD_ENABLED)
.enableFeature(window["google"].picker.Feature.MULTISELECT_ENABLED)
.setDeveloperKey( this.googleDriveApiKey)
.setAppId(this.googleDriveProjectId)
.addView(view)
.addView(uploadView)
.setOAuthToken(this.accessToken)
.setCallback(this.pickerCallback.bind(this))
.build();
picker.setVisible(true);
}
In the picker callback function, after we picked the files, we can set permissions to it.
This code make all the selected files to be accessible without signing in.