This repository was archived by the owner on Mar 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1853064
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
.DS_STORE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "cordova-plugin-linkedin", | ||
"version": "0.0.1", | ||
"description": "Cordova plugin for LinkedIn", | ||
"cordova": { | ||
"id": "cordova-plugin-linkedin", | ||
"platforms": [ | ||
"android", | ||
"ios" | ||
] | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zyramedia/cordova-plugin-linkedin.git" | ||
}, | ||
"keywords": [ | ||
"ecosystem:cordova", | ||
"cordova-android", | ||
"cordova-ios" | ||
], | ||
"author": "Ibby Hadeed <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/zyramedia/cordova-plugin-linkedin/issues" | ||
}, | ||
"homepage": "https://github.com/zyramedia/cordova-plugin-linkedin#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<plugin id="cordova-plugin-linkedin" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"><name>LinkedIn</name><js-module name="LinkedIn" src="www/LinkedIn.js"><clobbers target="cordova.plugins.LinkedIn" /></js-module><platform name="android"><config-file parent="/*" target="res/xml/config.xml"><feature name="LinkedIn"><param name="android-package" value="cordova-plugin-linkedin.LinkedIn" /></feature></config-file><config-file parent="/*" target="AndroidManifest.xml" /><source-file src="src/android/LinkedIn.java" target-dir="src/cordova-plugin-linkedin/LinkedIn" /></platform><platform name="ios"><config-file parent="/*" target="config.xml"><feature name="LinkedIn"><param name="ios-package" value="LinkedIn" /></feature></config-file><source-file src="src/ios/LinkedIn.m" /></platform></plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cordova-plugin-linkedin; | ||
|
||
import org.apache.cordova.CordovaPlugin; | ||
import org.apache.cordova.CallbackContext; | ||
|
||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
/** | ||
* This class echoes a string called from JavaScript. | ||
*/ | ||
public class LinkedIn extends CordovaPlugin { | ||
|
||
@Override | ||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { | ||
if (action.equals("coolMethod")) { | ||
String message = args.getString(0); | ||
this.coolMethod(message, callbackContext); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
private void coolMethod(String message, CallbackContext callbackContext) { | ||
if (message != null && message.length() > 0) { | ||
callbackContext.success(message); | ||
} else { | ||
callbackContext.error("Expected one non-empty string argument."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/********* LinkedIn.m Cordova Plugin Implementation *******/ | ||
|
||
#import <Cordova/CDV.h> | ||
|
||
@interface LinkedIn : CDVPlugin { | ||
// Member variables go here. | ||
} | ||
|
||
- (void)coolMethod:(CDVInvokedUrlCommand*)command; | ||
@end | ||
|
||
@implementation LinkedIn | ||
|
||
- (void)coolMethod:(CDVInvokedUrlCommand*)command | ||
{ | ||
CDVPluginResult* pluginResult = nil; | ||
NSString* echo = [command.arguments objectAtIndex:0]; | ||
|
||
if (echo != nil && [echo length] > 0) { | ||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo]; | ||
} else { | ||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; | ||
} | ||
|
||
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var exec = require('cordova/exec'); | ||
|
||
exports.coolMethod = function(arg0, success, error) { | ||
exec(success, error, "LinkedIn", "coolMethod", [arg0]); | ||
}; |