Actual Requirement
click on share button
generate a text/url/link
share this with other users via whatsapp/fb/twitter/email etc.
onclick of this link, my app opens with data passed in the link.
similar to youtube link like: https://youtu.be/g5MIJ3Us10k
What Is done till now...
I have a deeplink URL in String form.
It works perfectly when I access it as the hyperlink on a browser and my app opens correctly.
I need to create this URL string as hyperlink that can be shared among other apps from the app itself.
Using following code to generate share link
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "MyAPPLink");
shareIntent.putExtra(Intent.EXTRA_TEXT, url); //String deeplink url
return shareIntent;
I able to share text to other apps, but it's not a link rather plain text.
How can I make it a hyperlink, so that when user share it to the other app, other users can click on the link and open the app and pass the data in the link?
UPDATE
Following is the deeplink url format
url = intent://#Intent;scheme=;package=;S.browser_fallback_url=;end;
UPDATE 2
I have created a link to my website and appended my deeplink data
like http://example.com/deeplink?id=1234567
I have uploaded a HTML file without UI and using JS I am able fetch my ID in the script.
Now when script runs, my app is not launching but divert to fallback url.
If I put a button in HTML and onclick of that button I run the script, my application launches.
How can I launch my app from generated shared text???
I think I have resolved it. It is now working on my device with the chrome browser as default. Need to test with other combinations.
The issue was with JS. I put my redirect call inside setTimeout() and it worked.
Here is the logical flow
Create an intent filter with scheme, view action and browsable+default category in manifest
Create a share intent and setExtra text as http://example.com/deeplink?id=12345
Create an empty HTML file and using JS, fetch the query and extract "id"
Now using setTimeout(), call redirect deep link URL --> intent://#Intent;scheme=;package=;S.browser_fallback_url=;end;
In the Activity exposed to deeplink, get dataString from intent and extract ID passed by deeplink
I hope this helps others :)
Related
I have a custom HTML web resource as a subarea in my sitemap. The resource opens a specific Account view. It works for me when I hardcode the parameters, but I want to dynamically pass the App ID to the iFrame which I have saved in an Environment Variable. Otherwise, it would not work in the other environments as the App ID changes.
I am using the Xrm.WepApi.retrieveMultipleRecords function to extract the app id from the environmentvariablevalue table and it works inside a JS web resource (see below), but not in a stand-alone HTML web resource.
enter image description here
Does anyone have a simple HTML code example with JS that can solve the above issue?
My AngularJS project uses html5mode, I do these codes to open html5mode
In HTML:
...
<base href="/features-A/">
...
In JS:
app.config(['$locationProvider', function($locationProvider) {
$locationProvider.html5mode(true)
}])
NOTE: the /features-A/ is not an actual folder in my project, it is just a behavior defined in AWS CloudFront, Because we also have some URL /features-B point to other projects, We only need to know that: Whether it is accessed via "http://myhost.com" or "http://myhost.com/features-A/" is the entry file for my project: index.html
Here is what the browser does:
when going to my "Sign In" page, The URL in the address bar is
http://myhost.com/features-A/signin
When going to "Home" page, The URL in the address bar is
http://myhost.com/features-A/ome
As we see, AngularJS changed the URL via History API add /features-A/ inside to the URL
What I want
when people access "Sign In", The URL does not have /features-A/:
http://myhost.com/signin
When people access the "Home" page, The URL has /example:
http://myhost.com/features-A/home
This will make our website looks like the Sign In page is a system that is independent and outside /features-A/.
What I tried
I have tried some solutions however they haven't worked:
Set base href Dynamically In stateChangeSuccess event but URL still changed
Use HTML5 history API pushState and replaceState function, this way would cause page refresh indefinitely
So, Is there any solution to solve this problem?
how do not you create a new virtual host?
via php
php -S localhost:8080
type this Command in your folder's project
I have an project where I have to render the html form output to an new google docs(word and NOT THE SPREADSHEET !) The only thing what I can find on the internet is about spreadsheet.
The project.
I have an html with form.
I need to get all the data in a new file in google docs when i click on submit.
Can someone show me a way how to solve this.
Hint Links etc etc.
Try following this code:
function myFunction() {
// Create and open a document.
// Replace with your own document name
var doc = DocumentApp.create('Document Name');
var pages = doc.getBody();
pages.appendPageBreak();
pages.appendParagraph("A paragraph.");
pages.appendPageBreak();//push additional data to the next page
pages.appendParagraph("A paragraph 2.");
}
This code will let you create a document and write in the pages. Also read Document Service, this service allows scripts to create, access, and modify Google Docs files. There are alot of features you can use to make your document more presentable.
Now, you connect your form to apps script. Just follow the steps done in this tutorial. Publish your code as web app, then use the web app URL to pass the variable to your script and save the data to the document.
Hope this helps.
What I want
I want to be able to copy/paste the entire content of a chat to memory
so I can extract included YouTube urls from it.
What I know
As you may know, the group chat(s) run on a separate url and are loaded page by page. Normally you go to the previous page either by simply scrolling upwards, or by clicking on a show previous link (works differently on different devices I think).
Things I tried
Sadly I can't find the urls to either anymore, but ...
Add a script to Chrome console
The point was to add a script that went looking for the show previous link and clicked it.
Add a start=0 parameter to the url
This assumes you can find out the actual url, either manually or through something like Fiddler.
The idea was that you add something like ?start=0 to the url. This would cause the paging to start from the very first record and load all.
Both solutions didn't work.
Possibly this is because Facebook made these options obsolete. It's my impression that Facebook initially provided more dev options than it does now.
My question
What can I do to fully load chat content?
Not really sure what this has to do with C#, but i'll give a C# solution anyways. My solution would be to use something such as HTMLAgilityPack to get the InnerHTML from a page once it's loaded, although this will obviously require some type of authentication, so for this I suggest using something like a WebClient and sending along Auth credentials with whatever it is you're doing, OR just create a method to login, then use the same webclient to access chats via URL, use DownloadString() to get the contents of the page then using HTMLAgilityPack's methods to get the InnerHTML of whatever the chat box is called/indentified as.
Right now this is the nearest thing I can find:
https://www.facebook.com/help/community/question/?id=10200611181580779
There is a way to see your complete chat history on Facebook easily.
By this method you can also see Photos or videos you've shared on
Facebook. Your Wall posts etc. -- 'A copy of what you've shared on
Facebook' Follow these steps:
Go to 'Account Settings'
Click on 'Download a copy of your Facebook data' from bottom of General section
Then click 'Start My Archive' -- It may take a little while for gather your photos, wall posts, messages, and other information.
(Usually 20 to 60 minutes)
Once Archive generated Download it.
Extract and open 'index.html' from downloaded folder
Now you can see 'Messages' on bottom of the page, click it.
Done!
I got a response in my mail way faster than 20 minutes.
You will get a mail with a link to a zip file, containing your archive:
In the html folder you find: messages.htm
For that I can write a script that looks for YouTube URLs in that file.
What I'm aiming to do is write something akin to the File > Download as > * functionality currently in Google Spreadsheets, but I want it to be in a custom format.
Specifically, I want to turn a spreadsheet of financial transactions into an QIF or OFX file for importing into accounting software. In essence, pushing a button on the UI will download a QIF/OFX version of the currently open spreadsheet.
I have tried the following so far:
Publishing a service (via implementing doGet) that uses ContentService to create the custom file and return it as a download using TextOutput.downloadAsFile(). This works if I call the endpoint directly using my browser.
Tried redirecting the browser to the Service's URL via window.location, but that doesn't seem to be available in the context of the App Script.
Tried using UrlFetchApp.fetch to have the front-end (the spreadsheet) have the browser navigate to the URL for the service. This didn't work either (not really surprising).
So, is this the right approach here? How else can I attack this?
Looks like this is what you have to do.
Create a UiApp
Add a link to the download inside that app.
Show the UiInstance on the spreadsheet
It's a little bit bulky, but it seems the be the cleanest solution.
function downloadAsWhatever() {
var app = UiApp.createApplication();
app.add(app.createAnchor("Download the file now!", "https://script.google.com/macros/s/[...]/exec"))
SpreadsheetApp.getActiveSpreadsheet().show(app.setWidth(300).setHeight(150));
}
You can set the size of the app to whatever you'd like. I chose to set it smaller so it takes up less space on the Spreadsheet screen.
For now the best way to direct a user to a new page is to create an anchor widget and have them click it. We understand that this is not an ideal user experience, but it should suffice for must use cases.
Source