2

I've got a registration form on a website that requires users to upload photos of themselves. We're sending the link to this form on Facebook, and most of our users open it on mobile, via the inApp web browser of the Facebook App.

I tried to debug the problem with several devices and operating systems:

iOS 7&8: When clicking on the input field, the dialog to use camera or existing images shows up. Whatever I click, the InApp browser crashes, and I can't visit the link until the FB app is restarted.

Android 4.3: The InApp browser doesn't crash, but no dialog box comes up whatsoever. So when the user click on the file upload field, nothing happens.

I tried to insert a script which detects if the form is opened by the Facebook InApp browser and redirect to a _blank page (for it to open in the browser), but that doesn't work either, and I'm out of options.

It's not really an option to output a message to the user that he/she has to open the form in a browser.

Is there an easy way to fix this apart from these?

Edit: The problem doesn't occur in the FB Messenger app, only with the normal FB app.

PeterInvincible
  • 2,230
  • 5
  • 34
  • 62

2 Answers2

1

I'm facing the same question. Until now I figured it out how to overcome the issue on ios: You have to add the option multiple to your input file tag.

Example:

<input name="file" type="file" id="file" multiple>

Still don't know how to solve this in Android. I hope it helps!

Edit: I'm still not able to upload photos from the Android app, but I was able to capture the click event on the upload file button. So, what I did is a sloppy solution: The click event triggers an alert with a message asking the user to click on the top right button and select the option "open with..." and select a browser to proceed with the upload. It works, but is not pretty! I would hope to either be able to upload the photo directly from the browser window inside the app or to be able to open a browser window on the default browser.

Spacedoc
  • 11
  • 3
-1

Add this code in CDVInAppBrowserNavigationController for iOS:

-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
{
if ( self.presentedViewController)
{
    [super dismissViewControllerAnimated:flag completion:completion];
}
}

It would start working as required. You can find more info at iOS 8 SDK: modal UIWebView and camera/image picker

I am still looking for a solution for android. Hope it helps :)

Community
  • 1
  • 1
Vishwani
  • 623
  • 6
  • 8