Giter Site home page Giter Site logo

pts011080 / cordova-openwith-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luisbouca/cordova-openwith-plugin

0.0 1.0 0.0 102 KB

A plugin for cordova that enables your app to be added to the share file menu and receive said file url in the app

Objective-C 23.60% JavaScript 61.70% Java 14.70%

cordova-openwith-plugin's Introduction

cordova-openwith-plugin

A plugin to enable your app to be displayed in the share file menu and receive said file in the app for any kind of use.

This plugin defines a global ( OpenWith ) object which you can use to access the public API.

Supported Platforms

  • iOS
  • Android

Installation

  • Create a secondary provision profile for the extension with the bundle id <App_Bundle_ID>.shareextension

  • Add a Zip with the second provision profile for the extension with the name provisioning-profiles inside <App_Directory>/www/provisioning-profiles/provisioning-profiles.zip (Both provision profiles must use the same certificate)

  • Run the following command:

    cordova plugin add https://github.com/OutSystemsExperts/cordova-openwith-plugin.git \
    --variable IOS_URL_SCHEME="com.outsystems.openwith" \
    --variable PROVISIONING_PROFILES="{'com.luisbouca.outsystems.shareextension':'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'}" \
    --variable PRODUCT_BUNDLE_IDENTIFIER="com.luisbouca.outsystems.shareextension" \
    --variable EXTENSION_NAME="ShareExtension" \
    --variable DEVELOPMENT_TEAM="00B000A09l" \
    --variable CERTIFICATE_TYPE="Apple Development"
variable example notes
IOS_URL_SCHEME com.outsystems.openwith iOS only BundleIdentifier of the application
PROVISIONING_PROFILES {'com.outsystems.openwith.shareextension':'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'} iOS only json with the bundle identifier of the extension as the name and the second provision profile UUID as the value
PRODUCT_BUNDLE_IDENTIFIER com.outsystems.openwith.shareextension iOS only bundle identifier of the extension <YOUR_APP_BUNDLE_ID>.shareextension`.
EXTENSION_NAME ShareExtension iOS only Name of the extension
DEVELOPMENT_TEAM 00B000A09l iOS only Developer account teamId
CERTIFICATE_TYPE iPhone Distribution iOS only Certificate type that you choose when you created the certificate

API Reference

init (OpenWith.init)

Calling this method initializes the callbacks and sets options.

Param Type Description
handlerCallback Function Callback function called when a file is shared with the app.
errorCallback Function Callback function called when an error occurs.
return64Data Boolean(optional) Whether to return base64 data of the file. defaults to false.

Handler Callback

Signature:

function(fileData){
    // ...
};

Error Callback

Signature:

function(err){
    // ...
};

where err parameter is a JSON object:

{
    "code":"",
    "message":""
}

Possible error code values:

  • INVALID_DATA - Integer Value 2. Invalid file data content.

Contributors

  • OutSystems - Mobility Experts

Document author

###Copyright OutSystems, 2020


LICENSE

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cordova-openwith-plugin's People

Contributors

luisbouca avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.