const removeAllListeners = () => {
  DeviceEventEmitter.removeAllListeners('interstitialDidLoad');
  DeviceEventEmitter.removeAllListeners('interstitialDidFailToLoad');
  DeviceEventEmitter.removeAllListeners('interstitialDidOpen');
  DeviceEventEmitter.removeAllListeners('interstitialDidClose');
  DeviceEventEmitter.removeAllListeners('interstitialWIllLeaveApplication');
};
 //页面移除代理
 componentWillUnmount () {
   if (Platform.OS === 'ios') {
    DeviceEventEmitter.removeAllListeners('keyboardWillShow');
    DeviceEventEmitter.removeAllListeners('keyboardWillHide');
   }
   formView = <View/>;
   tableView = <View/>;
   mustToInputItems = {};
   inputItems = [];
 }
const removeAllListeners = () => {
  DeviceEventEmitter.removeAllListeners('rewardedVideoDidRewardUser');
  DeviceEventEmitter.removeAllListeners('rewardedVideoDidLoad');
  DeviceEventEmitter.removeAllListeners('rewardedVideoDidFailToLoad');
  DeviceEventEmitter.removeAllListeners('rewardedVideoDidOpen');
  DeviceEventEmitter.removeAllListeners('rewardedVideoDidClose');
  DeviceEventEmitter.removeAllListeners('rewardedVideoWillLeaveApplication');
};
Example #4
0
 componentWillUnmount () {
   DeviceEventEmitter.removeAllListeners('keyboardDidShow')
   DeviceEventEmitter.removeAllListeners('keyboardDidHide')
 }
Example #5
0
 componentWillUnmount() {
   DeviceEventEmitter.removeAllListeners('changeCategory');
 }
export default () => {
  DeviceEventEmitter.removeAllListeners('FINGERPRINT_SCANNER_AUTHENTICATION');
  ReactNativeFingerprintScanner.release();
}
 stopWatchPosition: function(success, failure) {
   success = success || emptyFn;
   failure = failure || emptyFn;
   DeviceEventEmitter.removeAllListeners(TAG + ":watchposition");
   RNBackgroundGeolocation.stopWatchPosition(success, failure);
 },
Example #8
0
    constructor(props) {
        super(props);

        this._connectedHosts = [];
        this._availableHosts = {};

        if(LANScan.listenerCount && LANScan.listenerCount > 0) {
            DeviceEventEmitter.removeAllListeners('RNLANScanStart');
            DeviceEventEmitter.removeAllListeners('RNLANScanStop');
            DeviceEventEmitter.removeAllListeners('RNLANScanStartFetch');
            DeviceEventEmitter.removeAllListeners('RNLANScanInfoFetched');
            DeviceEventEmitter.removeAllListeners('RNLANScanFetchError');
            DeviceEventEmitter.removeAllListeners('RNLANScanStartPings');
            DeviceEventEmitter.removeAllListeners('RNLANScanHostFoundPing');
            DeviceEventEmitter.removeAllListeners('RNLANScanEndPings');
            DeviceEventEmitter.removeAllListeners('RNLANScanPortOutOfRangeError');
            DeviceEventEmitter.removeAllListeners('RNLANScanStartBroadcast');
            DeviceEventEmitter.removeAllListeners('RNLANScanHostFound');
            DeviceEventEmitter.removeAllListeners('RNLANScanEndBroadcast');
            DeviceEventEmitter.removeAllListeners('RNLANScanEnd');
            DeviceEventEmitter.removeAllListeners('RNLANScanError');

            LANScan.listenerCount = 0;
        }

        if(LANScan.listenerCount === 0) {

            DeviceEventEmitter.addListener('RNLANScanStart', () => this.emit('start'));
            DeviceEventEmitter.addListener('RNLANScanStop', () => this.emit('stop'));
            DeviceEventEmitter.addListener('RNLANScanStartFetch', () => this.emit('start_fetch'));
            DeviceEventEmitter.addListener('RNLANScanInfoFetched', (info) => {
                if(!info || !info.ipAddress || !info.netmask) {
                    this.emit('fetch_error', "No Info fetched from the device wifi state");
                    return false;
                }

                this.emit('info_fetched', info);
            });
            DeviceEventEmitter.addListener('RNLANScanFetchError', (msg) => this.emit('fetch_error', msg));
            DeviceEventEmitter.addListener('RNLANScanStartPings', () => this.emit('start_pings'));
            DeviceEventEmitter.addListener('RNLANScanHostFoundPing', (host) => {

                if(!host)
                    return false;

                this._connectedHosts = [...this._connectedHosts, host];

                this.emit('host_found_ping', host, this._connectedHosts);
            });
            DeviceEventEmitter.addListener('RNLANScanEndPings', (number) => {

                if(number === null)
                    return false;

                this.emit('end_pings', number);
            });
            DeviceEventEmitter.addListener('RNLANScanPortOutOfRangeError', (msg) => this.emit('port_out_of_range_error', msg));
            DeviceEventEmitter.addListener('RNLANScanStartBroadcast', () => this.emit('start_broadcast'));
            DeviceEventEmitter.addListener('RNLANScanHostFound', (host) => {

                if(!host || !host.host || typeof host.host != "string" || host.port === null)
                    return false;

                if(this._availableHosts.hasOwnProperty(host.host)) {
                    if(this._availableHosts[host.host].indexOf(host.port) == -1) {
                        this._availableHosts[host.host].push(host.port);
                    }
                } else {
                    this._availableHosts[host.host] = [host.port];
                }

                this.emit('host_found', host, this._availableHosts);
            });
            DeviceEventEmitter.addListener('RNLANScanEndBroadcast', () => this.emit('end_broadcast'));
            DeviceEventEmitter.addListener('RNLANScanEnd', () => this.emit('end'));
            DeviceEventEmitter.addListener('RNLANScanError', (msg) => this.emit('error', msg));

        }


    }
 componentWillUnmount () {
   // TODO: figure out if removeAllListeners is the right thing to do
   DeviceEventEmitter.removeAllListeners('keyboardWillShow')
   DeviceEventEmitter.removeAllListeners('keyboardWillHide')
 }
Example #10
0
 componentWillUnmount() {
   ReactNativeHeading.stop();
   DeviceEventEmitter.removeAllListeners('headingUpdated');
 }
Example #11
0
 static removeAllListeners(type) {
     DeviceEventEmitter.removeAllListeners(type);
 }
 componentWillUnmount() {
   DeviceEventEmitter.removeAllListeners(ON_MEDIA_COMPLETION);
   DeviceEventEmitter.removeAllListeners(MEDIA_PROGRESS_UPDATE);
 }
Example #13
0
 componentWillUnmount(){
     DeviceEventEmitter.removeAllListeners('inputText');
 }
Example #14
0
    };
  },

  componentWillMount() {
    if (Platform.OS === 'android') {
      DeviceEventEmitter.addListener('onOpenAnnotation', this.onOpenAnnotation);
    }
  },

  componentDidMount() {
    if (taskStore.getAll() !== null) this._updateAnnotations();
  },

  componentWillUnmount() {
    if (Platform.OS === 'android') {
      DeviceEventEmitter.removeAllListeners();
    }
  },

  onOpenAnnotation(annotation) {
    let taskId;
    if (Platform.OS === 'android') {
      taskId = annotation.src.subtitle;
    } else {
      taskId = annotation.subtitle;
    }
    const annotationTask = taskStore.get(taskId);
    Actions.solveTask({ task: annotationTask });
  },

  updateAnnotations() {
Example #15
0
 componentWillUnmount() {
   clearTimeout(this.timer);
   DeviceEventEmitter.removeAllListeners('changeCategory');
 }
Example #16
0
 componentWillUnmount() {
   DeviceEventEmitter.removeAllListeners('keyboardWillHide');
   DeviceEventEmitter.removeAllListeners('keyboardWillShow');
 }
const removeEventListener = (type) => {
  DeviceEventEmitter.removeAllListeners(type);
}
Example #18
0
 componentWillUnmount() {
 DeviceEventEmitter.removeAllListeners('ChangeCollectData');
 }