How to post push notifications in APNS and how to show the notifications in iPhone?

£可爱£侵袭症+ 提交于 2019-12-08 01:59:28

问题


I have several doubts about APNS. Am trying myself to make clear on the APNS but still need some clarifications. I have to know how we are posting push notification in APN Server and how we push the notification to Apple APN Server? And also how am i receive the notification from Apple and show the notification to user? I know we are receive the Notifications from below delegate,

-(void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)userInfo

How we should show the notifications to the user, please suggest any sample codes? Please clarify my silly doubts. Thanks in advance. Please help me.


回答1:


this tutorial is useful please see http://mobiforge.com/developing/story/programming-apple-push-notification-services

when you receive push notificaion ,please NSLog userInfo

-(void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)userInfo
{
      NsLog("%@",userInfo);
}

push notificaion is come only one time , pop is open for about 10 second(Depend on notifcation type)... if you click then didReceiveRemoteNotification delegte is call , if you can't click any reason you see notificaion by go to setting->notification click...and check

if you want store total push notifaction use the database and store in your database



来源:https://stackoverflow.com/questions/10106416/how-to-post-push-notifications-in-apns-and-how-to-show-the-notifications-in-ipho

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!