如何在 APNS 中发布推送通知以及如何在 iPhone 中显示通知? [英] How to post push notifications in APNS and how to show the notifications in iPhone?

查看:35
本文介绍了如何在 APNS 中发布推送通知以及如何在 iPhone 中显示通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 APNS 有几个疑问.我试图让自己在 APNS 上说清楚,但仍然需要一些澄清.我必须知道 我们如何在 APN 服务器中发布推送通知以及我们如何将通知推送到 Apple APN 服务器? 还有我如何接收来自 Apple 的通知并向用户显示通知?我知道我们收到来自下面代表的通知,

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.

推荐答案

这个教程很有用请看http://mobiforge.com/developing/story/programming-apple-push-通知服务

当您收到推送通知时,请NSLog userInfo

when you receive push notificaion ,please NSLog userInfo

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

推送通知只来一次,弹出窗口打开大约 10 秒(取决于通知类型)...如果你点击然后 didReceiveRemoteNotification delegte is call ,如果你不能点击任何原因你看到通知转到设置->通知点击...并检查

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

这篇关于如何在 APNS 中发布推送通知以及如何在 iPhone 中显示通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆