-->

Trigger.io: : Unhandled intent result

2019-08-07 05:02发布

问题:

I am using Trigger.io to develop an application.

After using file.getImage and selecting an image from either the gallery or camera (on Android) I get this error message (Using trigger.io toolkit to run the app).

W Forge   : Unhandled intent result, should have been handled by Forge.

The app promptly crashes and restarts.

relevant code:

forge.file.getImage({}, function(file) {
    forge.request.ajax({
        type: 'POST',
        url: "http://example.com/upload/photo",
        files: [file],
        success: function(e) {
            console.log('success');
            console.log(JSON.stringify(e));
        },
        error: function(e) {
            console.log('failure');
            console.log(JSON.stringify(e));
        }
    });

What does this error mean?

回答1:

This problem is caused by the camera taking up memory on older Android devices causing it to unceremoniously shut down some apps to free up more memory.

We're working on providing more elegant handling of this situation or at least better debug output to tell you what's going on. The problem in this case was occurring on an Android 2.3 device, and could be worked around by shutting down some open apps / processes.

Update: we released a new foreground camera module to address this issue in our v1.4.41. platform version: http://current-docs.trigger.io/modules/camera.html#modules-camera



回答2:

I'm seeing this issue on older devices too. Apparently it's a common issue on both Phonegap and Native android apps also. More can be seen on this thread:

PhoneGap camera restarts the application

The following plugin was developed for Phonegap which resolves the issue. I would be great if something like this could be developed for Trigger.io

http://code.google.com/p/foreground-camera-plugin/