deeplink
This commit is contained in:
40
com.twin.app.shoptime/src/lunaSend/common.js
Normal file
40
com.twin.app.shoptime/src/lunaSend/common.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import LS2Request from "./LS2Request";
|
||||
|
||||
export const getConnectionStatus = ({ onSuccess, onFailure, onComplete }) => {
|
||||
if (process.env.REACT_APP_MODE === "DEBUG") {
|
||||
console.log("LUNA SEND getConnectionStatus");
|
||||
return "Some Hard Coded Mock Data";
|
||||
} else {
|
||||
return new LS2Request().send({
|
||||
service: "luna://com.webos.service.connectionmanager",
|
||||
method: "getStatus",
|
||||
subscribe: true,
|
||||
parameters: {},
|
||||
onSuccess,
|
||||
onFailure,
|
||||
onComplete,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const createToast = (message) => {
|
||||
if (typeof window === 'object' && !window.PalmSystem) {
|
||||
console.log("LUNA SEND createToast message", message);
|
||||
return;
|
||||
}
|
||||
return new LS2Request().send({
|
||||
service: 'luna://com.webos.notification',
|
||||
method: 'createToast',
|
||||
parameters: {
|
||||
message: message,
|
||||
iconUrl: '',
|
||||
noaction: true
|
||||
},
|
||||
onSuccess: (res) => {
|
||||
console.log("LUNA SEND createToast success", message);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log("LUNA SEND createToast failed", err);
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user