Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Commit 041a14e

Browse files
satya164expbot
authored andcommitted
Add a reset device to reset snacks on device
fbshipit-source-id: 00e0979
1 parent add684e commit 041a14e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/SnackSession.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,19 @@ export default class SnackSession {
344344
return { url: url + '/' + id };
345345
};
346346

347+
reloadSnack = () => {
348+
this.pubnub.publish(
349+
{ channel: this.channel, message: { type: 'RELOAD_SNACK' } },
350+
(status, response) => {
351+
if (status.error) {
352+
this._error(`Error reloading app`);
353+
} else {
354+
this._log('Reloaded successfully!');
355+
}
356+
}
357+
);
358+
};
359+
347360
// TODO: error when changing SDK to an unsupported version
348361
setSdkVersion = (sdkVersion: SDKVersion): void => {
349362
if (this.sdkVersion !== sdkVersion) {

0 commit comments

Comments
 (0)