diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 877d4ae1..c287ca1a 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -7,7 +7,7 @@ jobs: - uses: actions/checkout@v2 - uses: bahmutov/npm-install@v1 - id: publish - uses: JS-DevTools/npm-publish@v1 + uses: JS-DevTools/npm-publish@v2 with: token: ${{ secrets.npm_token }} diff --git a/CHANGELOD.md b/CHANGELOD.md index 4aae9cbe..9f1c6f8c 100644 --- a/CHANGELOD.md +++ b/CHANGELOD.md @@ -1,3 +1,7 @@ +## [2.0.4](https://github.com/spoonconsulting/cordova-plugin-telerik-imagepicker/compare/2.0.3...2.0.4) (2023-07-12) + +* **ios:** Use interfaceOrientation for ios 13+. + ## [2.0.3](https://github.com/spoonconsulting/cordova-plugin-telerik-imagepicker/compare/2.0.2...2.0.3) (2023-02-27) * **android:** Add READ_MEDIA_IMAGES permission for Android 13(Required in API 33). diff --git a/package-lock.json b/package-lock.json index c7647697..49a786f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@spoonconsulting/cordova-plugin-telerik-imagepicker", - "version": "2.0.3", + "version": "2.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@spoonconsulting/cordova-plugin-telerik-imagepicker", - "version": "2.0.3", + "version": "2.0.4", "license": "MIT", "engines": { "name": "cordova", diff --git a/package.json b/package.json index 01eaee04..26a0a33b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@spoonconsulting/cordova-plugin-telerik-imagepicker", - "version": "2.0.3", + "version": "2.0.4", "cordova_name": "ImagePicker", "description": "This plugin allows selection of multiple images from the camera roll / gallery in a phonegap app", "license": "MIT", diff --git a/plugin.xml b/plugin.xml index 851b633a..01185328 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="2.0.4"> ImagePicker diff --git a/src/ios/GMImagePicker/GMGridViewController.m b/src/ios/GMImagePicker/GMGridViewController.m index a2e30208..92a13ba9 100755 --- a/src/ios/GMImagePicker/GMGridViewController.m +++ b/src/ios/GMImagePicker/GMGridViewController.m @@ -95,7 +95,7 @@ -(id)initWithPicker:(GMImagePickerController *)picker } else { - if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) + if(UIInterfaceOrientationIsLandscape([self getOrientation])) { screenHeight = CGRectGetWidth(picker.view.bounds); screenWidth = CGRectGetHeight(picker.view.bounds); @@ -108,7 +108,7 @@ -(id)initWithPicker:(GMImagePickerController *)picker } - UICollectionViewFlowLayout *layout = [self collectionViewFlowLayoutForOrientation:[UIApplication sharedApplication].statusBarOrientation]; + UICollectionViewFlowLayout *layout = [self collectionViewFlowLayoutForOrientation:[self getOrientation]]; if (self = [super initWithCollectionViewLayout:layout]) { //Compute the thumbnail pixel size: @@ -794,5 +794,14 @@ - (NSArray *)assetsAtIndexPaths:(NSArray *)indexPaths return assets; } +- (UIInterfaceOrientation) getOrientation { + if (@available(iOS 13.0, *)) { + UIWindowScene *activeWindow = (UIWindowScene *)[[[UIApplication sharedApplication] windows] firstObject]; + return [activeWindow interfaceOrientation] ?: UIInterfaceOrientationPortrait; + } else { + return [[UIApplication sharedApplication] statusBarOrientation]; + } +} + @end