I am attempting to register a device with Parse Cloud code using PubNub. You can find more information here: PubNub JavaScript SDK
[Error]: ReferenceError: setTimeout is not defined
at Object.timeout (pubnub.js:2515:11)
at Object.PN_API (pubnub.js:2336:24)
at CREATE_PUBNUB (pubnub.js:244:24)
//Cloud Code
var PubNub = require('cloud/pubnub');
var pubnub = PubNub({
publish_key: "pub-c-bd9ec61f-8783-4c62-8157-d214ab6f8eca",
subscribe_key: "sub-c-065f58d8-ece5-11e5-baae-0619f8945a4f"
});
//Error Thrown before calling registration
pubnub.mobile_gw_provision ({
device_id: identifier,
op : 'add',
gw_type : 'apns', // or 'gcm'
channel : 'my_chat',
callback : mySuccessCallback,
error : myErrorCallback,
});