Trigger.io: : Unhandled intent result

痴心易碎 提交于 2019-12-11 05:52:34

问题


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/



来源:https://stackoverflow.com/questions/11618734/trigger-io-unhandled-intent-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!