A new plugin to share your files and content to other apps

Share icon

Why did we need to make such a plugin?

A Cobalt app has to get used to news uses and sharing content became essential and common. That’s why we had to create a Sharing plugin for Cobalt.

Just specify the type of the content (e.g. a text, image or video) and where to find it (an URL, the assets folder, etc.), then call cobalt.share(data)!

What does it do?

This plugin can share text, documents, pictures, video, music or other files type but also add contacts from you app. If needed, it can automatically download the content from Internet and save it into your phone storage for proper sharing.

How to use it?

Here is a sample code of sharing an image from an URL.
Usage on the Web side is quite straightforward:

Try it!

Documentation can be found here.

Try it out and tell us what you think!
You can also try this feature in the Catalog App.


The PubSub plugin

During the last Cobalt sprint, we also published the PubSub plugin which is probably one of the most important Cobalt plugin out there.

With each view of a Cobalt application in a different Web page, the application can share information between pages with cobalt storage. But sometimes, that’s not enough.

The concept of subscribing and publishing to a channel is used on many languages. Check out the wikipedia page about this pattern.

In this plugin, we used this pattern to allow you to send messages between Cobalt WebViews of a same app!

Continue reading The PubSub plugin