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

Location empty on iOS Vue #310

Closed
andrevvm opened this issue Oct 18, 2019 · 10 comments
Closed

Location empty on iOS Vue #310

andrevvm opened this issue Oct 18, 2019 · 10 comments

Comments

@andrevvm
Copy link

andrevvm commented Oct 18, 2019

Which platform(s) does your issue occur on?

  • iOS

Please, provide the following version numbers that your issue occurs with:

  • CLI: 6.1.2
  • Cross-platform modules: 6.1.2
  • Runtime(s): tns-ios: 6.0.1
  • Plugin(s): 7.1.0

Please, tell us how to recreate the issue in as much detail as possible.

Running the Demo Vue app, add a console log to the selection promise. The _ios object is returned empty.

Is there any code involved?

console.log(element._ios.location)

@ali4fun
Copy link

ali4fun commented Oct 20, 2019

i have same issue in nativesacript angular ios.
tns ios : 6.1.1
image picker 7.1.0
IOS :13.2

@bonkboykz
Copy link

Try this solution, it did helped me
#181 (comment)

@DimitarTodorov
Copy link
Contributor

Hi @andrevvm, @ali4fun
Can you confirm that the above mentioned solution works for you and we can proceed to close this issue?

@andrevvm
Copy link
Author

andrevvm commented Nov 1, 2019

Thanks @bonkboykz, @DimitarTachev

Still having issues. @bonkboykz were you having problems with geocode location, not filepath location as referred in the issue?

Either way, modifying the referenced code to work in Vue (removing PHAsset type):

const ios = selected.ios;

if (ios && ios.mediaType === PHAssetMediaType.Image) {
    filePath = await new Promise((resolve, reject) => {
    ios.requestContentEditingInputWithOptionsCompletionHandler(
      null,
      (input, info) => {
        resolve(input.fullSizeImageURL.toString().replace("file://", ""));
      }
    );
  });
}

I get the error:
Failed to load image data for asset <private> with format 9999

Any further advice is much appreciated.

@andrevvm
Copy link
Author

andrevvm commented Nov 1, 2019

I've further confirmed that the ios object is not empty, yet the location is. I've made sure the selected photos have geodata attached.

const ios = selected.ios;

console.log('mediaType', ios.mediaType);
console.log('mediaSubtypes', ios.mediaSubtypes);
console.log('sourceType', ios.sourceType);
console.log('pixelWidth', ios.pixelWidth);
console.log('pixelHeight', ios.pixelHeight);
console.log('creationDate', ios.creationDate);
console.log('location', ios.location);
console.log('duration', ios.duration);

Returns:

CONSOLE LOG file:///app/bundle.js:1030:24: 'mediaType' 1
CONSOLE LOG file:///app/bundle.js:1031:24: 'mediaSubtypes' 0
CONSOLE LOG file:///app/bundle.js:1032:24: 'sourceType' 1
CONSOLE LOG file:///app/bundle.js:1033:24: 'pixelWidth' 3264
CONSOLE LOG file:///app/bundle.js:1034:24: 'pixelHeight' 2448
CONSOLE LOG file:///app/bundle.js:1035:24: 'creationDate' Sat Oct 26 2019 19:45:29 GMT-0700 (MST)
CONSOLE LOG file:///app/bundle.js:1036:24: 'location' {}
CONSOLE LOG file:///app/bundle.js:1037:24: 'duration' 0

@bonkboykz
Copy link

@andrevvm, unfortunately, as you guessed right, I was not utilizing location property of ios object, only the filepath

Perhaps, we need to call for @DimitarTodorov

@andrevvm andrevvm changed the title Location (and _ios object) empty on iOS Vue Location empty on iOS Vue Dec 9, 2019
@andrevvm
Copy link
Author

andrevvm commented Dec 9, 2019

Any pointers on this @DimitarTodorov?

@lini
Copy link
Contributor

lini commented Dec 9, 2019

Could you try experimenting with photos from different sources? I think the problem you have is related to #90 - images from iCloud that are not stored physically on the device cannot be selected.

The plugin should work fine with local images, but the iCloud issue will require a fix to be merged in the upstream library that nativescript-imagepicker uses (https://github.com/questbeat/QBImagePicker).

@andrevvm
Copy link
Author

I've confirmed that the source images are not the issue by testing them with the core demo app in this repo. The ios.location object is returned with data.

The current Vue demo in the repo is not building, but I've tested with the same photos in both my own app, and the latest nativescript-vue cli template app. All tests with Vue return the ios.location as an empty object.

Perhaps this is an issue with vue-nativescript itself?

@andrevvm
Copy link
Author

Confirmed that this is indeed an issue with core NativeScript / Vue and not this plugin itself: NativeScript/NativeScript#8270

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

5 participants