Pushpin Update: Share to Pushpin from your Windows Phone Application

This one is for the developers out there, today's update allows Windows Phone applications to share directly to Pushpin. This article details how to implement this change.

Protocol Share Support

v1.0.0.16 provides support to allow app developers to share a link directly to Pushpin. The implementation for this is very straightforward and provides an easy way to allow Pushbullet support for your sharing. You can still use the ShareTarget on your application - as an example, if you go to Internet Explorer and share a page - an option for Pushpin will be shown allowing you to share the URL to anyone you want. Pushpin Share Target The new functionality allows you to share directly without the need to open the share window, it will open the application immediately.

Implementation

In order to share directly to Pushpin you will need create a Base64 Encoded string of a JSON Object - the JSON Object requires four fields that will allow Pushpin to correctly show the New Link share.
{ "type": "link", "url": "https://pushpin.orthodox.io", "title": "Pushpin for Windows Phone", "message": "Pushpin is a 3rd party Pushbullet client." }
  • type is always set as link.
  • url can be the URL of the article that the user was reading.
  • title is the title of the article.
  • message can be an excerpt or summary of the page that is being shared.
When the JSON object has been constructed it will then need to be Base64 encoded, here's a method that can be used to help you get started.
public string Base64Encode(string plainText)
 {
 var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
 return System.Convert.ToBase64String(plainTextBytes);
 }
Once that has been done the next step is to append the Base64 encoded string on to the URL. The final code to launch the URL will look something like

await Launcher.LaunchUriAsync(new Uri("pushpin://share/?params=" + encodedString));

Now when a user clicks on a "Share to Pushbullet" link or button they will be presented with the new link page of Pushpin with the fields pre-populated with the information that was passed from your application. Pushpin New Link

Frequently Asked Questions

What if Pushpin isn't installed on the user's Windows Phone device?

Windows Phone will notify the user and tell them that there isn't an application available to open supported protocol. It will then allow the user to search the store for a supported application - this is where Pushpin will be shown.

Are you planning on supporting the Note and File support?

I will be updating the application to support the Note type push but the File share support will remain as part of the Share Target window as data can not be passed as a URL query string parameter.

Changelog

You can find the full changelog of all previous updates on the app changelog page.

Download

As usual you can download the app from the Windows Phone Store

Sandeep Bansal is a Software Engineer focusing on Microsoft and Web technologies. He looks to develop both well designed and functional desktop/phone applications.

Similar Posts you might like

Comments