Skip to content

nexushubs/cordova-plugin-ios-shareextension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-ios-shareextension

Usage

cordova plugin add cordova-plugin-ios-shareextension --variable IOS_GROUP_IDENTIFIER=IOS_GROUP_IDENTIFIER --variable IOS_URL_NAME=IOS_URL_NAME --variable IOS_URL_SCHEME=IOS_URL_SCHEME

document.addEventListener('deviceready', onDeviceReady, false)

function onDeviceReady () {
  const cordova.shareextension.onFiles(function (urls) {
    alert(JSON.stringify(urls, null, 2))
  })
}

Meteor

App.configurePlugin('cordova-plugin-ios-shareextension', {
  IOS_GROUP_IDENTIFIER: 'group.com.example.shareextension',
  IOS_URL_NAME: 'com.example',
  IOS_URL_SCHEME: 'app',
})
Meteor.isCordova && Meteor.startup(function () {
  cordova.shareextension.onFiles(function (urls) {
    alert(JSON.stringify(urls, null, 2))
  })
})

// fetch urls manually, to resolve files that haven't been fetched yet
// e.g. files come while app is quitted
Tracker.autorun((computation) => {
  if (!Meteor.loggingIn()) {
    computation.stop();
    cordova.shareextension.fetchUrls(onFiles);
  }
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.0%
  • Swift 16.0%