2011-12-18 11 views
0

私はアプリが閉じている間に来るメッセージを除いて、プッシュ作業を得ることができます。ios 5プッシュ通知とrhomobile

メッセージは通知センターに表示さんが、唯一のユーザーは1

によって実際のMSG 1をクリックしたときに通知センターからのすべてのメッセージを取得する方法がある場合は、誰もが知っているアプリに渡しますローモビル?

がコントローラに続いて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 

に追加:

はiOSの通知センターからの通知を取得する方法を見つけることができませんでした

興味がある人々のために

答えて

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