opentok-react-native
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "opentok-react-native", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "React Native components for OpenTok iOS and Android SDKs", | ||
@@ -30,3 +30,4 @@ "main": "src/index.js", | ||
"underscore": "^1.8.3", | ||
"prop-types": "^15.6.0" | ||
"prop-types": "^15.6.0", | ||
"axios": "^0.18.0" | ||
}, | ||
@@ -44,4 +45,4 @@ "devDependencies": { | ||
"react": "16.2.0", | ||
"react-native": "0.51.0" | ||
"react-native": "^0.51.0" | ||
} | ||
} |
import { Platform } from 'react-native'; | ||
import { handleError } from '../OTError'; | ||
import { each } from 'underscore'; | ||
import axios from 'axios'; | ||
const _ = require('underscore'); | ||
const reassignEvents = (type, customEvents, events) => { | ||
@@ -10,3 +10,3 @@ const newEvents = {}; | ||
const platform = Platform.OS; | ||
_.each(events, (eventHandler, eventType) => { | ||
each(events, (eventHandler, eventType) => { | ||
if (customEvents[platform][eventType] !== undefined) { | ||
@@ -36,10 +36,8 @@ newEvents[`${preface}${customEvents[platform][eventType]}`] = eventHandler; | ||
}; | ||
fetch('https://hlg.tokbox.com/prod/logging/ClientEvent', { | ||
body: JSON.stringify(body), | ||
axios({ | ||
url: 'https://hlg.tokbox.com/prod/logging/ClientEvent', | ||
method: 'post', | ||
data: JSON.stringify(body), | ||
}) | ||
.then(() => { | ||
// initial response | ||
}) | ||
.then(() => { | ||
// response complete | ||
@@ -46,0 +44,0 @@ }) |
import { NativeModules, NativeEventEmitter, PermissionsAndroid } from 'react-native'; | ||
import { each } from 'underscore'; | ||
const _ = require('underscore'); | ||
const OT = NativeModules.OTSessionManager; | ||
@@ -26,3 +25,3 @@ const nativeEvents = new NativeEventEmitter(OT); | ||
permissionsError.permissionsDenied = []; | ||
_.each(result, (permissionValue, permissionType) => { | ||
each(result, (permissionValue, permissionType) => { | ||
if (permissionValue === 'denied') { | ||
@@ -73,3 +72,3 @@ permissionsError.permissionsDenied.push(permissionType); | ||
OT.setNativeEvents(eventNames); | ||
_.each(events, (eventHandler, eventType) => { | ||
each(events, (eventHandler, eventType) => { | ||
const allEvents = nativeEvents.listeners(); | ||
@@ -85,3 +84,3 @@ if (!allEvents.includes(eventType)) { | ||
OT.removeNativeEvents(eventNames); | ||
_.each(events, (eventHandler, eventType) => { | ||
each(events, (eventHandler, eventType) => { | ||
nativeEvents.removeListener(eventType, eventHandler); | ||
@@ -88,0 +87,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
0
3
699
+ Addedaxios@^0.18.0
+ Addedaxios@0.18.1(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
+ Addedis-buffer@2.0.5(transitive)