3

I'm registering my app for receiving push notifications from APNS in application:didFinishLaunchingWithOptions: method this way:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

The registration is ok and my provider succesfully gets my token, in fact I do receive push notifications, but when my app is not in foreground a banner is displayed. I expected an alert to be shown, with 'Close' and 'View' buttons, and I receive the "alert" string in the payload dictionary... what could be happening?

4

2 回答 2

7

检查电话设置,用户可以自定义他们希望推送通知在其设备上的显示方式。

  1. 转到 iOS 设备上的“设置”应用。
  2. 然后选择“通知”
  3. 点击列表中显示的应用名称
  4. 更改推送通知的显示设置(下面的屏幕截图)

iPhone推送设置

不能使用代码更改此设置(参考:https ://stackoverflow.com/a/9137501/ )

但是,您可以检查当前设置,然后请求用户更改它。

于 2013-09-11T06:40:15.003 回答
0

Settings->Notifications->select Your App->Alert style(None,Banners,Alert) select Alerts.

于 2013-09-11T06:40:34.990 回答