Open only Whatsapp and Messaging app using DataTransferManager showshareuri - windows-phone-8.1

I am using following code to open share UI. It opens all available share text sharing apps. Is there any way i can filter those share to Messaging and Whatsapp apps?
void dataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
DataRequest request = e.Request;
request.Data.Properties.Title = "the title";
request.Data.Properties.Description = "description";
request.Data.Properties.ApplicationName = "Messeging";
request.Data.SetText(shareText);
}

No, this is the expected behaviour and all the apps who can read text will be shown.

Related

GMail OAUTH not asking for permission when published

I've started using the GMail API and it's working fine on my local machine; it will open the Google permissions page and I can select my account. It then stores the return json token and only asks again if this token is removed.
When I publish to the server, the OAUTH page is never displayed and the application appears to timeout with a 'Thread was being aborted' exception.
My code;
try
{
using (var stream = new FileStream(HttpContext.Current.Server.MapPath("~/credentials/client_id.json"), FileMode.Open, FileAccess.Read))
{
string credPath = HttpContext.Current.Server.MapPath("~/credentials/gmail_readonly_token.json");
_credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
Scopes,
"user",
CancellationToken.None,
new FileDataStore(credPath, true)).Result;
db.writeLog("INFO", "Gmail Credentials Saved","Credential file saved to: " + credPath);
}
// Create Gmail API service.
service = new GmailService(new BaseClientService.Initializer()
{
HttpClientInitializer = _credential,
});
}
catch (Exception e)
{
db.writeLog("Error", "Failure when creating Gmail class", e.Message, null, _username, null);
}
Is there something I need to change within the 'client_id.json' (formally client_secret.json) file? The only thing I have altered is the redirect_uris line.
Any other suggestions would be welcome, the only other question I could find that is similar is here but there is no answer.
Thanks,
Danny.
The first one worked because you followed the intended use case, which is client-side. But, to implement authorization on the server, follow the Implementing Server-Side AUthorization guide.

How to send a link in mail in Windows Phone 8.1 using C# and XAML

i want to share a item of my OneDrive, so i am sending an Email with the link of that item , but what i want is that, the user should get a hyperlink but i am not able to generate a hyperlink.
The code which i am using is as follows :
private async void shareOneDrvItem(string SharefilePath)
{
var emailMessage = new Windows.ApplicationModel.Email.EmailMessage();
emailMessage.Body = SharefilePath ;
emailMessage.Subject = "Shared Link from OneDrive";
await ApplicationModel.Email.EmailManager.ShowComposeNewEmailAsync(emailMessage);
}
Please help me guys.

Windows Phone 8.0 Facebook/Twitter/Google + Sharing?

How to share image on facebook , twitter and google + using windows phone 8.0(silverlight) app development?
Try this code, it will definitely help you
using Microsoft.Phone.Tasks;
cameraCaptureTask.Show();
void cameraCaptureTask_Completed(object sender, PhotoResult e)
{
if(e.TaskResult == TaskResult.OK)
{
ShowShareMediaTask(e.OriginalFileName);
}
}
void ShowShareMediaTask(string path)
{
ShareMediaTask shareMediaTask = new ShareMediaTask();
shareMediaTask.FilePath = path;
shareMediaTask.Show();
}
Take the help of the following link for further reference: https://msdn.microsoft.com/en-us/library/windows/apps/jj207027%28v=vs.105%29.aspx
If you want to post direct on the social network, you can uses the deep link.
Facebook: https://somoswindev.wordpress.com/2015/06/09/postando-diretamente-no-facebook-usando-c-no-windows-phone/
Twitter: https://somoswindev.wordpress.com/2015/06/01/postanto-no-twitter-no-windows-phone-usando-c/

How can I pass data between two Chrome apps?

I have created two Chrome apps and I want to pass some data (string format) from one Chrome app to another Chrome app. Appreciate if someone can help me with showing the correct way of doing this?
It's an RTFM question.
From Messaging documentation (note that it mentions extensions, but it works for apps):
In addition to sending messages between different components in your extension, you can use the messaging API to communicate with other extensions. This lets you expose a public API that other extensions can take advantage of.
You need to send messages using chrome.runtime.sendMessage (using app ID) and receive them using chrome.runtime.onMessageExternal event. If required, long-lived connections can also be established.
// App 1
var app2id = "abcdefghijklmnoabcdefhijklmnoab2";
chrome.runtime.onMessageExternal.addListener(
// This should fire even if the app is not running, as long as it is
// included in the event page (background script)
function(request, sender, sendResponse) {
if(sender.id == app2id && request.data) {
// Use data passed
// Pass an answer with sendResponse() if needed
}
}
);
// App 2
var app1id = "abcdefghijklmnoabcdefhijklmnoab1";
chrome.runtime.sendMessage(app1id, {data: /* some data */},
function(response) {
if(response) {
// Installed and responded
} else {
// Could not connect; not installed
// Maybe inspect chrome.runtime.lastError
}
}
);

Push Notification not received by windows phone app : Parse

I have followed all the steps given in the documentation to register for a push notification from the Parse website. (All the steps in the sense I downloaded the default project and added event handler to handle the incoming toast notification).
ParseClient.Initialize("x0uNa3Q164SVGKbH4mxZJaxWxsuYtslB5tVPj893",
"cXFv9RQAoray9xFdwdcZCHXrrkrM6KNd0WyN194H");
this.Startup += async (sender, args) =>
{
// This optional line tracks statistics around app opens, including push effectiveness:
ParseAnalytics.TrackAppOpens(RootFrame);
// By convention, the empty string is considered a "Broadcast" channel
// Note that we had to add "async" to the definition to use the await keyword
await ParsePush.SubscribeAsync("");
};
ParsePush.ToastNotificationReceived += ParsePushOnToastNotificationReceived;
and the handler
private void ParsePushOnToastNotificationReceived(object sender,
NotificationEventArgs notificationEventArgs)
{
var s = new ShellToast();
s.Content = notificationEventArgs.Collection.Values.First();
s.Title = "My Toast";
s.Show();
}
private async void Application_Launching(object sender, LaunchingEventArgs e)
{
await ParseAnalytics.TrackAppOpenedAsync();
}
When I run the app in the emulator it registers the app and I can verify it in my dashboard. But as soon as I send push notification from the website number of registered devices will be shown as 0 and the app doesnt receive the notification.
One thing to mention is this behavior is not consistent. Sometimes the app does receive the notification. Can anyone mention the reason for this or any other point I am missing?
One thing to note is that ShellToast.Show() should only be used from background task. If you call it when an app is in the foreground, toast won't be shown. http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.shell.shelltoast.show(v=vs.105).aspx
So, be sure your app is not in the foreground when you expect to see toast notification.
Firstly you will be shown toast notification only if the foreground app is not running. If your app is running when you receive push notification you have to do like:
void ParsePushOnToastNotificationReceived(object sender,
NotificationEventArgs notificationEventArgs)
{
Deployment.Current.Dispatcher.BeginInvoke(()=>{
// do anything
MessageBox.Show("got notification");
});
}
If your app is not running the os will handle the notification properly, you dont have to do anything.