Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
readme update
  • Loading branch information
illuzor committed Mar 18, 2017
1 parent 1d28812 commit 84fbdbe
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Expand Up @@ -15,29 +15,29 @@ Connect com.illuzor.extensions.SharingExtension.ane file to your android air pro
Import com.illuzor.sharingextension.SharingExtension;

1) Share text:

SharingExtension.shareText("Title", "Text for sharing");

```actionscript
SharingExtension.shareText("Title", "Text for sharing");
```
2) Share image:

var bitmap:Bitmap = ...;

// encoding image by native encoder (availible on FP 11.3/AIR 3.3 or newer)
var bitmapBytes:ByteArray = bitmap.bitmapData.encode(new Rectangle(0, 0, bitmap.width, bitmap.height), new JPEGEncoderOptions(70)));

var file:File = File.documentsDirectory.resolvePath("image_for_share.jpg");

var stream:FileStream = new FileStream(); // write file to local memory
stream.open(file, FileMode.WRITE);
stream.writeBytes(fileBytes);
stream.close();

SharingExtension.shareImage(file, "Choser title", "Message"));

3) Dispose. If you don`t need extension after use, dispose it:
```actionscript
var bitmap:Bitmap = ...;
SharingExtension.dispose();

// encoding image by native encoder (availible on FP 11.3/AIR 3.3 or newer)
var bitmapBytes:ByteArray = bitmap.bitmapData.encode(new Rectangle(0, 0, bitmap.width, bitmap.height), new JPEGEncoderOptions(70)));
var file:File = File.documentsDirectory.resolvePath("image_for_share.jpg");
var stream:FileStream = new FileStream(); // write file to local memory
stream.open(file, FileMode.WRITE);
stream.writeBytes(fileBytes);
stream.close();
SharingExtension.shareImage(file, "Choser title", "Message"));
```
3) Dispose. If you don`t need extension after use, dispose it:
```actionscript
SharingExtension.dispose();
```
Demo app - http://yadi.sk/d/Se_LR8fm1lgsD

![demoAppQR.gif](http://download.illuzor.com/images/github/ane/demoAppQR.gif)
![demoAppQR.gif](http://download.illuzor.com/images/github/ane/demoAppQR.gif)

0 comments on commit 84fbdbe

Please sign in to comment.