Skip to content

Commit c5ceba1

Browse files
smelzerdanielsogl
authored andcommitted
feat(photo-viewer): add new params (#2895)
* 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.
1 parent e1a4903 commit c5ceba1

File tree

1 file changed

+23
-0
lines changed
  • src/@ionic-native/plugins/photo-viewer

1 file changed

+23
-0
lines changed

src/@ionic-native/plugins/photo-viewer/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ export interface PhotoViewerOptions {
66
* Set to false to disable the share button (Android only). Default: true
77
*/
88
share?: boolean;
9+
/**
10+
* Add HTTP headers to the request. Useful for authenticated pages.
11+
* The value is a string in a JSON format. Default: ''
12+
*/
13+
headers?: string;
14+
/**
15+
* Option for close button visibility when share false [ONLY FOR iOS]
16+
*/
17+
closeButton?: boolean;
18+
/**
19+
* If you need to copy image to reference before show then set it true [ONLY FOR iOS]
20+
*/
21+
copyToReference?: boolean;
22+
/**
23+
* Enable or Disable Picasso Options ( Only Android ): fit, centerInside, centerCrop.
24+
*/
25+
piccasoOptions?: {
26+
fit?: boolean;
27+
centerInside?: boolean;
28+
centerCrop?: boolean;
29+
};
930
}
1031

1132
/**
@@ -22,6 +43,8 @@ export interface PhotoViewerOptions {
2243
* this.photoViewer.show('https://mysite.com/path/to/image.jpg');
2344
*
2445
* this.photoViewer.show('https://mysite.com/path/to/image.jpg', 'My image title', {share: false});
46+
*
47+
* this.photoViewer.show('https://mysecuresite.com/path/to/image.jpg', 'My image title', {share: false, headers: '{username:foo,password:bar}'});
2548
* ```
2649
*/
2750
@Plugin({

0 commit comments

Comments
 (0)