How to use the hyperview/src/services/namespaces.SHARE function in hyperview

To help you get started, we’ve selected a few hyperview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Instawork / hyperview / src / behaviors / hv-share / index.js View on Github external
callback: (element: Element) => {
    // This share API is based off https://facebook.github.io/react-native/docs/0.52/share
    const dialogTitle: ?DOMString = element.getAttributeNS(
      Namespaces.SHARE,
      'dialog-title',
    );
    const message: ?DOMString = element.getAttributeNS(
      Namespaces.SHARE,
      'message',
    );
    const subject: ?DOMString = element.getAttributeNS(
      Namespaces.SHARE,
      'subject',
    );
    const title: ?DOMString = element.getAttributeNS(Namespaces.SHARE, 'title');
    const url: ?DOMString = element.getAttributeNS(Namespaces.SHARE, 'url');

    const content = getContent(message, title, url);
    if (content) {
      const options = getOptions(dialogTitle, subject);
github Instawork / hyperview / src / behaviors / hv-share / index.js View on Github external
callback: (element: Element) => {
    // This share API is based off https://facebook.github.io/react-native/docs/0.52/share
    const dialogTitle: ?DOMString = element.getAttributeNS(
      Namespaces.SHARE,
      'dialog-title',
    );
    const message: ?DOMString = element.getAttributeNS(
      Namespaces.SHARE,
      'message',
    );
    const subject: ?DOMString = element.getAttributeNS(
      Namespaces.SHARE,
      'subject',
    );
    const title: ?DOMString = element.getAttributeNS(Namespaces.SHARE, 'title');
    const url: ?DOMString = element.getAttributeNS(Namespaces.SHARE, 'url');

    const content = getContent(message, title, url);
    if (content) {
      const options = getOptions(dialogTitle, subject);
      Share.share(content, options);
    }
  },
};
github Instawork / hyperview / src / index.js View on Github external
import Navigation, { ANCHOR_ID_SEPARATOR } from 'hyperview/src/services/navigation';
import React from 'react';
import VisibilityDetectingView from './VisibilityDetectingView.js';
import { addHref, createProps, getBehaviorElements, getFirstTag, later, shallowCloneToRoot, getFormData } from 'hyperview/src/services';
import { version } from '../package.json';
import { ACTIONS, FORM_NAMES, NAV_ACTIONS, ON_EVENT_DISPATCH, UPDATE_ACTIONS } from 'hyperview/src/types';
import urlParse from 'url-parse';
import eventEmitter from 'tiny-emitter/instance';

const AMPLITUDE_NS = Namespaces.AMPLITUDE;
const HYPERVIEW_ALERT_NS = Namespaces.HYPERVIEW_ALERT;
const HYPERVIEW_NS = Namespaces.HYPERVIEW;
const INTERCOM_NS = Namespaces.INTERCOM;
const PHONE_NS = Namespaces.PHONE;
const REDUX_NS = Namespaces.REDUX;
const SHARE_NS = Namespaces.SHARE;
const SMS_NS = Namespaces.SMS;

const HYPERVIEW_VERSION = version;

function getHyperviewHeaders() {
  const { width, height } = Dimensions.get('window');
  return {
    'X-Hyperview-Version': HYPERVIEW_VERSION,
    'X-Hyperview-Dimensions': `${width}w ${height}h`,
  };
}


/**
 *
 */