-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-16514] Prompt the user before making a call from a webview link #5409
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,6 +339,16 @@ properties: | |
default: false | ||
platforms: [iphone, ipad] | ||
|
||
- name: handlePlatformUrl | ||
summary: Lets the platform handle the url in a link from the webview | ||
description: | | ||
Set to `true` to let the platform handle the url automatically. This is necessary, for example, if the url | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update description to what the property actually does. |
||
links to a telephone number and you wish to promt the user before making a call. | ||
type: Boolean | ||
platforms: [iphone, ipad] | ||
since: "3.3.0" | ||
default: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undefined. Behaves as if false. |
||
|
||
- name: hideLoadIndicator | ||
summary: Hides activity indicator when loading remote URL. | ||
type: Boolean | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -683,6 +683,9 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *) | |
return YES; | ||
} | ||
|
||
if([TiUtils boolValue: [[self proxy] valueForUndefinedKey:@"handlePlatformUrl"] def:NO]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inefficient implementation. Remove this check and save the property in a local variable. Then the following if condition can become |
||
return YES; | ||
} | ||
UIApplication * uiApp = [UIApplication sharedApplication]; | ||
|
||
if ([uiApp canOpenURL:newUrl]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets the webView handle platform supported URL's