You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran across an issue where the library would not work for my app which actually supports housing multiple users.
My app operates in a stateless manner, with configuration values passed between steps. Initiating pairing being one step - however 10 users could have initiated pairing through the same app instance before the original user has moved to the next step (entering their pairing code/pin). Unfortunately, the library leverages fields to pass those values around (_deviceId, _deviceName, _pairingRequestToken). I got around it by modifying a few functions.
@@ -114,12 +114,12 @@ let SMARTCAST = function smartcast(host, authKey) {
* @param {string} pin The PIN displayed on the smartcast device
* @return {Observable}
*/
- pair: (pin) => {+ pair: (pin, deviceId, pairingRequestToken) => {
let data = {
- DEVICE_ID: _deviceId,+ DEVICE_ID: deviceId || _deviceId,
CHALLENGE_TYPE: 1,
RESPONSE_VALUE: pin,
- PAIRING_REQ_TOKEN: _pairingRequestToken+ PAIRING_REQ_TOKEN: pairingRequestToken || _pairingRequestToken
};
return sendRequest('put', host + '/pairing/pair', null, data).then((data) => {
if (data && data.STATUS.RESULT === 'SUCCESS') {
They remain optional, in the event that (most people) aren't going to need this functionality. It's kind of a band-aid, let me know what you think.
The text was updated successfully, but these errors were encountered:
I ran across an issue where the library would not work for my app which actually supports housing multiple users.
My app operates in a stateless manner, with configuration values passed between steps. Initiating pairing being one step - however 10 users could have initiated pairing through the same app instance before the original user has moved to the next step (entering their pairing code/pin). Unfortunately, the library leverages fields to pass those values around (
_deviceId
,_deviceName
,_pairingRequestToken
). I got around it by modifying a few functions.They remain optional, in the event that (most people) aren't going to need this functionality. It's kind of a band-aid, let me know what you think.
The text was updated successfully, but these errors were encountered: