Unable to load the URL in iOS WebView when the button is clicked for the first time - ios

The mobile app is all about showing a SharePoint website in a WebView. I am trying to get the URL of a third party website on click of a button which is a part of the WebView. Based on this URL, I am trying to show an alert. On the first click of the button, the URL I am looking for, is not loading and hence the alert is not showing up. However, I am able to see the URL for the second click of the button and I'm able to see the alert as well.
Any help would be appreciated.
Thanks in Advance.

Related

How to show popup ads on click in webview using sketchware

Can someone help me and tell me how to enable popup ads window on click in webview using sketchware
it's a bit tricky to make the WebView interact with the app in sketchware but...you can improvise to work around that...I'm pretty sure there's tons of ways to do it..try this(i can't send an image cause of rep):
add webview widget
Go to event of webview
Click "onPageStarted"
Put "If" block
in the if block You'll compare the url variable with the url when the button is clicked and if they're equal, then load your ad
and if you don't get it...let me know I'll share a project that can do the same thing

Switch between WebView and NativeView with Swift

Problem Statement:
I have an a native app which has a G+ single sign-on.
When I click that button, it displays an alert - "application wants to use google.com to sign-in" along with 2 buttons "Continue" and "Cancel"
When I press "Continue" on the alert, it opens a browser inside the app where the account selection page opens. It shows accounts.google.com as the page URL.
Assuming that I've already signed in to Google once before, I want to select / click a particular account from the list of google accounts being displayed there.
After I click the account, the user is navigated to a native screen called "Dashboard".
To automate this, in Appium + Java, I click on the G+ button and then switch the context to webview and then select the account using xpath and then switch back to native view as login is done now and application is back to the native screen.
driver.findElement(By.xpath("XPATH of Native Screen - Google SignIn Button")).click;
driver.switchTo().alert().accept();//Clicks "Continue" Button.
driver.context("WEBVIEW"); //Switch to WebView
driver.findElement(By.xpath("XPATH of intended Account Name HTML control")).click();
driver.context("NATIVEVIEW");
...Then, I perform the other operations that I want to perform on the native app screen.
I want to do the same in XCode + Swift but I'm not finding any way to do it.
Here's what I do
//some code to click on the button
app.buttons["Google Sign In"].tap()
app.alerts["“AppName” Wants to Use “google.com” to Sign In"].buttons["Continue"].tap()
...Now I don't know how to switch to WebView of the App and click on the HTML control that contains the account name and then switch back to native view.
Please help.
Try using this when you click on sign in with google:
GIDSignIn.sharedInstance().signOut()

Popop Box With URL Like Dribbble.com

Explanation:
I have a portfolio page with all of my graphic design I've made. I always liked the Dribbble way of showing "Shots".
Problem:
The problem is that I don't know how I can make the popup have an URL like on Dribbble. Dribbble opens the "Shots" in a popup box with an URL callback.
Question:
Can you guys point me in the right direction? What is this type of action called? I will appreciate all type of help!
Thanks in advance.
It's a combination of opening a popup with onclick and changing the url and opening the popup when the url has /shots in it onload. The popup content itself is loaded trough ajax.
If you want I can make an example. Do you want to load content that is already on the page in the popup or load external content?

disable external url links in UIWebView

I used some open resource to handle my external links in WebView, so right now every time I click the url a new view would show the page with "Done" "back" "forward" "open link in safari" something like that. But at the same time the earlier webview of my app is still loading and show the url website. How could I stop it? When the user click Done for the new page, definitely they want to go back to the earlier page.
here is the open resource class I used : https://github.com/samvermette/SVWebViewController
Thanks. wish I made myself clear. I'm new here, and also new to ios development.
Not entirely clear what you're asking but every time a link is clicked in a UIWebView, the UIWebView delegate shouldStartLoadWithRequest method gets called.
If you don't want the link to load you simply return NO from this method.
There are also properties in the UIWebView class to enable you to go back or go forward through the page history.
If that doesn't answer your question, can you try and rephrase it.

BlackBerry BrowserField displaying a webpage - detect when user navigates to other pages

I have a BrowserField in my application displaying a webpage.
Is there a way to detect browser navigation when user clicking on one link in the webpage and move to another webpage?
http://www.blackberry.com/developers/docs/4.6.0api/net/rim/device/api/browser/field/BrowserContentChangedEvent.html
Not sure if this will trigger it however if you look at the api you can see all your options.
Let me know if you find it.

Resources