First of all can I say a big thank you to juannn91 for this excellent tutorial showing how to make posts onto Twitter and Facebook using the Browser object. The guidance in the tutorial required some modification to be made to the Browser object's js and, frankly, I stopped following at that point. I have managed to post to Twitter on iOS and Android and to Facebook on Android using an standard Browser object, but iOS requires the URL to be encoded somehow.
hollowthreat pointed out in a comment that URLencode(str) could be used to encode the string instead. My problem is I don't know which part of the URL needs to be encoded. I've just spent a few hours trying to get this to work, by encoding all of the URL or just the last part after 'uri=', removing spaces and replacing etc and I've registered my app on Facebook and it works in Android... The best I have achieved using the URLencoder is a new Facebook window opening with the following error message:
The dialog has passed a bad parameter
API Error Code: 100
API Error Description: Invalid parameter
Error Message: redirect_uri URL is not properly formatted
But at least it was in a new facebook window! So, I'm close but I can't think of what to do to get this last step to work. Any advice would be very welcome!