2012-11-20 2 views
1

나는 티타늄에 대한 응용 프로그램을 가지고 있으며 내 응용 프로그램에서 애플로부터 푸시를 복구하는 방법을 궁금해.iPhone을 복구하는 티타늄 푸시

알림은 알림을 클릭 한 후 앱을 열 때 푸시 데이터에 따라 특정 창을 열 수 있습니다. 나 혼자 찾아

감사합니다,

+0

티타늄에는 "didReceiveLocalNotification"이 없습니까? –

답변

0

다음 통지에 클릭에서 오는 재개 경우 Titanium.Network.registerForPushNotifications가 다시 시작한 후라고합니다. 나는 그것이이 때 가장 좋은 방법이라고 생각한다.

app.globals.is_resumed = true; // where app.globals is your globals object in app 

Titanium.Network.registerForPushNotifications({ 
    types:[ 
     Titanium.Network.NOTIFICATION_TYPE_BADGE, 
     Titanium.Network.NOTIFICATION_TYPE_ALERT, 
     Titanium.Network.NOTIFICATION_TYPE_SOUND 
      ], 
    success: successCallback, 
    error: errorCallback, 
    callback: function(notif) { 
      // you can use notif.data .. 
      if (app.globals.is_resumed === false) { 
       // application is launch on notification click 
      } else { 
       // application is already launch when notification pop 
      } 
     } 
}); 

Titanium.App.addEventListener('pause', function() { 
    app.globals.is_resumed = true; 
}); 

Titanium.App.addEventListener('resumed', function(e) { 
     app.globals.is_resumed = false; 
}); 
관련 문제