Skip to content

IOS : Selected image is empty #197

@kefahB

Description

@kefahB

Which platform(s) does your issue occur on?

  • iOS
  • emulator or device. What type of device?
    Tested on :
  • IOS 10.2 on iPhone 6
  • IOS 11.4 on iPhine 8 Plus

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

  • CLI: (run tns --version to fetch it)
    4.1.1
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)

"tns-core-modules": "^4.1.0",

  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)

"tns-android": {
"version": "4.1.3"
},
"tns-ios": {
"version": "4.1.1"
}

  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.7.1",
"typescript": "~2.6.2"
}

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

Describe the steps to reproduce it.

I use your code with onSelectSingleTap method :

private startSelection(context) {
        context
            .authorize()
            .then(() => {
                this.imageAssets = [];
                this.imageSrc = null;
                return context.present();
            })
            .then((selection) => {
                console.log("Selection done: " + JSON.stringify(selection));
                this.imageSrc = this.isSingleMode && selection.length > 0 ? selection[0] : null;

                // set the images to be loaded from the assets with optimal sizes (optimize memory usage)
                selection.forEach(element => {
                    element.options.width = this.isSingleMode ? this.previewSize : this.thumbSize;
                    element.options.height = this.isSingleMode ? this.previewSize : this.thumbSize;
                });

                this.imageAssets = selection;
            }).catch(function (e) {
                console.log(e);
            });
    }

Is there any code involved?

  • provide a code example to recreate the problem
  • (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.

On IOS i get this after select image :

[{"_observers":{},"_options":{"keepAspectRatio":true},"_ios":{}}]

It work fine on android

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions