Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot embed Picker oneDrive in react.js, using v7.2 #1804

Open
2 of 3 tasks
sarobidygmail12 opened this issue Jun 24, 2024 · 0 comments
Open
2 of 3 tasks

Cannot embed Picker oneDrive in react.js, using v7.2 #1804

sarobidygmail12 opened this issue Jun 24, 2024 · 0 comments

Comments

@sarobidygmail12
Copy link

Category

  • Question
  • Documentation issue
  • Bug

Hi i try to embed picker one drive :

My config :

React
https://js.live.net/v7.2/OneDrive.js

i init it with this code :

var launchOneDrivePicker = function (oneDriveApplicationId: string) {
    return new Promise(function (resolve, reject) {
      var odOptions: any = {
        clientId: oneDriveApplicationId,
        multiSelect: true,
        action: 'download',
        openInNewWindow: true,
        advanced: {
          redirectUri: 'http://localhost:3000',
          scopes: 'Files.ReadWrite.All',
          queryParameters:
            'select=id,name,size,file,folder,photo,@microsoft.graph.downloadUrl',
          filter:
            'folder,.png,.jpeg,.jpg' /* display folder and files with extension '.png' only */,
          accessToken:
            ' TOKEN_HERE',
          endpointHint: 'https://contoso.sharepoint.com/shared%20documents/',
        },
        success: function (files: any) {
          console.log('success');
        },
        cancel: function () {
          console.log('cancel');
        },
        error: function () {
          console.log('error');
        },
      };
      window.OneDrive.open(odOptions);
    });
  };

But when call the function launchOneDrivePicker with a button no thing happen no error no newWindow
so i use good Token that i echeive use microsoft auth

I followed the documentation how to do it, but it still doesn't work :
https://learn.microsoft.com/en-us/onedrive/developer/controls/file-pickers/?view=odsp-graph-online

Somme can give me a help

@sarobidygmail12 sarobidygmail12 changed the title Cannot embed Piker oneDrive in react.js, using v7.2 Cannot embed Picker oneDrive in react.js, using v7.2 Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant