The completion handler for UIactivityViewController is always returning true for whatsapp share.

I am using message, mail and whatsapp to share in UIactivityViewController. The completion handler is working fine for message and mail share but for whatsapp, the completion handler always returns true. Is this the problem with Whatsapp or iOS?


The code I am using is:


self.presentViewController(activityViewController, animated: true, completion:nil)

activityViewController.completionWithItemsHandler = {(activityType, completed:Bool, returnedItems:[AnyObject]?, error: NSError?) in

// Return if cancelled

if (!completed) {

return

}

//activity complete

//some code here

}

}

Replies

I have the same problem. E.g., If I put iPhone in airplane mode and go to share via WhatsApp, it takes me to the WhatsApp interface. When I tap 'Send', an error message sates 'Could not connect to WhatsApp service. Please try again later.' I tap 'OK' and cancel (still within WhatsApp) and it returns to my app --> more specifically works through completionWithItemsHandler and triggers 'completed'. I have had similar problems with other types (e.g. Tumblr, Gmail - if not previously logged in to those apps). Apple have told me it is not their problem but ask me to file bug reports. I've also had other problems with the activityViewController such as text in gmail being repeated in subject line or Facebook not allowing text to be shared with photos. Please post any solution/s you find

Did somebody find a solution to use? I am having the exact same problem now.