End all open requests and close
the PubNub instance.
pubnub.stop();
This function allow to decrypt
the data.
To decrypt
the data you can use the following method(s) in JavaScript V4 SDK.
var decrypted = pubnub.decrypt(encrypted, 'myCipherKey'); // Pass the encrypted data as the first parameter in decrypt Method
It returns the decrypted data
as an object.
This function allow to encrypt
the data.
To encrypt
the data you can use the following method(s) in JavaScript V4 SDK.
var sCypher = "testCypher";
var msgContent = "This is the data I wish to encrypt.";
console.log('msgContent: ' + msgContent);
// Encrypt with pubnub
var encryptedMessage = pubnub.encrypt(JSON.stringify(msgContent), sCypher);
console.log('encryptedMessage PN: ' + encryptedMessage);
It returns the encrypted data
as string.
Call the reconnect
method to force the SDK to try and reach out PubNub.
To reconnect
the data you can use the following method(s) in JavaScript V4 SDK.
pubnub.reconnect();
This function will return a 17 digit precision Unix epoch.
| Timetoken The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000
Example of creating a timetoken for a specific time & date
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
|
To fetch
Time
you can use the following method(s) in JavaScript V4 SDK
// assuming an initialized PubNub instance already exists
pubnub.time(function(status, response) {
if (status.error) {
// handle error if something went wrong based on the status object
} else {
console.log(response.timetoken);
}
})
//Example of status
{
error: false,
operation: 'PNTimeOperation',
statusCode: 200
}
//Example of response
{
timetoken: 15031768233407550
}
End all open requests and close
the PubNub instance.
pubnub.stop();
This function allow to decrypt
the data.
To decrypt
the data you can use the following method(s) in Node.js V4 SDK.
var decrypted = pubnub.decrypt(encrypted, 'myCipherKey'); // Pass the encrypted data as the first parameter in decrypt Method
It returns the decrypted data
as an object.
This function allow to encrypt
the data.
To encrypt
the data you can use the following method(s) in Node.js V4 SDK.
var sCypher = "testCypher";
var msgContent = "This is the data I wish to encrypt.";
console.log('msgContent: ' + msgContent);
// Encrypt with pubnub
var encryptedMessage = pubnub.encrypt(JSON.stringify(msgContent), sCypher);
console.log('encryptedMessage PN: ' + encryptedMessage);
It returns the encrypted data
as string.
Call the reconnect
method to force the SDK to try and reach out PubNub.
To reconnect
the data you can use the following method(s) in Node.js V4 SDK.
pubnub.reconnect();
Call setProxy()
to instruct the SDK to assign or reassign a proxy configuration in run time.
To setProxy
the data you can use the following method(s) in Node.js V4 SDK.
pubnub.setProxy({
hostname: 'YOUR HOSTNAME HERE',
port: 8080,
protocol: 'YOUR PROTOCOL HERE'
});
This function will return a 17 digit precision Unix epoch.
| Timetoken The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000
Example of creating a timetoken for a specific time & date
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
|
To fetch
Time
you can use the following method(s) in Node.js V4 SDK
// assuming an initialized PubNub instance already exists
pubnub.time(function(status, response) {
if (status.error) {
// handle error if something went wrong based on the status object
} else {
console.log(response.timetoken);
}
})
//Example of status
{
error: false,
operation: 'PNTimeOperation',
statusCode: 200
}
//Example of response
{
timetoken: 15031768233407550
}
End all open requests and close
the PubNub instance.
pubnub.stop();
This function allow to decrypt
the data.
To decrypt
the data you can use the following method(s) in PhoneGap V4 SDK.
var decrypted = pubnub.decrypt(encrypted, 'myCipherKey'); // Pass the encrypted data as the first parameter in decrypt Method
It returns the decrypted data
as an object.
This function allow to encrypt
the data.
To encrypt
the data you can use the following method(s) in PhoneGap V4 SDK.
var sCypher = "testCypher";
var msgContent = "This is the data I wish to encrypt.";
console.log('msgContent: ' + msgContent);
// Encrypt with pubnub
var encryptedMessage = pubnub.encrypt(JSON.stringify(msgContent), sCypher);
console.log('encryptedMessage PN: ' + encryptedMessage);
It returns the encrypted data
as string.
Call the reconnect
method to force the SDK to try and reach out PubNub.
To reconnect
the data you can use the following method(s) in PhoneGap V4 SDK.
pubnub.reconnect();
This function will return a 17 digit precision Unix epoch.
| Timetoken The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000
Example of creating a timetoken for a specific time & date
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
|
To fetch
Time
you can use the following method(s) in PhoneGap V4 SDK
// assuming an initialized PubNub instance already exists
pubnub.time(function(status, response) {
if (status.error) {
// handle error if something went wrong based on the status object
} else {
console.log(response.timetoken);
}
})
//Example of status
{
error: false,
operation: 'PNTimeOperation',
statusCode: 200
}
//Example of response
{
timetoken: 15031768233407550
}
Beta Version Available! | A beta release of the PubNub React framework, version 2.0 is now available. You can access it in the v2.0 branch of the react repository. |
End all open requests and close
the PubNub instance.
pubnub.stop();
This function allow to decrypt
the data.
To decrypt
the data you can use the following method(s) in React V4 SDK.
var decrypted = pubnub.decrypt(encrypted, 'myCipherKey'); // Pass the encrypted data as the first parameter in decrypt Method
It returns the decrypted data
as an object.
This function allow to encrypt
the data.
To encrypt
the data you can use the following method(s) in React V4 SDK.
var sCypher = "testCypher";
var msgContent = "This is the data I wish to encrypt.";
console.log('msgContent: ' + msgContent);
// Encrypt with pubnub
var encryptedMessage = pubnub.encrypt(JSON.stringify(msgContent), sCypher);
console.log('encryptedMessage PN: ' + encryptedMessage);
It returns the encrypted data
as string.
Call the reconnect
method to force the SDK to try and reach out PubNub.
To reconnect
the data you can use the following method(s) in React V4 SDK.
pubnub.reconnect();
This function will return a 17 digit precision Unix epoch.
| Timetoken The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000
Example of creating a timetoken for a specific time & date
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
|
To fetch
Time
you can use the following method(s) in React V4 SDK
this.pubnub.time((status, response) => {
if (status.error) {
console.log(status.error);
} else {
console.log(response.timetoken);
}
});
//Example of status
{
error: false,
operation: 'PNTimeOperation',
statusCode: 200
}
//Example of response
{
timetoken: 15031768233407550
}
End all open requests and close
the PubNub instance.
pubnub.stop();
This function allow to decrypt
the data.
To decrypt
the data you can use the following method(s) in Titanium V4 SDK.
var decrypted = pubnub.decrypt(encrypted, 'myCipherKey'); // Pass the encrypted data as the first parameter in decrypt Method
It returns the decrypted data
as an object.
This function allow to encrypt
the data.
To encrypt
the data you can use the following method(s) in Titanium V4 SDK.
var sCypher = "testCypher";
var msgContent = "This is the data I wish to encrypt.";
console.log('msgContent: ' + msgContent);
// Encrypt with pubnub
var encryptedMessage = pubnub.encrypt(JSON.stringify(msgContent), sCypher);
console.log('encryptedMessage PN: ' + encryptedMessage);
It returns the encrypted data
as string.
Call the reconnect
method to force the SDK to try and reach out PubNub.
To reconnect
the data you can use the following method(s) in Titanium V4 SDK.
pubnub.reconnect();
This function will return a 17 digit precision Unix epoch.
| Timetoken The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000
Example of creating a timetoken for a specific time & date
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
|
To fetch
Time
you can use the following method(s) in Titanium V4 SDK
pubnub.time(function(status, response) {
if (status.error) {
console.log(status.error);
} else {
console.log(response.timetoken);
}
});
//Example of status
{
error: false,
operation: 'PNTimeOperation',
statusCode: 200
}
//Example of response
{
timetoken: 15031768233407550
}
End all open requests and close
the PubNub instance.
import PubNubVue from 'pubnub-vue';
const pubnub = PubNubVue.getInstance();
pubnub.stop();
This function allow to decrypt
the data.
To decrypt
the data you can use the following method(s) in Vue V4 SDK.
import PubNubVue from 'pubnub-vue';
const pubnub = PubNubVue.getInstance();
const decrypted = pubnub.decrypt(encrypted, 'myCipherKey'); // Pass the encrypted data as the first parameter in decrypt Method
It returns the decrypted data
as an object.
This function allow to encrypt
the data.
To encrypt
the data you can use the following method(s) in Vue V4 SDK.
import PubNubVue from 'pubnub-vue';
const pubnub = PubNubVue.getInstance();
const sCypher = "testCypher";
const msgContent = "This is the data I wish to encrypt.";
console.log('msgContent: '+ msgContent);
// Encrypt with pubnub
const encryptedMessage = pubnub.encrypt(JSON.stringify(msgContent), sCypher);
console.log('encryptedMessage PN: '+ encryptedMessage);
It returns the encrypted data
as string.
Call the reconnect
method to force the SDK to try and reach out PubNub.
To reconnect
the data you can use the following method(s) in Vue V4 SDK.
import PubNubVue from 'pubnub-vue';
const pubnub = PubNubVue.getInstance();
pubnub.reconnect();
This function will return a 17 digit precision Unix epoch.
| Timetoken The timetoken is constructed using the following algorithm:
timetoken = (Unix epoch time in seconds) * 10000000
Example of creating a timetoken for a specific time & date
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
|
To fetch
Time
you can use the following method(s) in Vue V4 SDK
import PubNubVue from 'pubnub-vue';
const pubnub = PubNubVue.getInstance();
pubnub.time(function(status, response) {
if (status.error) {
// handle error if something went wrong based on the status object
} else {
console.log(response.timetoken);
}
});
//Example of status
{
error: false,
operation: 'PNTimeOperation',
statusCode: 200
}
//Example of response
{
timetoken: 15031768233407550
}