Skip to content

Commit

Permalink
feat(photo-viewer): add new params (#2895)
Browse files Browse the repository at this point in the history
* Change for new 'headers' option

As of 1.1.19 of PhotoViewer, a new PhotoViewer option was added called 'headers' which allows for HTTP headers to be used when requesting the image.  This is useful for authenticated sites.

* Typo in example

* Added new PhotoViewerOptions

There are several other new PhotoViewerOptions besides 'headers' that need to be imported into the latest version.  I was selfishly only concerned about the one I needed, but the build really needs them all.
  • Loading branch information
smelzer authored and danielsogl committed Feb 14, 2019
1 parent e1a4903 commit c5ceba1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/@ionic-native/plugins/photo-viewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ export interface PhotoViewerOptions {
* Set to false to disable the share button (Android only). Default: true
*/
share?: boolean;
/**
* Add HTTP headers to the request. Useful for authenticated pages.
* The value is a string in a JSON format. Default: ''
*/
headers?: string;
/**
* Option for close button visibility when share false [ONLY FOR iOS]
*/
closeButton?: boolean;
/**
* If you need to copy image to reference before show then set it true [ONLY FOR iOS]
*/
copyToReference?: boolean;
/**
* Enable or Disable Picasso Options ( Only Android ): fit, centerInside, centerCrop.
*/
piccasoOptions?: {
fit?: boolean;
centerInside?: boolean;
centerCrop?: boolean;
};
}

/**
Expand All @@ -22,6 +43,8 @@ export interface PhotoViewerOptions {
* this.photoViewer.show('https://mysite.com/path/to/image.jpg');
*
* this.photoViewer.show('https://mysite.com/path/to/image.jpg', 'My image title', {share: false});
*
* this.photoViewer.show('https://mysecuresite.com/path/to/image.jpg', 'My image title', {share: false, headers: '{username:foo,password:bar}'});
* ```
*/
@Plugin({
Expand Down

0 comments on commit c5ceba1

Please sign in to comment.