File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Examples/PushNotificationsExample/PushNotificationsExample Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
6060 didReceiveRemoteNotification userInfo: [ AnyHashable : Any ] ,
6161 fetchCompletionHandler completionHandler: @escaping ( UIBackgroundFetchResult ) -> Void
6262 ) {
63- Self . bird. notifications. applicationDidReceiveRemoteNotification ( userInfo: userInfo, completionHandler: completionHandler)
63+ Self . bird. notifications. handleBackgroundNotification ( userInfo: userInfo, completionHandler: completionHandler)
6464 }
6565}
6666
@@ -81,7 +81,17 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
8181 withCompletionHandler completionHandler: @escaping ( ) -> Void
8282 ) {
8383 Self . logger. log ( #function)
84- Self . bird. notifications. didReceiveResponse ( response)
84+ if let result = Self . bird. notifications. handleNotificationResponse (
85+ response: response,
86+ automaticallyOpenDeeplinks: false
87+ ) {
88+ Self . logger. log ( " type \( result. type. rawValue) " )
89+ Self . logger. log ( " payload \( result. payload) ) " )
90+ Self . logger. log ( " action.type \( result. action. type. rawValue) " )
91+ Self . logger. log ( " action.url \( result. action. url? . absoluteString ?? " " ) " )
92+ Self . logger. log ( " action.identifier \( result. action. identifier) " )
93+
94+ }
8595 completionHandler ( )
8696 }
8797}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ struct ContentView: View {
4040 }
4141 Text ( " Contact " )
4242 Button ( " Put Attributes " ) {
43- let attributes = BirdKit . Attributes ( ) . put ( " displayName " , " Name from iOS " )
43+ let attributes = BirdKit . Attributes ( ) . put ( " displayName " , " iOS: push notifications example " )
4444 AppDelegate . bird? . contact. putAttributes ( attributes: attributes )
4545 }
4646
You can’t perform that action at this time.
0 commit comments