How to open web app link through gmail add-on?
please help anyone to write a code for in App script
Update
In the current state it's not possible to open a link when I click on my add -on or while opening add on, the homepageTrigger should return:
an array of Card objects that make up the homepage UI
You can open a new FR in Google's Issue Tracker and ask for this feature to be included. Use this template for doing so.
You can easily open a link using newOpenLink()
const openLinkDemo = CardService.newTextButton()
.setText("Click me!")
.setOpenLink(CardService.newOpenLink().setUrl("https://google.com"));
Remember to review the Allowlist URLs guide
Documentation
CardService
Related
I integrated the Skype web control for our website, chat feature is working very well.
But when I click on the the voice or video call.
It open a new tab where It try to load the url https://swc.cdn.skype.com/v/0.80.47/calling-popup.html
Which will give the error 404 (not found)
I have search the doc and other resourced available but no luck.
any help would be appreciated.
Note: If you know how to hide these icon without CSS. It will also help.
Thanks.
Resources:
Browser: Chrome (68.0.3440.106)
SKD url: https://swc.cdn.skype.com/sdk/v1/sdk.min.js
Doc: https://dev.skype.com/webcontrol
Issue: https://github.com/Microsoft/BotBuilder/issues/3882
The error you have there has nothing to do with Skype , it just a question of the path to the HTML that is supposed to trigger your link, check path, or if the file is there where the url points to.
This applies both to Android and iOS. My web page may be sometimes opened by an app (you go to the app, and click a link there which opens the page).
I want to know if the page was accessed through an app or if the user got to it, let's say, by typing the address on the browser.
If accessed through an app, I don't need to know which app it was.
The only thing I know of is document.referrer, but it seems to return "" when the page has been opened by the app. Unfortunately using "" as an indicator is not possible, as other ways of getting to the page may also show "" (for example typing the address). The history object does not seem to contain the info I'm looking for either.
I am using a Zendesk Help Center, so I only have access to the javascript of the page in order to detect this. I can't make changes on the server-side of my page.
Alternatively, I may be able to talk to the people in charge of the app so that they include something when the app opens the browser which would allow me to access that info on the browser, but I am not sure what that could be. Any ideas?
Thank you!
It seems to me like your best bet would be to have specific links for your site that will let you know that the link came from the app.
Like so: http://www.yoursite.com/?openedFromApp
You will use those links inside the app that will be directing users to your website.
That way, if you were using PHP as your server-side language you'd be able to check if the openedFromApp URL parameter was set like so:
<?php
if(isset($_GET['openedFromApp'])) {
echo "The website was opened by an app";
}
else { echo "The website was opened normally"; }
?>
If you want to check if the openedFromApp URL parameter is set using Javascript you'd have to create your own function for accessing URL parameters as Javascript does not have a built-in way of accessing them.
But this link could help you access the URL parameters with Javascript: https://stackoverflow.com/questions/...
We are changing our social account names/urls. I'll have to go through our websites, emails, etc... and manually change hundred+ number of links. I think our CMS might have the ability to do most of the work on the web, but let's assume it won't for fun.
Since social sites live outside of our domain (facebook, twitter, etc...). I was toying with the idea of replacing the old urls with the new url with jquery or Js. Such as:
$("a[href^='http://OldSocialLink1.com']")
.each(function()
{
this.href = this.href.replace(/^http:\/\/newSocialLink1\.com,
"http://OldSocialLink1.com");
});
Is there a better way to do this-besides changing all the links manually? Possible onclick - If you are on one of our pages and you come across an old social link to facebook and clicked it. Change oldFBLink to new link.
I know of a good search & replace utility available on GitHub here. All you need to do is save it and transfer it to the root directory of your site and navigate to it at 'yoursite.com/migrate.php'
Say if you wanted to change facebook links from 'facebook.com/oldurl' to 'facebook.com/newurl', simply input the new and old URL into the script page. I know this script has been very useful to me while migrating WordPress sites which requires old URLs to be replaced with new ones. Hopefully this script can help you as much as it helped me!
I have a JavaScript app which uses the Google Drive API. I read how to open a standard sharing dialog here: https://developers.google.com/drive/web/manage-sharing
<head>
...
<script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
<script type="text/javascript">
init = function() {
s = new gapi.drive.share.ShareClient('<MY_APP_ID>');
s.setItemIds(["<MY_FILE_ID>"]);
}
window.onload = function() {
gapi.load('drive-share', init);
}
</script>
</head>
<body>
<button onclick="s.showSettingsDialog()">Share</button>
</body>
Seems like I do everything right, when I click my share button, the dialog starts loading but it can't be loaded.
In the console I see:
Refused to display 'https://drive.google.com/share?...' in a frame
because it set 'X-Frame-Options' to 'SAMEORIGIN'.
I've googled this error and I've seen that there are some similar questions in SO and other sites, but they don't help. I guess Google doesn't allow itself to be in a frame in a not-google-site (cause of "SAMEORIGIN").
What can I do to open sharing dialog in my app?
The "Launching the Google Drive sharing dialog in your app" page here states:
The URL of the page that launches the dialog must have the same origin
as the Open URL registered for the app.
If you then look at the instructions to "Configure the Drive SDK" here, you can see that the "Open URL" section reads:
There are two important things to keep in mind for the Open URL:
Make sure you give a fully qualified domain name for Open URL -- localhost won't work.
The URL must belong to you. After the app registration is complete, you'll need to verify your ownership of this URL in order to create a
Chrome Web Store listing. For more information, see Site Verification.
Hence your page which is launching the dialog does not have the same origin as the Open URL registered for the app in you Google Drive SDK settings. So to fix your problem correct the Open URL so that it has the correct URL i.e. a URL with the same origin as the Open URL. Note that you can change the Google Drive SDK settings via https://console.developers.google.com/project.
As well as making sure the Open URL is set correctly. You'll also need to substitute your Drive SDK app ID for 'MY_APP_ID'. You can find the App ID by following these instructions:
Goto https://console.developers.google.com
Click your project
Click "APIs and auth" on the left
Click the "Drive SDK" settings cog icon
The "App ID" can then be found under the "Google Drive SDK" title e.g. App ID: 47XXXXXXXX3
The problem was solved thanks to this answer https://stackoverflow.com/a/20742994/1185123
dan-man says in his answer:
Client ID You can find this in the Google Cloud Console - see above.
Mine is a 12 digit number, so yours will probably be too.
Mine client id looks like
175564412906-ui22fsaghkvkkj09j2bprku55m8k3d0d.apps.googleusercontent.com
I've used this id in
s = new gapi.drive.share.ShareClient('<MY_APP_ID>');
After reading the answer, I tried to use only first 12 digits of my client id. I didn't expect it to work, I was just desperate. But the strange thing, it works perfectly!
If somebody can explain why it works and why nothing about this is said in the documentation — you are welcome to answer!
I'm trying to install facebook comments on my page, but it doesn't let me moderate. On a test page with only the comments plugin - no problem. the same code exactly on a live page - doesn't let me moderate.
the test page:
http://www.radicalislam.org/test3.html
the live page:
http://www.radicalislam.org/news/pakistan-hands-huge-prison-sentence-bin-laden-informant
tried to debug, it shows the right admin and app id.
it's a drupal site, if it's important
Looks like you are using partial URLs for the href. Use the full one.
Use the following instead.
<div class="fb-comments" href="http://www.radicalislam.org/news/pakistan-hands-huge-prison-sentence-bin-laden-informant" data-num-posts="5" data-width="580"></div>
Unfortunately my work Firewall wouldn't let me click through to the link.
Are you using the correct URL when you add the Facebook comments to the page? If you aren't you won't be able to moderate, you will likely need to dynamically add the URL to the generated code.
Have you tried scraping the page using the debug tool (as the admin)?
http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.radicalislam.org%2Ftest3.html
This will read the updated admin IDs and let the administrator see the moderation panel in the plugin and via https://developers.facebook.com/tools/comments