"Encountering a Timeout Referencing Issue within the Pubnub JavaScript SDK while Operating in

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,
});

Answer №1

Issue with setTimeout() function in Parse.com platform SDK:

It seems like there is a current bug in the SDK causing issues with setTimeout(). I was able to resolve it by temporarily commenting out the setTimeout function.

//return setTimeout(fun, wait);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering Type Error in Angular 2

Here is the Angular 2 code snippet I am working with: <ion-grid *ngFor="let item of menuData; let i = index;" ng-init="getAllItemToGrid()"> <img src="{{'assets/Products/'+menuData[i].image}}" ng-click="onLogin()" width="100%"> ...

Make Fomantic-UI (Angular-JS) sidebar scroll independently

Is there a way to make a sidebar scroll independently of the content it pushes? Currently, my page is structured like this: -------------------------- |[button] Header | -------------------------- |S | Main content | |i | ...

What causes the percentages to become jumbled after the website has been active for a full day?

Within this piece of code, the intention is for the month to reset "every month of the week", "every week and day", and "every day." As per the coding logic, upon running it for a single day, the daily percentage should be distinct while maintaining consi ...

View real-time input updates in React Native

I'm trying to create a real-time text display in React Native without using state. My goal is to show the typed input as it's being entered, updating the text below the input field with each letter typed. However, the code I have doesn't see ...

Using 'interface' declarations from TypeScript is unsupported in JS for React Native testing purposes

I have a ReactNative app and I'm attempting to create a test using Jest. The test requires classes from a native component (react-native-nfc-manager), and one of the needed classes is defined as follows export interface TagEvent { ndefMessage: N ...

Struggling with implementing a materialize modal?

I am encountering a problem with Materialize. This time, I am trying to create a modal div, but it doesn't seem to be working. The button is created, but when I click on it, nothing happens. I have made sure to link all the necessary Materialize files ...

How to retrieve data as an array using a promise in an Express application with React and

After including an array in the return statement, everything seems to be functioning correctly with dispatch and rendering in reducer-items.js. However, there is a discrepancy when I update the data as it does not reflect the changes made. export defa ...

Encountered a problem while attempting to generate JSON data on Spring 3.2, resulting in a "Page not found 404" error

I am currently working on retrieving data from a database using Sprng 3.2 and myBatis with the goal of receiving the data in JSON format. In order to achieve this, I have included jackson-core-asl, jackson-core-lgpl, and jackson-mapper-asl(1.9.13) in the ...

Changing the URI for the Apollo client instance

Currently, we are using Angular Apollo in one of our projects. The apollo client is being created like this: this.apollo.create({ link: this.httpLink.create({ uri: `${environment.apiBase}/graphql?access_token=${this.tokenService.token}`}), cache: new ...

Tips for effectively modeling data with AngularJS and Firebase: Deciding when to utilize a controller

While creating a project to learn AngularJS and Firebase, I decided to build a replica of ESPN's Streak for the Cash. My motivation behind this was to experience real-time data handling and expand my knowledge. I felt that starting with this project w ...

Is the fulfillment of AngularJS $q promises determined by the return value?

I'm currently working with angularjs 1.6.1 and $q. My task involves fetching a large amount of data from an API. I'm struggling to grasp when promises are actually fulfilled. Here's a snippet of what I'm doing: // controller this.dataO ...

How is the time complexity of merging two sorted arrays to create one larger sorted array determined?

This is my solution to a problem that involves merging two arrays of integers sorted in ascending order into one larger sorted array. The function merges the arrays by comparing elements from each array and appending them to a new array in an orderly fashi ...

Loading JQuery dynamically from an externally linked JavaScript file

Our clients can easily add a short script to their website to load our application. This script asynchronously loads the JavaScript that triggers the application on the client's page, typically as a pop-up. The launch code for the application requires ...

What is the best method for sending JSON data to an ASP Server through AJAX?

I'm currently working on a website built with ASP.NET that requires data retrieval from CloudKit. Utilizing CloudKit JS, I successfully retrieve a record from CloudKit and aim to send the data to the server using C# in my JavaScript code. I can conver ...

JavaScript Three.JS Shadows Unable to Render

As a newcomer to Three.js, I am thoroughly enjoying it but facing some difficulties with shadow maps. Despite researching extensively, I can't seem to make it work. Could someone please guide me in identifying my mistake? var scene = new THREE.S ...

Conceal an element depending on the values of surrounding elements

I want to dynamically hide a table based on the values of two fields. If field2 is equal to field1, then I need the table to be hidden. JSfiddle HTML: <form> Expected Number of Items: <input type="text" value="14" name="totalItems" id="tota ...

Transforming Form Input into Request Payload for an AJAX Call

I'm facing a challenge in submitting my form data through a POST AJAX request and haven't been able to come across any solutions so far. Due to the dynamic creation of the form based on database content, I can't simply fetch the values usin ...

Utilizing variables across various scopes in AngularJS

I am working on an AngularJS controller where I have defined a 'MapCtrl' function. In this function, I am trying to retrieve the user's current position using geolocation and store it in a variable called curPos. However, when I try to log t ...

Console displays null as the attribute value

When I check the console, I notice that the data-postid attribute is displaying 'null'. What could be causing this issue? I would like to view the data-id in the console when clicking on the button with the id modal-save. I have reviewed my cod ...

Discovering hyperlinks within a text input and converting them into HTML links using AngularJS

I am trying to convert links in a text input into HTML links using AngularJS. Below is the code I have written, but it doesn't seem to be working as expected. Html <div class="item item-body" ng-bind-html="{{deal.notification_details}} | linky" &g ...