Most of the SDKs essentially release the device when an empty token is passed to device.setup(), so I figured it made sense to make that a consistent behavior everywhere.
Also, device.setup() isn't guaranteed to leave the device in the ready state, so I added a check to the device's state.
Finally, TwilioPlugin.Device.prototype.status needs to take a function as a parameter, otherwise it doesn't do anything.
Most of the SDKs essentially release the device when an empty token is passed to device.setup(), so I figured it made sense to make that a consistent behavior everywhere.
Also, device.setup() isn't guaranteed to leave the device in the ready state, so I added a check to the device's state.
Finally, TwilioPlugin.Device.prototype.status needs to take a function as a parameter, otherwise it doesn't do anything.