iOS WKWebView File upload failure on iPhone - ios

In our app we use WKWebView to display web contents, but the file upload works incorrectly.
On iPhone we could browse from photo library (or take picture) but after the file has been selected, a thumbnail image shows up on the right side of the file input and after that the webpage quickly (or as I see, the whole ViewController) reloads itself (and webpage with th default URL). No image uploaded to server.
BUT!!
On iPad with the same OS version we could successful upload photo or captured image.
Any idea?
Thanks!

My bad! In the viewWillAppear function I load an url. So every time when the app come back from background, or another app gives back the control, this lifecycle event will be called, therefor in my case the webview always reload the default url.

Related

Itunes Connect App Preview Disappearing

My app preview keeps disappearing after i tap save, or leave and come back again after a while. The app preview uploads without issues using safari, than it displays that it is processing after choosing the poster frame, i tap save sometimes its gone other times i have to check back later and than it is gone.
I thought this was just an issue with iTunes connect but my app got approved and still not video.
I've tried uploading
Prores format and H.264, though i doubt this is the issue as it would display 'unable to load file'.
I am uploading it for the 5.5 inch and using that for the other devices.
Has anybody else ran into this issue? I searched around and got nothing.
Update:
This stopped happening after a while, must have been a bug.
Make sure you're using Safari. Wait for the entire preview to finish processing. Click Save. Edit Poster Frame. Click Save.
I've had the same issue and saving before it finishes processing, or trying to set the Poster Frame before it finishes processing will cause issues.
Also, make sure you're inline with the App Preview Properties.

Performing a task through a website and going back to an iOS app

I'm developing an iOS 7+ app that I need to offer the option of navigating to a certain web page to let the users to fill in a form there, and after that to come back to the app's view where the user was.
Is it possible to programmatically open Safari with a given url? If it is, I suppose that then there is no way to automatically redirect the user to your app from there... right? Is then a UIWebView the only option? Is it possible to navigate back or dismiss the view with the UIWebView without the need of user interaction?
Thanks
You can open links in Safari as detailed in this post How to launch safari and open URL from iOS app
I don't believe you can set a 'callback' and have it return to your app on completion, as you have no control over the user once they have exited your app's sandbox.
Opening the link in UIWebView would provide control, as you can utilize the UIWebView callbacks.

UIImagePickerController to take multiple pictures and save them in Document directory ony by one

I need my app to provide users to click multiple pictures. I want a layout with two separate buttons, one for clicking picture and another for saving the picture taken in the document's directory of filesystem. This screen will be presented and UIImagePickerController will be opened.
When user clicks first button, we will disable this button and show the picture obtained in an overlay. And show another button(this will be enabled now) to save this picture.
When user clicks another button, we will disable this button and save it in filesystem. After saving successfully, we will again enable the first button to take more pictures.
I have tried and implemented this app and it works perfectly at our end. But our some users report of app crashing when UIImagePickerOriginalImage key returned is nil.
This doesn't even happen to them frequently. Instead they face this crash after a long usage of app. However, we have tried of taking more 200 pictures and saving too. It didn't lead to any crash.
Please anyone suggest what might be the cause for this crash. Or any other better workaround to implement this functionality.

How to upload images in the background in ios using Afnetworking

I want to upload images from an iOS app to a php server. I am currently using POST Multi-Part Request in AFNetworkingOperationManager.
What I want to do is that when a user taps to upload image, Its starts uploading in the background and then a user can migrate away to a different controller. And when the upload the finished, The image is added to the list of images in a different controller where they are displayed in a table view just like twitter.
Can I accomplish this using AFNetworking?
Yes ,you can get it, First ,I aways get a mutableArray instead of some paths of picture, then you can upload them in background.

iPhone/iPad wallpaper image monotouch

is there a way to setup an image as a device wallpaper? Originally I want to download an image, save it somewhere in a picture roll and set it up as a wallpaper programmatically.
google doesn't give me any answer on how could it be done.
Unfortunately this API is not exposed to developers. There is also no URL scheme exposed for developers to launch the Photos app.
You're only option is to display a prompt that tells the user to manually go to the Photos application to set their wallpaper, and indicate how they would set the wallpaper there.

Resources