opentok-react-native
Advanced tools
Comparing version 0.12.2 to 0.13.0
@@ -0,2 +1,7 @@ | ||
# 0.13.0 (Mar 23, 2020) | ||
- **[Feature]**: Add Session Options support, both [iOS](https://tokbox.com/developer/sdks/ios/reference/Classes/OTSessionSettings.html) and [Android](https://tokbox.com/developer/sdks/android/reference/). Note: iceConfig option is not currently supported | ||
- **[Feature]**: Update of iOS SDK to `2.16.5` and Android SDK to `2.16.5` | ||
# 0.12.2 (Dec 4, 2019) | ||
@@ -3,0 +8,0 @@ |
@@ -100,2 +100,3 @@ ### OTSession Component | ||
isCamera2Capable: false, // Android only - default is false | ||
ipWhitelist: false, // https://tokbox.com/developer/sdks/js/reference/OT.html#initSession - ipWhitelist | ||
}; | ||
@@ -102,0 +103,0 @@ } |
{ | ||
"name": "opentok-react-native", | ||
"version": "0.12.2", | ||
"version": "0.13.0", | ||
"description": "React Native components for OpenTok iOS and Android SDKs", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -14,5 +14,5 @@ import { Platform } from 'react-native'; | ||
newEvents[`${eventKey}:${preface}${customEvents[platform][eventType]}`] = eventHandler; | ||
} else if(customEvents[platform][eventType] !== undefined ) { | ||
} else if (customEvents[platform][eventType] !== undefined) { | ||
newEvents[`${preface}${customEvents[platform][eventType]}`] = eventHandler; | ||
} else if(events['otrnError']) { | ||
} else if (events['otrnError']) { | ||
// ignore otrnError event because it's for the js layer | ||
@@ -67,5 +67,7 @@ } else { | ||
const logRequest = (body) => { | ||
const logRequest = (body, proxyUrl) => { | ||
const hlgUrl = 'hlg.tokbox.com/prod/logging/ClientEvent'; | ||
const url = proxyUrl ? `${proxyUrl}/${hlgUrl}` : `https://${hlgUrl}`; | ||
axios({ | ||
url: 'https://hlg.tokbox.com/prod/logging/ClientEvent', | ||
url, | ||
method: 'post', | ||
@@ -82,4 +84,4 @@ data: JSON.stringify(body), | ||
const logOT = (apiKey, sessionId, action, connectionId) => { | ||
logRequest(getLog(apiKey, sessionId, action, connectionId)); | ||
const logOT = ({ apiKey, sessionId, action, connectionId, proxyUrl }) => { | ||
logRequest(getLog(apiKey, sessionId, action, connectionId), proxyUrl); | ||
}; | ||
@@ -86,0 +88,0 @@ |
import { Platform } from 'react-native'; | ||
import { reassignEvents } from './OTHelper'; | ||
import { handleSignalError, handleError } from '../OTError'; | ||
import { each, isNull, isEmpty, isString, isBoolean } from 'underscore'; | ||
import { each, isNull, isEmpty, isString, isBoolean, isObject } from 'underscore'; | ||
@@ -10,2 +10,4 @@ const validateString = value => (isString(value) ? value : ''); | ||
const validateObject = value => (isObject(value) ? value : {}); | ||
const sanitizeSessionEvents = (sessionId, events) => { | ||
@@ -59,2 +61,5 @@ if (typeof events !== 'object') { | ||
connectionEventsSuppressed: false, | ||
ipWhitelist: false, | ||
iceConfig: {}, | ||
proxyUrl: '', | ||
useTextureViews: false, | ||
@@ -67,2 +72,5 @@ androidOnTop: '', // 'publisher' || 'subscriber' | ||
connectionEventsSuppressed: false, | ||
ipWhitelist: false, | ||
iceConfig: {}, | ||
proxyUrl: '', | ||
} | ||
@@ -78,2 +86,5 @@ } | ||
connectionEventsSuppressed: 'boolean', | ||
ipWhitelist: 'boolean', | ||
iceConfig: 'object', | ||
proxyUrl: 'string', | ||
}, | ||
@@ -86,2 +97,5 @@ android: { | ||
androidZOrder: 'string', | ||
ipWhitelist: 'boolean', | ||
iceConfig: 'object', | ||
proxyUrl: 'string', | ||
}, | ||
@@ -93,3 +107,9 @@ }; | ||
if (optionType !== undefined) { | ||
sessionOptions[key] = optionType === 'boolean' ? validateBoolean(value) : validateString(value); | ||
if (optionType === 'boolean') { | ||
sessionOptions[key] = validateBoolean(value); | ||
} else if (optionType === 'string') { | ||
sessionOptions[key] = validateString(value); | ||
} else if (optionType === 'object') { | ||
sessionOptions[key] = validateObject(value) | ||
} | ||
} else { | ||
@@ -127,3 +147,3 @@ handleError(`${key} is not a valid option`); | ||
each(credentials, (value, key) => { | ||
if(!isString(value) || isEmpty(value) || isNull(value)) { | ||
if (!isString(value) || isEmpty(value) || isNull(value)) { | ||
handleError(`Please add the ${key}`); | ||
@@ -138,3 +158,3 @@ } else { | ||
const getConnectionStatus = (connectionStatus) => { | ||
switch(connectionStatus) { | ||
switch (connectionStatus) { | ||
case 0: | ||
@@ -141,0 +161,0 @@ return "not connected"; |
@@ -34,3 +34,3 @@ import React, { Component, Children, cloneElement } from 'react'; | ||
this.createSession(this.sanitizedCredentials, sessionOptions); | ||
logOT(this.sanitizedCredentials.apiKey, this.sanitizedCredentials.sessionId, 'rn_initialize'); | ||
logOT({ apiKey, sessionId, action: 'rn_initialize', proxyUrl: sessionOptions.proxyUrl }); | ||
} else { | ||
@@ -74,3 +74,3 @@ handleError('Please check your OpenTok credentials.'); | ||
}); | ||
logOT(apiKey, sessionId, 'rn_on_connect', session.connection.connectionId); | ||
logOT({ apiKey, sessionId, action: 'rn_on_connect', proxyUrl: sessionOptions.proxyUrl, connectionId: session.connection.connectionId }); | ||
if (Object.keys(signal).length > 0) { | ||
@@ -77,0 +77,0 @@ this.signal(signal); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
243319
64
877