iOS Phonegap app share extension (images) with ionic
iOS Phonegap app share extension (images) with ionic
Share extensions give users a convenient way to share content with other entities, such as social sharing websites or upload services. For example, in an app that includes a Share button, users can choose a Share extension that represents a social sharing website and then use it to post a comment or other content. Link
In iOS Share extension create new share project in existing project.
1) Create and add share extension project on your app.
4) Add Content Handle Plugin files on share project
ContentHandlePlugin.h and ContentHandlePlugin.m
GetFile : Github .
6) Add www ionic directory on share project (add directory with reference ).
9) Add framework on share project
1) MobileCoreServices.framework
2) CoreGraphics.framework
3) AssetsLibrary.framework
4) libCordova.a
Note : indexshareimage.html demo page of ionic framework.
1) Create and add share extension project on your app.
File >>New >>Target ...>>Application Extension >>Share Extension >>Next (Click on).
2) Add share Project Details : product name ,Organization identifier ...etc .. >> finish.
3) Replace : ShareViewController.h and ShareViewController.m file.
4) Add Content Handle Plugin files on share project
ContentHandlePlugin.h and ContentHandlePlugin.m
GetFile : Github .
5) Add contenthandleplugin.js file on ionic www js file .
Add indexshareimage.html on your ionic www directory.
6) Add www ionic directory on share project (add directory with reference ).
9) Add framework on share project
1) MobileCoreServices.framework
2) CoreGraphics.framework
3) AssetsLibrary.framework
4) libCordova.a
10) In contenthandleplugin.js file have function.
1) showShareImages(images) // return image list
2) closeView() call for Cancel button of share view close
Cancel and Send button used like : (app.js )
indexshareimage.html Page
1) showShareImages(images) // return image list
2) closeView() call for Cancel button of share view close
Cancel and Send button used like : (app.js )
app.controller('MainCtrl', function($scope) { $scope.cancelshareview = function() {
closeView();//Cancel button event };
$scope.sendshareview = function() { // send button event
//Apply your logic for image upload on server
closeView();
}; }
indexshareimage.html Page
Note : indexshareimage.html demo page of ionic framework.