Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
v. 1.7.1 - Activities and callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Møller committed Oct 16, 2013
1 parent 904e47d commit a91bff9
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 26 deletions.
4 changes: 4 additions & 0 deletions Classes/DkNappSocialModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
@property(nonatomic,readonly) NSNumber *ACTIVITY_COPY;
@property(nonatomic,readonly) NSNumber *ACTIVITY_ASSIGN_CONTACT;
@property(nonatomic,readonly) NSNumber *ACTIVITY_SAVE_CAMERA;
@property(nonatomic,readonly) NSNumber *ACTIVITY_READING_LIST;
@property(nonatomic,readonly) NSNumber *ACTIVITY_FLICKR;
@property(nonatomic,readonly) NSNumber *ACTIVITY_VIMEO;
@property(nonatomic,readonly) NSNumber *ACTIVITY_AIRDROP;
@property(nonatomic,readonly) NSNumber *ACTIVITY_TENCENT_WEIBO;
@property(nonatomic,readonly) NSNumber *ACTIVITY_CUSTOM;

@end
17 changes: 15 additions & 2 deletions Classes/DkNappSocialModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ @implementation DkNappSocialModule
MAKE_SYSTEM_PROP(ACTIVITY_COPY, UIActivityTypeCopyToPasteboard);
MAKE_SYSTEM_PROP(ACTIVITY_ASSIGN_CONTACT, UIActivityTypeAssignToContact);
MAKE_SYSTEM_PROP(ACTIVITY_SAVE_CAMERA, UIActivityTypeSaveToCameraRoll);

// iOS7+
MAKE_SYSTEM_PROP(ACTIVITY_READING_LIST, UIActivityTypeAddToReadingList);
MAKE_SYSTEM_PROP(ACTIVITY_FLICKR, UIActivityTypePostToFlickr);
MAKE_SYSTEM_PROP(ACTIVITY_VIMEO, UIActivityTypePostToVimeo);
MAKE_SYSTEM_PROP(ACTIVITY_AIRDROP, UIActivityTypeAirDrop);
MAKE_SYSTEM_PROP(ACTIVITY_TENCENT_WEIBO, UIActivityTypePostToTencentWeibo);

// Custom
MAKE_SYSTEM_PROP(ACTIVITY_CUSTOM, 100);


#pragma mark Internal

// this is generated for your module, please do not change it
Expand Down Expand Up @@ -921,8 +930,12 @@ -(NSMutableArray *)activityIcons:(NSString *)removeIcons
@"contact": UIActivityTypeAssignToContact,
@"weibo": UIActivityTypePostToWeibo,
@"print": UIActivityTypePrint,
@"camera": UIActivityTypeSaveToCameraRoll
@"airdrop": UIActivityTypeAirDrop
@"camera": UIActivityTypeSaveToCameraRoll,
@"readinglist": UIActivityTypeAddToReadingList,
@"flickr": UIActivityTypePostToFlickr,
@"vimeo": UIActivityTypePostToVimeo,
@"airdrop": UIActivityTypeAirDrop,
@"tencentweibo": UIActivityTypePostToTencentWeibo
};

NSArray *icons = [removeIcons componentsSeparatedByString:@","];
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ Each of these options is optional
* **ACTIVITY_COPY**: UIActivityTypeCopyToPasteboard
* **ACTIVITY_ASSIGN_CONTATCT**: UIActivityTypeAssignToContact
* **ACTIVITY_SAVE_CAMERA**: UIActivityTypeSaveToCameraRoll
* **ACTIVITY_READING_LIST**: UIActivityTypeAddToReadingList
* **ACTIVITY_FLICKR**: UIActivityTypePostToFlickr
* **ACTIVITY_VIMEO**: UIActivityTypePostToVimeo
* **ACTIVITY_AIRDROP**: UIActivityTypeAirDrop
* **ACTIVITY_TENCENT_WEIBO**: UIActivityTypePostToTencentWeibo
* **ACTIVITY_CUSTOM**: Custom Activities

### Events
Expand Down Expand Up @@ -226,6 +231,11 @@ Please check the *Example* section in the file.

## Changelog

**v1.7.1**

* Added new activities in iOS7: `ACTIVITY_READING_LIST`, `ACTIVITY_FLICKR`, `ACTIVITY_VIMEO`, `ACTIVITY_AIRDROP ` & `ACTIVITY_TENCENT_WEIBO`
* Added callback on custom activities

**v1.7.0**

* Added support iOS7
Expand Down
Binary file added dist/dk.napp.social-iphone-1.7.1.zip
Binary file not shown.
31 changes: 8 additions & 23 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,18 @@ if (Titanium.Platform.name == 'iPhone OS'){
{
title:"Custom Share",
type:"hello.world",
image:"pin.png"
image:"pin.png",
callback: function(e) {
alert("You chose me!");
}
},
{
title:"Open in Safari",
type:"open.safari",
image:"safari.png"
image:"safari.png",
callback: function(e) {
Ti.Platform.openURL("http://www.napp.dk");
}
}
]);
} else {
Expand Down Expand Up @@ -337,27 +343,6 @@ if (Titanium.Platform.name == 'iPhone OS'){
Ti.API.info("customActivity");
Ti.API.info(e);

//MAKE YOUR OWN CUSTOM ACTIVITY !
setTimeout(function(){
if(e.title == "Open in Safari"){
Ti.Platform.openURL("http://www.google.com");
} else {
//implement some logic here..
var close = Ti.UI.createButton({
title:"close"
});
close.addEventListener("click", function(e){
win.close();
});
var win = Ti.UI.createWindow({
backgroundColor:"red",
leftNavButton:close,
title:"do something nice"
});
win.open({modal:true});
}

},500);
});
}

Expand Down
2 changes: 1 addition & 1 deletion manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.7.0
version: 1.7.1
apiversion: 2
description: Social.Framework Module
author: Mads Møller
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>8EA2E083-0BD5-47FD-B30B-7FEBBCFCA13D</string>
<key>IDESourceControlProjectName</key>
<string>social</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>CCA18F54-52D8-4E6C-AE83-1A38649058F3</key>
<string>https://github.com/viezel/TiSocial.Framework.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>social.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>CCA18F54-52D8-4E6C-AE83-1A38649058F3</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/viezel/TiSocial.Framework.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>CCA18F54-52D8-4E6C-AE83-1A38649058F3</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>CCA18F54-52D8-4E6C-AE83-1A38649058F3</string>
<key>IDESourceControlWCCName</key>
<string>TiSocial</string>
</dict>
</array>
</dict>
</plist>

0 comments on commit a91bff9

Please sign in to comment.