• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 10 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CommonJS Module and Widget for Appcelerator that implements cross-platform sharing of text and images over social networks.

SocialShare

This library is part of the code included in the book

Get the book

SocialShare is a CommonJS Module for Titanium that implements cross-platform sharing of text and images over social networks.

iOS

On iOS, the module uses the native sharing Action Sheet and offers options for sharing with Facebook and Twitter (if the native apps are installed), plus AirDrop, Text Message, Email and other built-in iOS mechanisms.

Android

On Android it uses the Native Sharing Intent, which brings up a list of installed apps to choose from.

Usage

If you want to send an image, set the image property to the Native Path to the image. If you wish to only send text, simply don't send the image property.

require('com.alcoapps.socialshare').share({
	status 					: 'This is the status to share',
	image 					: fileToShare.nativePath,
	androidDialogTitle 		: 'Sharing is caring!!!'
})

BOOM! That's it! You're sharing!

The Alloy Widget

To use the Widget, copy it to your widgets folder and declare it as a dependecy in your config.json. Then to use it, use a similar syntax:

function shareTextWidget(e){
	// share text status
	var socialWidget=Alloy.createWidget('com.alcoapps.socialshare');
	socialWidget.share({
		status 				: 'This is the status to sahre',
		androidDialogTitle 	: 'Caption!!!'
	})
}

iPad

On iPad, the sharing options are displayed in a PopOver, as shown below.

This PopOver needs to be pointing to some view, and you specify this view using the View property like so:

socialWidget.share({
	status 				: 'This is the status to sahre',
	androidDialogTitle 	: 'Caption!!!',
	view 				: $.shareView
})

Dependencies

This module requires dk.napp.social for iOS which you can get from https://github.com/viezel/TiSocial.Framework

Why more sharing options on Android

Because Android is awesome!

No, really. The reason is because the "sharing intent" is a method "baked" into the Android SDK, so you simply call it with the data you want to share, and Android will return the installed apps that can handle that type of data. iOS on the other hand offers some built-in methods, but others need to be added by native code. The dk.napp.social module does just that, but only for Twitter, Facebook and Weibo (which is only relevant for China users).

Facebook and Twitter not showing even when the apps are installed?

The TiSocial.Framework module gets its Twitter and Facebook credentials from iOS and not from the Facebook and Twitter apps. If the Facebook and/or Twitter icons are not showing in, make sure accounts are added to the iOS social settings.

Get it

You can get it from the /app/lib folder or the Widget from the /app/widgets/com.alcoapps.socialshare folder.

NOTE

iOS Sharing CAN be achieved from the Titanium core SDK using the DocumentViewer object.

docViewer = Ti.UI.iOS.createDocumentViewer({url:'appicon.png'});

navButton.addEventListener('click', function(){
    docViewer.show({view:navButton, animated: true});
});

The code above will effectively show the UIActivityViewController, but will only allow you to send files and not status updates, because it is designed to open documents.

Credits

This module borrows from from code and ideas by:

License

MIT - http://alco.mit-license.org

More Repositories

1

actionbarextras

Titanium Android Native Module that exposes ActionBar features not exposed by the Titanium SDK
Java
148
star
2

alloy-widget-drawermenu

An Appcelerator Alloy Widget to implement a slide-in, drawer-style menu
JavaScript
103
star
3

actionbarclone

Appcelerator Alloy Widget that emulates Android's ActionBar functionality
JavaScript
65
star
4

AlloyAppTemplate

This repo was moved to https://github.com/appcelerator-developer-relations/Template.Hierarchical-Navigation
JavaScript
51
star
5

jssql

CommonJS wrapper around Ti.Database that makes accessing SQLite Databases feel more like accessing JavaScript objects
JavaScript
48
star
6

acspushmod

ACS Push Notifications Library
JavaScript
40
star
7

lzload

Titanium code to implement cross-platform lazy loading on TableViews
JavaScript
32
star
8

TiCrossPlatformNavigationGroup

Titanium Cross-Platform Navitation Group
JavaScript
29
star
9

tiactionbarhelper

ActionBar Helper Class for Titanium. Full blog post at http://t.co/MvnKi2LgGg
JavaScript
29
star
10

Ti.MarkdownViewer

Alloy widget that allows you to display Markdown documents in your Appcelerator Apps.
JavaScript
28
star
11

TiAlloyCharts

Alloy Widget to add pretty charts to your mobile apps using HighCharts.js. This is a WIP. If you like it and use it, please send Pull Requests.
JavaScript
24
star
12

tinormalizer

TiNormalizer - An attempt at normalizing some Titanium APIs for ease of use across platforms.
JavaScript
19
star
13

AndroidRotateImage

This is a native Android module written by Justin Toth that fixes TIMOB-3887. All credit goes to Justin; I only built the module.
Java
17
star
14

acsphppushnotifications

PHP Script to send cross-platform push notifications with ACS
PHP
17
star
15

node_mediasite

Node-based media server and client
JavaScript
16
star
16

AppC_AutoComplete

An example of how to build an incremental search/auto-complete search with Appcelerator
JavaScript
15
star
17

Ti.DrawerLayout-Demo-Alloy-App

Demo app for Ti.DrawerLayout Module (https://github.com/Tripvi/Ti.DrawerLayout)
JavaScript
14
star
18

lilacs

Li'l ACS is an instant API on top of Appcelerator Cloud Services, using the Custom Objects API. Use LilACS any time you need to have a custom on-line database for your web and/or mobile apps.
CSS
13
star
19

nodeacs_sample_website

Example of how to use Node.ACS MVC framework to build a custom front-end to ACS.
JavaScript
12
star
20

tiphotogram

Proof-of-concept. Build a photo sharing app with Titanium and ACS
JavaScript
11
star
21

hidingactionbar

Examples of how to hide the ActionBar on Titanium after 3.3.0.
JavaScript
10
star
22

AppC_iOS8_Interactive_Notifications

Example of how to use iOS 8 interactive notifications with Titanium SDK 3.4
JavaScript
10
star
23

appc_book_code

This repository contains all the source code for the book Build Native Cross-Platform Apps with Appcelerator. For more information about the book, visit http://buildmobileapps.io.
JavaScript
10
star
24

AppC-Meetup-12-11-12

Emulating the Facebook Android App UI using Titanium and Alloy. This is the code for the December 11, 2012 Silicon Valley Titanium User Group Meetup.
JavaScript
10
star
25

navdrawer

Experimenting with the possibility of building a native java module that exposes Android's Navigation Drawer to Titanium
Java
9
star
26

ti.templates.collection

Titanium App Templates Collection
JavaScript
9
star
27

ticsonv

On-the-fly CSV to JSON conversion. TiCSONV is a version of CSONV (https://github.com/archan937/csonv.js) modified to work with Appcelerator Titanium. CSONV is a tiny library to fetch relational CSV data at client-side just like JSON.
JavaScript
7
star
28

New_in_Ti_3.3.0

Examples of several features new to Titanium SDK 3.3.0
JavaScript
7
star
29

taffydb4tidemo

Demo on how to use Taffy DB on a Titanium cross-platform iOS and Android app
JavaScript
7
star
30

wordpressjson

Super awesome, powerful and flexible JSON api for Wordpress
PHP
6
star
31

androidtabsandactionitems

An example of how to use TabGroups with different Action Items on each tab
JavaScript
6
star
32

electron_scaffolding

Build cross-platform (Mac, Win, Linux) Desktop apps the easy way
CSS
5
star
33

Mobat2012

Mobat for Titanium
JavaScript
5
star
34

ezti

Easy Titanium : (Titanium Training Wheels) - A wrapper around Alloy. Designed to provide an abstraction layer for graphic artists, web developers and light Javascript coders. NOTE: The only important file is /app/lib/ezti.js. If you know what you're doing, then simply download this file and add it to your project.
JavaScript
5
star
35

xls2json

Node app that takes an Excel spreadsheet and converts each worksheet into an individual JSON file.
JavaScript
5
star
36

AlloyOpenWindow

Opening new Windows with Alloy
JavaScript
4
star
37

understanding_titanium_views

A test case to demonstrate building flexible user interfaces with Titanium
JavaScript
4
star
38

AlloyDynamicTableViewOpenWindow

Creating a dynamic TableView with event handling and opening new Window using Alloy
JavaScript
3
star
39

TiAndroidPlaylistsModule

Native Android module for Titanium to get Android native playlists and their contents.
D
3
star
40

AlloyDynamicTableView

Quick example for creating a dynamic simple TableView with Alloy
JavaScript
3
star
41

titokyo02

Demo 02 for tiTokyo 2013. Demonstrates a simple hard-coded app containing two views, one on top of the other. Upon clicking the top-most view, it is animated to move out of the way, bringing the bottom one into view.
JavaScript
2
star
42

a2c.alco.rocks

Generate Add 2 Calendar Buttons
PHP
2
star
43

titemplates

Titanium App Templates
JavaScript
2
star
44

titokyo03

Demo 03 for tiTokyo 2013. Creating and applying "themes" in Alloy.
JavaScript
2
star
45

hubspotmigrate

PHP Script to migrate HubSpot Blog to Wordpress (and other formats)
PHP
2
star
46

apirouter

An experiment in creating a generic API router in node.js
JavaScript
2
star
47

ti.sendgrid

A Sendgrid CommonJS module for Titanium
JavaScript
2
star
48

static-dashboard

Quick and Dirty Responsive Static Dasboard Website
HTML
2
star
49

titokyo04

Demo 04 for tiTokyo 2013. Demonstrates how to create a "widget" in Alloy, exposing views and methods, and maintaining logic within the "widget".
JavaScript
2
star
50

tiJokes

Simple Jokes App written in Appcelerator Alloy using the ezti library
JavaScript
2
star
51

AlloyStaticTableView

Creating a static TableView with Alloy
JavaScript
1
star
52

titokyo00

Demo 00 for tiTokyo 2013. This is the default project for a Titanium Classic App, as it comes with Titanium Studio.
JavaScript
1
star
53

titokyo01

Demo 01 for tiTokyo 2013. This is the sample project for Titanium Alloy as it is generated by Titanium Studio.
JavaScript
1
star
54

acssearchhistory

ACS Search History example
JavaScript
1
star
55

acs_key_value_store

Generic Key-Value store using Node.ACS and ACS. This app allows you to have an INSTANT endpoint to store any JSON database, as long as you stay below the 2MB mark.
JavaScript
1
star
56

MobatBarcamp2012

MobatBarcamp2012
1
star
57

browser_localstorage_db

Proof of concept of using the browser's local storage as a DB
JavaScript
1
star
58

titokyo05

Demo 05 for tiTokyo 2013. Demonstrates how to use a simple backbone model to provide persistent data storage and TableView data-binding using Alloy.
JavaScript
1
star
59

axe-fx-virtual-midi-pedalboard

Change your AxeFx patches from your browser window
EJS
1
star
60

clasificadosonline-alloy-demo

A full-app demo using Appcelerator Alloy to create a full-native cross-platform mobile app for ClasificadosOnline.com
JavaScript
1
star
61

epsl

Editables del libro "Economía y Productividad con Software Libre" (epsl) / Sources of the book "Economía y Productividad con Software Libre (epsl)
1
star
62

newsapp4tiwebinar

This is the basic, 1 screen news app used for the weekly Titanium webinar for beginners
JavaScript
1
star