Layar: Redirecting user to website of POI in clients NATIVE browser - layar

I want users to be able to click a POI and then be able to click a button 'goto website' which redirects to the website of that POI in the clients native browser.
I think this page describes what I need: http://layar.pbworks.com/w/page/35910641/User%20Interaction%20Dialog%20API#showdialog
However, whats not clear to me: how can I test the action?
- I dont see which request (what are the parameters etc) is passed to my server in order for me to return the showDialog object
- I dont see IF and HOW I should nest the showDialog object in my POI
- how can I test this functionality on a layar in test mode (not published yet)

You should be able to do what you want simply using the Response Hotspot Action Object:
http://layar.pbworks.com/w/page/28473525/GetPOIs-JSON%20Response#Actions
You can add as many actions as you like - including links to websites:
"actions": [
{"activityType": 4, "uri": "http://www.mywebsite.com", "label": "Go To Website"}
]

Related

How to trigger specific action after event on all opened tabs in Nuxt.js

Imagine that we have a web application in which a user can log in.
After authorization, the user has access to his list of projects. When the page with projects is loaded, the client sends a request to the server and receives this list. When a new project is added, a second request is made to the server, and the list of projects is updated.
At this stage, everything is clear.
Now imagine that the user has opened a list of projects in several tabs in the browser at once. After changing the list on one open tab, a certain "trigger" should be triggered, which will force the remaining open components to perform certain actions.
More specifically.
We have the same link opened three times in different tabs: "Tab 1", "Tab 2", "Tab 3".
The user has created a new project on "Tab 1" and I need "Tab 2" and "Tab 3" to request new data from the server and update the list.
Please tell me how best to implement this. I tried using Vuex and it worked while there was no pagination in the application. Pagination does not allow storing all objects in one list, because different pages can be opened on different open tabs. Any ideas would be helpful. It may still be worth using a Vuex, but in a different way, or the solution lies elsewhere.
what about socket.io ? have you read about it ?
i think you could achive your desire performance with it
In this case the solution could be: use POST request in nuxt proxy server or in your backend, like axios.post('/data', payload) and connect the websockets, you can use pusher for that. The final logic is: user add some data => post to server => server emits the websockets event => vuex listen to the event and the data will be reactive in all tabs.

Zabbix web scenario authentication

So i'm trying to set up zabbix web scenario to monitor webpage up/down. Ive found a way googeling which should work for me, however there is an issue in the login page. I need to be able to press TAB 4 times and then end it with a space to reach the login information panel. But i can not figure out how to tell zabbix to insert TABs or Spaces on the page before it attempts to login.
by default SMART-ID is our main authentication, and the order can not be changed as it would interfere with our user welfare policies. So i need to make zabbix able to navigate to the "Parool" tab for login. Also using the tab key on the page visualy does nothing untill you press the space bar, only after space bar it actually shows you where you have navigated.
So far i have tried to simply add tab and space in the "post fields" section however this does not do anything and i have not managed to google the information i require.
That's not how Zabbix Scenarios works.
Zabbix uses libCurl to check web endpoints, not a browser: you can't render javascript nor post/click to forms (ie: like Python Splinter does).
You can post data to specific web endpoints, like http://somewhere/test.php?id=2345&userid={BLABLABLA} then grab the output and/or the resulting http return code.
Please refer to the documentation for a complete overview.

Showing file selection UI : Integrating Dropbox with OAuth 2

I am trying to create a web page which will allow my user to upload a file to my S3 storage. For choosing the file user can use Google Drive, Dropbox and also local system. Am facing issues while implementing the Dropbox part of this.
Am using this technique for integration(using core API and OAuth 2).
First when user chooses Dropbox i am opening an HTML page in an IFrame. Here I have an authorize button which will open the authorize endpoint mentioned in the above link. This link shows me X-FRAME-Options error inside the Iframe so i had to open this link as a popup to work.
Is there a way around this? I'd like the authorize URL to open in the same iframe by using location.href.
Also when i open it as a popup, after the user logs in successfully the redirect_uri which i pass i getting opened in the popup. I had to do some unconventional setInterval coding to go around this. Can someone suggest a solution for this as well?
I also tried using CSRF tokens as mentioned in Smarx's blog but this also gives me the same error.
EDIT :
#smarx i tried using dropbox.js and it works fine. Stuck at one place
I used the OAuth popup driver and have a button which says sign-in.
First on load i create the client and then the popup driver as below
client = new Dropbox.Client({ key: client_id });
client.authDriver(new Dropbox.AuthDriver.Popup({
receiverUrl: "http://localhost/uploadCare/dbcallback.html"
});
);
And in the call back html i am writing
Dropbox.AuthDriver.Popup.oauthReceiver()
as mentioned in the docs.
But this does not take me back to the original page and show me the list of files.
I particularly did not understand this part of the explanation
"To use the popup driver, create a page on your site that contains the receiver code, change the code to reflect the location of dropbox.js on your site, and point the Dropbox.AuthDriver.Popup constructor to it."
Could you please help me out here.
You definitely can't put dropbox.com into an iframe, for security reasons (e.g. clickjacking).
A few suggestions:
Can you just use the Chooser for your use case? That would certainly be easier for you and your users.
If you can't use the Chooser, is there a reason you're not using dropbox.js? It has a popup auth driver that will pretty much just take care of all this for you. The redirect will definitely happen in the same window as auth, so communication between the windows (usually via localStorage) is generally necessary. This is already done in dropbox.js.

Handling the google interactive post onclick via javascript

My scenario is as follows:
Our application is building on top of google-plus and takes advantage of the google-plus connections.
Is this supported with Interactive posts? I want to:
Block showing the interactive post dialog on the button click if a certain condition is not met
Perform a certain action once the button to show the dialog is clicked - onClick works for this but I could not find documentation on it.
var options = {
contenturl: url,
clientid: googleappid,
cookiepolicy: "single_host_origin",
prefilltext: text,
calltoactionlabel: "START",
calltoactionurl: ctaurl,
recipients: connectionid,
onClick: specialFunctionToRunOnClick(params)
};
gapi.interactivepost.render('submitInvitationongoogle', options);
Is there something like beforeSend that can prevent the click from firing?
There currently is not an API for testing whether the user has created an interactive post on their stream. You can know when the interactive post was rendered to the user by logging the API calls for gapi.interactivepost.render and can use the call-to-action url for testing when the recipient clicked the button. You can also look at their public stream activity to test whether the post was shared publicly but this is probably not what you want.

How to use google OAuth2 in a Sencha Touch2 application?

I build Web application using Sencha Touch2.
At iPhone, the application can be used by full screen.
I already have build web application for pc browser, and use google calendar API connecting with OAuth2.
The authorization step need to open new window to login the user google account.
Maybe I can build Sencha Touch application use the same architecture of pc,
but opening new window make the full screen application closed.
Do you know how to use google OAuth2 in a Sencha Touch2 application?
-- Add 2013/2/6
My Sencha Touch2 application is web application.
I want to know that it is possible to grant permission in the full screen web application, not in the browser.
-- Add 2013/2/7
I use the tip.
http://miketheindian.com/2012/02/22/staying-in-full-screen-mode-on-the-iphone-from-page-to-page/
This way is not need to open browser.
It is better than opening new window, but the best is authorizing in iframe...
-- Add 2013/2/13
Finally, I take the way;
Google AOuth is three patter, for user.
1.User google Account is logout, user must write user ID and password.
2.User google Account is login and but the application is not allowed, user must click "allow" button.
3.User google Account is login, user do not need to do anything.
When the time of 3., we can authorize in iframe.
And, when the time of 1. or 2., we can not authorize in frame, so use location.href change approach ( detail in http://miketheindian.com/2012/02/22/staying-in-full-screen-mode-on-the-iphone-from-page-to-page/ ).
Details
make view has the container
{
xtype: 'container',
html: '<iframe src="" id="googleLogin" style="border:0;">'
},
change src in controller
var iframe = Ext.get(Ext.query('#googleLogin'));
iframe.set(
{
src: responseInformation.googleOAuthUrl
});
When the time of 3., user google account login , this is ok.
When the time of 1. or 2., we change location.href.
We want to handle iframe "onerror" event, but there is not that event.
I use settimer and check if the src of the iframe is not change first src (because of error redirecting to google login page).
3000 ms is not so meaning. When the time of 3., redirect is success and page has changed.
me.timerId = setInterval(function(){
if (iframe.el.dom.src.indexOf( /* first url */'') !== -1){
location.href = iframe.el.dom.src;
clearInterval(me.timerId);
}
}, 3000);
On Android, it's probably a good idea to use the local Contacts database on the device rather than working over the network. Yes, the user has to grant permission, but they would anyhow for network access. That way you don't need to spin out any extra browsers or anything.
There is another way to face the problem:
Use inAppBrowser plugin from Cordova or Sencha to launch the auth prompt, then, with a eventListener, wait for page load, and if url matches the success callback URL, then you can parse the url and get the auth/code or auth/token.
Example using Cordova:
window.authmodal = window.open(authorizationUrl, '_blank', 'location=yes');
window.authmodal.addEventListener('loadstart', function(event){
var code = getParam(event.url,"code");
if(code != null){
//here we got the code, now make a last request to get the TOKEN
OAuth2Helper.finish(function(token){
window.authmodal.close();
window.localStorage.setItem("token",token)
//do somethink else with your logic
},code)
}else{
//no code found in this page start.
}
});
NOTE: OAuth2Helper.finish, makes a request to the token url, using the code, in order to get a valid and usable token.