how to use uncompleted url in plugin InAppWebView for browsing in flutter - flutter

if I input link: youtube.com, URLRequest(url: Uri.parse(url)) will not response this url, so I have to input https://www.youtube.com/, but normal user will not input so complicated url link, so is that a way to let InAppWebView confirm this uncompleted url?

A work around:
In the Input field use a prefix text as "https://" and get the URL from the user. In this way the user would know to not type the HTTP part again. ( like the dollar symbol in the below image)
Edit this line to: URLRequest("https://"+url: Uri.parse("https://"+url))
How to add prefix text to input field? ANSWER

Related

How to receive/fetch url parameter (get request) in flutter web?

I am using a script by exporting it with flutter for the web.
There I need to put something over an URL slug into a field via a get request.
Example:
www.url.de/?id=123
here I need to put "123" into the field.
How can I read this 123 out of the URL with Flutter Web?
Try Uri.base.queryParameters it returns a Map, so you can do Uri.base.queryParameters['id'] and it will return the value

URL rename using re-write.properties in JBOSS

I am new in JBOSS. I would like to change my URL name using JBOSS's rewrite.properties to show just on screen URL.I would like to know, Is there any condition or regular expression or flags that can change the URL name instead of invoking or substituation to the URL.
For example, if the actual URL is "www.myexample.com/test" then it should be "www.myexample.com/yourtest" while the operation is same expect the URL name differences.
Thanks.

Yii - formatting GET url created by form submisson

Can i change the URL format generated by a Yii form submisson?
eg. my url using the get method will look like:
domain/search/new?Search[field_1]=1&Search[field_2]=2&Search[field_3]=3
can i make it look like:
domain/search/new/1/2/3 or
domain/search/new/field_1:1/field_2:2/field_3:3 or
domain/search/new/field_1/1/field_2/2/field_3/3
Not if you let the browser submit the form normally.
On the other hand, if you use jQuery to prevent the form submission and make a custom AJAX request (or even point the browser to another URL) instead then you can do anything you like.

Is it possible to pass parameters to the callback URL of a FB app which is accessed through a tab?

I have this facebook application which adds a custom tab to fan pages. You access the tab by an URL like:
http://www.facebook.com/pages/PAGE-NAME-HERE/PAGE-ID?v=APP-ID
I want to be able to add some extra get parameters to that URL, but it seems they don't get passed correctly because facebook is filtering them. Is there a way to pass those parameters? Even not via GET but some other kind of technique.
If you want to pass multiple querystring params though the app_data param, you can urlencode it.
All querystring params that need to propagate through a Facebook tab should be url-encoded in the app_data var.
In other words, the "&" and the "=" need to be url-encoded (especially if passing more than one param).
Examples
GOOD TAB URL (this passes all 3 params):
https://www.facebook.com/pages/yourpagename/56789?sk=app_12345&app_data=var1%3D123456789%26anothervar%3Drawr%26athird%3Dmeow
In the app_data from this signed request, I got this value: var1=123456789&anothervar=rawr&athird=meow
BAD TAB URL (this passes only the first param through the signed_request):
https://www.facebook.com/pages/yourpagename/12345?sk=app_56789&app_data=var1=123456789&anothervar=rawr&athird=meow
In the app_data from this signed request, I ONLY got this value: var1=123456789 (Facebook dropped the rest)
You can even give your media team instructions like this =)
Media team,
Here is an online utility to urlencode the querysting data you want to
embed in the app_data param: http://meyerweb.com/eric/tools/dencoder/
Base Url: https://www.facebook.com/pages/yourpagename/12345?sk=app_56789&app_data=
Steps:
Go to http://meyerweb.com/eric/tools/dencoder/
Type var1=123456789&anothervar=rawr&athird=meow in the box
Hit the Encode button
You’ll get var1%3D123456789%26anothervar%3Drawr%26athird%3Dmeow which becomes your app_data param. Append that to the baseUrl noted above like this:
https://www.facebook.com/pages/yourpagename/12345?sk=app_56789&app_data=var1%3D123456789%26anothervar%3Drawr%26athird%3Dmeow (this is the URL with the tracking params for the [banner ad] [online media] [etc])
p.s. Querystring params in non-tab pages are handled fine (https://apps.facebook.com/yourappname/Canvas.aspx?var1=123456789&anothervar=rawr&athird=meow does not strip out qs params like what happens in the Tab, for example).
You must pass the app_data parameter in the URL:
http://facebook.com/pages/:page_id/:page_name?sk=app_:app_id&app_data=my_data
You will then access it through the signed_request param. For instance with Ruby and RestGraph:
user = RestGraph.new.parse_signed_request(params[:signed_request)
data = user['app_data'] # => "my_data"
Appending app_data worked for me.
http://www.facebook.com/pages/MyPage/11111111111111?sk=app_22222222229&app_data=foo_bar
Then retrieve signed request using PHP SDK (in my case). app_data is then available in the assoc. array returned.
I was wondering the same, in my case I had needed to pass a parameter "from" to identify if user was using mobile form or web form to login. My app use Spring Security. The way I was able to do that was creating my own SocialAuthenticationFilter:
1) Add a (hidden in my case) parameter to your login form ("from" in this example).
2) Get the right SocialAuthenticationFilter.java source (in accordance with your Spring version).
3) Create your MySocialAuthenticationFilter using it.
4) In method:
getRequestedProviderId(HttpServletRequest request) is where you can
grab your parameter:
private String getRequestedProviderId(HttpServletRequest request) {
String f = request.getParameter("from");
if(f!=null) {
final String dbValue = request.getParameter("from");
request.getSession().setAttribute("from", dbValue);
}
...
And thats all. In this way after a successful authentication you will be able to recover from session your parameter.
Be aware this method is called several times during OAuth exchanging, and when it is called from the authentication provider (Facebook for example) the parameter will be null. That is the reason to check the value before save in session in order to avoid delete your right value.
I answer myself by saying this is not possible.

on facebook connect login uri, can I add an extra get param on url, and have that passed to my script once user logs in?

to connect to an app on facebook, the user types in
www.facebook.com/login.php?api=12312312323123123
how can I add an extra get var to this url and pass it to my script on successful login?
Do you add a redirect_url as part of the login call?
If so you can add the GET parameter to that. For instance let us say you are asking Facebook to redirect to http://tld/fbhandler after user logs in. You can change that to http://tld/fbhandler?extra=value.
This URL is specified at the time of making the (OAuth) login call to Facebook and therefore you can change the value as you see fit.
You cannot do this. Facebook will strip custom query values from the url. I have found that there are two ways to do this. The first is that they will let you have a single query value at the end of the url if you encode the ? to %3F. For example:
redirect_url=http://www.example.com%3FmyextraParameter
You could use this approach to do something like base64url encode your values and add them at the end.
The other thing that I have done is to change the parameters to be path variables
redirect_url=http://www.example.com/realUrl/parameter1/parameter2
Neither are great solutions, but I have yet to find a way to send querystring values without them being stripped off.