페이로드가 다시 전송됩니다.
alert(evt.payload);
CloudPush.addEventListener('callback', function(evt) {
Ti.API.debug(evt.payload);
}
페이로드는 데이터 페이로드의 JSON 문자열입니다. JSON.parse를 사용하여이 객체를 사용할 수있는 객체로 변환하십시오.
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
당신은 당신이 발사하려는 어떤 의도 창이나 행동에 대한 점검을 기반으로이 페이로드를 사용할 수 있습니다. cloudPush에서 콜백 eventEventLister 내부
var payload = JSON.parse(evt.payload);
if (payload...) {
// Do first option
} else {
// Do fallback option
}
당신은 당신이 비슷한을로드 할 수있는 페이로드를 분석 한 후 : 다른 창을 전환 할 경우에 URL 객체를 설정
CloudPush.addEventListener('callback', function(evt) {
... Do payload check if statement from evt.payload...
// Or this could be a new window, alert, etc,
Titanium.Android.NotificationManager.notify(0,
Ti.Android.createNotification({
contentTitle : "title",
contentText : "text",
tickerText : "custom notification!",
contentIntent : Titanium.Android.createPendingIntent({
intent : Titanium.Android.createIntent({
url : 'foo.js'
})
})
})
);
});
evt.payload가 전송 된 내용에 따라 설정되는 맞춤 변수의 의도입니다.
예는
intent : Titanium.Android.createIntent({
url : presetWindowUrl
})
presetWindowUrl는, 당신이 목적을 위해 사용자 정의 시작 화면을 설정할 수 있어야 간단한 만약 다른 문으로 함수의 시작 부분에 설정할 수 있습니다. – Michael
tiapp.xml 파일에 아무것도 지정해야합니까? – M14
마이클이 작동하지 않습니다! – M14