2011-12-18 5 views
0

앱이 닫히는 동안 들어오는 메시지를 제외하고 푸시 작동을 얻을 수 있습니다.ios 5 푸시 알림 및 rhomobile

메시지 알림 센터에 표시 할 수 있지만 사용자와 알림 센터에서 모든 메시지를 가져올 수있는 방법이 있다면 누구나 알고 있나요 1.

에 의해 실제 MSG 하나를 클릭 할 때 앱에 전달 Rhomobile?

컨트롤러에서 다음 application.rb

def on_activate_app 
    # Had to do this for iOS not getting all the messages from Notification Center 
    Rho::Timer.start(100, "/app/Settings/check_for_pending_friends", "nil") 
    super 
end 

에 추가 :

는 아이폰 OS 알림 센터에서 알림을 검색 할 수있는 방법을 찾을 수 없습니다

에 관심있는 사람들을위한

답변

0

, 그래서 나는 다음과 같은했다. 설정 폴더 안에 RB

def check_for_pending_friends 
    person = Person.find(:first) 
    url = "http://my_app.com/users/#{person.remote_id}/pending_msgs 
    # which looks for any msgs sent to that person with read_at = nil from server 
    Rho::AsyncHttp.get( 
    :url => url, 
    :headers => {'User-Agent' => Rho::RhoConfig.user_agent}, 
    :callback => url_for(:action => :see_if_pending_messages_callback) 
    ) if person 
end 

def see_if_pending_messages_callback 
    # Check to see if msg does not already exist in device, if not then add it 
end