Share content via whatsapp in wp8 apps - c#

Just implemented sharing via SMS, Mail Twitter and Facebook with the from the WP8 SDK provided ShareStatusTask:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.tasks.sharestatustask(v=vs.105).aspx
Whatsapp does not seem to be supported here - do you guys know a trick to get around this?

Technically no, not yet, but something may come in the future using Uri Schemes.
For now, it seems that you can only run the WhatsApp app by doing this:
await Windows.System.Launcher.LaunchUriAsync(new Uri("whatsapp:"));
but on iPhone, you can use this form of Uri
whatsapp://send?text=Hello%2C%20World!
so I expect the same functionality to appear in the near future in WhatsApp for Windows Phone. There's no reason why they wouldn't implement it.
In fact, maybe they already have, but I haven't found it publicly documented. See on Nokia Developer website for other Uri Schemes

My understanding is that you can only make your App available as a means of photo sharing. (See here: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967563%28v=vs.105%29.aspx)
There is no way to share to a particular third party App, unless it has "Extended the share picker" as seen at the link above.

You can share text with whatsapp friends by using following URI scheme:
await Windows.System.Launcher.LaunchUriAsync(new Uri("whatsapp://send?text=Hello"));

Related

WP8 Facebook send message app-to-app

My question is simple, but I cannot seem to find the answer with Google. I'm working on a Windows Phone 8 app and I would like to offer the possibility to share content with certain people in private. I will add a feature to send by SMS, but I would also like to offer the possibility to send a private message in Facebook.
There is a Facebook app for Windows Phone 8 and I wanted to know if there is a way with "App-to-app" communication to have the Facebook app send the message for me. This way, the user could edit the message and choose who to send it to, without my app having to manage this for him. I think it would be a better user experience than using the Facebook API since it would be consistent.
I looked online and there is a way to make a post. However, that's not what I want since my app handles a financial matters. Is there a simple way to do that ?
It depends not on your App but the Facebook App - if it supports such a feature.
In Windows Phone you can for example associate files and Uri's with certain Apps - MSDN source. By this it is possible (I think somehow) to pass a file (message) to other App (if that App supports it). Other problem may be where to save that file - maybe some webservice as IsolatedStorage is a bad idea.
It will be hard workaround, but surely depend mostly not on your App.
In this case I think it will be better to use Facebook API in your App.
Use Facebook to do post function like below
await Launcher.LaunchUriAsync(new Uri("fb:post?text=foo"));
Or you need implement an OAuth flow to get Facebook token then do Post by Facebook post API
https://graph.facebook.com//v2.0/me/feed?message=foo&access_token={TOKEN}
I think these are the possible ways to achieve what you want.

C#/.NET Desktop App Based on Instagram's API (For Offline Use & No Database Connectivity)

For my semester assignment, I want to make a simple C#/.NET windows desktop application that will call the Instagram API and use its Photo Effects/Filters.
But my professor has said that the app must be a standalone windows desktop app which means it should not have any internet or database connectivity.
For example: If a user selects an image/photo from his computer using the desktop application (that I want to develop), I want the application to show a bunch of instagram filters that can applied to that image (without internet or any database connection).
My basic question: Is it possible for me to develop such an app that uses the instagram API but does not need any internet or database connectivity? If it is possible, can you guys guide me? I have visited instagram.com/developer/authentication/ link but I am not sure what to do. And if it is not possible, is there any other way to make an app that applies some effects/filters to an image? Please help me out. Thanks.
EDIT: I am still a little confused though. When we use intagram on phone, we use internet only when we want to upload a photo. Filters are offline features. So is there any way I can get these features from the API? As my teacher said I 'can use API but not internet' I assumed APIs can work without the need of an internet connection.
To implement offline image processing, you would either need an assembly of the filters or the actual code. I don't think that Instagram provides such tools. But there are plenty of third party libraries out there for image processing, if that's what you are looking for. For instance the AForge image processing.

How to post a single tweet in C#

I am trying to post a single tweet in my Windows phone application to any twitter account. I don't want to complicate my code using external libs or APIs. If they are unavoidable, I will include. I don't need to read any tweets or need to persist my connection. Its simple, The user supplies a username, password and a tweet message and hits tweet.
The famous temple run in iPhone has exactly what I need (screenshot below).
Please guide me in C#
This is possible via XAuth. The technique is not straight forward though, your request will have to go through the Twitter API team and once they approve they will give the xAuth Access. See this other SOF answer for more details.
If you want to integrate it like in you screenshot I think you need to communicate with the API yourself.
But there is the ShareStatusTask in the Microsoft.Phone.Tasks namespace.
With that users can share your status to the social media they configured.
Also check: http://msdn.microsoft.com/en-us/library/hh394027(v=vs.92).aspx
You have two choices:
use the built-in ShareStatusTask
roll your own system.
The advantage of ShareStatusTask is that it is simple to implement and maintain.
For the user it is also a good solution as it will allow him to post the status on the social network of its choice and it avoids forcing him to authenticate again.
If you want to roll your own system, you'll have to deal with different problems:
user authentication (OAuth)
maintenance (sometimes Twitter like to change the way 3rd party apps
interact with them...)
Here is a tutorial that explains how to implement Twitter in a Windows Phone app.
Also Tweetsharp is a nice Twitter lib you can use

How to authorize my app with Facebook

I know I have seen apps that log me in using Facebook but never present me with an authorization screen. I can not, for the life of me, figure out how to do this with Windows Phone 7. The best I have been able to get is using the Facebook for C# SDK to get the authorization screen in a WebView. This looks hideous and the page does not even appear to be mobile ready.
I have searched high and low for an answer and have found nothing. Wondering if anyone can point me in the right direction to getting this to work?
Yes, I also saw this kind of apps (e.g. Spotify prompts you to enter your Facebook account credentials rather than using the normal authorization flow). My best guess is that they either some kind of premium partners and have access to some private APIs or they use custom authorization flows (e.g. when you authorize an app on a website, the system saves authorization key in the database. The same app id/secret is then used in Windows Phone app and all you need to do is to type in your email/username in order for the system to locate authorization key that was saved earlier).
I also don't like the approach of displaying Facebook login/auth using WebBrowser control (mostly because of UI inconsistency) but I'd say that this is still the way to go in most cases (because this is the official and recommended way of authorizing the app and all other approaches seem hacky for me and also have their disadvantages).
You will want to be using the "server-side authentication" approach. The following document describes how it works: Server-side authentication (read also OAuth Dialog documentation for how to configure the authentication dialog). You can change the way the UI looks by passing a display parameter (either to touch or wap).
Please note that display=touch is currently broken in Windows Phone - Facebook always falls back to wap which is deprecated and will be removed as per July 2012 update (corresponding case: Facebook API can't be used with Windows Phone apps). It's also among known issues on Facebook C# SDK project page: Facebook C# SDK - Known issues.
Hope this clarifies things a bit.

Accessing the browser's favorites

I used so far the WebBrowserTask in order to open URLs from code in my WP7 app, but I am interested in accessing the links saved in the browser's favorites. Does anyone know if this is possible?
No, I don't think there is any API available in Windows Phone SDK to do so
It's not possible to access the inbuilt app on WP7 unless there is a task available in the API

Categories

Resources