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

Example usage is missing #6

Open
ansgarschulte opened this issue Jul 28, 2014 · 5 comments
Open

Example usage is missing #6

ansgarschulte opened this issue Jul 28, 2014 · 5 comments

Comments

@ansgarschulte
Copy link

Please provide a sample usage to view a simple pdf or similar file

@devgeeks
Copy link
Collaborator

Yeah, I know... this plugin is mostly in use in our SpiderOak mobile app... I really really need to clean it up and do proper documentation :(

@devgeeks devgeeks self-assigned this Jul 28, 2014
@ansgarschulte
Copy link
Author

so it is not possible to use it in my app with this state, right?

@devgeeks
Copy link
Collaborator

Well, it is... But the API is a bit odd as it started as a plugin just for android. It uses some odd android-isms that I'd like to clean out.

@franzwilding
Copy link

If anyone is looking for a (very simple) example:

$ionicLoading.hide();

  // if FileViewerPlugin is supported
  if(typeof(FileViewerPlugin) != 'undefined') {

    // Open file
    FileViewerPlugin.view(

      // file url (local)
      {url: url},

      // success cb
      function(){
        // do nothing in success

      // error cb
      }, function(){
        alert("There was an error, opening the file.");
      });

  } else {
    alert("FileViewerPlugin not supported");
  }

@rocifier
Copy link

rocifier commented Jan 1, 2016

What format does url need to be in? I tried opening /data/data/com.example.app/files/test.jpg and got the error callback triggering. I also tried adding file:// to the start of the url with the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants