iOS - Push notification alert is not shown when the app is running

前端 未结 7 595
死守一世寂寞
死守一世寂寞 2020-12-12 15:45

I\'ve integrated push notifications in my app. Users will receive push notification to join a group. When the user clicks Join, I\'ve to handle something in

7条回答
  •  囚心锁ツ
    2020-12-12 16:12

    For anyone might be interested, I ended up creating a custom view that looks like the system push banner on the top but adds a close button (small blue X) and an option to tap the message for custom action. It also supports the case of more than one notification arrived before the user had time to read/dismiss the old ones (With no limit to how many can pile up...)

    Link to GitHub: AGPushNote

    The usage is basically on-liner:

    [AGPushNoteView showWithNotificationMessage:@"John Doe sent you a message!"];
    

    And it looks like this on iOS7 (iOS6 have an iOS6 look and feel...)

    Example

提交回复
热议问题