https://github.com/eaceto/fbshare-cordovaplugin-ios
Facebook (native SDK) share plugin for Cordova Apps (iOS Only)
https://github.com/eaceto/fbshare-cordovaplugin-ios
Last synced: 10 months ago
JSON representation
Facebook (native SDK) share plugin for Cordova Apps (iOS Only)
- Host: GitHub
- URL: https://github.com/eaceto/fbshare-cordovaplugin-ios
- Owner: eaceto
- License: gpl-2.0
- Created: 2015-09-30T12:56:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-30T13:21:25.000Z (over 10 years ago)
- Last Synced: 2025-08-21T15:23:55.303Z (10 months ago)
- Language: Objective-C
- Size: 8.5 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FBShare (a Cordova Plugin for sharing links to Facebook in iOS)
## Installation
### Add to iOS project
https://github.com/eaceto/FBShare-CordovaPlugin-iOS.git
### Include Facebook library
Drag and Drop the following files from "lib" to your XCode project
FBSDKCoreKit.framework
FBSDKLoginKit.framework
FBSDKShareKit.framework
### AppDelegate
Add the following lines to the end of application:didFinishLaunchingWithOptions:
return [FBSharing initWithApplication:application launchOptions:launchOptions];
Add the following lines to the end of application:openURL:sourceApplication:annotation:
return [FBSharing application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
So and example AppDelegate will have:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return [FBSharing initWithApplication:application launchOptions:launchOptions];
}
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
{
if (!url) {
return NO;
}
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
return [FBSharing application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
### Call the share method
var success = function(message) {
}
var failure = function() {
}
cordova.exec(success, failure, "FBSharing", "share", [,"",""]);