No image or text appears when attemping to share to Twitter/Instagram using Xamarin.Essentials - xamarin.forms

I am using Xamarin.Essentials share feature but with lackluster success.
If i do a:
await Share.RequestAsync(new ShareTextRequest
{
Text = "Works",
Title = "Not working"
});
and open Twitter or Instagram or Whatsapp, i cannot see the Title, only the text getting filled.
If i do:
await Share.RequestAsync(new ShareFileRequest
{
Title = title,
File = new ShareFile(post.Image, "image/jpeg")
});
Then i cannot see either text or an image when attempting to share it to twitter or instagram. Is this a known bug or is it simply because these platforms doesn't support it?
"post.Image" has a valid .jpeg https url to it.

Related

Deep Link doesn't open the app instead does a google search

I have been using Expo to develop a react-native app, The functionality I am currently trying to implement is to share a link with friends on platforms such as fb messenger/whatapp or even normal texts and when they click this link it will launch my app to a specific page using the parameters.
After extensive research online - I’ve come to a blocker, following expo’s documentation I defined a scheme for my app - when I press share everything works correctly a message is created and I’m able to share content but only as string.
I am using react-natives Share library to share to an app and I’m using Expo to provide me with the link.
Ideally my first goal is to get the app opening using the Expo Link before I explore further into adding more functionality to the link.
Share.share({
message: "Click Here to View More! " + Linking.makeUrl( ' ' , { postkey : "7a5d6w2x9d6s3a28d8d});
url: Linking.makeUrl( ' ' , { pkey : gkey });
title: 'This post is amazing',
})
.then((result) =>{
console.log(result)
if(result === 'dismissedAction'){
return
}
})
.catch((error) => console.log(error))
In the root of my app I have also defined the event handlers: App.js
_handleRedirect=(event)=> {
let {path,queryParams} = Linking.parse(event);
Alert.alert(`queryparams : ${event} path : ${path} `)
this.props.navigation.navigate("Post_Detail",{key:queryParams.postkey})
}
}
componentDidMount() {
let scheme = 'nxet'
Linking.getInitialURL()
.then(url => {
console.log("App.js getInitialURL Triggered")
// this.handleOpenURL({ url });
})
.catch(error => console.error(error));
Linking.addEventListener('url', ({url}) => this._handleRedirect(url));;
}
componentWillUnmount() {
Linking.removeEventListener('url', this.handleOpenURL);
}
When I share the link to Whatsapp, Facebook Messenger or even just messages or notes it appears as myapplink://, I try to enter this into the browser and instead of asking me to open my app - it does a google search.
Please note I am attempting to have this working on Android Device and facing this issue
Is there something I am doing incorrectly?
Any help is much appreciated. Thanks.
You can not open external links, means other than http, https on Android. But you can on iOS. In order to be able to open your expo links, you need proper anchor tags on android. You can create html mails and give it a try, you will see it is gonna work on Android as well.

react native share dynamic link

1.Everything work fine before share, I shared to Facebook Messenger and click the social content, the redirect link is not the link that firebase generated. The link has become the dynamic domain mixed with the title and description.
2.I tried to copy only the generated firebase link and paste to Facebook Messenger, social content loaded, then by clicking the content it call the dynamic link correctly and launch the app.
const link = new firebase.links.DynamicLink('https://example.com/parameter' , 'abc123.app.goo.gl')
.android.setPackageName('com.example.android')
.ios.setBundleId('com.example.android')
.social.setTitle("Social Title")
.social.setImageUrl("http://exmaple.com/super.png")
.social.setDescriptionText("Description");
firebase.links().createShortDynamicLink(link, 'SHORT')
.then((url) => {
Share.share({
message: "Message Title",
url: url,
title: "Title"
}, {
// Android only:
dialogTitle: 'Super Share'
})
// ...
});
How to share with correct dynamic link not just copy and paste, consider the user behavior.

Using Accounts.emailTemplates.resetPassword.html correctly in Meteor

I have no problems using Accounts.emailTemplates.resetPassword.text but if I also use Accounts.emailTemplates.resetPassword.html I don't get an HTML email.
Are there any example of how to use Accounts.emailTemplates.resetPassword.html correctly?
It is very simple to use - just like you would use text. See the example below, it will send the return value as the e-mail body. Works for all three: resetPassword, verifyEmail, and enrollAccount.
Accounts.emailTemplates.verifyEmail.html = function (user, url) {
return "<h1>Thanks for signing up!</h1>"
+ " To <strong>activate</strong> your account, click the link below:\n\n"
+ url;
};
Still, both variants are sent as e-mail: text and html. If your e-mail client defaults to display emails as text, then you will not see the HTML flavor of the message, so make sure both text and html contain the same information.

Adding Firebase VAR to website

I setup and account at http://feedthefire.in and on Firebase dot com - to manage feeds I would liek to display on my site. I set everything up and the feeds get pulled into Firebase just like it should, now its time to add it to a web page...nothing, can't get the feeds to pull in from Firebase. I added the firebase.js reference in the header and in the body I placed
<script type="text/javascript">
var ref = new Firebase"'https://aodf.firebaseio.com");
ref.child("meta").once("value", function(snapshot) {
$("#e-title").html(snapshot.val().description);
});
ref.child("articles").limit(3).on("child_added", function(snapshot) {
var article = snapshot.val();
var link = $("<a>", {
"href": article.link,
"target": "_blank"
});
$("#e-list").append($("<li>").append(link.html(article.title)));
});
when you go to http://sandbox.studiorooster.com/ao I should see a list of feeds, but I don't, so I know I am supposed to place something else in the code; I think :)
There are a number of problems in what you posted above, each of which is explained below:
Syntax error on line #2: var ref = new Firebase("https://aodf.firebaseio.com");
You're loading a description on lines #3-5, but never rendering it, because there is no element with id e-title in the page you linked to. Trying adding <h2 id="e-title"></h2> to your template.
Similarly, you are loading a number of articles on lines #6-13, and trying to append each of these items to a list with id e-list, which also does not exist in your template. Try adding <ul id="e-list"></ul> to your template.
Hope that helps!

How to ignore "Content-Disposition: attachment" in Firefox

How can I cause Firefox to ignore the Content-Disposition: attachment header?
I find it absolutely annoying that I can't view an image in the browser, because it asks me to download it.
I don't want to download the file, I just want to view it in the browser. If the browser doesn't have a plugin to handle it, then it should ask to download.
E.g. I have Adobe Acrobat Reader installed as a plugin for Firefox. I click a link to a PDF, and it asks me to save it, when it should open in the browser using the plugin. This is the behaviour if the server does not send the Content-Disposition: attachment header in the response.
Firefox 3.6.6
Windows XP SP3
Legacy InlineDisposition 1.0.2.4 by Kai Liu can fix this problem.
In the Classic Add-ons Archive at:
caa:addon/inlinedisposition
The "Open in browser" extension is useful for formats supported natively by the browser, not sure about PDF.
Legacy version 1.18 (for users of browsers such as Waterfox Classic) is in the Classic Add-ons Archive at:
caa:addon/open-in-browser
I also found this tonight that totally prevents Firefox from littering your desktop with downloads. It's actually a redirect fix to the hidden /private/temp folder in MAC. Genius.
You can mimic the Windows behaviour simply by changing [Firefox's]
download directory to /tmp.
To do this, open Firefox's General preferences pane, under Save
Downloaded Files To select [choose].... In the dialog that appears,
hit Shift-Command-G to bring up the Go to Folder dialog.
In this dialog, simply type /tmp, hit OK, then hit Select in the
main window.
Well, that's the purpose of disposition type "attachment".
The default behavior (when the header is absent) should be to display in-line.
Maybe there's a configuration problem in your browser, or the Reader plugin?
For PDFs there is an addon called PDF-Download which overrides any attempt to download a PDF and lets the user decide how they want it downloaded (inline, save, external, etc). You could probably modify it to work for other filetypes too.
You could write a firefox extension that removes the disposition header for PDF files. This would be a fairly simple extension.
Since I was looking for a solution and no available add-on was actually working with my Firefox 31.0 (Ubuntu) I decided to try creating my own add-on.
The code if you want to archive a similar goal or just want to know how it works.
console.log("starting addon to disable content-disposition...");
//getting necessary objects
var {Cc, Ci} = require("chrome");
//creating the observer object which alters the Content-Disposition header to inline
var httpResponseObserver = {
//gets fired whenever a response is getting processed
observe: function(subject, topic, data) {
if (topic == "http-on-examine-response") {
var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
httpChannel.setResponseHeader("Content-Disposition", "inline", false);
}
},
//needed for this.observerServer.addObserver --> without addObserver will fail
get observerService() {
return Cc["#mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
},
//used to register with an observer
register: function() {
console.log("register with an observer to get response-events");
this.observerService.addObserver(this, "http-on-examine-response", false);
},
//used to unregister from the observer
unregister: function() {
console.log("unregister from observer");
this.observerService.removeObserver(this, "http-on-examine-response");
}
};
//gets called at enable or install of the add-on
exports.main = function(options, callbacks) {
console.log("content-dispostion main method got invoked");
//call register to make httpResponseObserver.observe get fired whenever a response gets processed
httpResponseObserver.register();
};
//gets called on disable or uninstall
exports.onUnload = function(reason) {
console.log("content-dispostion unloaded");
//unregister from observer
httpResponseObserver.unregister();
};
/*
//not needed!!! just test code for altering http-request header
var httpRequestObserver =
{
observe: function(subject, topic, data)
{
console.log("in observe...");
console.log("topic is: " + topic);
if (topic == "http-on-modify-request") {
var httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
httpChannel.setRequestHeader("X-Hello", "World", false);
}
},
get observerService() {
return Cc["#mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
},
register: function()
{
this.observerService.addObserver(this, "http-on-modify-request", false);
},
unregister: function()
{
this.observerService.removeObserver(this, "http-on-modify-request");
}
};
httpRequestObserver.register();
*/
As an alternative you can get my xpi-File to directly install the add-on in Firefox. If you want to disable the "Content-Disposition" altering just deactivate the add-on ;-).
http://www.file-upload.net/download-9374691/content-disposition_remover.xpi.html

Resources